s3

package
v0.0.0-...-0a9dbb4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnectionFailed = errors.New("connection to S3 failed")

Functions

This section is empty.

Types

type Client

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

func New

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

New creates a new S3 client

func (*Client) BucketExists

func (c *Client) BucketExists(ctx context.Context, bucketName string) (bool, error)

BucketExists checks if a bucket exists with context

func (*Client) CreateBucket

func (c *Client) CreateBucket(ctx context.Context, bucketName string, opts minio.MakeBucketOptions) error

CreateBucket creates a bucket with context

func (*Client) DownloadFile

func (c *Client) DownloadFile(ctx context.Context, bucketName string, objectName string, filePath string) error

DownloadFile downloads a file from S3 with context

func (*Client) FileExists

func (c *Client) FileExists(ctx context.Context, bucketName string, objectName string) (bool, error)

FileExists checks if a file exists with context

func (*Client) GetFileURL

func (c *Client) GetFileURL(ctx context.Context, bucketName string, objectName string) (*url.URL, error)

GetFileURL returns a URL for a file with context

func (*Client) ListFiles

func (c *Client) ListFiles(ctx context.Context, bucketName string) ([]string, error)

ListFiles lists all files in a bucket with context

func (*Client) RemoveBucket

func (c *Client) RemoveBucket(ctx context.Context, bucketName string) error

RemoveBucket removes a bucket with context

func (*Client) RemoveFile

func (c *Client) RemoveFile(ctx context.Context, bucketName string, objectName string) error

RemoveFile removes a file from S3 with context

func (*Client) UploadFile

func (c *Client) UploadFile(ctx context.Context, bucketName string, objectName string, reader *bytes.Reader) error

UploadFile uploads a file to S3 with context

type CreateBucketError

type CreateBucketError struct {
	Err  error
	Name string
}

func (CreateBucketError) Error

func (e CreateBucketError) Error() string

Jump to

Keyboard shortcuts

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