kvdb

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	QueryBufferSize        = 1024
	ReadQueryResultTimeout = 50 * time.Millisecond
)
View Source
var MaxTimeBetweenGroupedWrites = 5 * time.Millisecond

Functions

func New

func New(node peer.Node) kvdb.Factory

Types

type Batch

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

func (*Batch) Commit

func (b *Batch) Commit() error

func (*Batch) Delete

func (b *Batch) Delete(key string) error

func (*Batch) Put

func (b *Batch) Put(key string, value []byte) error

type FilterKeyRegEx

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

func NewFilterKeyRegEx

func NewFilterKeyRegEx(regexs ...string) (*FilterKeyRegEx, error)

func (*FilterKeyRegEx) Filter

func (f *FilterKeyRegEx) Filter(e query.Entry) bool

type PubSubBroadcaster added in v1.1.0

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

PubSubBroadcaster implements a Broadcaster using libp2p PubSub.

func NewPubSubBroadcaster added in v1.1.0

func NewPubSubBroadcaster(ctx context.Context, psub *pubsub.PubSub, topic string) (b *PubSubBroadcaster, err error)

NewPubSubBroadcaster returns a new broadcaster using the given PubSub and a topic to subscribe/broadcast to. The given context can be used to cancel the broadcaster. Please register any topic validators before creating the Broadcaster.

The broadcaster can be shut down by cancelling the given context. This must be done before Closing the crdt.Datastore, otherwise things may hang.

func (*PubSubBroadcaster) Broadcast added in v1.1.0

func (pbc *PubSubBroadcaster) Broadcast(data []byte) error

Broadcast publishes some data.

func (*PubSubBroadcaster) Next added in v1.1.0

func (pbc *PubSubBroadcaster) Next() ([]byte, error)

Next returns published data.

Jump to

Keyboard shortcuts

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