aws

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2019 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultS3Region string = endpoints.UsWest2RegionID

Variables

View Source
var S3Regions strset.Set

Functions

func ErrorAuth

func ErrorAuth() 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 IsNoSuchKeyErr

func IsNoSuchKeyErr(err error) bool

func IsNotFoundErr

func IsNotFoundErr(err error) bool

func IsS3FileExternal

func IsS3FileExternal(bucket string, key string) (bool, error)

func IsS3PathFileExternal added in v0.5.0

func IsS3PathFileExternal(s3Path string) (bool, error)

func IsS3PrefixExternal

func IsS3PrefixExternal(bucket string, prefix string) (bool, error)

func IsS3aPathPrefixExternal added in v0.5.0

func IsS3aPathPrefixExternal(s3aPath string) (bool, error)

func IsValidS3Path

func IsValidS3Path(s3Path string) bool

func IsValidS3aPath

func IsValidS3aPath(s3aPath string) bool

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

	HashedAccountID string
	// contains filtered or unexported fields
}

func New

func New(region, bucket string) *Client

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) GetLogs

func (c *Client) GetLogs(prefix string, logGroup string) (string, error)

func (*Client) IsS3Dir

func (c *Client) IsS3Dir(dirPath string) (bool, error)

func (*Client) IsS3File

func (c *Client) IsS3File(key string) (bool, error)

func (*Client) IsS3Prefix

func (c *Client) IsS3Prefix(prefix string) (bool, 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
)

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

type FluentdLog

type FluentdLog struct {
	Log    string `json:"log"`
	Stream string `json:"stream"`
	Docker struct {
		ContainerID string `json:"container_id"`
	} `json:"docker"`
	Kubernetes struct {
		ContainerName string `json:"container_name"`
		NamespaceName string `json:"namespace_name"`
		PodName       string `json:"pod_name"`
		OrphanedName  string `json:"orphaned_namespace"`
		NamespaceID   string `json:"namespace_id"`
	} `json:"kubernetes"`
}

Jump to

Keyboard shortcuts

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