s3

package
v0.7.0-alpha Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewS3Store

func NewS3Store(opts Opts) (media.Store, error)

NewS3Store initialises store for S3 provider. It takes in the AWS configuration and sets up the `simples3` client to interact with AWS APIs for all bucket operations.

Types

type Client

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

Client implements `media.Store` for S3 provider

func (*Client) Delete

func (c *Client) Delete(name string) error

Delete accepts the filename of the object and deletes from S3.

func (*Client) Get

func (c *Client) Get(name string) string

Get accepts the filename of the object stored and retrieves from S3.

func (*Client) Put

func (c *Client) Put(name string, cType string, file io.ReadSeeker) (string, error)

Put takes in the filename, the content type and file object itself and uploads to S3.

type Opts

type Opts struct {
	AccessKey  string        `koanf:"aws_access_key_id"`
	SecretKey  string        `koanf:"aws_secret_access_key"`
	Region     string        `koanf:"aws_default_region"`
	Bucket     string        `koanf:"bucket"`
	BucketPath string        `koanf:"bucket_path"`
	BucketURL  string        `koanf:"bucket_url"`
	BucketType string        `koanf:"bucket_type"`
	Expiry     time.Duration `koanf:"expiry"`
}

Opts represents AWS S3 specific params

Jump to

Keyboard shortcuts

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