snapshot

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileProviderType   = "file://"
	S3ProviderType     = "s3://"
	SpacesProviderType = "digitaloceanspaces"
)

Variables

This section is empty.

Functions

func ParseSnapshotBackupURL

func ParseSnapshotBackupURL(url string) (string, string)

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

Types

type AmazonConfig added in v0.3.0

type AmazonConfig struct {
	RoleSessionName string
	S3URL           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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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