Version: v0.0.2 Latest Latest

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

Go to latest
Published: May 5, 2018 License: AGPL-3.0 Imports: 7 Imported by: 1




This section is empty.


This section is empty.


func BuildNodesV1

func BuildNodesV1(nodes *runtime.Nodes) interface{}

BuildNodesV1 transforms data to legacy meshviewer

func BuildNodesV2

func BuildNodesV2(nodes *runtime.Nodes) interface{}

BuildNodesV2 transforms data to modern meshviewers

func Register

func Register(configuration map[string]interface{}) (output.Output, error)


type Config

type Config map[string]interface{}

func (Config) GraphPath

func (c Config) GraphPath() string

func (Config) NodesPath

func (c Config) NodesPath() string

func (Config) Version

func (c Config) Version() int64

type Flags

type Flags struct {
	Online  bool `json:"online"`
	Gateway bool `json:"gateway"`

Flags status of node set by collector for the meshviewer

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

func BuildGraph(nodes *runtime.Nodes) *Graph

BuildGraph transform from nodes (Neighbours) to Graph

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 GraphNode

type GraphNode struct {
	ID     string `json:"id"`
	NodeID string `json:"node_id"`

GraphNode small struct of a node for the graph struct

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)


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. or

type Output

type Output struct {
	// contains filtered or unexported fields

func (*Output) Save

func (o *Output) Save(nodes *runtime.Nodes)

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

Jump to

Keyboard shortcuts

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