jetstream

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package jetstream package implements the watermark progression using Jetstream as the KV store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSKVStoreOption

type JSKVStoreOption func(*KVJetStreamStore) error

JSKVStoreOption is to pass in Jetstream options.

type JSKVWatcherOption

type JSKVWatcherOption func(*KVJetStreamWatch) error

JSKVWatcherOption is to pass in Jetstream options.

type KVJetStreamStore

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

KVJetStreamStore implements the watermark's KV store backed up by Jetstream.

func NewKVJetStreamKVStore

func NewKVJetStreamKVStore(ctx context.Context, pipelineName string, bucketName string, client clients.JetStreamClient, opts ...JSKVStoreOption) (*KVJetStreamStore, error)

NewKVJetStreamKVStore returns KVJetStreamStore.

func (*KVJetStreamStore) Close

func (kv *KVJetStreamStore) Close()

Close closes the jetstream connection.

func (*KVJetStreamStore) DeleteKey

func (kv *KVJetStreamStore) DeleteKey(_ context.Context, k string) error

DeleteKey deletes the key from the JS key-value store.

func (*KVJetStreamStore) GetAllKeys

func (kv *KVJetStreamStore) GetAllKeys(_ context.Context) ([]string, error)

GetAllKeys returns all the keys in the key-value store.

func (*KVJetStreamStore) GetStoreName

func (kv *KVJetStreamStore) GetStoreName() string

GetStoreName returns the store name.

func (*KVJetStreamStore) GetValue

func (kv *KVJetStreamStore) GetValue(_ context.Context, k string) ([]byte, error)

GetValue returns the value for a given key.

func (*KVJetStreamStore) PutKV

func (kv *KVJetStreamStore) PutKV(_ context.Context, k string, v []byte) error

PutKV puts an element to the JS key-value store.

type KVJetStreamWatch

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

KVJetStreamWatch implements the watermark's KV store backed up by Jetstream.

func NewKVJetStreamKVWatch

func NewKVJetStreamKVWatch(ctx context.Context, pipelineName string, kvBucketName string, client clients.JetStreamClient, opts ...JSKVWatcherOption) (*KVJetStreamWatch, error)

NewKVJetStreamKVWatch returns KVJetStreamWatch specific to Jetsteam which implements the WatermarkKVWatcher interface.

func (*KVJetStreamWatch) Close

func (k *KVJetStreamWatch) Close()

Close closes the connection.

func (*KVJetStreamWatch) GetKVName

func (k *KVJetStreamWatch) GetKVName() string

GetKVName returns the KV store (bucket) name.

func (*KVJetStreamWatch) Watch

func (k *KVJetStreamWatch) Watch(ctx context.Context) <-chan store.WatermarkKVEntry

Watch watches the key-value store (aka bucket).

Jump to

Keyboard shortcuts

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