stores

package
v0.0.0-...-0207d7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func (s *S3Config) FindLatestBackup(basedir, namePrefix string) (string, error)

FindLatestBackup returns the most recent backup of the S3 store

func (*S3Config) RemoveOlderBackups

func (s *S3Config) RemoveOlderBackups(basedir, namePrefix string, keep int) error

RemoveOlderBackups keeps the most recent backups of the S3 service and deletes the old ones

func (*S3Config) Retrieve

func (s *S3Config) Retrieve(s3path string) (string, error)

Retrieve downloads a S3 object to the local filesystem

func (*S3Config) Store

func (s *S3Config) Store(filepath, prefix, filename string) error

Store saves a file to a remote S3 service

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL