forked from wal-g/wal-g
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbackup_file_list_builder.go
44 lines (34 loc) · 1.19 KB
/
backup_file_list_builder.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package testtools
import (
"time"
"github.com/wal-g/wal-g/internal"
)
const (
SimplePath = "/simple"
SkippedPath = "/skipped"
IncrementedPath = "/incremented"
)
var SimpleDescription = *internal.NewBackupFileDescription(false, false, time.Time{})
var SkippedDescription = *internal.NewBackupFileDescription(false, true, time.Time{})
var IncrementedDescription = *internal.NewBackupFileDescription(true, false, time.Time{})
type BackupFileListBuilder struct {
fileList internal.BackupFileList
}
func NewBackupFileListBuilder() BackupFileListBuilder {
return BackupFileListBuilder{internal.BackupFileList{}}
}
func (listBuilder BackupFileListBuilder) WithSimple() BackupFileListBuilder {
listBuilder.fileList[SimplePath] = SimpleDescription
return listBuilder
}
func (listBuilder BackupFileListBuilder) WithSkipped() BackupFileListBuilder {
listBuilder.fileList[SkippedPath] = SkippedDescription
return listBuilder
}
func (listBuilder BackupFileListBuilder) WithIncremented() BackupFileListBuilder {
listBuilder.fileList[IncrementedPath] = IncrementedDescription
return listBuilder
}
func (listBuilder BackupFileListBuilder) Build() internal.BackupFileList {
return listBuilder.fileList
}