Versions in this module Expand all Collapse all v0 v0.2.0 Feb 20, 2023 Changes in this version + var ErrKeyNotFound = errors.New("key not found") + type WatchNotificationFunc func(key string, err error) + type WatchOptions struct + Logger hclog.Logger + PanicOnUnmarshalFailure bool + WatchNotification WatchNotificationFunc v0.1.0 Jan 7, 2023 Changes in this version + func Watch(client *api.Client, key string, cfg Reloadable, logger hclog.Logger) error + type InstanceListener interface + OnChange func(instances []string) + type Instancer struct + func NewInstancer(config InstancerConfig) (*Instancer, error) + func (i *Instancer) Close() + func (i *Instancer) Instance() (string, bool) + func (i *Instancer) Instances() []string + func (i *Instancer) RegisterListener(l InstanceListener) + type InstancerConfig struct + AllowStale bool + Client *api.Client + Logger hclog.Logger + PassingOnly bool + Service string + Tag string + type KVClient struct + func NewKVClient(c *api.Client) *KVClient + func (c KVClient) Delete(key string) error + func (c KVClient) Get(key string, allowStale bool) (option.Option[KeyValue], error) + func (c KVClient) MustGet(key string, allowStale bool) KeyValue + func (c KVClient) MustPut(key string, value []byte) + func (c KVClient) MustPutJSON(key string, v any) + func (c KVClient) MustPutYAML(key string, v any) + func (c KVClient) Put(key string, value []byte) error + func (c KVClient) PutJSON(key string, v any) error + func (c KVClient) PutYAML(key string, v any) error + type KeyValue struct + func (kv KeyValue) CreateIndex() uint64 + func (kv KeyValue) Flags() uint64 + func (kv KeyValue) IsEmpty() bool + func (kv KeyValue) Key() string + func (kv KeyValue) LockIndex() uint64 + func (kv KeyValue) ModifyIndex() uint64 + func (kv KeyValue) MustUnmarshalValueJSON(v any) + func (kv KeyValue) MustUnmarshalValueYAML(v any) + func (kv KeyValue) Namespace() string + func (kv KeyValue) Partition() string + func (kv KeyValue) RawValue() []byte + func (kv KeyValue) Session() string + func (kv KeyValue) UnmarshalValueJSON(v any) error + func (kv KeyValue) UnmarshalValueYAML(v any) error + func (kv KeyValue) Unwrap() *api.KVPair + func (kv KeyValue) Value() string + type Reloadable interface + Reload func(data []byte) error