config

package
v0.0.0-...-697c109 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: MIT Imports: 4 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"`
	Version string `env-required:"true" yaml:"version" env:"APP_VERSION"`
}

type Config

type Config struct {
	App    `yaml:"app"`
	HTTP   `yaml:"http"`
	Log    `yaml:"log"`
	PG     `yaml:"postgres"`
	JWT    `yaml:"jwt"`
	Hasher `yaml:"hasher"`
}

func NewConfig

func NewConfig(configPath string) (*Config, error)

type HTTP

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

type Hasher

type Hasher struct {
	Salt string `env-required:"true" env:"HASHER_SALT"`
}

type JWT

type JWT struct {
	SignKey  string        `env-required:"true"                  env:"JWT_SIGN_KEY"`
	TokenTTL time.Duration `env-required:"true" yaml:"token_ttl" env:"JWT_TOKEN_TTL"`
}

type Log

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

type PG

type PG struct {
	MaxPoolSize int    `env-required:"true" yaml:"max_pool_size" env:"PG_MAX_POOL_SIZE"`
	URL         string `env-required:"true"                      env:"PG_URL"`
}

Jump to

Keyboard shortcuts

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