s3

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(s *Storage)

Option represents the S3 storage options

func WithAccessKey

func WithAccessKey(accessKey string) Option

WithAccessKey sets the bucket accessKey

func WithBucketName

func WithBucketName(name string) Option

WithBucketName sets the bucket name

func WithBucketRegion

func WithBucketRegion(region string) Option

WithBucketRegion sets the bucket region

func WithEndpoint added in v0.3.1

func WithEndpoint(endpoint string) Option

WithEndpoint sets the bucket endpoint

func WithHystrixCommand

func WithHystrixCommand(hytrixCmd storage.HystrixCommand) Option

WithHystrixCommand sets the bucket hystrixCmd

func WithSecretKey

func WithSecretKey(secretKey string) Option

WithSecretKey sets the bucket secretKey

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

Storage holds the fields used by S3 storage implementation

func NewStorage

func NewStorage(opts ...Option) *Storage

NewStorage returns a new s3.Storage instance

func (*Storage) Get

func (s *Storage) Get(ctx context.Context, path string) storage.IResponse

Get takes in the Context and path as an argument and returns an IResponse interface implementation. This method figures out how to get the data from the S3 storage backend.

func (*Storage) GetPartially added in v0.1.0

GetPartially takes in the Context, path and opt as an argument and returns an IResponse interface implementation. This method figures out how to get partial data from the S3 storage backend.

Jump to

Keyboard shortcuts

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