dynamodb

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package dynamodb provides a persistence Driver backed by Amazon DynamoDB.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.18.0

type Config struct {
	// AWS is the AWS configuration used to create the DynamoDB client.
	AWS aws.Config

	// ClientOptions are additional options applied to the DynamoDB client.
	ClientOptions []func(*awsdynamodb.Options)

	// TablePrefix is the prefix for DynamoDB table names. Each primitive uses a
	// separate table ("<prefix>-journal", "<prefix>-kv", "<prefix>-set").
	TablePrefix string
}

Config holds the configuration for a DynamoDB persistence driver.

func FromURL added in v0.18.0

func FromURL(ctx context.Context, u *url.URL) (*Config, error)

FromURL returns a Config for the given URL.

See ParseURL for the URL format.

func ParseURL added in v0.18.0

func ParseURL(ctx context.Context, u string) (*Config, error)

ParseURL returns a Config for the given URL string.

URL format:

dynamodb:///<table-prefix>
dynamodb://<host>:<port>/<table-prefix>

The table prefix is prepended to the names of each DynamoDB table. Each primitive uses a separate table ("<prefix>-journal", "<prefix>-kv", "<prefix>-set"). If a host is specified, it is used as a custom endpoint.

Supported query parameters:

  • region: AWS region (e.g. "us-east-1"); if omitted, resolved from the environment
  • role_arn: ARN of an IAM role to assume via STS
  • insecure: use HTTP instead of HTTPS for a custom endpoint (requires a host)

func (*Config) NewDriver added in v0.18.0

func (c *Config) NewDriver(context.Context) (driver.Driver, error)

NewDriver returns a Driver described by the given configuration.

type Driver added in v0.18.0

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

Driver is a persistence driver backed by Amazon DynamoDB.

func New added in v0.18.0

func New(cfg *Config) *Driver

New returns a Driver described by the given configuration.

func NewFromClient added in v0.19.0

func NewFromClient(client *awsdynamodb.Client, tablePrefix string) *Driver

NewFromClient returns a Driver that uses a pre-built DynamoDB client and table prefix. The caller retains ownership of the client.

func (*Driver) Close added in v0.18.0

func (d *Driver) Close() error

Close is a no-op. The DynamoDB client does not require explicit cleanup.

func (*Driver) JournalStore added in v0.18.0

func (d *Driver) JournalStore() journal.BinaryStore

JournalStore returns a journal store backed by DynamoDB.

func (*Driver) KVStore added in v0.18.0

func (d *Driver) KVStore() kv.BinaryStore

KVStore returns a key/value store backed by DynamoDB.

func (*Driver) SetStore added in v0.18.0

func (d *Driver) SetStore() set.BinaryStore

SetStore returns a set store backed by DynamoDB.

Directories

Path Synopsis
Package dynamojournal provides an implementation of journal.BinaryStore that persists to a DynamoDB table.
Package dynamojournal provides an implementation of journal.BinaryStore that persists to a DynamoDB table.
Package dynamokv provides a kv.BinaryStore implementation that persists to a DynamoDB table.
Package dynamokv provides a kv.BinaryStore implementation that persists to a DynamoDB table.
Package dynamoset provides a set.BinaryStore implementation that persists to a DynamoDB table.
Package dynamoset provides a set.BinaryStore implementation that persists to a DynamoDB table.

Jump to

Keyboard shortcuts

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