bucket

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket struct {
	S3   *s3.Client
	Name *string
}

A Bucket is an S3 bucket which holds properties such as bucket name and SSE things for S3 Bucket.

func New

func New(s *s3.Client, name string) *Bucket

New returns Bucket instance with bucket name name.

func (*Bucket) BuildListObjectVersionsPaginatorFactory

func (b *Bucket) BuildListObjectVersionsPaginatorFactory(
	ctx context.Context,
	prefix string,
	opts ...option.ListObjectVersionsInput,
) ListObjectVersionsPaginatorFactory

BuildListObjectVersionsPaginatorFactory builds a factory that builds *s3.ListObjectVersionsPaginator to go through versioning objects with a given prefix.

func (*Bucket) BuildListObjectsV2PaginatorFactory

func (b *Bucket) BuildListObjectsV2PaginatorFactory(
	ctx context.Context,
	prefix string,
	opts ...option.ListObjectsV2Input,
) ListObjectsV2PaginatorFactory

BuildListObjectsV2PaginatorFactory builds a factory that builds *s3.ListObjectsV2Paginator to go through objects with a given prefix.

func (*Bucket) CopyObject

func (b *Bucket) CopyObject(ctx context.Context, dest, src string, opts ...option.CopyObjectInput) (*s3.CopyObjectOutput, error)

CopyObject copies an object within the bucket.

func (*Bucket) DeleteObject

func (b *Bucket) DeleteObject(ctx context.Context, key string) (*s3.DeleteObjectOutput, error)

DeleteObject deletes an object for key.

func (*Bucket) DeleteObjects

func (b *Bucket) DeleteObjects(ctx context.Context, identifiers []types.ObjectIdentifier) (*s3.DeleteObjectsOutput, error)

DeleteObjects deletes each object for the given identifiers. A maximum of 1000 objects can be deleted at a time with this method.

func (*Bucket) ExistsObject

func (b *Bucket) ExistsObject(ctx context.Context, key string, opts ...option.HeadObjectInput) (bool, error)

ExistsObject returns true if key does not exist on bucket.

func (*Bucket) GetObject

func (b *Bucket) GetObject(ctx context.Context, key string, opts ...option.GetObjectInput) (*s3.GetObjectOutput, error)

GetObject returns the s3.GetObjectOutput.

func (*Bucket) GetObjectReader

func (b *Bucket) GetObjectReader(ctx context.Context, key string, opts ...option.GetObjectInput) (io.ReadCloser, error)

GetObjectReader returns a reader assosiated with body. A caller of this MUST close the reader when it finishes reading.

func (*Bucket) HeadObject

func (b *Bucket) HeadObject(ctx context.Context, key string, opts ...option.HeadObjectInput) (*s3.HeadObjectOutput, error)

HeadObject retrieves an object metadata for key.

func (*Bucket) ListObjects

func (b *Bucket) ListObjects(ctx context.Context, prefix string, opts ...option.ListObjectsInput) (*s3.ListObjectsOutput, error)

ListObjects lists objects that has prefix.

func (*Bucket) PresignClient

func (b *Bucket) PresignClient(optFns ...func(*s3.PresignOptions)) *PresignClient

PresignClient generates a presign client wrapper using the given API Client and presign options.

func (*Bucket) PutObject

func (b *Bucket) PutObject(ctx context.Context, key string, rs io.ReadSeeker, opts ...option.PutObjectInput) (*s3.PutObjectOutput, error)

PutObject puts an object with reading data from reader.

type ListObjectVersionsPaginatorFactory

type ListObjectVersionsPaginatorFactory func(opts ...func(*s3.ListObjectVersionsPaginatorOptions)) *s3.ListObjectVersionsPaginator

ListObjectVersionsPaginatorFactory represents a factory that builds *s3.ListObjectVersionsPaginator.

type ListObjectsV2PaginatorFactory

type ListObjectsV2PaginatorFactory func(opts ...func(*s3.ListObjectsV2PaginatorOptions)) *s3.ListObjectsV2Paginator

ListObjectsV2PaginatorFactory represents a factory that builds *s3.ListObjectsV2Paginator.

type PresignClient

type PresignClient struct {
	PresignClient *s3.PresignClient
	Name          *string
	// contains filtered or unexported fields
}

PresignClient wraps the S3 presign client with the given S3 API client, bucket name and the presign optionsd. If you want to give different presign options, please generate another one by Bucket#PresignClient. It implements only the object-level operations.

func (*PresignClient) PresignDeleteObject

func (c *PresignClient) PresignDeleteObject(ctx context.Context, key string) (*v4.PresignedHTTPRequest, error)

PresignDeleteObject generates a presigned HTTP Request for DeleteObject operation.

func (*PresignClient) PresignGetObject

func (c *PresignClient) PresignGetObject(ctx context.Context, key string, opts ...option.GetObjectInput) (*v4.PresignedHTTPRequest, error)

PresignGetObject generates a presigned HTTP Request for GetObject operation.

func (*PresignClient) PresignHeadObject

func (c *PresignClient) PresignHeadObject(ctx context.Context, key string, opts ...option.HeadObjectInput) (*v4.PresignedHTTPRequest, error)

PresignHeadObject generates a presigned HTTP Request for HeadObject operation.

func (*PresignClient) PresignPutObject

func (c *PresignClient) PresignPutObject(ctx context.Context, key string, rs io.ReadSeeker, opts ...option.PutObjectInput) (*v4.PresignedHTTPRequest, error)

PresignPutObject generates a presigned HTTP Request for PutObject operation.

Directories

Path Synopsis
Package option provides adapters to change a parameter in S3 request.
Package option provides adapters to change a parameter in S3 request.

Jump to

Keyboard shortcuts

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