Documentation ¶
Index ¶
- type FilesystemConfig
- func (f *FilesystemConfig) Close()
- func (f *FilesystemConfig) FindLatestBackup(basedir, namePrefix string) (string, error)
- func (f *FilesystemConfig) RemoveOlderBackups(basedir, namePrefix string, keep int) error
- func (f *FilesystemConfig) Retrieve(filename string) (string, error)
- func (f *FilesystemConfig) Store(src, prefix, filename string) error
- type S3Config
- func (s *S3Config) Close()
- func (s *S3Config) FindLatestBackup(basedir, namePrefix string) (string, error)
- func (s *S3Config) RemoveOlderBackups(basedir, namePrefix string, keep int) error
- func (s *S3Config) Retrieve(s3path string) (string, error)
- func (s *S3Config) Store(filepath, prefix, filename string) error
- type Storer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemConfig ¶
type FilesystemConfig struct {
SaveDir string
}
FilesystemConfig has the config options for the FilesystemConfig service
func (*FilesystemConfig) Close ¶
func (f *FilesystemConfig) Close()
Close deinitializes the store (no dothing)
func (*FilesystemConfig) FindLatestBackup ¶
func (f *FilesystemConfig) FindLatestBackup(basedir, namePrefix string) (string, error)
FindLatestBackup returns the most recent backup of the specified directory
func (*FilesystemConfig) RemoveOlderBackups ¶
func (f *FilesystemConfig) RemoveOlderBackups(basedir, namePrefix string, keep int) error
RemoveOlderBackups keeps the most recent backups of a directory and deletes the old ones
func (*FilesystemConfig) Retrieve ¶
func (f *FilesystemConfig) Retrieve(filename string) (string, error)
Retrieve returns the path of the requested file
func (*FilesystemConfig) Store ¶
func (f *FilesystemConfig) Store(src, prefix, filename string) error
Store moves/copies a file to another directory
type S3Config ¶
type S3Config struct { Endpoint string Region string Bucket string Prefix string ForcePathStyle bool KeepAfterUpload bool SaveDir string // contains filtered or unexported fields }
S3Config has the config options for the S3 service
func (*S3Config) Close ¶
func (s *S3Config) Close()
Close deinitializes the store (remove downloaded file)
func (*S3Config) FindLatestBackup ¶
FindLatestBackup returns the most recent backup of the S3 store
func (*S3Config) RemoveOlderBackups ¶
RemoveOlderBackups keeps the most recent backups of the S3 service and deletes the old ones
type Storer ¶
type Storer interface { Store(filepath, prefix, filename string) error Retrieve(s3path string) (string, error) RemoveOlderBackups(basedir, namePrefix string, keep int) error FindLatestBackup(basedir, namePrefix string) (string, error) Close() }
Storer represents the methods to store/retrieve a backup from another location