Documentation ¶
Index ¶
- Variables
- func Add(ctx context.Context, nodeConf *protocol.ClientConfig)
- func Delete(n *node) bool
- func Get(addr string) *node
- func GetAddr(ctx context.Context) string
- func GetAll() *map[string]*node
- func GetPeer(ctx context.Context) *peer.Peer
- func GetStats() (stats []*protocol.Statistics)
- func NewNode(ctx context.Context, nodeConf *protocol.ClientConfig) *node
- func SetNotificationsChannel(notificationsStream protocol.UI_NotificationsServer) *node
- func Total() int
- func UpdateStats(ctx context.Context, stats *protocol.Statistics)
- type Status
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Online = Status(log.Bold(log.Green("online"))) Offline = Status(log.Bold(log.Red("offline"))) )
Statuses of a node.
Functions ¶
func Add ¶
func Add(ctx context.Context, nodeConf *protocol.ClientConfig)
Add a new node the list of nodes.
func GetStats ¶
func GetStats() (stats []*protocol.Statistics)
GetStats returns the stats of all nodes combined.
func NewNode ¶
func NewNode(ctx context.Context, nodeConf *protocol.ClientConfig) *node
NewNode instanstiates a new node.
func SetNotificationsChannel ¶
func SetNotificationsChannel(notificationsStream protocol.UI_NotificationsServer) *node
SetNotificationsChannel sets the communication channel for a given node. https://github.com/grpc/grpc-go/blob/master/stream.go
func UpdateStats ¶
func UpdateStats(ctx context.Context, stats *protocol.Statistics)
UpdateStats of a node.
Types ¶
Click to show internal directories.
Click to hide internal directories.