config_store

package
v2.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCatalog

func WithCatalog(catalog string) func(*ConfigStore)

func WithDomain

func WithDomain(domain string) func(*ConfigStore)

func WithEventHandler

func WithEventHandler(fn func(*ConfigEntry)) func(*ConfigStore)

func WithTTL

func WithTTL(ttl time.Duration) func(*ConfigStore)

Types

type ConfigEntry

type ConfigEntry struct {
	Operation ConfigOp
	Key       string
	Value     []byte
	Revision  uint64
	Created   time.Time
	Delta     uint64
}

type ConfigOp

type ConfigOp int32
const (
	ConfigCreate ConfigOp = iota
	ConfigUpdate
	ConfigDelete
)

func (ConfigOp) String

func (co ConfigOp) String() string

type ConfigStore

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

func NewConfigStore

func NewConfigStore(client *core.Client, opts ...func(*ConfigStore)) *ConfigStore

func (*ConfigStore) Delete

func (cs *ConfigStore) Delete(key string) error

func (*ConfigStore) Get

func (cs *ConfigStore) Get(key string) (nats.KeyValueEntry, error)

func (*ConfigStore) Init

func (cs *ConfigStore) Init() error

func (*ConfigStore) Keys

func (cs *ConfigStore) Keys() ([]string, error)

func (*ConfigStore) Put

func (cs *ConfigStore) Put(key string, value []byte) (uint64, error)

func (*ConfigStore) Update

func (cs *ConfigStore) Update(key string, value []byte, revision uint64) (uint64, error)

Jump to

Keyboard shortcuts

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