aws

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultS3Region string = endpoints.UsWest2RegionID

Variables

View Source
var S3Regions strset.Set

Functions

func CheckErrCode added in v0.8.0

func CheckErrCode(err error, errorCode string) bool

func ErrorAuth

func ErrorAuth() error

func ErrorBucketInaccessible added in v0.8.0

func ErrorBucketInaccessible(bucket string) error

func ErrorInvalidS3Path

func ErrorInvalidS3Path(provided string) error

func ErrorInvalidS3aPath

func ErrorInvalidS3aPath(provided string) error

func GetBucketRegion added in v0.5.0

func GetBucketRegion(bucket string) (string, error)

func IsGenericNotFoundErr added in v0.9.0

func IsGenericNotFoundErr(err error) bool

func IsNoSuchBucketErr added in v0.9.0

func IsNoSuchBucketErr(err error) bool

func IsNoSuchKeyErr

func IsNoSuchKeyErr(err error) bool

func IsNotFoundErr

func IsNotFoundErr(err error) bool

func IsValidS3Path

func IsValidS3Path(s3Path string) bool

func IsValidS3aPath

func IsValidS3aPath(s3aPath string) bool

func S3PathJoin added in v0.8.0

func S3PathJoin(paths ...string) string

func SplitS3Path

func SplitS3Path(s3Path string) (string, string, error)

func SplitS3aPath

func SplitS3aPath(s3aPath string) (string, string, error)

Types

type Client

type Client struct {
	Region string
	Bucket string
	S3     *s3.S3

	CloudWatchLogsClient *cloudwatchlogs.CloudWatchLogs
	CloudWatchMetrics    *cloudwatch.CloudWatch

	HashedAccountID string
	// contains filtered or unexported fields
}

func New

func New(region string, bucket string, withAccountID bool) (*Client, error)

func NewFromS3Path added in v0.8.0

func NewFromS3Path(s3Path string, withAccountID bool) (*Client, error)

func (*Client) AuthUser

func (c *Client) AuthUser(accessKeyID string, secretAccessKey string) (bool, error)

func (*Client) DeleteFromS3ByPrefix

func (c *Client) DeleteFromS3ByPrefix(prefix string, continueIfFailure bool) error

func (*Client) ExractS3PathPrefixes added in v0.8.0

func (c *Client) ExractS3PathPrefixes(s3Paths ...string) ([]string, error)

func (*Client) IsS3Dir

func (c *Client) IsS3Dir(dirPaths ...string) (bool, error)

func (*Client) IsS3File

func (c *Client) IsS3File(keys ...string) (bool, error)

func (*Client) IsS3PathDir added in v0.8.0

func (c *Client) IsS3PathDir(s3Paths ...string) (bool, error)

func (*Client) IsS3PathFile added in v0.8.0

func (c *Client) IsS3PathFile(s3Paths ...string) (bool, error)

func (*Client) IsS3PathPrefix added in v0.8.0

func (c *Client) IsS3PathPrefix(s3Paths ...string) (bool, error)

func (*Client) IsS3Prefix

func (c *Client) IsS3Prefix(prefixes ...string) (bool, error)

func (*Client) ListPrefix added in v0.8.0

func (c *Client) ListPrefix(prefix string, maxResults int64) ([]*s3.Object, error)

func (*Client) ReadBytesFromS3

func (c *Client) ReadBytesFromS3(key string) ([]byte, error)

func (*Client) ReadJSONFromS3

func (c *Client) ReadJSONFromS3(objPtr interface{}, key string) error

func (*Client) ReadMsgpackFromS3

func (c *Client) ReadMsgpackFromS3(objPtr interface{}, key string) error

func (*Client) ReadStringFromS3

func (c *Client) ReadStringFromS3(key string) (string, error)

func (*Client) S3Path

func (c *Client) S3Path(key string) string

func (*Client) UploadBufferToS3

func (c *Client) UploadBufferToS3(buffer *bytes.Buffer, key string) error

func (*Client) UploadBytesToS3

func (c *Client) UploadBytesToS3(data []byte, key string) error

func (*Client) UploadBytesesToS3

func (c *Client) UploadBytesesToS3(data []byte, keys ...string) error

func (*Client) UploadFileToS3

func (c *Client) UploadFileToS3(filePath string, key string) error

func (*Client) UploadJSONToS3

func (c *Client) UploadJSONToS3(obj interface{}, key string) error

func (*Client) UploadMsgpackToS3

func (c *Client) UploadMsgpackToS3(obj interface{}, key string) error

func (*Client) UploadStringToS3

func (c *Client) UploadStringToS3(str string, key string) error

type Error

type Error struct {
	Kind ErrorKind
	// contains filtered or unexported fields
}

func (Error) Error

func (e Error) Error() string

type ErrorKind

type ErrorKind int
const (
	ErrUnknown ErrorKind = iota
	ErrInvalidS3aPath
	ErrInvalidS3Path
	ErrAuth
	ErrBucketInaccessible
)

func (ErrorKind) MarshalBinary

func (t ErrorKind) MarshalBinary() ([]byte, error)

MarshalBinary satisfies BinaryMarshaler

func (ErrorKind) MarshalText

func (t ErrorKind) MarshalText() ([]byte, error)

MarshalText satisfies TextMarshaler

func (ErrorKind) String

func (t ErrorKind) String() string

func (*ErrorKind) UnmarshalBinary

func (t *ErrorKind) UnmarshalBinary(data []byte) error

UnmarshalBinary satisfies BinaryUnmarshaler Needed for msgpack

func (*ErrorKind) UnmarshalText

func (t *ErrorKind) UnmarshalText(text []byte) error

UnmarshalText satisfies TextUnmarshaler

Jump to

Keyboard shortcuts

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