nodestatus

package
v0.0.11-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeStatus

type NodeStatus struct {
	PeerID                    string        `json:"peerId"`
	FirstJoined               time.Time     `json:"firstJoined"`
	LastJoined                time.Time     `json:"lastJoined"`
	LastLeft                  time.Time     `json:"lastLeft"`
	LastUpdated               time.Time     `json:"lastUpdated"`
	CurrentUptime             time.Duration `json:"currentUptime"`
	ReadableCurrentUptime     string        `json:"readableCurrentUptime"`
	AccumulatedUptime         time.Duration `json:"accumulatedUptime"`
	ReadableAccumulatedUptime string        `json:"readableAccumulatedUptime"`
	IsActive                  bool          `json:"isActive"`
	IsStaked                  bool          `json:"isStaked"`
	IsWriterNode              bool          `json:"isWriterNode"`
}

type SubscriptionHandler

type SubscriptionHandler struct {
	NodeStatus      []NodeStatus
	NodeStatusTopic *pubsub.Topic

	NodeStatusCh chan []byte
	// contains filtered or unexported fields
}

SubscriptionHandler handles storing node status updates and publishing them to the node status topic.

func (*SubscriptionHandler) HandleMessage

func (handler *SubscriptionHandler) HandleMessage(message *pubsub.Message)

HandleMessage implement subscription handler here

Jump to

Keyboard shortcuts

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