Documentation ¶
Overview ¶
Package s3 provides Amazon S3 client implementations.
Index ¶
- type Client
- func (this *Client) CreateBucket(name, region string) (*aws_s3.CreateBucketOutput, error)
- func (this *Client) CreateClient(ctx context.Context, region, accessKey, secretAccessKey, sessionToken string, ...) error
- func (this *Client) DeleteBucket(name string) (*aws_s3.DeleteBucketOutput, error)
- func (this *Client) DeleteObject(bucketName string, key string) (*aws_s3.DeleteObjectOutput, error)
- func (this *Client) GetObject(bucketName string, key string) (*aws_s3.GetObjectOutput, error)
- func (this *Client) ListBuckets() (*aws_s3.ListBucketsOutput, error)
- func (this *Client) PutObject(bucketName, key, body string) (*aws_s3.PutObjectOutput, error)
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 ¶
DeleteObject is delete an object.
ex) _, err := client.DeleteObject(bucketName, key)
func (*Client) GetObject ¶
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()
Click to show internal directories.
Click to hide internal directories.