config

package
v0.0.0-...-0ddd045 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config provides the top-level config struct

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Log     LogOptions
	Turn    TurnOptions
	Store   StoreOptions
	Router  RouterOptions
	General GeneralOptions
}

func New

func New() *Config

New returns a new config struct

func NewDefault

func NewDefault() *Config

NewDefault returns a default config

func (*Config) Read

func (c *Config) Read(path string) error

Read reads a .toml config file from path and returns a config struct or an error

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config

func (*Config) Write

func (c *Config) Write(path string) error

type GeneralOptions

type GeneralOptions struct {
	Name           string `toml:"NAME"`
	EnableRegister bool   `toml:"ENABLE_REGISTER"`
	DisableBanner  bool   `toml:"DISABLE_BANNER"`
}

type LogOptions

type LogOptions struct {
	Path   string `toml:"PATH"`
	Prefix string `toml:"PREFIX"`
}

type RouterOptions

type RouterOptions struct {
	Port       int    `toml:"PORT"`
	Domain     string `toml:"DOMAIN"`
	WebPath    string `toml:"WEB_PATH"`
	AvatarPath string `toml:"AVATAR_PATH"`
	JWTSecret  string `toml:"JWT_SIGNING_KEY"`
	OTPIssuer  string `toml:"OTP_ISSUER"`
	EnableGZIP bool   `toml:"ENABLE_GZIP"`
}

type StoreOptions

type StoreOptions struct {
	User     string `toml:"USER"`
	Password string `toml:"PASSWORD"`
	Database string `toml:"DATABASE"`
	Host     string `toml:"HOST"`
	Port     int    `toml:"PORT"`
}

type TurnOptions

type TurnOptions struct {
	Domain   string `toml:"DOMAIN"`
	PublicIP string `toml:"PUBLIC_IP"`
	Port     int    `toml:"PORT"`
}

Jump to

Keyboard shortcuts

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