s3

package
v2.11.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert added in v2.9.0

type Cert struct {
	CACert     string
	ClientCert string
	ClientKey  string
}

type Client

type Client struct {
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	// contains filtered or unexported fields
}

Client wraps the minio s3 client

func New

func New(endpoint, accessKeyID, secretAccessKey string, cert Cert) *Client

New returns a new Client

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

Connect creates a minio client

func (*Client) DeleteBucket

func (c *Client) DeleteBucket(ctx context.Context) error

DeleteBucket deletes the main bucket where the client is connected to.

func (*Client) DeleteBucketByName

func (c *Client) DeleteBucketByName(ctx context.Context, name string) error

DeleteBucketByName deletes the bucket with the specified name

func (*Client) Get

func (c *Client) Get(ctx context.Context, filename string) (*minio.Object, error)

Get gets a file or returns an error.

func (*Client) ListObjects

func (c *Client) ListObjects(ctx context.Context) ([]minio.ObjectInfo, error)

ListObjects lists all objects in the bucket

func (*Client) Stat

func (c *Client) Stat(ctx context.Context, filename string) (minio.ObjectInfo, error)

Stat returns metainformation about an object in the repository.

func (*Client) Upload

func (c *Client) Upload(ctx context.Context, object UploadObject) error

Upload uploads a io.Reader object to the configured endpoint

type UploadObject

type UploadObject struct {
	ObjectStream io.Reader
	Name         string
}

Jump to

Keyboard shortcuts

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