objaws

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package objaws provides an implementation of 'objstore.Client' for use with AWS S3.

Index

Constants

View Source
const (
	// PageSize is the default page size used by AWS.
	PageSize = 1_000

	// MaxUploadParts is the maximum number of parts for a multipart upload in AWS.
	MaxUploadParts = 10_000

	// MinUploadSize is the minimum size for a multipart upload in AWS.
	MinUploadSize = 5 * 1024 * 1024
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implements the 'objcli.Client' interface allowing the creation/management of objects stored in AWS S3.

func NewClient

func NewClient(options ClientOptions) *Client

NewClient returns a new client which uses the given 'serviceAPI', in general this should be the one created using the 's3.New' function exposed by the SDK.

func (*Client) AbortMultipartUpload

func (c *Client) AbortMultipartUpload(ctx context.Context, bucket, id, key string) error

func (*Client) AppendToObject

func (c *Client) AppendToObject(ctx context.Context, bucket, key string, data io.ReadSeeker) error

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, bucket, id, key string, parts ...objval.Part) error

func (*Client) CreateMultipartUpload

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

func (*Client) DeleteDirectory

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

func (*Client) DeleteObjects

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

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, bucket, key string, br *objval.ByteRange) (*objval.Object, error)

func (*Client) GetObjectAttrs

func (c *Client) GetObjectAttrs(ctx context.Context, bucket, key string) (*objval.ObjectAttrs, error)

func (*Client) IterateObjects

func (c *Client) IterateObjects(ctx context.Context, bucket, prefix, delimiter string, include,
	exclude []*regexp.Regexp, fn objcli.IterateFunc,
) error

func (*Client) ListParts

func (c *Client) ListParts(ctx context.Context, bucket, id, key string) ([]objval.Part, error)

func (*Client) Provider

func (c *Client) Provider() objval.Provider

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, bucket, key string, body io.ReadSeeker) error

func (*Client) UploadPart

func (c *Client) UploadPart(
	ctx context.Context, bucket, id, key string, number int, body io.ReadSeeker,
) (objval.Part, error)

func (*Client) UploadPartCopy

func (c *Client) UploadPartCopy(
	ctx context.Context, bucket, id, dst, src string, number int, br *objval.ByteRange,
) (objval.Part, error)

type ClientOptions

type ClientOptions struct {
	// ServiceAPI is the is the minimal subset of functions that we use from the AWS SDK, this allows for a greatly
	// reduce surface area for mock generation.
	//
	// NOTE: Required
	ServiceAPI serviceAPI
}

ClientOptions encapsulates the options for creating a new AWS Client.

Jump to

Keyboard shortcuts

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