Commit 998d2ef8 authored by ale's avatar ale

Rename some files for clarity

parent e977bcbb
......@@ -123,3 +123,11 @@ func expandVars(s string, backup Backup, ds Dataset, atom Atom) string {
}
})
}
func makeSingleAtomDataset(ds Dataset, atom Atom) Dataset {
return Dataset{
Name: filepath.Join(ds.Name, atom.Name),
Handler: ds.Handler,
Atoms: []Atom{atom},
}
}
......@@ -105,7 +105,7 @@ func (d *dummyMetadataStore) AddDataset(_ context.Context, backup Backup, ds Dat
return nil
}
func TestBackup(t *testing.T) {
func TestManager_Backup(t *testing.T) {
store := &dummyMetadataStore{}
repoSpec := RepositorySpec{
Name: "main",
......
......@@ -38,6 +38,11 @@ func createTempDirWithData(t *testing.T) string {
// nolint: gocyclo
func TestRestic(t *testing.T) {
// Check that we can actually run restic.
if err := checkResticVersion("restic"); err != nil {
t.Skip("can't run restic: ", err)
}
store := &dummyMetadataStore{}
tmpdir := createTempDirWithData(t)
......
......@@ -96,3 +96,11 @@ func runAtomsCommand(ctx context.Context, cmd string) ([]Atom, error) {
}
return atoms, scanner.Err()
}
func normalizeDataset(ds Dataset) Dataset {
// If the Dataset has no atoms, add an empty one.
if len(ds.Atoms) == 0 {
ds.Atoms = []Atom{Atom{}}
}
return ds
}
......@@ -4,7 +4,6 @@ import (
"context"
"fmt"
"io"
"path/filepath"
"regexp"
"strings"
"time"
......@@ -58,22 +57,6 @@ type Dataset struct {
Atoms []Atom `json:"atoms"`
}
func makeSingleAtomDataset(ds Dataset, atom Atom) Dataset {
return Dataset{
Name: filepath.Join(ds.Name, atom.Name),
Handler: ds.Handler,
Atoms: []Atom{atom},
}
}
func normalizeDataset(ds Dataset) Dataset {
// If the Dataset has no atoms, add an empty one.
if len(ds.Atoms) == 0 {
ds.Atoms = []Atom{Atom{}}
}
return ds
}
// FindRequest specifies search criteria for atoms.
type FindRequest struct {
Pattern string `json:"pattern"`
......@@ -97,12 +80,6 @@ type Version struct {
Backup Backup `json:"backup"`
}
// FindResponseEntry groups datasets and their versions.
type FindResponseEntry struct {
Dataset Dataset `json:"dataset"`
Versions []Backup `json:"versions"`
}
// MetadataStore is the client interface to the global metadata store.
type MetadataStore interface {
// Find the datasets that match a specific criteria. Only
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment