s3

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backup

func Backup(source io.Reader, s3Conf config.S3ClientConfig, cypherKey []byte) error

func Prune

func Prune(s3Conf config.S3ClientConfig, expiry time.Duration, minCount int64) error

func PruneBackupEntry

func PruneBackupEntry(cli *minio.Client, bucket string, namingConv NamingConvention, entry BackupEntry) error

func Restore

func Restore(s3Conf config.S3ClientConfig, timestamp string) (io.Reader, []byte, error)

func RotateKey

func RotateKey(s3Conf config.S3ClientConfig, conv ConvertKeyFn) error

Types

type BackupEntries

type BackupEntries struct {
	Entries   map[time.Time]BackupEntry
	LastEntry *BackupEntry
}

func ListBackups

func ListBackups(cli *minio.Client, bucket string, nameConv NamingConvention) (BackupEntries, error)

func (*BackupEntries) GetDeletable

func (entries *BackupEntries) GetDeletable(cutoff time.Time, minCount int64) []BackupEntry

type BackupEntry

type BackupEntry struct {
	Timestamp time.Time
	Encrypted bool
	DumpFound bool
}

type ConvertKeyFn

type ConvertKeyFn func([]byte) ([]byte, error)

type NamingConvention

type NamingConvention struct {
	Prefix string
	// contains filtered or unexported fields
}

func NewNamingConvention

func NewNamingConvention(prefix string) NamingConvention

func (*NamingConvention) GetObjectInfo

func (conv *NamingConvention) GetObjectInfo(objName string) (ObjectInfo, error)

func (*NamingConvention) GetObjectNames

func (conv *NamingConvention) GetObjectNames(timestamp time.Time) (string, string)

type ObjectInfo

type ObjectInfo struct {
	Timestamp time.Time
	Type      ObjectType
}

type ObjectType

type ObjectType int
const (
	OBJ_TYPE_DUMP ObjectType = iota
	OBJ_TYPE_KEY
)

Jump to

Keyboard shortcuts

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