cfg

package
v0.4.9-no-login-entrop... Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: AGPL-3.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig() mo.Result[Config]

func LoadLoggerConfig

func LoadLoggerConfig() mo.Result[logging.Config]

TODO: refactor so that parser parses each section of the config separately

Types

type AuthConfig

type AuthConfig struct {
	AuthMountPoint     string `yaml:"auth_mount_point", default:"/auth"`
	AuthCookieName     string `yaml:"auth_cookie_name", default:"auth"`
	AuthCookiePath     string `yaml:"auth_cookie_path", default:"/"`
	AuthCookieSecure   bool   `yaml:"auth_cookie_secure", default:"false"`
	AuthCookieHTTPOnly bool   `yaml:"auth_cookie_http_only", default:"true"`
	AuthCookieDomain   string `yaml:"auth_cookie_domain", default:""`
	AuthCookieExpire   int    `yaml:"auth_cookie_expire", default:"3600"`
}

type Config

type Config struct {
	DBConfig    `json:"database,omitempty" yaml:"database"`
	Fiber       FiberConfig `json:"fiber,omitempty" yaml:"fiber"`
	SiginingKey string      `json:"sigining_key,omitempty" yaml:"sigining_key"`
	DBPass      string      `json:"db_pass,omitempty" yaml:"db_pass"`
	// default to production for security reasons
	LibrateEnv string `json:"librate_env,omitempty" yaml:"librate_env,default:production"`
}

func ReadDefaults

func ReadDefaults() Config

type DBConfig

type DBConfig struct {
	Engine    string `yaml:"engine,default:postgres"`
	Host      string `yaml:"host,default:localhost"`
	Port      uint16 `yaml:"port,default:5432"`
	Database  string `yaml:"database,default:librerym"`
	User      string `yaml:"user,default:postgres"`
	Password  string `yaml:"password,default:postgres"`
	SSL       string `yaml:"ssl,default:unknown"`
	PG_Config string `yaml:"pg_config,default:/usr/bin/pg_config"`
}

type FiberConfig

type FiberConfig struct {
	Host string `yaml:"host,default:localhost"`
	Port string `yaml:"port,default:3000"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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