s3storage

package
v0.0.0-...-ae6cc27 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2018 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockS3

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

MockS3 mocks S3Storage

func NewMockS3

func NewMockS3(t *testing.T) *MockS3

NewMockS3 constructs a MockS3

func (*MockS3) Start

func (s *MockS3) Start(t *testing.T)

Start starts server used for MockS3

func (*MockS3) Stop

func (s *MockS3) Stop()

Stop stops server used for MockS3

type S3Storage

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

S3Storage implements the strata.Storage interface using S3 as its storage backing

func NewS3Storage

func NewS3Storage(region aws.Region, auth aws.Auth, bucketName string, prefix string, bucketACL s3.ACL) (*S3Storage, error)

NewS3Storage initializes the S3Storage with required AWS arguments

func NewStorageWithMockS3

func NewStorageWithMockS3(s *MockS3) (*S3Storage, error)

NewStorageWithMockS3 constructs an S3Storage that uses MockS3

func (*S3Storage) Delete

func (s *S3Storage) Delete(path string) error

Delete removes the object at the given S3 path

func (*S3Storage) Get

func (s *S3Storage) Get(path string) (io.ReadCloser, error)

Get returns a reader to the specified S3 path. The reader is a wrapper around a ChecksummingReader. This protects against network corruption.

func (*S3Storage) List

func (s *S3Storage) List(prefix string, maxSize int) ([]string, error)

List returns a list of objects (up to maxSize) with the given prefix from S3

func (*S3Storage) Lock

func (s *S3Storage) Lock(path string) error

Lock is not implemented

func (*S3Storage) Put

func (s *S3Storage) Put(path string, data []byte) error

Put places the byte slice at the given path in S3. Put also sends a checksum to protect against network corruption.

func (*S3Storage) PutReader

func (s *S3Storage) PutReader(path string, reader io.Reader) error

PutReader consumes the given reader and stores it at the specified path in S3. A checksum is used to protect against network corruption.

func (*S3Storage) Unlock

func (s *S3Storage) Unlock(path string) error

Unlock is not implemented

Jump to

Keyboard shortcuts

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