app

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(params *LoggerParams) (zerolog.Logger, error)

Types

type CLI

type CLI struct {
	Config string `optional:"" short:"c" type:"existingfile" placeholder:"PATH" help:"Path to the config file."`
}

func NewCLI

func NewCLI(args []string) (cli CLI, err error)

type Config

type Config struct {
	Logger    LoggerConfig    `env-prefix:"LOGGER_" yaml:"logger"`
	Database  DatabaseConfig  `env-prefix:"DB_" yaml:"db"`
	WireGuard WireGuardConfig `env-prefix:"WG_" yaml:"wireguard"`
	SSH       SSHConfig       `env-prefix:"SSH_" yaml:"ssh"`
}

func NewConfig

func NewConfig(configPath string) (cfg Config, err error)

func (*Config) Default

func (cfg *Config) Default()

func (*Config) Validate

func (cfg *Config) Validate() error

type DatabaseConfig

type DatabaseConfig struct {
	Path string `env:"PATH" yaml:"path"`
}

func (*DatabaseConfig) Default

func (cfg *DatabaseConfig) Default()

type LoggerConfig

type LoggerConfig struct {
	Level      string `env:"LEVEL" yaml:"level"`
	Directory  string `env:"DIRECTORY" yaml:"directory"`
	MaxSize    int    `env:"MAX_SIZE" yaml:"max_size"`
	MaxAge     int    `env:"MAX_AGE" yaml:"max_age"`
	MaxBackups int    `env:"MAX_BACKUPS" yaml:"max_backups"`
}

func (*LoggerConfig) Default

func (cfg *LoggerConfig) Default()

func (*LoggerConfig) Validate

func (cfg *LoggerConfig) Validate() error

type LoggerParams

type LoggerParams struct {
	Level             zerolog.Level
	AdditionalWriters []io.Writer
}

type SSHConfig

type SSHConfig struct {
	Port        int      `env:"PORT" yaml:"port"`
	HostKeyPath string   `env:"HOST_KEY_PATH" yaml:"host_key_path"`
	AdminKeys   []string `env:"ADMIN_KEYS" yaml:"admin_keys"`
}

func (*SSHConfig) Default

func (cfg *SSHConfig) Default()

func (*SSHConfig) Validate

func (cfg *SSHConfig) Validate() error

type WireGuardConfig

type WireGuardConfig struct {
	Host                string   `env:"HOST" yaml:"host"`
	Path                string   `env:"PATH" yaml:"path"`
	Address             string   `env:"ADDRESS" yaml:"address"`
	Port                int      `env:"PORT" yaml:"port"`
	Device              string   `env:"DEVICE" yaml:"device"`
	AllowedIPs          []string `env:"ALLOWED_IPS" yaml:"allowed_ips"`
	PersistentKeepalive int      `env:"PERSISTENT_KEEPALIVE" yaml:"persistent_keepalive"`
	DNS                 []string `env:"DNS" yaml:"dns"`
}

func (*WireGuardConfig) Default

func (cfg *WireGuardConfig) Default()

func (*WireGuardConfig) Validate

func (cfg *WireGuardConfig) Validate() error

Jump to

Keyboard shortcuts

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