gossip

package
v0.0.0-...-45c524d Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const PortKey = "port"
View Source
const ReplicationRoleValue = "replication"
View Source
const RoleKey = "role"
View Source
const StorageRoleValue = "storage"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GossipPort int
	Port       string
	Nodes      []string
	Meta       map[string]string
}

type EventDelegate

type EventDelegate struct {
	Service *GossipService
}

func (*EventDelegate) NotifyJoin

func (n *EventDelegate) NotifyJoin(node *memberlist.Node)

func (*EventDelegate) NotifyLeave

func (n *EventDelegate) NotifyLeave(node *memberlist.Node)

func (*EventDelegate) NotifyUpdate

func (n *EventDelegate) NotifyUpdate(node *memberlist.Node)

type GossipService

type GossipService struct {
	Handlers []Handler
	// contains filtered or unexported fields
}

func (*GossipService) JoinDataNode

func (p *GossipService) JoinDataNode(node *memberlist.Node) error

func (*GossipService) RemoveDataNode

func (p *GossipService) RemoveDataNode(node *memberlist.Node) error

func (*GossipService) Start

func (p *GossipService) Start(ctx context.Context, c *Config) error

type Handler

type Handler interface {
	Support(map[string]string) bool
	GetTarget() *consistent.Consistent
}

type NodeDelegate

type NodeDelegate struct {
	Port    string
	Service *GossipService
	Meta    map[string]string
}

func (*NodeDelegate) GetBroadcasts

func (n *NodeDelegate) GetBroadcasts(overhead, limit int) [][]byte

func (*NodeDelegate) LocalState

func (n *NodeDelegate) LocalState(join bool) []byte

func (*NodeDelegate) MergeRemoteState

func (n *NodeDelegate) MergeRemoteState(buf []byte, join bool)

func (*NodeDelegate) NodeMeta

func (n *NodeDelegate) NodeMeta(limit int) []byte

func (*NodeDelegate) NotifyMsg

func (n *NodeDelegate) NotifyMsg(bytes []byte)

Jump to

Keyboard shortcuts

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