Documentation
¶
Overview ¶
Package gluon provides types for Gluon-firmware style mesh node metadata and means to (un)serialize it.
Index ¶
Constants ¶
View Source
const ( // A.L.F.R.E.D. packet type ID for Gluon NodeInfo data NODEINFO_PACKETTYPE = 158 // A.L.F.R.E.D. packet version for Gluon NodeInfo data NODEINFO_PACKETVERSION = 0 )
View Source
const ( // A.L.F.R.E.D. packet type ID for Gluon Statistics data STATISTICS_PACKETTYPE = 159 // A.L.F.R.E.D. packet version for Gluon Statistics data STATISTICS_PACKETVERSION = 0 )
Variables ¶
View Source
var ErrParse = errors.New("parse error")
Functions ¶
This section is empty.
Types ¶
type AutoUpdater ¶
type Network ¶
type Network struct { Mac string `json:"mac,omitempty"` Addresses []net.IP `json:"addresses,omitempty"` MeshInterfaces []alfred.HardwareAddr `json:"mesh_interfaces,omitempty"` }
type NodeInfo ¶
type NodeInfo struct { Source alfred.HardwareAddr Data *NodeInfoData }
wrapper type for storing the metadata and its origin
func (*NodeInfo) GetPacketType ¶
type NodeInfoData ¶
type NodeInfoData struct { NodeID string `json:"node_id,omitempty"` Network *Network `json:"network,omitempty"` Hostname string `json:"hostname,omitempty"` Location *Location `json:"location,omitempty"` Software *Software `json:"software,omitempty"` Hardware *Hardware `json:"hardware,omitempty"` Owner *Owner `json:"owner,omitempty"` }
mesh node metadata
type Software ¶
type Software struct { FastD *FastD `json:"fastd,omitempty"` AutoUpdater *AutoUpdater `json:"autoupdater,omitempty"` BatmanAdv *BatmanAdv `json:"batman-adv,omitempty"` Firmware *Firmware `json:"firmware,omitempty"` }
type Statistics ¶
type Statistics struct { Source alfred.HardwareAddr Data *StatisticsData }
wrapper type for storing the statistics data and its origin
func (*Statistics) GetPacketType ¶
func (stat *Statistics) GetPacketType() uint8
func (*Statistics) ReadAlfred ¶
func (stat *Statistics) ReadAlfred(data alfred.Data) error
read structured information from A.L.F.R.E.D. packet
type StatisticsData ¶
type StatisticsData struct { NodeID string `json:"node_id"` Clients *Clients `json:"clients,omitempty"` RootFSUsage float64 `json:"rootfs_usage,omitempty"` LoadAvg float64 `json:"loadavg,omitempty"` Uptime float64 `json:"uptime,omitempty"` IdleTime float64 `json:"idletime,omitempty"` Gateway *alfred.HardwareAddr `json:"gateway,omitempty"` Processes *Processes `json:"processes,omitempty"` Traffic *Traffic `json:"traffic,omitempty"` Memory *Memory `json:"memory,omitempty"` }
mesh node statistics
type Traffic ¶
type Traffic struct { Tx *TrafficCounter `json:"tx,omitempty"` Rx *TrafficCounter `json:"rx,omitempty"` MgmtTx *TrafficCounter `json:"mgmt_tx,omitempty"` MgmtRx *TrafficCounter `json:"mgmt_rx,omitempty"` Forward *TrafficCounter `json:"forward,omitempty"` }
type TrafficCounter ¶
Click to show internal directories.
Click to hide internal directories.