s3

package
v0.0.0-...-72d3ff2 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAWSCredentials

func GetAWSCredentials(opts S3ClientOpts) (*credentials.Credentials, error)

Get AWS credentials based on default order from aws SDK

func GetAssumeRoleCredentials

func GetAssumeRoleCredentials(opts S3ClientOpts) (*credentials.Credentials, error)

GetAssumeRoleCredentials gets Assumed role credentials

func IsS3ErrCode

func IsS3ErrCode(err error, code string) bool

IsS3ErrCode returns if the supplied error is of a specific S3 error code

Types

type S3Client

type S3Client interface {
	// PutFile puts a single file to a bucket at the specified key
	PutFile(bucket, key, path string) error

	// PutDirectory puts a complete directory into a bucket key prefix, with each file in the directory
	// a separate key in the bucket.
	PutDirectory(bucket, key, path string) error

	// GetFile downloads a file to a local file path
	GetFile(bucket, key, path string) error

	// GetDirectory downloads a directory to a local file path
	GetDirectory(bucket, key, path string) error

	// IsDirectory tests if the key is acting like a s3 directory
	IsDirectory(bucket, key string) (bool, error)
}

func NewS3Client

func NewS3Client(opts S3ClientOpts) (S3Client, error)

NewS3Client instantiates a new S3 client object backed

type S3ClientOpts

type S3ClientOpts struct {
	Endpoint        string
	Region          string
	Secure          bool
	AccessKey       string
	SecretKey       string
	Trace           bool
	RoleARN         string
	RoleSessionName string
	UseSDKCreds     bool
}

Jump to

Keyboard shortcuts

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