s3

package
v0.0.0-...-17ee6b1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(regionname, bucketname string) (backend.Backend, error)

Open opens the S3 backend at bucket and region.

Types

type S3Backend

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

func OpenS3Bucket

func OpenS3Bucket(bucket *s3.Bucket, bucketname string) *S3Backend

Open a backend using an S3 bucket object

func (*S3Backend) Close

func (be *S3Backend) Close() error

Close does nothing

func (*S3Backend) Create

func (be *S3Backend) Create() (backend.Blob, error)

Create creates a new Blob. The data is available only after Finalize() has been called on the returned Blob.

func (*S3Backend) Delete

func (be *S3Backend) Delete() error

Delete removes all restic keys

func (*S3Backend) Get

func (be *S3Backend) Get(t backend.Type, name string) (io.ReadCloser, error)

Get returns a reader that yields the content stored under the given name. The reader should be closed after draining it.

func (*S3Backend) GetReader

func (be *S3Backend) GetReader(t backend.Type, name string, offset, length uint) (io.ReadCloser, error)

GetReader returns an io.ReadCloser for the Blob with the given name of type t at offset and length. If length is 0, the reader reads until EOF.

func (*S3Backend) List

func (be *S3Backend) List(t backend.Type, done <-chan struct{}) <-chan string

List returns a channel that yields all names of blobs of type t. A goroutine is started for this. If the channel done is closed, sending stops.

func (*S3Backend) Location

func (be *S3Backend) Location() string

Location returns this backend's location (the bucket name).

func (*S3Backend) Remove

func (be *S3Backend) Remove(t backend.Type, name string) error

Remove removes the blob with the given name and type.

func (*S3Backend) Test

func (be *S3Backend) Test(t backend.Type, name string) (bool, error)

Test returns true if a blob of the given type and name exists in the backend.

Jump to

Keyboard shortcuts

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