Files
openlan/pkg/models/output_linux.go
Daniel Ding 80ea5c26b4
Some checks failed
Coverage CI / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
Ubuntu CI / build (push) Has been cancelled
fea: fallback for output.
2025-08-29 10:43:14 +08:00

14 lines
238 B
Go
Executable File

package models
import (
nl "github.com/vishvananda/netlink"
)
func (l *Output) Update() {
if link, err := nl.LinkByName(l.Device); err == nil {
sts := link.Attrs().Statistics
l.RxBytes = sts.RxBytes
l.TxBytes = sts.TxBytes
}
}