snapshot

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidScheme  = errors.New("invalid scheme")
	ErrCannotParseURL = errors.New("cannot parse url")
)

Functions

This section is empty.

Types

type AmazonConfig added in v0.3.0

type AmazonConfig struct {
	RoleSessionName string
	Bucket          string
	Key             string
}

type AmazonSnapshotter added in v0.3.0

type AmazonSnapshotter struct {
	*s3.S3
	*s3manager.Downloader
	*s3manager.Uploader
	// contains filtered or unexported fields
}

func NewAmazonSnapshotter added in v0.3.0

func NewAmazonSnapshotter(cfg *AmazonConfig) (*AmazonSnapshotter, error)

func (*AmazonSnapshotter) Load added in v0.3.0

func (s *AmazonSnapshotter) Load() (io.ReadCloser, error)

func (*AmazonSnapshotter) Save added in v0.3.0

func (s *AmazonSnapshotter) Save(r io.ReadCloser) error

type DigitalOceanConfig added in v0.3.0

type DigitalOceanConfig struct {
	AccessToken     string
	SpacesURL       string
	SpacesAccessKey string
	SpacesSecretKey string
}

type DigitalOceanSnapshotter

type DigitalOceanSnapshotter struct {
	*AmazonSnapshotter
}

func NewDigitalOceanSnapshotter

func NewDigitalOceanSnapshotter(cfg *DigitalOceanConfig) (*DigitalOceanSnapshotter, error)

type FileSnapshotter

type FileSnapshotter struct {
	// contains filtered or unexported fields
}

func NewFileSnapshotter

func NewFileSnapshotter(path string) (*FileSnapshotter, error)

func (*FileSnapshotter) Load

func (fs *FileSnapshotter) Load() (io.ReadCloser, error)

func (*FileSnapshotter) Save

func (fs *FileSnapshotter) Save(r io.ReadCloser) error

type Snapshotter added in v0.3.0

type Snapshotter interface {
	Load() (io.ReadCloser, error)
	Save(io.ReadCloser) error
}

type Type added in v0.4.1

type Type int
const (
	FileType Type = iota
	S3Type
	SpacesType
)

type URL added in v0.4.1

type URL struct {
	Type   Type
	Bucket string
	Path   string
}

func ParseSnapshotBackupURL

func ParseSnapshotBackupURL(s string) (*URL, error)

ParseSnapshotBackupURL deconstructs a uri into a type prefix and a bucket example inputs and outputs:

file://file                                -> file://, file
s3://bucket                                -> s3://, bucket
https://nyc3.digitaloceanspaces.com/bucket -> digitaloceanspaces, bucket

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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