kvdb

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: BSD-3-Clause Imports: 17 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

func NewStats

func NewStats() kvdb.Stats

Types

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

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

PubSubBroadcaster implements a Broadcaster using libp2p PubSub.

func NewPubSubBroadcaster

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

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

Broadcast publishes some data.

func (*PubSubBroadcaster) Next

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