dynamodb

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 20 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 interface{}) (out interface{}, 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) (interface{}, 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(interface{}) bool)

func (*Client) WatchPrefix

func (c *Client) WatchPrefix(ctx context.Context, prefix string, f func(string, interface{}) 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"`
}

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