conf

package
v0.0.0-...-4c11209 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingEnvironmentStage missing stage configuration.
	ErrMissingEnvironmentStage = errors.New("Missing Stage ENV Variable")

	// ErrMissingEnvironmentBranch missing branch configuration.
	ErrMissingEnvironmentBranch = errors.New("Missing Branch ENV Variable")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Debug                bool   `envconfig:"DEBUG"`
	Addr                 string `envconfig:"ADDR" default:":8080"`
	Stage                string `envconfig:"STAGE" default:"dev"`
	Branch               string `envconfig:"BRANCH"`
	PGDatasource         string `envconfig:"PGDATASOURCE"`
	OpenIDProvider       string `envconfig:"OPENID_PROVIDER_URL"`
	ClientID             string `envconfig:"OAUTH_CLIENT_ID"`
	MetricsWriteInterval int    `envconfig:"METRICS_WRITE_INTERVAL"`
	DbSecrets            string `envconfig:"DB_SECRET"`
}

Config for the environment.

func NewDefaultConfig

func NewDefaultConfig() (*Config, error)

NewDefaultConfig reads configuration from environment variables and validates it.

type DBSecrets

type DBSecrets struct {
	Password string `json:"password,omitempty"`
	DBName   string `json:"dbname,omitempty"`
	Engine   string `json:"engine,omitempty"`
	Port     int    `json:"port,omitempty"`
	Host     string `json:"host,omitempty"`
	Username string `json:"username,omitempty"`
}

Jump to

Keyboard shortcuts

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