Documentation
¶
Index ¶
- func NewFromCmdlineOptions() plugin.Plugin
- type BlobStoreS3
- func (d *BlobStoreS3) Bucket() string
- func (d *BlobStoreS3) Client() *s3.Client
- func (d *BlobStoreS3) Close() error
- func (d *BlobStoreS3) Delete(txn types.Txn, key []byte) error
- func (d *BlobStoreS3) Get(txn types.Txn, key []byte) ([]byte, error)
- func (b *BlobStoreS3) GetCommitTimestamp() (int64, error)
- func (d *BlobStoreS3) NewIterator(txn types.Txn, opts types.BlobIteratorOptions) types.BlobIterator
- func (d *BlobStoreS3) NewTransaction(readWrite bool) types.Txn
- func (d *BlobStoreS3) Put(ctx context.Context, key string, value []byte) error
- func (d *BlobStoreS3) Set(txn types.Txn, key, val []byte) error
- func (b *BlobStoreS3) SetCommitTimestamp(ts int64, txn types.Txn) error
- func (d *BlobStoreS3) Start() error
- func (d *BlobStoreS3) Stop() error
- type BlobStoreS3OptionFunc
- func WithBucket(bucket string) BlobStoreS3OptionFunc
- func WithLogger(logger *slog.Logger) BlobStoreS3OptionFunc
- func WithPrefix(prefix string) BlobStoreS3OptionFunc
- func WithPromRegistry(registry prometheus.Registerer) BlobStoreS3OptionFunc
- func WithRegion(region string) BlobStoreS3OptionFunc
- func WithTimeout(timeout time.Duration) BlobStoreS3OptionFunc
- type S3Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFromCmdlineOptions ¶
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) 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) 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) 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.