Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { ListDirectories(p Path) ([]Path, error) List(p Path) ([]Path, error) Download(p Path) ([]byte, error) DownloadInFile(p Path, f *os.File) (int64, error) Copy(source Path, target Path) error Upload(b []byte, p Path) error DeleteRecursive(p Path) error DeleteBucket(name string, log logr.Logger) error DeleteObject(p Path) error Exists(p Path) bool CreateBucket(name string) error AddBucketTag(bucketName string, tags map[string]string, overwrite bool) error BlockBucketPublicAccess(name string) error BucketServerSideEncryption(bucket string) error }
Client is designed to be an Storage Interface for S3 s3Client
func NewClient ¶
func NewClient(options ...ClientOption) (Client, error)
NewClient initializes the s3Client struct with a new session
type ClientOption ¶
ClientOption is desing to allow user overwrites to the aws config
func WithCredentials ¶
func WithCredentials(cred *credentials.Credentials) ClientOption
WithCredentials allows overwriting the credentials / useful for minio server see: https://docs.min.io/docs/how-to-use-aws-sdk-for-go-with-minio-server.html
func WithDisableSSL ¶
func WithDisableSSL(ssl bool) ClientOption
WithDisableSSL disables SSL when set to true
func WithEndpoint ¶
func WithEndpoint(endpoint string) ClientOption
WithEndpoint allows to overwrite the aws endpoint / useful for minio server
func WithRegion ¶
func WithRegion(region string) ClientOption
WithRegion allows to set the aws region
func WithS3ForcePathStyle ¶
func WithS3ForcePathStyle(force bool) ClientOption
WithS3ForcePathStyle allows to set S3ForcePathStyle
type Path ¶
Path is to store a bucket and key for s3 purposes
func FromURI ¶
FromURI accepts an s3 uri of format `s3://<bucket>(/<key>, optional)` where the key can have slashes, `/`. Returns the bucket and key in a struct, Path, with fields of those names, and an error if there was trouble parsing the passed uri.