config

package
v0.0.0-...-9ed8f83 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applictaion

type Applictaion struct {
	Preload  bool     `mapstructure:"preload"`
	Features []string `mapstructure:"features"`
}

type Config

type Config struct {
	Server         Server      `mapstructure:"server"`
	MasterDatabase Database    `mapstructure:"master_database"`
	Secrets        Secrets     `mapstructure:"secrets"`
	Applictaion    Applictaion `mapstructure:"applictaion"`
	Logger         Logger      `mapstructure:"logger"`
	Migration      Migration   `mapstructure:"migration"`
}

func LoadConfig

func LoadConfig(path string) (config *Config, err error)

LoadConfig reads configuration from file or environment variables.

type Database

type Database struct {
	Type              string `mapstructure:"type"`
	Username          string `mapstructure:"username"`
	Password          string `mapstructure:"password"`
	Host              string `mapstructure:"host"`
	Port              int    `mapstructure:"port"`
	DBname            string `mapstructure:"dbname"`
	PoolSize          int    `mapstructure:"pool_size"`
	ConnectionTimeout int    `mapstructure:"connection_timeout"`
}

type Logger

type Logger struct {
	Development bool   `mapstructure:"development"`
	Level       string `mapstructure:"level"`
	Encoding    string `mapstructure:"encoding"`
}

type Migration

type Migration struct {
	Active bool `mapstructure:"active"`
}

type Secrets

type Secrets struct {
	MasterEncKey string `mapstructure:"master_enc_key"`
	JwtSecret    string `mapstructure:"jwt_secret"`
}

type Server

type Server struct {
	Port             int    `mapstructure:"port"`
	Host             string `mapstructure:"host"`
	ServerName       string `mapstructure:"server_name"`
	RequestBodyLimit int    `mapstructure:"request_body_limit"`
	Timeout          int    `mapstructure:"timeout"`
	AdminCors        string `mapstructure:"admin_cors"`
	StoreCors        string `mapstructure:"store_cors"`
}

Jump to

Keyboard shortcuts

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