internal

package
v0.0.0-...-f44c590 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeLogger

func InitializeLogger()

func Run

func Run(conf Config)

func SetLogLevel

func SetLogLevel(level string)

func ValidateConfig

func ValidateConfig(conf Config) bool

func WriteResult

func WriteResult(conf Config, result Result)

Types

type Client

type Client struct {
	IP       string `json:"ip"`
	Hostname string `json:"hostname"`
	City     string `json:"city"`
	Region   string `json:"region"`
	Country  string `json:"country"`
	Loc      string `json:"loc"`
	Org      string `json:"org"`
	Postal   string `json:"postal"`
	Timezone string `json:"timezone"`
}

type Config

type Config struct {
	LibrespeedBinary string
	LibrespeedServer int
	CronSpec         string
	LogLevel         string
	InfluxAddress    string
	InfluxToken      string // v2
	InfluxOrg        string // v2
	InfluxBucket     string // v2
	InfluxUsername   string // v1
	InfluxPassword   string // v1
	InfluxDatabase   string // v1
	InfluxSSL        bool   // ?
}

func ParseConfig

func ParseConfig(ConfigFile string) Config

type Result

type Result struct {
	Timestamp     string  `json:"timestamp"` //TODO: check type?
	Server        Server  `json:"server"`
	Client        Client  `json:"client"`
	BytesSent     int     `json:"bytes_sent"`
	BytesReceived int     `json:"bytes_received"`
	Ping          float64 `json:"ping"`
	Jitter        float64 `json:"jitter"`
	Upload        float64 `json:"upload"`
	Download      float64 `json:"download"`
	Share         string  `json:"share"`
}

type Server

type Server struct {
	Name string `json:"name"`
	Url  string `json:"url"`
}

Jump to

Keyboard shortcuts

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