Documentation ¶
Index ¶
- type ObjectURLer
- type Service
- func (s *Service) BatchPut(ctx context.Context, us []*Upload, workers int) error
- func (s *Service) EmptyBucket(ctx context.Context, bucket string) error
- func (s *Service) GetObject(ctx context.Context, bucket, key string) (string, []byte, error)
- func (s *Service) ObjectURL(bucket, key string) string
- func (s *Service) PutObject(ctx context.Context, bucket, key string, contentType string, body []byte, ...) (string, error)
- func (s *Service) Test(ctx context.Context, bucket string) error
- type Upload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ObjectURLer ¶
ObjectURLer is a function that takes a key and returns the publicly accessible URL for that object
func AWSURLer ¶
func AWSURLer(region string) ObjectURLer
func MinioURLer ¶
func MinioURLer(endpoint string) ObjectURLer
type Service ¶
Service is simple abstraction layer to work with a S3-compatible storage service
func NewService ¶
NewService creates a new S3 service with the given credentials and configuration
func (*Service) BatchPut ¶
BatchPut writes the entire batch of items to the passed in URLs, returning a map of errors if any. Writes will be retried up to three times automatically.
func (*Service) EmptyBucket ¶
EmptyBucket is a convenience method to delete all the objects in a bucket
func (*Service) GetObject ¶
GetObject is a convenience method to get an object from S3 and read its contents into a byte slice
Click to show internal directories.
Click to hide internal directories.