eadmin

package module
v0.0.0-...-b914f9e Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server ServerConfig
	Broker MqttBroker
}

func LoadConfig

func LoadConfig() (Config, error)

type Device

type Device struct {
	Pings map[string]*Ping
}

func (*Device) Location

func (d *Device) Location() string

type Entry

type Entry map[string]string

type MqttBroker

type MqttBroker struct {
	Server   string // Like tcp://host:port.
	Username string
	Password string
	ClientID string
}

type Ping

type Ping struct {
	ID       string  `json:"id"`
	Disc     string  `json:"disc"`
	IDType   int     `json:"idType"`
	Rssi1M   int     `json:"rssi@1m"`
	Rssi     int     `json:"rssi"`
	Raw      float64 `json:"raw"`
	Distance float64 `json:"distance"`
	Speed    float64 `json:"speed"`
	Mac      string  `json:"mac"`
	Interval int     `json:"interval"`
	Recieved time.Time
}

type Room

type Room struct {
	LastPing time.Time

	Telemetry Telemetry
	// contains filtered or unexported fields
}

type ServerConfig

type ServerConfig struct {
	Host string
	Port int
}

type TableResponse

type TableResponse struct {
	Rooms []string `json:"rooms"`
	Data  []Entry  `json:"data"`
}

type Telemetry

type Telemetry struct {
	IP              string  `json:"ip"`
	Uptime          int     `json:"uptime"`
	Firm            string  `json:"firm"`
	Rssi            int     `json:"rssi"`
	Ver             string  `json:"ver"`
	Adverts         int     `json:"adverts"`
	Seen            int     `json:"seen"`
	Queried         int     `json:"queried"`
	Reported        int     `json:"reported"`
	FreeHeap        int     `json:"freeHeap"`
	MaxAllocHeap    int     `json:"maxAllocHeap"`
	MemFrag         float64 `json:"memFrag"`
	ScanHighWater   int     `json:"scanHighWater"`
	ReportHighWater int     `json:"reportHighWater"`
	Recieved        time.Time
}

func (Telemetry) UptimeDuration

func (t Telemetry) UptimeDuration() time.Duration

type ThreeD

type ThreeD struct {
	Nodes []ThreeDNode `json:"nodes"`
	Links []ThreeDLink `json:"links"`
}
type ThreeDLink struct {
	Source string `json:"source"`
	Target string `json:"target"`
	Value  int    `json:"value"`
}

type ThreeDNode

type ThreeDNode struct {
	ID    string `json:"id"`
	Group int    `json:"group"`
}

type WebApp

type WebApp struct {
	// contains filtered or unexported fields
}

func NewWebApp

func NewWebApp(c Config) (*WebApp, error)

func (*WebApp) Run

func (a *WebApp) Run() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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