config

package
v0.0.0-...-5f07eeb Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath() string

GetConfigPath get config path

func ReadYamlConfigFile

func ReadYamlConfigFile() error

ReadYamlConfigFile Initial Function

Types

type Application

type Application struct {
	Port        string `yaml:"http-port"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

Application application config

type Config

type Config struct {
	MyAppConfig MyAppConfig `yaml:"myappconfig"`
}

Config config

func GetConfig

func GetConfig() Config

GetConfig get config

type DatabaseConfig

type DatabaseConfig struct {
	DBName   string `yaml:"dbname"`
	Username string `yaml:"user"`
	Password string `yaml:"password"`
	Location string `yaml:"location"`
	Port     string `yaml:"port"`
	LogPath  string `yaml:"logPath"`
}

DatabaseConfig database config

type LogConfig

type LogConfig struct {
	Location   string `yaml:"location"`
	Level      string `yaml:"level"`
	MaxBackups int    `yaml:"maxbackups"`
	MaxAge     int    `yaml:"maxage"`
}

LogConfig log config

type MyAppConfig

type MyAppConfig struct {
	Database    DatabaseConfig `yaml:"database"`
	Log         LogConfig      `yaml:"log"`
	Application Application    `yaml:"application"`
}

MyAppConfig config

Jump to

Keyboard shortcuts

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