aws

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromCmdlineOptions

func NewFromCmdlineOptions() plugin.Plugin

Types

type BlobStoreS3

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

BlobStoreS3 stores data in an AWS S3 bucket

func New

func New(
	dataDir string,
	logger *slog.Logger,
	promRegistry prometheus.Registerer,
) (*BlobStoreS3, error)

New creates a new S3-backed blob store and dataDir must be "s3://bucket" or "s3://bucket/prefix"

func NewWithOptions

func NewWithOptions(opts ...BlobStoreS3OptionFunc) (*BlobStoreS3, error)

NewWithOptions creates a new S3-backed blob store using options.

func (*BlobStoreS3) Bucket

func (d *BlobStoreS3) Bucket() string

Returns the bucket handle.

func (*BlobStoreS3) Client

func (d *BlobStoreS3) Client() *s3.Client

Returns the S3 client.

func (*BlobStoreS3) Close added in v0.19.0

func (d *BlobStoreS3) Close() error

Close implements the BlobStore interface.

func (*BlobStoreS3) Delete added in v0.19.0

func (d *BlobStoreS3) Delete(txn types.Txn, key []byte) error

Delete removes a key from S3 within a transaction

func (*BlobStoreS3) Get

func (d *BlobStoreS3) Get(txn types.Txn, key []byte) ([]byte, error)

Get retrieves a value from S3 within a transaction

func (*BlobStoreS3) GetCommitTimestamp

func (b *BlobStoreS3) GetCommitTimestamp() (int64, error)

func (*BlobStoreS3) NewIterator added in v0.19.0

func (d *BlobStoreS3) NewIterator(
	txn types.Txn,
	opts types.BlobIteratorOptions,
) types.BlobIterator

NewIterator creates an iterator for S3 within a transaction.

Important: items returned by the iterator's `Item()` must only be accessed while the transaction used to create the iterator is still active. Implementations may validate transaction state at access time (for example `ValueCopy` may fail if the transaction has been committed or rolled back). Typical usage iterates and accesses item values within the same transaction scope.

func (*BlobStoreS3) NewTransaction added in v0.19.0

func (d *BlobStoreS3) NewTransaction(readWrite bool) types.Txn

NewTransaction returns a lightweight transaction wrapper.

func (*BlobStoreS3) Put

func (d *BlobStoreS3) Put(ctx context.Context, key string, value []byte) error

Put writes a value to key.

func (*BlobStoreS3) Set added in v0.19.0

func (d *BlobStoreS3) Set(txn types.Txn, key, val []byte) error

Set stores a key-value pair in S3 within a transaction

func (*BlobStoreS3) SetCommitTimestamp

func (b *BlobStoreS3) SetCommitTimestamp(
	ts int64,
	txn types.Txn,
) error

func (*BlobStoreS3) Start

func (d *BlobStoreS3) Start() error

Start implements the plugin.Plugin interface.

func (*BlobStoreS3) Stop

func (d *BlobStoreS3) Stop() error

Stop implements the plugin.Plugin interface.

type BlobStoreS3OptionFunc

type BlobStoreS3OptionFunc func(*BlobStoreS3)

func WithBucket

func WithBucket(bucket string) BlobStoreS3OptionFunc

WithBucket specifies the S3 bucket name

func WithLogger

func WithLogger(logger *slog.Logger) BlobStoreS3OptionFunc

WithLogger specifies the logger object to use for logging messages

func WithPrefix

func WithPrefix(prefix string) BlobStoreS3OptionFunc

WithPrefix specifies the S3 object prefix

func WithPromRegistry

func WithPromRegistry(
	registry prometheus.Registerer,
) BlobStoreS3OptionFunc

WithPromRegistry specifies the prometheus registry to use for metrics

func WithRegion

func WithRegion(region string) BlobStoreS3OptionFunc

WithRegion specifies the AWS region

func WithTimeout

func WithTimeout(timeout time.Duration) BlobStoreS3OptionFunc

WithTimeout specifies the timeout for AWS config loading

type S3Logger

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

S3Logger is a thin wrapper giving our logger a consistent interface.

func NewS3Logger

func NewS3Logger(logger *slog.Logger) *S3Logger

func (*S3Logger) Debugf

func (g *S3Logger) Debugf(msg string, args ...any)

func (*S3Logger) Errorf

func (g *S3Logger) Errorf(msg string, args ...any)

func (*S3Logger) Infof

func (g *S3Logger) Infof(msg string, args ...any)

func (*S3Logger) Warningf

func (g *S3Logger) Warningf(msg string, args ...any)

Jump to

Keyboard shortcuts

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