Documentation ¶
Index ¶
- type MockS3
- type S3Storage
- func (s *S3Storage) Delete(path string) error
- func (s *S3Storage) Get(path string) (io.ReadCloser, error)
- func (s *S3Storage) List(prefix string, maxSize int) ([]string, error)
- func (s *S3Storage) Lock(path string) error
- func (s *S3Storage) Put(path string, data []byte) error
- func (s *S3Storage) PutReader(path string, reader io.Reader) error
- func (s *S3Storage) Unlock(path string) error
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
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 ¶
NewStorageWithMockS3 constructs an S3Storage that uses MockS3
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 ¶
List returns a list of objects (up to maxSize) with the given prefix from S3
func (*S3Storage) Put ¶
Put places the byte slice at the given path in S3. Put also sends a checksum to protect against network corruption.
Click to show internal directories.
Click to hide internal directories.