config

package
v0.0.0-...-23da319 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 3 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"`
}

type Container

type Container struct {
	App       `yaml:"app"`
	Log       `yaml:"log"`
	HTTP      *HTTP      `yaml:"http"`
	Token     *Token     `yaml:"token"`
	Dragonfly *Dragonfly `yaml:"dragonfly"`
	PSQL      *PSQL      `yaml:"psql"`
	Settings  *Settings  `yaml:"settings"`
}

func NewConfig

func NewConfig() (*Container, error)

type Dragonfly

type Dragonfly struct {
	URL      string `env-required:"true" yaml:"url" env:"DRAGONFLY_URL"`
	DBNumber int    `env-required:"true" yaml:"db_number" env:"DRAGONFLY_DB_NUMBER"`
}

type HTTP

type HTTP struct {
	Host string `env-required:"true" yaml:"host" env:"HTTP_HOST"`
	Port int    `env-required:"true" yaml:"port" env:"HTTP_PORT"`
}

type Log

type Log struct {
	Level int `env-required:"true" yaml:"level" env:"LOG_LEVEL"`
}

type PSQL

type PSQL struct {
	URL     string `env-required:"true" yaml:"url" env:"PSQL_URL"`
	PoolMax int    `env-required:"true" yaml:"pool_max" env:"PSQL_POOL_MAX"`
}

type Settings

type Settings struct {
	ServerReadTimeout int `env-required:"true" yaml:"server_read_timeout" env:"SERVER_READ_TIMEOUT"`
	PSQLConnAttempts  int `env-required:"true" yaml:"psql_conn_attempts" env:"PSQL_CONN_ATTEMPTS"`
	PSQLConnTimeout   int `env-required:"true" yaml:"psql_conn_timeout" env:"PSQL_CONN_TIMEOUT"`
}

type Token

type Token struct {
	SymmetricKey string        `env-required:"true" yaml:"symmetric_key" env:"TOKEN_SYMMETRIC_KEY"`
	TokenTTL     time.Duration `env-required:"true" yaml:"ttl" env:"TOKEN_TTL"`
	RefreshTTL   time.Duration `env-required:"true" yaml:"refresh_ttl" env:"REFRESH_TTL"`
}

Jump to

Keyboard shortcuts

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