config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	BotToken string `envconfig:"BOT_TOKEN"`
	AccessID int    `envconfig:"ACCESS_ID"`
}

Bot config.

type Config

type Config struct {
	Bot    *Bot    `yaml:"bot"`
	Logger *Logger `yaml:"logger"`
	DB     *DB     `yaml:"db"`
}

Config app.

func Parse

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

Parse config file and env vars.

type DB

type DB struct {
	Type           string `yaml:"type" envconfig:"DB_TYPE"`
	Host           string `yaml:"host" envconfig:"DB_HOST"`
	Port           string `yaml:"port" envconfig:"DB_PORT"`
	User           string `yaml:"user" envconfig:"DB_USER"`
	Name           string `yaml:"name" envconfig:"DB_NAME"`
	Password       string `yaml:"password" envconfig:"DB_PASSWORD"`
	MigrationsPath string `yaml:"migrations_path" envconfig:"DB_MIGRATIONS_PATH"`
}

DB config.

type Logger

type Logger struct {
	Level string `yaml:"level" envconfig:"LOGGER_LEVEL"`
	File  string `yaml:"file" envconfig:"LOGGER_FILE"`
}

Logger config.

Jump to

Keyboard shortcuts

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