config

package
v0.0.0-...-4044be6 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NonceLength = 16 // NonceLength is the length of the nonce : 16 bytes * 8 bits/byte = 128 bits
)

Variables

View Source
var (
	AccessToken string //nolint:gochecknoglobals //Very Secure
	WebhookURL  string //nolint:gochecknoglobals //Very Secure
)

Functions

This section is empty.

Types

type AUTH

type AUTH struct {
	AccessToken string `env-required:"true" env:"AUTH_ACCESS" yaml:"access_token"`
	WebhookURL  string `env-required:"true" env:"WEBHOOK_URL" yaml:"webhook_url"`
}

AUTH -.

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"`
}

App -.

type Config

type Config struct {
	App  `yaml:"app"`
	HTTP `yaml:"http"`
	Log  `yaml:"logger"`
	AUTH `yaml:"auth"`
	PG   `yaml:"postgres"`
	JWT  `yaml:"jwt"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type HTTP

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

HTTP -.

type JWT

type JWT struct {
	HeaderLen  int `env-required:"true" env-default:"2" yaml:"jwt_header_len"`
	Expiration int `env-required:"true" env:"JWT_EXPIRATION" yaml:"jwt_expiration"`
}

JWT -.

type Log

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

Log -.

type PG

type PG struct {
	URL     string `env-required:"true" env:"PG_URL" yaml:"url"`
	PoolMax int    `env-required:"true" env:"PG_POOL_MAX" yaml:"pool_max"`
}

PG -.

Jump to

Keyboard shortcuts

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