config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &Configuration{}

Config inits configuration

Functions

func Init

func Init() error

Init read config values

Types

type Configuration

type Configuration struct {
	Logger   *Logger   `yaml:"logger"`
	Storage  *Storage  `yaml:"storage"`
	RestAPI  *RestAPI  `yaml:"rest_api"`
	Database *Database `yaml:"database"`
	Tasker   *Tasker   `yaml:"tasker"`
}

Configuration is a yaml config with environment secrets

type Database added in v0.0.2

type Database struct {
	Host       string `yaml:"host"`
	Port       uint16 `yaml:"port"`
	SSL        bool   `yaml:"ssl"`
	User       string `yaml:"user"`
	DBName     string `yaml:"db_name"`
	Password   string `yaml:"password"`
	Migrations string `yaml:"migrations"`
}

Database is a config of the database connect

type EnvConfig added in v0.0.2

type EnvConfig struct {
	ConfigFile string `env:"CONFIGFILE" envDefault:"./conf.dev.yml"`
	DBPass     string `env:"DBPASS"`
}

EnvConfig is a env vars config

type Logger added in v0.0.2

type Logger struct {
	EnableDebugLog bool `yaml:"enable_debug_log"`
	PrettyLog      bool `yaml:"pretty_log"`
}

Logger is a configuration of the logger

type RestAPI

type RestAPI struct {
	Address string `yaml:"address"`
}

RestAPI is a config of the rest api server

type Storage

type Storage struct {
	Path    string `yaml:"path"`
	TmpPath string `yaml:"tmp_path"`
}

Storage is a config of the file system storage

type Tasker added in v0.0.2

type Tasker struct {
	EnableWritingTasksToDB bool `yaml:"enable_writing_tasks_to_db"`
}

Tasker config

Jump to

Keyboard shortcuts

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