Files
openlan/pkg/models/output_linux.go
2024-01-08 20:56:21 +08:00

15 lines
246 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
}
return
}