config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteDefault

func WriteDefault(data []byte) error

Types

type API

type API struct {
	ListenAddress      string   `mapstructure:"listen_address"`
	Port               int      `mapstructure:"port"`
	CorsAllowedOrigins []string `mapstructure:"cors_allowed_origins"`
}

type Auth

type Auth struct {
	SessionTtl int    `mapstructure:"session_ttl"`
	SigningKey string `mapstructure:"signing_key"`
}

type Config

type Config struct {
	API           API           `mapstructure:"api"`
	Auth          Auth          `mapstructure:"auth"`
	Database      Database      `mapstructure:"database"`
	Observability Observability `mapstructure:"observability"`
}

func Load

func Load(configFile string) (*Config, error)

func LoadDefault

func LoadDefault() (*Config, error)

type Database

type Database struct {
	Location string `mapstructure:"location"`
}

type Observability

type Observability struct {
	WriteToFile    bool `mapstructure:"write_to_file"`
	WriteToConsole bool `mapstructure:"write_to_console"`

	Path       string `mapstructure:"path"`
	MaxSize    int    `mapstructure:"max_size"`
	MaxBackups int    `mapstructure:"max_backups"`
}

Jump to

Keyboard shortcuts

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