config

package
v0.0.0-...-70b3fac Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupConfig

func SetupConfig(c *Config, file string) error

SetupConfig reads the configuration from the specified file

Types

type Config

type Config struct {
	Debug  bool   `mapstructure:"debug"`
	Server Server `mapstructure:"server"`
	DSN    string `mapstructure:"dsn"`
	Log    Log    `mapstructure:"log"`
}

Config is the entrypoint for all configuration items

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig create a default configuration structure with the same values as the default configuration in config.yaml

type Log

type Log struct {
	Level string `mapstructure:"level"`
	Path  string `mapstructure:"path"`
}

Log configuration

type Server

type Server struct {
	HTTPListen  string    `mapstructure:"http_listen"`
	HTTPSListen string    `mapstructure:"https_listen"`
	TLS         ServerTLS `mapstructure:"tls"`
}

Server configuration

type ServerTLS

type ServerTLS struct {
	CertFile string `mapstructure:"cert_file"`
	KeyFile  string `mapstructure:"key_file"`
}

ServerTLS is used for server TLS certificate configuration

Jump to

Keyboard shortcuts

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