s3remote

package
v1.36.3-cluster Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	// Path to S3 credentials file.
	CredsFilePath string

	// Path to S3 configs file.
	ConfigFilePath string

	// GCS bucket to use.
	Bucket string

	// Directory in the bucket to write to.
	Dir string

	// Set for using S3-compatible enpoint such as MinIO etc.
	CustomEndpoint string

	// The name of S3 config profile to use.
	ProfileName string
	// contains filtered or unexported fields
}

FS represents filesystem for backups in S3.

Init must be called before calling other FS methods.

func (*FS) CopyPart

func (fs *FS) CopyPart(srcFS common.OriginFS, p common.Part) error

CopyPart copies p from srcFS to fs.

func (*FS) CreateFile added in v1.32.1

func (fs *FS) CreateFile(filePath string, data []byte) error

CreateFile creates filePath at fs and puts data into it.

The file is overwritten if it already exists.

func (*FS) DeleteFile added in v1.32.1

func (fs *FS) DeleteFile(filePath string) error

DeleteFile deletes filePath from fs if it exists.

The function does nothing if the file doesn't exist.

func (*FS) DeletePart

func (fs *FS) DeletePart(p common.Part) error

DeletePart deletes part p from fs.

func (*FS) DownloadPart

func (fs *FS) DownloadPart(p common.Part, w io.Writer) error

DownloadPart downloads part p from fs to w.

func (*FS) HasFile added in v1.32.1

func (fs *FS) HasFile(filePath string) (bool, error)

HasFile returns true if filePath exists at fs.

func (*FS) Init

func (fs *FS) Init() error

Init initializes fs.

func (*FS) ListParts

func (fs *FS) ListParts() ([]common.Part, error)

ListParts returns all the parts for fs.

func (*FS) RemoveEmptyDirs

func (fs *FS) RemoveEmptyDirs() error

RemoveEmptyDirs recursively removes empty dirs in fs.

func (*FS) String

func (fs *FS) String() string

String returns human-readable description for fs.

func (*FS) UploadPart

func (fs *FS) UploadPart(p common.Part, r io.Reader) error

UploadPart uploads part p from r to fs.

Jump to

Keyboard shortcuts

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