electiontypes

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterMessageTypePing          uint8 = 255
	ClusterMessageTypePingResponse  uint8 = 250
	ClusterMessageTypeNodes         uint8 = 252
	ClusterMessageTypeNodesResponse uint8 = 251
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumeLeader

type AssumeLeader struct {
	SrcAddr string
}

type ClusterNode

type ClusterNode struct {
	Name   string
	IP     string
	Ping   time.Time
	Leader bool
}

ClusterNode tracks the latest ping response time for a node

func (*ClusterNode) Key

func (c *ClusterNode) Key() string

type ClusterNodesNotification

type ClusterNodesNotification struct {
	listener.GenericNotification
	Nodes []ClusterNode `json:"nodes"`
}

ClusterNodesNotification is a notification that indicates nodes in the cluster

func NewClusterNodesNotification

func NewClusterNodesNotification(nodes []ClusterNode, guid string) *ClusterNodesNotification

type ClusterNodesRequest

type ClusterNodesRequest struct {
	ClusterNotification
}

func NewClusterNodesRequest

func NewClusterNodesRequest() *ClusterNodesRequest

type ClusterNotification

type ClusterNotification struct {
	GuidVal     string
	MessageType uint8
	SrcAddr     string
	DstAddr     string
}

func (*ClusterNotification) Data

func (n *ClusterNotification) Data() interface{}

func (*ClusterNotification) Guid

func (n *ClusterNotification) Guid() string

func (*ClusterNotification) Type

func (n *ClusterNotification) Type() uint8

type ClusterPingRequest

type ClusterPingRequest struct {
	ClusterNotification
}

func NewClusterPingRequest

func NewClusterPingRequest(srcAddress, dstAddress string) *ClusterPingRequest

type ClusterPingResponse

type ClusterPingResponse struct {
	ClusterNotification
	IP string
}

func NewClusterPingResponse

func NewClusterPingResponse(srcAddress, dstAddress, ip string) *ClusterPingResponse

func (*ClusterPingResponse) Key

func (c *ClusterPingResponse) Key() string

Jump to

Keyboard shortcuts

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