s3

package
v0.0.0-...-06c7680 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStore

func NewStore(endpoint, accessKey, secretKey, region, bucket string, duration time.Duration) (media.Store, error)

NewStore creates a new S3 media storage.

func NewStoreFromConfig

func NewStoreFromConfig(conf *config.S3) (media.Store, error)

NewStoreFromConfig creates a new S3 media storage from configuration.

Types

type Client

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

func (*Client) Delete

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

Delete deletes the file if it exists.

func (*Client) Get

func (c *Client) Get(filename string, signed bool) string

Get returns an url to the object relative to the endpoint.

func (*Client) Put

func (c *Client) Put(filename string, perm media.Permission, reader io.ReadSeeker) (string, error)

Put saves the file on S3. If the saving process fails, it returns an empty string and an error. Else it returns the object id and no error.

Jump to

Keyboard shortcuts

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