fea: add statics for output

This commit is contained in:
Daniel Ding
2024-01-08 20:56:21 +08:00
parent 53dcac37f9
commit c542a184cc
20 changed files with 268 additions and 63 deletions

19
pkg/models/output.go Executable file
View File

@@ -0,0 +1,19 @@
package models
import "time"
type Output struct {
Network string
Protocol string
Connection string
Vlan int
Device string
RxBytes uint64
TxBytes uint64
ErrPkt uint64
NewTime int64
}
func (o *Output) UpTime() int64 {
return time.Now().Unix() - o.NewTime
}