config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string `default:"prod"`

	PostgresDSN string `split_words:"true"`

	PortalAPIListenAddress string `default:":8081" split_words:"true"`
	PortalAPIBaseAddress   string `default:"http://localhost:8081" split_words:"true"`
	PortalAPIAllowedOrigin string `default:"http://localhost:3000" split_words:"true"`

	OIDCProviderURL  string `split_words:"true"`
	OIDCClientID     string `split_words:"true"`
	OIDCClientSecret string `split_words:"true"`

	DataAPIListenAddress string `default:":8082" split_words:"true"`
}

Config represents the application configuration structure

func LoadFromEnv

func LoadFromEnv() (*Config, error)

LoadFromEnv loads a new configuration structure using environment variables and an optional .env file

func (*Config) IsEnvProduction

func (config *Config) IsEnvProduction() bool

IsEnvProduction returns whether the application runs in production environment

func (*Config) IsPortalAPISecure

func (config *Config) IsPortalAPISecure() bool

IsPortalAPISecure returns whether the portal API uses SSL in the end

Jump to

Keyboard shortcuts

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