config

package
v0.0.0-...-99fda48 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: MIT Imports: 6 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 {
	Env             string        `yaml:"env"`
	AccessTokenTtl  time.Duration `env-required:"true" yaml:"access_token_ttl"`
	RefreshTokenTtl time.Duration `env-required:"true" yaml:"refresh_token_ttl"`
	Postgres        Postgres      `env-required:"true" yaml:"postgres"`
	GRPC            Grpc          `env-required:"true" yaml:"grpc"`
}

func MustLoad

func MustLoad(envPath string) *Config

MustLoad loads config from .env and yaml file

envPath is ".env" by default

type Grpc

type Grpc struct {
	Host    string        `env-required:"true" yaml:"host"`
	Port    int           `env-required:"true" yaml:"port"`
	Timeout time.Duration `env-required:"true" yaml:"timeout"`
}

type Postgres

type Postgres struct {
	Host        string `env-required:"true" env:"PG_HOST"`
	Port        int    `env-required:"true" env:"PG_PORT"`
	User        string `env-required:"true" env:"PG_USER"`
	Password    string `env-required:"true" env:"PG_PASS"`
	Database    string `env-required:"true" env:"PG_DBNAME"`
	SSLMode     string `env-required:"true" env:"PG_SSLMODE"`
	DSNTemplate string
}

Jump to

Keyboard shortcuts

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