config

package
v0.0.0-...-9fc71da Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: MIT Imports: 5 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"`
	DB       StorageConfig `yaml:"storage"`
	GRPC     GRPCConfig    `yaml:"grpc"`
	TokenTTL time.Duration `yaml:"token_ttl" env-default:"1h"`
}

func MustLoad

func MustLoad() *Config

func MustLoadPath

func MustLoadPath(configPath string) *Config

type GRPCConfig

type GRPCConfig struct {
	Port    int           `yaml:"port"`
	Timeout time.Duration `yaml:"timeout"`
}

type StorageConfig

type StorageConfig struct {
	Type     string `yaml:"type"`
	DBName   string `yaml:"db-name"`
	User     string `yaml:"user"`
	Password string `yaml:"password" env:"DB_PASSWORD"`
	Host     string `yaml:"host"`
	Port     int    `yaml:"port"`
}

Jump to

Keyboard shortcuts

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