config

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: Apache-2.0 Imports: 8 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"`
	CommonName           string `env-required:"true" yaml:"common_name" env:"APP_COMMON_NAME"`
	EncryptionKey        string `yaml:"encryption_key" env:"APP_ENCRYPTION_KEY"`
	AllowInsecureCiphers bool   `yaml:"allow_insecure_ciphers" env:"APP_ALLOW_INSECURE_CIPHERS"`
	DisableCIRA          bool   `yaml:"disable_cira" env:"APP_DISABLE_CIRA"`
}

App -.

type Auth

type Auth struct {
	Disabled                 bool          `yaml:"disabled" env:"AUTH_DISABLED"`
	AdminUsername            string        `yaml:"adminUsername" env:"AUTH_ADMIN_USERNAME"`
	AdminPassword            string        `yaml:"adminPassword" env:"AUTH_ADMIN_PASSWORD"`
	JWTKey                   string        `env-required:"true" yaml:"jwtKey" env:"AUTH_JWT_KEY"`
	JWTExpiration            time.Duration `yaml:"jwtExpiration" env:"AUTH_JWT_EXPIRATION"`
	RedirectionJWTExpiration time.Duration `yaml:"redirectionJWTExpiration" env:"AUTH_REDIRECTION_JWT_EXPIRATION"`
	ClientID                 string        `yaml:"clientId" env:"AUTH_CLIENT_ID"`
	Issuer                   string        `yaml:"issuer" env:"AUTH_ISSUER"`
	UI                       UIAuthConfig  `yaml:"ui"`
}

Auth -.

type Config

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

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"`
	WSCompression  bool     `yaml:"ws_compression" env:"WS_COMPRESSION"`
	TLS            TLS      `yaml:"tls"`
}

HTTP -.

type Log

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

Log -.

type Secrets added in v1.15.0

type Secrets struct {
	Address string `yaml:"address" env:"SECRETS_ADDR"`
	Token   string `yaml:"token" env:"SECRETS_TOKEN"`
	Path    string `yaml:"path" env:"SECRETS_PATH"`
}

Secrets -.

type TLS added in v1.13.0

type TLS struct {
	Enabled  bool   `yaml:"enabled" env:"HTTP_TLS_ENABLED"`
	CertFile string `yaml:"certFile" env:"HTTP_TLS_CERT_FILE"`
	KeyFile  string `yaml:"keyFile" env:"HTTP_TLS_KEY_FILE"`
}

TLS -.

type UIAuthConfig

type UIAuthConfig struct {
	ClientID                          string `yaml:"clientId"`
	Issuer                            string `yaml:"issuer"`
	RedirectURI                       string `yaml:"redirectUri"`
	Scope                             string `yaml:"scope"`
	ResponseType                      string `yaml:"responseType"`
	RequireHTTPS                      bool   `yaml:"requireHttps"`
	StrictDiscoveryDocumentValidation bool   `yaml:"strictDiscoveryDocumentValidation"`
}

UIAuthConfig -.

Jump to

Keyboard shortcuts

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