config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// EventLogPath is the output path for wirerguard access log.
	EventLogPath string `toml:"event_log_path"`
	// DaemonLogPathr is the output path for wg-logger internal log.
	DaemonLogPath string `toml:"daemon_log_path"`
	// LogMaxMB is the maximum size in megabytes of the log file before it gets rotated.
	LogMaxMB int `toml:"log_max_mb"`
	// LogMaxDays is the maximum number of days to retain old log files based on the
	// timestamp encoded in their filename.
	LogMaxDays int `toml:"log_max_days"` // keepdays
	// LogLevel is string, choosen from 'error', 'warn', 'info', 'debug'
	LogLevel string `toml:"log_level"`
	// WGConf is the path to wireguard config file
	WGConf string `toml:"wg_conf"`
	// Database is the path to database file (peristent data)
	Database string `toml:"database"`
	// Interval is the interval time in seconds to check wireguard status
	Interval int64 `toml:"interval"`
	// SuspectedInactiveThreshold is the threshold time in minutes to detect event 'suspected inactive'
	SuspectedInactiveThreshold int64 `toml:"suspected_inactive_threshold"`
	// WGToolsPath is the path to wg-tools(wg) command
	WGToolsPath string `toml:"wg_tools_path"`
}

func GetConfig

func GetConfig(conf string) (*Config, error)

GetConfig loads config file.

func GetDefault

func GetDefault() *Config

func (*Config) PrintConfig

func (c *Config) PrintConfig()

PrintConfig prints current config parameters as TOML

Jump to

Keyboard shortcuts

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