skynode

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeInfoSliceEqual

func NodeInfoSliceEqual(a, b NodeInfoSlice) bool

NodeInfoSliceEqual determines if two instances of a NodeInfoSlice (a and b) are equal - on the basis that they contain the same list of NodeInfo structures. TODO: May need to review this function and how it determines equality. Very simplistice ATM.

func NodesAreEqual

func NodesAreEqual(a, b NodeInfo) bool

NodesAreEqual determines if two instances of a NodeInfo structure (a and b) represent the same Node based on their Keys. Not that this is not an equality check of the structure - but simply that the two structures represent the same Node. Other elements of the structure may be different.

Types

type NodeInfo

type NodeInfo struct {
	Key         string `json:"key"`
	Conntype    string `json:"type"`
	SendBytes   int    `json:"send_bytes"`
	RecvBytes   int    `json:"recv_bytes"`
	LastAckTime int    `json:"last_ack_time"`
	StartTime   int    `json:"start_time"`
}

NodeInfo structure stores of JSON response from /conn/getAll API

func (NodeInfo) FmtString

func (ni NodeInfo) FmtString() string

FmtString returns a rich formatted string representing the data of the NodeInfo struct

func (NodeInfo) String

func (ni NodeInfo) String() string

String satisfies the fmt.Stringer interface for the NodeInfo type

type NodeInfoMap

type NodeInfoMap map[string]NodeInfo

NodeInfoMap defines a string key based map of NodeInfo structs

func NodeInfoSliceToMap

func NodeInfoSliceToMap(nis NodeInfoSlice) NodeInfoMap

NodeInfoSliceToMap converts a provided NodeInfoSlice to a NodeInfoMap

type NodeInfoSlice

type NodeInfoSlice []NodeInfo

NodeInfoSlice defines an in-memory (dynamic) array of NodeInfo structures

Jump to

Keyboard shortcuts

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