config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoggingFormatText = "text"
	LoggingFormatJson = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Host           string   `mapstructure:"host"`
	Port           uint     `mapstructure:"port"`
	IsBehindProxy  bool     `mapstructure:"behind_proxy"`
	TrustedProxies []string `mapstructure:"trusted_proxies"`
	TLS            TLS      `mapstructure:"tls"`
}

type Config

type Config struct {
	Application Application `mapstructure:"application"`
	Database    Database    `mapstructure:"database"`
	Logging     Logging     `mapstructure:"logging"`
}

func New

func New() (*Config, error)

type Database

type Database struct {
	Host     string `mapstructure:"host"`
	Port     uint   `mapstructure:"port"`
	Name     string `mapstructure:"name"`
	Username string `mapstructure:"user"`
	Password string `mapstructure:"pass"`
	Charset  string `mapstructure:"charset"`
}

type Logging

type Logging struct {
	File   string `mapstructure:"file"`
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

type TLS added in v0.2.0

type TLS struct {
	Enabled  bool   `mapstructure:"enabled"`
	CertPath string `mapstructure:"cert_path"`
	KeyPath  string `mapstructure:"key_path"`
}

Jump to

Keyboard shortcuts

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