aws

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: Apache-2.0 Imports: 16 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) Get

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

Get reads the value at key.

func (*BlobStoreS3) GetCommitTimestamp

func (b *BlobStoreS3) GetCommitTimestamp(ctx context.Context) (int64, error)

func (*BlobStoreS3) Put

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

Put writes a value to key.

func (*BlobStoreS3) SetCommitTimestamp

func (b *BlobStoreS3) SetCommitTimestamp(ctx context.Context, ts int64) 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