config

package
v1.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name                     string        `env-required:"true" yaml:"name" env:"APP_NAME"`
	Repo                     string        `env-required:"true" yaml:"repo" env:"APP_REPO"`
	Version                  string        `env-required:"true"`
	EncryptionKey            string        `yaml:"encryption_key" env:"APP_ENCRYPTION_KEY"`
	JWTKey                   string        `env-required:"true" yaml:"jwtKey" env:"APP_JWT_KEY"`
	AuthDisabled             bool          `yaml:"authDisabled" env:"APP_AUTH_DISABLED"`
	AdminUsername            string        `yaml:"adminUsername" env:"APP_ADMIN_USERNAME"`
	AdminPassword            string        `yaml:"adminPassword" env:"APP_ADMIN_PASSWORD"`
	JWTExpiration            time.Duration `yaml:"jwtExpiration" env:"APP_JWT_EXPIRATION"`
	RedirectionJWTExpiration time.Duration `yaml:"redirectionJWTExpiration" env:"APP_REDIRECTION_JWT_EXPIRATION"`
}

App -.

type Config

type Config struct {
	App  `yaml:"app"`
	HTTP `yaml:"http"`
	Log  `yaml:"logger"`
	DB   `yaml:"postgres"`
	EA   `yaml:"ea"`
}

Config -.

var ConsoleConfig *Config

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type DB

type DB struct {
	PoolMax int    `env-required:"true" yaml:"pool_max" env:"DB_POOL_MAX"`
	URL     string `env:"DB_URL"`
}

DB -.

type EA

type EA struct {
	URL      string `yaml:"url" env:"EA_URL"`
	Username string `yaml:"username" env:"EA_USERNAME"`
	Password string `yaml:"password" env:"EA_PASSWORD"`
}

EA -.

type HTTP

type HTTP struct {
	Host           string   `env-required:"true" yaml:"host" env:"HTTP_HOST"`
	Port           string   `env-required:"true" yaml:"port" env:"HTTP_PORT"`
	AllowedOrigins []string `env-required:"true" yaml:"allowed_origins" env:"HTTP_ALLOWED_ORIGINS"`
	AllowedHeaders []string `env-required:"true" yaml:"allowed_headers" env:"HTTP_ALLOWED_HEADERS"`
}

HTTP -.

type Log

type Log struct {
	Level string `env-required:"true" yaml:"log_level"   env:"LOG_LEVEL"`
}

Log -.

Jump to

Keyboard shortcuts

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