Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tabacco
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ai3
tools
tabacco
Commits
998d2ef8
Commit
998d2ef8
authored
Aug 04, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename some files for clarity
parent
e977bcbb
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
24 deletions
+22
-24
handler_pipe.go
handler_pipe.go
+8
-0
manager_test.go
manager_test.go
+1
-1
repository_restic_test.go
repository_restic_test.go
+5
-0
source.go
source.go
+8
-0
types.go
types.go
+0
-23
No files found.
handler_pipe.go
View file @
998d2ef8
...
...
@@ -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
},
}
}
backup
_test.go
→
manager
_test.go
View file @
998d2ef8
...
...
@@ -105,7 +105,7 @@ func (d *dummyMetadataStore) AddDataset(_ context.Context, backup Backup, ds Dat
return
nil
}
func
TestBackup
(
t
*
testing
.
T
)
{
func
Test
Manager_
Backup
(
t
*
testing
.
T
)
{
store
:=
&
dummyMetadataStore
{}
repoSpec
:=
RepositorySpec
{
Name
:
"main"
,
...
...
repository_restic_test.go
View file @
998d2ef8
...
...
@@ -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
)
...
...
source.go
View file @
998d2ef8
...
...
@@ -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
}
backup
.go
→
types
.go
View file @
998d2ef8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment