conf

package
v0.0.0-...-995e40d Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(args []string, namespace string, appConfig *App) error

Load will load the configuration into the App Configuration

Types

type App

type App struct {
	conf.Version
	Web       WebServer
	Email     SMTP
	AdminUser string `conf:"default:admin"`
	AdminPass string `conf:"default:admin,noprint" json:"-"`
	Domain    string `conf:"default:http://localhost:8080"`
	Database  string `conf:"default:$HOME/.wg-concierge"`
	WireGuard WireGuard
	Log       Logging
}

App holds the application configuration

func (*App) PrettyString

func (app *App) PrettyString() string

PrettyString generates a JSON well formated string representation of the configuraiton

type Logging

type Logging struct {
	Prefix string `conf:"default:[WG] :"`
}

Logging hold the log configuration settings

type SMTP

type SMTP struct {
	Server   string `conf:"default:smtp.sendgrid.net"`
	Port     int    `conf:"default:587"`
	From     string `conf:"default:WG Concierge<no-reply@wg-concierge>"`
	Username string `conf:"required"`
	Password string `conf:"required,noprint" json:"-"`
}

SMTP hold the smtp connection configuration settings

type WebServer

type WebServer struct {
	Host              string        `conf:"default:localhost:8080"`
	ReadTimeout       time.Duration `conf:"default:5s"`
	WriteTimeout      time.Duration `conf:"default:30s"`
	IdleTimeout       time.Duration `conf:"default:30s"`
	ReadHeaderTimeout time.Duration `conf:"default:5s"`
	ShutdownTimeout   time.Duration `conf:"default:5s"`
}

WebServer holds the server configuration settings

type WireGuard

type WireGuard struct {
	ConfigPath     string `conf:"default:/etc/wireguard/wg0.conf"`
	DNS            string `conf:"default:1.1.1.1"`
	PublicEndpoint string `conf:"required"`
}

Jump to

Keyboard shortcuts

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