plug

package
v0.0.0-...-1472157 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	Op   types.Operation
	Data *types.Member
}

type Formatter

type Formatter interface {
	PrintKeyspace(cname string) string
	PrintKey(m *types.Member) string
	PrintValue(m *types.Member) string

	ScanKey(key string, m *types.Member)
	ScanValue(value string, m *types.Member)
}

func NewBasicFormatter

func NewBasicFormatter(prefix string, delim string) Formatter

type Plug

type Plug interface {
	// Advertise myself as a publisher
	Me(ctx context.Context, op types.Operation, me *types.Member) error

	// Returns a channel that emits changes on cluster publisher.
	// Each channel must be a singleton.
	Watch(ctx context.Context, cname string, size int) (<-chan *Event, error)

	// Stop watching changes on a Cluster
	Stop(cname string)

	// Stop all watching changes and close client
	Close()
}

Plug is a wrapper of a database client which is connected with Cluster member store. Plug is a singleton and handles all the clusters and nodes related to the node. Plug doesn't handle connection between nodes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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