client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 10 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 {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cred *Credentials) (*Client, error)

NewClient returns a new S3 client from the given credentials.

func (*Client) CreateBucketIfNotExists

func (c *Client) CreateBucketIfNotExists(ctx context.Context, bucket, region string) error

CreateBucketIfNotExists creates the s3 bucket with name <bucket> in <region>. If it already exists, no error is returned.

func (*Client) DeleteBucketIfExists

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

DeleteBucketIfExists deletes the s3 bucket with name <bucket>. If it does not exist, no error is returned.

func (*Client) DeleteObjectsWithPrefix

func (c *Client) DeleteObjectsWithPrefix(ctx context.Context, bucket, prefix string) error

DeleteObjectsWithPrefix deletes the s3 objects with the specific <prefix> from <bucket>. If it does not exist, no error is returned.

type Credentials

type Credentials struct {
	AccessKeyID        string
	Region             string
	SecretAccessKey    string
	Endpoint           *string
	InsecureSkipVerify bool
	S3ForcePathStyle   bool
	TrustedCaCert      *string
}

Jump to

Keyboard shortcuts

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