backend

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	// Save saves the backup from the given reader with given etcd version and revision.
	// It returns the size of the snapshot saved.
	Save(etcdVersion string, rev int64, r io.Reader) (size int64, err error)

	// GetLatest gets latest backup's name.
	// If no backup is available, returns empty string name.
	GetLatest() (name string, err error)

	// Open opens a backup file for reading
	Open(name string) (rc io.ReadCloser, err error)

	// Total returns the total number of available backups.
	Total() (int, error)

	// TotalSize returns the total size of the backups.
	TotalSize() (int64, error)

	// Purge purges backup files when backups are greater than maxBackupFiles.
	Purge(maxBackupFiles int) error
}

Backend defines required backend operations

func NewAbsBackend

func NewAbsBackend(abs *abs.ABS) Backend

func NewFileBackend

func NewFileBackend(dir string) Backend

func NewS3Backend

func NewS3Backend(s3 *s3.S3, dir string) Backend

Jump to

Keyboard shortcuts

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