-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update keeper registry methods, add/update documentation
- Loading branch information
1 parent
4691789
commit 82d3f4f
Showing
7 changed files
with
269 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# backup | ||
|
||
|
||
|
||
#### type BackupMetadata | ||
|
||
```go | ||
type BackupMetadata struct { | ||
Date time.Time `json:"timestamp"` | ||
FileFormat string `json:"format"` | ||
FilePath string `json:"path"` | ||
Stores []string `json:"stores,omitempty"` | ||
Checksum Checksum `json:"checksum,omitempty"` | ||
Size int64 `json:"size,omitempty"` | ||
} | ||
``` | ||
|
||
|
||
#### func (BackupMetadata) Format | ||
|
||
```go | ||
func (bm BackupMetadata) Format() string | ||
``` | ||
|
||
#### func (BackupMetadata) Path | ||
|
||
```go | ||
func (bm BackupMetadata) Path() string | ||
``` | ||
|
||
#### func (BackupMetadata) Timestamp | ||
|
||
```go | ||
func (bm BackupMetadata) Timestamp() time.Time | ||
``` | ||
|
||
#### type Checksum | ||
|
||
```go | ||
type Checksum struct { | ||
Type string `json:"type"` | ||
Value string `json:"value"` | ||
} | ||
``` | ||
|
||
|
||
#### type Format | ||
|
||
```go | ||
type Format string | ||
``` | ||
|
||
|
||
```go | ||
const ( | ||
FormatTarGz Format = "tar.gz" | ||
FormatTar Format = "tar" | ||
FormatZip Format = "zip" | ||
) | ||
``` | ||
|
||
#### type TarGzBackup | ||
|
||
```go | ||
type TarGzBackup struct { | ||
} | ||
``` | ||
|
||
|
||
#### func NewTarGzBackup | ||
|
||
```go | ||
func NewTarGzBackup(inPath string, outPath string, stores []string, extraData ...[]byte) (*TarGzBackup, error) | ||
``` | ||
|
||
#### func (*TarGzBackup) Format | ||
|
||
```go | ||
func (tgz *TarGzBackup) Format() string | ||
``` | ||
|
||
#### func (*TarGzBackup) Metadata | ||
|
||
```go | ||
func (tgz *TarGzBackup) Metadata() BackupMetadata | ||
``` | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
# metadata | ||
|
||
|
||
|
||
#### type Metadata | ||
|
||
```go | ||
type Metadata struct { | ||
KeeperType string `json:"type"` | ||
Created time.Time `json:"created,omitempty"` | ||
LastOpened time.Time `json:"last_opened,omitempty"` | ||
KnownStores []string `json:"stores,omitempty"` | ||
Backups map[string]models.Backup `json:"backups,omitempty"` | ||
} | ||
``` | ||
|
||
Metadata is a struct that holds the metadata for a [Keeper]'s DB. This is | ||
critical for migrating data between [Keeper]s. The only absolute requirement is | ||
that the [Type] field is set. | ||
|
||
#### func NewMeta | ||
|
||
```go | ||
func NewMeta(keeperType string) *Metadata | ||
``` | ||
|
||
#### func NewMetaFile | ||
|
||
```go | ||
func NewMetaFile(keeperType, path string) (*Metadata, error) | ||
``` | ||
|
||
#### func OpenMetaFile | ||
|
||
```go | ||
func OpenMetaFile(path string) (*Metadata, error) | ||
``` | ||
|
||
#### func (*Metadata) AddStore | ||
|
||
```go | ||
func (m *Metadata) AddStore(name string) | ||
``` | ||
|
||
#### func (*Metadata) Close | ||
|
||
```go | ||
func (m *Metadata) Close() error | ||
``` | ||
|
||
#### func (*Metadata) Ping | ||
|
||
```go | ||
func (m *Metadata) Ping() | ||
``` | ||
|
||
#### func (*Metadata) RemoveStore | ||
|
||
```go | ||
func (m *Metadata) RemoveStore(name string) | ||
``` | ||
|
||
#### func (*Metadata) Sync | ||
|
||
```go | ||
func (m *Metadata) Sync() error | ||
``` | ||
|
||
#### func (*Metadata) Timestamp | ||
|
||
```go | ||
func (m *Metadata) Timestamp() time.Time | ||
``` | ||
|
||
#### func (*Metadata) Type | ||
|
||
```go | ||
func (m *Metadata) Type() string | ||
``` | ||
|
||
#### func (*Metadata) WithBackups | ||
|
||
```go | ||
func (m *Metadata) WithBackups(backups ...models.Backup) *Metadata | ||
``` | ||
|
||
#### func (*Metadata) WithCreated | ||
|
||
```go | ||
func (m *Metadata) WithCreated(created time.Time) *Metadata | ||
``` | ||
|
||
#### func (*Metadata) WithLastOpened | ||
|
||
```go | ||
func (m *Metadata) WithLastOpened(lastOpened time.Time) *Metadata | ||
``` | ||
|
||
#### func (*Metadata) WithStores | ||
|
||
```go | ||
func (m *Metadata) WithStores(stores ...string) *Metadata | ||
``` | ||
|
||
#### func (*Metadata) WithWriter | ||
|
||
```go | ||
func (m *Metadata) WithWriter(w io.WriteCloser) *Metadata | ||
``` | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# models | ||
|
||
|
||
|
||
#### type Backup | ||
|
||
```go | ||
type Backup interface { | ||
Metadata() Metadata | ||
Format() string | ||
Path() string | ||
} | ||
``` | ||
|
||
|
||
#### type Metadata | ||
|
||
```go | ||
type Metadata interface { | ||
Type() string | ||
Timestamp() time.Time | ||
} | ||
``` | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters