Help us shape the future of Go! Take the 2026 Go Developer Survey

dynamodb

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DdbBatchSizeLimit Current limit of 25 actions per batch
	// https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html
	DdbBatchSizeLimit = 25
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func NewClient

func NewClient(cfg Config, cc codec.Codec, logger log.Logger, registerer prometheus.Registerer) (*Client, error)

func (*Client) CAS

func (c *Client) CAS(ctx context.Context, key string, f func(in any) (out any, retry bool, err error)) error

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, key string) error

func (*Client) Get

func (c *Client) Get(ctx context.Context, key string) (any, error)

func (*Client) LastUpdateTime

func (c *Client) LastUpdateTime(key string) time.Time

func (*Client) List

func (c *Client) List(ctx context.Context, key string) ([]string, error)

func (*Client) WatchKey

func (c *Client) WatchKey(ctx context.Context, key string, f func(any) bool)

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(ctx context.Context, prefix string, f func(string, any) bool)

type Config

type Config struct {
	Region         string        `yaml:"region"`
	TableName      string        `yaml:"table_name"`
	TTL            time.Duration `yaml:"ttl"`
	PullerSyncTime time.Duration `yaml:"puller_sync_time"`
	MaxCasRetries  int           `yaml:"max_cas_retries"`
	Timeout        time.Duration `yaml:"timeout"`
}

Config to create a ConsulClient

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet, prefix string)

RegisterFlags adds the flags required to config this to the given FlagSet If prefix is not an empty string it should end with a period.

Jump to

Keyboard shortcuts

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