Documentation ¶
Overview ¶
Package cluster is for clustering SPV Wallet Engine(s) or servers to work together for chainstate monitoring and other tasks
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel string
Channel all keys used in cluster coordinator
var ( // DestinationNew is a message sent when a new destination is created DestinationNew Channel = "new-destination" )
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the client (configuration)
func (*Client) GetClusterPrefix ¶
GetClusterPrefix returns the cluster key prefix that can be used in things like Redis
type ClientInterface ¶
type ClientInterface interface { IsDebug() bool GetClusterPrefix() string // contains filtered or unexported methods }
ClientInterface interface for the internal pub/sub functionality for clusters
type ClientOps ¶
type ClientOps func(c *clientOptions)
ClientOps allow functional options to be supplied that overwrite default client options.
func WithKeyPrefix ¶
WithKeyPrefix will set the prefix to use for all keys in the cluster coordinator
type Coordinator ¶
type Coordinator string
Coordinator the coordinators supported in cluster mode
var ( // CoordinatorRedis definition CoordinatorRedis Coordinator = "redis" // CoordinatorMemory definition - use only in single server setups of SPV Wallet Engine! CoordinatorMemory Coordinator = "memory" )
type MemoryPubSub ¶
type MemoryPubSub struct {
// contains filtered or unexported fields
}
MemoryPubSub struct
func NewMemoryPubSub ¶
func NewMemoryPubSub(ctx context.Context) (*MemoryPubSub, error)
NewMemoryPubSub create a new memory pub/sub client this is the default (mock) implementation for the internal pub/sub communications on standalone servers for clusters, use another solution, like RedisPubSub
func (*MemoryPubSub) Logger ¶
func (m *MemoryPubSub) Logger() *zerolog.Logger
Logger returns the logger to use
type RedisPubSub ¶
type RedisPubSub struct {
// contains filtered or unexported fields
}
RedisPubSub struct
func NewRedisPubSub ¶
func NewRedisPubSub(ctx context.Context, options *redis.Options) (*RedisPubSub, error)
NewRedisPubSub create a new redis pub/sub client
func (*RedisPubSub) Logger ¶
func (r *RedisPubSub) Logger() *zerolog.Logger
Logger returns the logger to use