bucket

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//OptS3Bucket s3 bucket name
	OptS3Bucket = iota + storage.OptDataTypes + 1
	//OptS3Suffix object key suffix e.g. '.json'
	OptS3Suffix
	//OptS3MimeType object mime type e.g. 'application/json'. Use MimeTypeJson or MimeTypeText
	OptS3MimeType
	//OptS3Region AWS region e.g. 'eu-west-2'
	OptS3Region
)
View Source
const (
	MimeTypeJson = "application/json"
	MimeTypeText = "text/plain"
)

Variables

This section is empty.

Functions

func New

func New(bucket string, prefix string, suffix string, mimeType string, region string) (storage.Storage, error)

Types

type S3Iface

type S3Iface interface {
	DeleteObject(ctx context.Context, params *s3.DeleteObjectInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectOutput, error)
	DeleteObjects(ctx context.Context, params *s3.DeleteObjectsInput, optFns ...func(*s3.Options)) (*s3.DeleteObjectsOutput, error)
	GetObject(ctx context.Context, params *s3.GetObjectInput, optFns ...func(*s3.Options)) (*s3.GetObjectOutput, error)
	HeadObject(ctx context.Context, params *s3.HeadObjectInput, optFns ...func(*s3.Options)) (*s3.HeadObjectOutput, error)
	PutObject(ctx context.Context, params *s3.PutObjectInput, optFns ...func(*s3.Options)) (*s3.PutObjectOutput, error)
}

S3Iface provides an interface to AWS SDK V2 s3 client. We require this for mocking the client in tests

Jump to

Keyboard shortcuts

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