Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) CAS(ctx context.Context, key string, ...) error
- func (c *Client) Delete(ctx context.Context, key string) error
- func (c *Client) Get(ctx context.Context, key string) (interface{}, error)
- func (c *Client) LastUpdateTime(key string) time.Time
- func (c *Client) List(ctx context.Context, key string) ([]string, error)
- func (c *Client) WatchKey(ctx context.Context, key string, f func(interface{}) bool)
- func (c *Client) WatchPrefix(ctx context.Context, prefix string, f func(string, interface{}) bool)
- type Config
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) LastUpdateTime ¶
func (c *Client) LastUpdateTime(key string) time.Time
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.
Click to show internal directories.
Click to hide internal directories.