kvs

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KVEntry

type KVEntry interface {
	// Key is the key that was retrieved.
	Key() string
	// Value is the retrieved value.
	Value() []byte
	// Operation returns `KVWatchOp`.
	Operation() KVWatchOp
}

KVEntry defines what can be read on the Watch stream.

type KVStorer

type KVStorer interface {
	// GetAllKeys the keys from KV store.
	GetAllKeys(context.Context) ([]string, error)
	// DeleteKey deletes the key from KV store.
	DeleteKey(context.Context, string) error
	// PutKV inserts a key-value pair into the KV store.
	PutKV(context.Context, string, []byte) error
	// GetValue gets the value of the given key.
	GetValue(context.Context, string) ([]byte, error)
	// GetStoreName returns the bucket name of the KV store.
	GetStoreName() string
	// Watch starts watching the KV store for changes. It returns a channel of KVEntry and a done channel.
	// The KVEntry channel is used to read the KVEntry and the done channel is used to indicate the end of the watch.
	Watch(context.Context) (<-chan KVEntry, <-chan struct{})
	// Close closes the backend connection
	Close()
}

KVStorer defines the storage for publishing the watermark and sideinput

type KVWatchOp

type KVWatchOp int64

KVWatchOp is the operation as detected by the KV watcher.

const (
	// KVPut indicates an element has been put/added into the KV store.
	KVPut KVWatchOp = iota
	// KVDelete represents a delete.
	KVDelete
	// KVPurge is when the kv bucket is purged.
	// This value is only for JetStream.
	KVPurge
)

func (KVWatchOp) String

func (kvOp KVWatchOp) String() string

Directories

Path Synopsis
Package inmem package implements the watermark progression using in mem store as the KV store.
Package inmem package implements the watermark progression using in mem store as the KV store.
Package jetstream package implements the kv store and watcher using Jetstream.
Package jetstream package implements the kv store and watcher using Jetstream.

Jump to

Keyboard shortcuts

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