s3

package
v0.5.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2025 License: Apache-2.0 Imports: 21 Imported by: 5

Documentation

Index

Constants

View Source
const DefaultRegion = "us-east-1"

DefaultRegion is the region used if one is not specified.

View Source
const MaxKeys = 1000

MaxKeys is the number of keys S3 can operate on per batch.

View Source
const ReplicaClientType = "s3"

ReplicaClientType is the client type for this package.

Variables

This section is empty.

Functions

func ParseHost added in v0.3.3

func ParseHost(s string) (bucket, region, endpoint string, forcePathStyle bool)

ParseHost extracts data from a hostname depending on the service provider.

Types

type ReplicaClient added in v0.3.5

type ReplicaClient struct {

	// AWS authentication keys.
	AccessKeyID     string
	SecretAccessKey string

	// S3 bucket information
	Region         string
	Bucket         string
	Path           string
	Endpoint       string
	ForcePathStyle bool
	SkipVerify     bool
	// contains filtered or unexported fields
}

ReplicaClient is a client for writing LTX files to S3.

func NewReplicaClient added in v0.3.5

func NewReplicaClient() *ReplicaClient

NewReplicaClient returns a new instance of ReplicaClient.

func (*ReplicaClient) DeleteAll added in v0.3.5

func (c *ReplicaClient) DeleteAll(ctx context.Context) error

DeleteAll deletes all LTX files.

func (*ReplicaClient) DeleteLTXFiles added in v0.5.0

func (c *ReplicaClient) DeleteLTXFiles(ctx context.Context, a []*ltx.FileInfo) error

DeleteLTXFiles deletes a set of LTX files.

func (*ReplicaClient) Init added in v0.3.5

func (c *ReplicaClient) Init(ctx context.Context) (err error)

Init initializes the connection to S3. No-op if already initialized.

func (*ReplicaClient) LTXFiles added in v0.5.0

func (c *ReplicaClient) LTXFiles(ctx context.Context, level int, seek ltx.TXID) (ltx.FileIterator, error)

LTXFiles returns an iterator over all available LTX files.

func (*ReplicaClient) OpenLTXFile added in v0.5.0

func (c *ReplicaClient) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID) (io.ReadCloser, error)

OpenLTXFile returns a reader for an LTX file Returns os.ErrNotExist if no matching index/offset is found.

func (*ReplicaClient) Type added in v0.3.5

func (c *ReplicaClient) Type() string

Type returns "s3" as the client type.

func (*ReplicaClient) WriteLTXFile added in v0.5.0

func (c *ReplicaClient) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, rd io.Reader) (info *ltx.FileInfo, err error)

WriteLTXFile writes an LTX file from rd into a remote location.

Jump to

Keyboard shortcuts

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