s3

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2019 License: BSD-3-Clause Imports: 22 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFound

func IsNotFound(err error) bool

func ReadCloserFromBytes

func ReadCloserFromBytes(b []byte) (io.ReadCloser, error)

func ValidS3Credentials

func ValidS3Credentials() []string

func ValidS3CredentialsString

func ValidS3CredentialsString() string

Types

type S3Config

type S3Config struct {
	Bucket      string
	Prefix      string
	Region      string
	Credentials string // see notes below
}

func NewS3ConfigFromString

func NewS3ConfigFromString(str_dsn string) (*S3Config, error)

type S3Connection

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

func NewS3Connection

func NewS3Connection(s3cfg *S3Config) (*S3Connection, error)

func (*S3Connection) Delete

func (conn *S3Connection) Delete(key string) error

func (*S3Connection) DeleteRecursive

func (conn *S3Connection) DeleteRecursive(path string) error

func (*S3Connection) Get

func (conn *S3Connection) Get(key string) (io.ReadCloser, error)

func (*S3Connection) GetBytes

func (conn *S3Connection) GetBytes(key string) ([]byte, error)

func (*S3Connection) HasChanged

func (conn *S3Connection) HasChanged(key string, local []byte) (bool, error)

func (*S3Connection) Head

func (conn *S3Connection) Head(key string) (*s3.HeadObjectOutput, error)

func (*S3Connection) List

func (conn *S3Connection) List(cb S3ListCallback, opts *S3ListOptions) error

func (*S3Connection) PrepareKey added in v0.1.3

func (conn *S3Connection) PrepareKey(key string) string

func (*S3Connection) Put

func (conn *S3Connection) Put(key string, fh io.ReadCloser, args ...interface{}) error

func (*S3Connection) PutBytes

func (conn *S3Connection) PutBytes(key string, body []byte) error

func (*S3Connection) SetACLForBucket

func (conn *S3Connection) SetACLForBucket(acl string, opts *S3ListOptions) error

func (*S3Connection) SetACLForKey

func (conn *S3Connection) SetACLForKey(key string, acl string) error

func (*S3Connection) URI

func (conn *S3Connection) URI(key string) string

type S3ListCallback

type S3ListCallback func(*S3Object) error

type S3ListOptions

type S3ListOptions struct {
	Strict  bool
	Timings bool
	MaxKeys int64
	Path    string
}

func DefaultS3ListOptions

func DefaultS3ListOptions() *S3ListOptions

type S3Object

type S3Object struct {
	KeyRaw       string // what aws-sdk-go returns
	Key          string // KeyRaw but with S3Connection.prefix removed
	Size         int64
	LastModified time.Time
	ETag         string
}

Jump to

Keyboard shortcuts

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