Help us shape the future of Go! Take the 2026 Go Developer Survey

poe

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PriorityLabel

func PriorityLabel(n int) string

func Sync

func Sync(app core.App, device *core.Record, info Info) error

Types

type Info

type Info struct {
	Budget      float64            `json:"budget"`
	Consumption float64            `json:"consumption"`
	Ports       map[string]RawPort `json:"ports"`
}

func (Info) NormalizedPorts

func (i Info) NormalizedPorts() (ports []Port)

NormalizedPorts converts the raw ports map into a slice of Port sorted by name for deterministic output.

type Port

type Port struct {
	Name        string // full UCI port key, e.g. "lan4"
	Priority    string // one of low/normal/high/critical
	Status      string
	Consumption float64
}

type RawPort

type RawPort struct {
	Priority    int     `json:"priority"`
	Mode        string  `json:"mode"`
	Status      string  `json:"status"`
	Consumption float64 `json:"consumption"`
}

Jump to

Keyboard shortcuts

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