s3

package
v3.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRetries = 3

DefaultRetries is the number of retries for a S3 upload until an error is raised

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a S3 uploader client

func NewClient

func NewClient(ctx context.Context, logger Logger) (*Client, error)

NewClient returns a new S3 Client, configuration is read from env variables or configuration files, see https://docs.aws.amazon.com/sdkref/latest/guide/creds-config-files.html

func (*Client) Upload

func (c *Client) Upload(filepath, bucket, key string) (string, error)

Upload uploads a file to an s3 bucket, on success it returns the s3:// URL of the object.

type Logger

type Logger interface {
	Debugf(format string, v ...any)
}

Logger defines the interface for an S3 logger

Jump to

Keyboard shortcuts

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