s3

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package s3 provides Amazon S3 client implementations.

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
}

Client is a struct that provides client related methods.

func (*Client) CreateBucket

func (this *Client) CreateBucket(name, region string) (*aws_s3.CreateBucketOutput, error)

CreateBucket is create a bucket.

ex) _, err := client.CreateBucket(bucketName, "dummy")

func (*Client) CreateClient

func (this *Client) CreateClient(ctx context.Context, region, accessKey, secretAccessKey, sessionToken string, loadOptionFunctions ...func(*config.LoadOptions) error) error

CreateClient is create client. ex)

err := client.CreateClient(context.TODO(), "dummy", "dummy", "dummy", "dummy",
    config.WithEndpointResolver(aws.EndpointResolverFunc(
        func(service, region string) (aws.Endpoint, error) {
            return aws.Endpoint{URL: fmt.Sprintf("http://127.0.0.1:9090"), HostnameImmutable: true}, nil
        })),
)

func (*Client) DeleteBucket

func (this *Client) DeleteBucket(name string) (*aws_s3.DeleteBucketOutput, error)

DeleteBucket is delete a bucket.

ex) _, err := client.DeleteBucket(bucketName)

func (*Client) DeleteObject

func (this *Client) DeleteObject(bucketName string, key string) (*aws_s3.DeleteObjectOutput, error)

DeleteObject is delete an object.

ex) _, err := client.DeleteObject(bucketName, key)

func (*Client) GetObject

func (this *Client) GetObject(bucketName string, key string) (*aws_s3.GetObjectOutput, error)

GetObject is get an object.

ex) output, err := client.GetObject(bucketName, key)

func (*Client) ListBuckets

func (this *Client) ListBuckets() (*aws_s3.ListBucketsOutput, error)

ListBuckets is get buckets.

ex) output, err := client.ListBuckets()

func (*Client) PutObject

func (this *Client) PutObject(bucketName, key, body string) (*aws_s3.PutObjectOutput, error)

PutObject is put an object.

ex) _, err := client.PutObject(bucketName, key, data)

Jump to

Keyboard shortcuts

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