config

package
v0.0.0-...-e979ea2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2022 License: Apache-2.0 Imports: 2 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 {
	Host            string        `env:"HOST" env-default:"0.0.0.0:9020"`
	DebugURI        string        `env:"DEBUGURI" env-default:"0.0.0.0:9021"`
	ReadTimeout     time.Duration `env:"READTIMEOUT" env-default:"10s"`
	WriteTimeout    time.Duration `env:"WRITETIMEOUT" env-default:"20s"`
	IdleTimeout     time.Duration `env:"IDLETIMEOUT" env-default:"120s"`
	ShutdownTimeout time.Duration `env:"SHUTDOWNTIMEOUT" env-default:"20s"`
	AuthKeysFolder  string        `env:"AUTH_KEYFOLDER" env-default:"infra/keys/"`
	AuthActiveKID   string        `env:"AUTH_ACTIVEKID" env-default:"c2e055bb-f637-4cc3-9b4a-916a8b31304a"`

	// Database PostgreSQL
	DB DB
}

func New

func New() Config

type DB

type DB struct {
	User         string `env:"DB_USER" env-default:"postgres"`
	Password     string `env:"DB_PASSWORD" env-default:"postgres"`
	Host         string `env:"DB_HOST" env-default:"localhost"`
	Name         string `env:"DB_NAME" env-default:"postgres"`
	MaxIdleConns int    `env:"DB_MAXIDLE" env-default:"0"`
	MaxOpenConns int    `env:"DB_MAXOPEN" env-default:"0"`
	DisableTLS   bool   `env:"DB_DISABLETLS" env-default:"true"`
}

Jump to

Keyboard shortcuts

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