nats

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, connection string, tlsInfo tls.Config) (server.Backend, error)

New return an implementation of server.Backend using NATS + JetStream. See the `examples/nats.md` file for examples of connection strings.

func NewLegacy added in v0.10.1

func NewLegacy(ctx context.Context, connection string, tlsInfo tls.Config) (server.Backend, error)

NewLegacy return an implementation of server.Backend using NATS + JetStream with legacy jetstream:// behavior, ignoring the embedded server.

Types

type Config

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

type Driver

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

func (*Driver) Count

func (d *Driver) Count(ctx context.Context, prefix string) (revRet int64, count int64, err error)

Count returns an exact count of the number of matching keys and the current revision of the database

func (*Driver) Create

func (d *Driver) Create(ctx context.Context, key string, value []byte, lease int64) (revRet int64, errRet error)

Create

func (*Driver) DbSize

func (d *Driver) DbSize(context.Context) (int64, error)

DbSize get the kineBucket size from JetStream.

func (*Driver) Delete

func (d *Driver) Delete(ctx context.Context, key string, revision int64) (revRet int64, kvRet *server.KeyValue, deletedRet bool, errRet error)

func (*Driver) Get

func (d *Driver) Get(ctx context.Context, key, rangeEnd string, limit, revision int64) (revRet int64, kvRet *server.KeyValue, errRet error)

Get returns the associated server.KeyValue

func (*Driver) List

func (d *Driver) List(ctx context.Context, prefix, startKey string, limit, revision int64) (revRet int64, kvRet []*server.KeyValue, errRet error)

func (*Driver) Start

func (d *Driver) Start(ctx context.Context) error

func (*Driver) Update

func (d *Driver) Update(ctx context.Context, key string, value []byte, revision, lease int64) (revRet int64, kvRet *server.KeyValue, updateRet bool, errRet error)

func (*Driver) Watch

func (d *Driver) Watch(ctx context.Context, prefix string, revision int64) <-chan []*server.Event

type JSValue

type JSValue struct {
	KV           *server.KeyValue
	PrevRevision int64
	Create       bool
	Delete       bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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