config

package
v0.0.0-...-186c3ae Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadEnv

func ReadEnv(cfg *Config) error

ReadEnv reads some configs from environment variables

func ReadYAML

func ReadYAML(path string, cfg *Config) (err error)

Types

type Account

type Account struct {
	MinUsernameLength int `yaml:"min_username_length"`
}

type App

type App struct {
	Name    string `yaml:"name" envconfig:"CLEANSERVICE_APP_NAME"`
	Address string `yaml:"port" envconfig:"CLEANSERVICE_APP_ADDRESS"`
}

type Config

type Config struct {
	App     App     `yaml:"app"`
	Mysql   Mysql   `yaml:"mysql"`
	Account Account `yaml:"account"`
}

type Mysql

type Mysql struct {
	Username string `yaml:"username" envconfig:"CLEANSERVICE_MYSQL_USERNAME"`
	Password string `yaml:"password" envconfig:"CLEANSERVICE_MYSQL_PASSWORD"`
	DBName   string `yaml:"db_name" envconfig:"CLEANSERVICE_MYSQL_DBNAME"`
	Host     string `yaml:"host" envconfig:"CLEANSERVICE_MYSQL_HOST"`
	Port     string `yaml:"port" envconfig:"CLEANSERVICE_MYSQL_PORT"`
}

Jump to

Keyboard shortcuts

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