objaws

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 21 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, opts objcli.AbortMultipartUploadOptions) error

func (*Client) AppendToObject

func (c *Client) AppendToObject(ctx context.Context, opts objcli.AppendToObjectOptions) error

func (*Client) Close

func (c *Client) Close() error

Close is a no-op for AWS as this won't result in a memory leak.

func (*Client) CompleteMultipartUpload

func (c *Client) CompleteMultipartUpload(ctx context.Context, opts objcli.CompleteMultipartUploadOptions) error

func (*Client) CopyObject

func (c *Client) CopyObject(ctx context.Context, opts objcli.CopyObjectOptions) error

func (*Client) CreateMultipartUpload

func (c *Client) CreateMultipartUpload(ctx context.Context, opts objcli.CreateMultipartUploadOptions) (string, error)

func (*Client) DeleteDirectory

func (c *Client) DeleteDirectory(ctx context.Context, opts objcli.DeleteDirectoryOptions) error

func (*Client) DeleteObjects

func (c *Client) DeleteObjects(ctx context.Context, opts objcli.DeleteObjectsOptions) error

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, opts objcli.GetObjectOptions) (*objval.Object, error)

func (*Client) GetObjectAttrs

func (c *Client) GetObjectAttrs(ctx context.Context, opts objcli.GetObjectAttrsOptions) (*objval.ObjectAttrs, error)

func (*Client) IterateObjects

func (c *Client) IterateObjects(ctx context.Context, opts objcli.IterateObjectsOptions) error

func (*Client) ListParts

func (c *Client) ListParts(ctx context.Context, opts objcli.ListPartsOptions) ([]objval.Part, error)

func (*Client) Provider

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

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, opts objcli.PutObjectOptions) error

func (*Client) UploadPart

func (c *Client) UploadPart(ctx context.Context, opts objcli.UploadPartOptions) (objval.Part, error)

func (*Client) UploadPartCopy

func (c *Client) UploadPartCopy(ctx context.Context, opts objcli.UploadPartCopyOptions) (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

	// Logger is the passed logger which implements a custom Log method
	Logger *slog.Logger
}

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