s3ext

package
v1.3.16 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func Dial

func Dial(configs Configs) (*Client, error)

func (*Client) Delete

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

func (*Client) DeleteWithContext

func (c *Client) DeleteWithContext(ctx context.Context, bucket, filename string) error

func (*Client) Download

func (c *Client) Download(bucket, filename string) ([]byte, error)

func (*Client) DownloadByURL

func (c *Client) DownloadByURL(uri url.URL) ([]byte, error)

func (*Client) DownloadByURLWithContext

func (c *Client) DownloadByURLWithContext(ctx context.Context, uri url.URL) ([]byte, error)

func (*Client) DownloadWithContext

func (c *Client) DownloadWithContext(ctx context.Context, bucket, filename string) ([]byte, error)

func (*Client) Upload

func (c *Client) Upload(bucket, filename string, data []byte, public bool) (*url.URL, error)

func (*Client) UploadWithContext

func (c *Client) UploadWithContext(ctx context.Context, bucket, filename string, data []byte, public bool) (*url.URL, error)

type Configs

type Configs struct {
	S3EndpointURL  url.URL       `env:"S3_ENDPOINT_URL,required"`
	S3AccessKey    string        `env:"S3_ACCESS_KEY,required"`
	S3SecretKey    string        `env:"S3_SECRET_KEY,required"`
	S3Timeout      time.Duration `env:"S3_TIMEOUT" envDefault:"5s"`
	S3MaxRetries   int           `env:"S3_MAX_RETRIES" envDefault:"3"`
	S3BufferSize   int           `env:"S3_BUFFER_SIZE_KB" envDefault:"500"`
	S3BufferGrowth float64       `env:"S3_BUFFER_GROWTH" envDefault:"1.8"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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