Documentation ¶
Index ¶
- Constants
- type Client
- type HeartbeatClient
- type HeartbeatServer
- func (h *HeartbeatServer) FilterNodeInfos(nodeInfos []*models.NodeInfo, state models.NodeConnectionState) []*models.NodeInfo
- func (h *HeartbeatServer) Handle(ctx context.Context, heartbeat messages.Heartbeat) error
- func (h *HeartbeatServer) HandleMessage(ctx context.Context, message *envelope.Message) error
- func (h *HeartbeatServer) RemoveNode(nodeID string)
- func (h *HeartbeatServer) ShouldProcess(ctx context.Context, message *envelope.Message) bool
- func (h *HeartbeatServer) Start(ctx context.Context) error
- func (h *HeartbeatServer) UpdateNodeInfo(state *models.NodeState)
- type HeartbeatServerParams
- type TimestampedHeartbeat
Constants ¶
View Source
const (
// HeartbeatMessageType is the message type for heartbeats
HeartbeatMessageType = "heartbeat"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatClient ¶
type HeartbeatClient struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(conn *nats.Conn, nodeID string, publisher ncl.Publisher) (*HeartbeatClient, error)
func (*HeartbeatClient) SendHeartbeat ¶
func (h *HeartbeatClient) SendHeartbeat(ctx context.Context, sequence uint64) error
type HeartbeatServer ¶
type HeartbeatServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(params HeartbeatServerParams) (*HeartbeatServer, error)
func (*HeartbeatServer) FilterNodeInfos ¶
func (h *HeartbeatServer) FilterNodeInfos(nodeInfos []*models.NodeInfo, state models.NodeConnectionState) []*models.NodeInfo
FilterNodeInfos will return only those NodeInfos that have the requested liveness
func (*HeartbeatServer) Handle ¶
Handle will handle a message received through the legacy heartbeat topic
func (*HeartbeatServer) HandleMessage ¶ added in v1.5.0
HandleMessage will handle a message received through ncl and will call the Handle method
func (*HeartbeatServer) RemoveNode ¶
func (h *HeartbeatServer) RemoveNode(nodeID string)
RemoveNode will handle removing the liveness for a specific node. This is useful when a node is removed from the cluster.
func (*HeartbeatServer) ShouldProcess ¶ added in v1.5.0
func (*HeartbeatServer) UpdateNodeInfo ¶
func (h *HeartbeatServer) UpdateNodeInfo(state *models.NodeState)
UpdateNode will add the liveness for specific nodes to their NodeInfo
type HeartbeatServerParams ¶
type TimestampedHeartbeat ¶
Click to show internal directories.
Click to hide internal directories.