config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultProd is the default mode.
	DefaultProd = false
	// DefaultHost is the default host to listen on.
	DefaultHost = "localhost"
	// DefaultPort is the default port to listen on.
	DefaultPort = "1812"
	// DefaultDatabaseFilePath is the default file path to the database definition file.
	DefaultDatabaseFilePath = "database.yaml"
	// DefaultVerbose is the default verbosity level.
	DefaultVerbose = VerboseLevelInfo
	// DefaultQuiet is the default quiet mode.
	DefaultQuiet = false
)

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config")

ErrInvalidConfig is returned when the config is invalid.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Prod is a flag that indicates if the server is running in production mode.
	Prod bool
	// Debug defines whether or not the server should run in debug mode.
	Debug bool
	// Host is the host to listen on.
	Host string
	// Port is the port to listen on.
	Port string
	// DatabaseFilePath is the path to the database definition file.
	DatabaseFilePath string
	// RadiusSecret is the secret used to authenticate RADIUS requests.
	RadiusSecret string
	// Verbose defines the verbosity level.
	Verbose VerboseLevel `json:"verbose"`
	// Quiet defines whether or not the server should be quiet.
	Quiet bool
	// TelegramBotToken is the token used to authenticate with the Telegram bot API.
	TelegramBotToken string
	// TelegramChatIDs is a list of chat IDs that are allowed to interact with the bot.
	TelegramChatIDs []string
}

func NewConfig

func NewConfig() *Config

func (*Config) GetAddr

func (c *Config) GetAddr() string

func (*Config) Validate

func (c *Config) Validate() error

type VerboseLevel

type VerboseLevel int
const (
	VerboseLevelQuiet VerboseLevel = iota - 1
	VerboseLevelInfo
	VerboseLevelAccessLogs
	VerboseLevelDebug
)

Jump to

Keyboard shortcuts

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