Documentation ¶
Index ¶
- func BuildNodesV1(nodes *runtime.Nodes) interface{}
- func BuildNodesV2(nodes *runtime.Nodes) interface{}
- func Register(configuration map[string]interface{}) (output.Output, error)
- type Config
- type Flags
- type Graph
- type GraphLink
- type GraphNode
- type Node
- type NodesV1
- type NodesV2
- type Output
- type Statistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildNodesV1 ¶
BuildNodesV1 transforms data to legacy meshviewer
func BuildNodesV2 ¶
BuildNodesV2 transforms data to modern meshviewers
Types ¶
type Graph ¶
type Graph struct { Version int `json:"version"` Batadv struct { Directed bool `json:"directed"` Graph []string `json:"graph"` Nodes []*GraphNode `json:"nodes"` Links []*GraphLink `json:"links"` } `json:"batadv"` }
Graph a struct for all links between the nodes
func BuildGraph ¶
BuildGraph transform from nodes (Neighbours) to Graph
type GraphLink ¶
type GraphLink struct { Source int `json:"source"` Target int `json:"target"` VPN bool `json:"vpn"` TQ float32 `json:"tq"` Bidirect bool `json:"bidirect"` }
GraphLink a struct for the link between two nodes
type Node ¶
type Node struct { Firstseen jsontime.Time `json:"firstseen"` Lastseen jsontime.Time `json:"lastseen"` Flags Flags `json:"flags"` Statistics *Statistics `json:"statistics"` Nodeinfo *data.NodeInfo `json:"nodeinfo"` Neighbours *data.Neighbours `json:"-"` }
Node struct
type NodesV1 ¶
type NodesV1 struct { Version int `json:"version"` Timestamp jsontime.Time `json:"timestamp"` // Timestamp of the generation List map[string]*Node `json:"nodes"` // the current nodemap, indexed by node ID }
NodesV1 struct, to support legacy meshviewer (which are in master branch)
i.e. https://github.com/ffnord/meshviewer/tree/master
type NodesV2 ¶
type NodesV2 struct { Version int `json:"version"` Timestamp jsontime.Time `json:"timestamp"` // Timestamp of the generation List []*Node `json:"nodes"` // the current nodemap, as array }
NodesV2 struct, to support new version of meshviewer (which are in legacy develop branch or newer)
i.e. https://github.com/ffnord/meshviewer/tree/dev or https://github.com/ffrgb/meshviewer/tree/develop
type Statistics ¶
type Statistics struct { NodeID string `json:"node_id"` Clients uint32 `json:"clients"` RootFsUsage float64 `json:"rootfs_usage,omitempty"` LoadAverage float64 `json:"loadavg,omitempty"` MemoryUsage *float64 `json:"memory_usage,omitempty"` Uptime float64 `json:"uptime,omitempty"` Idletime float64 `json:"idletime,omitempty"` GatewayIPv4 string `json:"gateway,omitempty"` GatewayIPv6 string `json:"gateway6,omitempty"` Processes struct { Total uint32 `json:"total"` Running uint32 `json:"running"` } `json:"processes,omitempty"` MeshVPN *data.MeshVPN `json:"mesh_vpn,omitempty"` Traffic struct { Tx *data.Traffic `json:"tx"` Rx *data.Traffic `json:"rx"` Forward *data.Traffic `json:"forward"` MgmtTx *data.Traffic `json:"mgmt_tx"` MgmtRx *data.Traffic `json:"mgmt_rx"` } `json:"traffic,omitempty"` }
Statistics a meshviewer spezifisch struct, different from respondd
func NewStatistics ¶
func NewStatistics(stats *data.Statistics, isOnline bool) *Statistics
NewStatistics transform respond Statistics to meshviewer Statistics
Click to show internal directories.
Click to hide internal directories.