s3

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Region     string
	Endpoint   string
	AccessKey  string
	SecretKey  string
	PathStyle  bool
	DisableSSL bool
}

Config stores the configuration for the S3 store.

type Store

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

Store implements the Store interface for an S3-compatible backend.

func New

func New(cfg Config) (*Store, error)

New creates a new client for accessing an S3-backed store.

func (*Store) Copy

func (s *Store) Copy(bucket string, from string, to string) error

Copy makes a copy of an object.

func (*Store) Delete

func (s *Store) Delete(bucket string, key string) error

Delete removes an object. No error is returned if the object does not exist.

func (*Store) Get

func (s *Store) Get(ctx context.Context, bucket string, key string) (io.ReadCloser, error)

Get returns an object from the store as an io.ReadCloser. Returns store.ErrNotFound if the object does not exist.

func (*Store) PresignGetURL

func (s *Store) PresignGetURL(bucket string, key string, expires time.Duration, contentRange *store.Range) (string, error)

PresignGetURL returns a URL to GET an object in the store.

func (*Store) Put

func (s *Store) Put(ctx context.Context, bucket string, key string, r io.Reader) error

Put saves an object to S3.

Jump to

Keyboard shortcuts

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