Documentation ¶
Index ¶
- Variables
- func AddStat(nwIf, date string, rx, tx int64)
- func BasicAuthFromFile(filePath string) error
- func IFStat(nwIf string) (int64, int64, error)
- func InitInterfaces(cmd *cobra.Command) error
- func LoadStats(nwIf string) error
- func SaveStats()
- func StartHTTP()
- func SyncNwInterfaces()
- type DBStruct
- type InterfaceLog
- type JSONReturn
- type Stat
- type Statistic
Constants ¶
This section is empty.
Variables ¶
View Source
var Config struct { Interfaces []string DatabaseDir string SaveInterval time.Duration Listen string AuthUser string AuthPass string SSLCert string SSLKey string }
Config struct
View Source
var ( // DB is the global database variable DB = make(map[string]DBStruct) )
Functions ¶
func BasicAuthFromFile ¶
BasicAuthFromFile opens a file and sets a global user/password if a line with two words is found
func InitInterfaces ¶
InitInterfaces will set a slice of config interfaces from the cmd
func SyncNwInterfaces ¶
func SyncNwInterfaces()
SyncNwInterfaces will log each interface to the global DB if either the RX or TX > 0
Types ¶
type InterfaceLog ¶
InterfaceLog struct stores each interface's previous stats to calculate difference
Click to show internal directories.
Click to hide internal directories.