config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppInfo

type AppInfo struct {
	Name    string `toml:"name"`
	Url     string `toml:"url"`
	Port    string `toml:"port"`
	Debug   bool   `toml:"debug"`
	Version string `toml:"version"`
}

type LogConf

type LogConf struct {
	Level logrus.Level `toml:"log_level"`
}

type MysqlConf

type MysqlConf struct {
	Host     string `toml:"db_host"`
	Port     string `toml:"db_port"`
	DB       string `toml:"db_database"`
	User     string `toml:"db_user"`
	Password string `toml:"db_password"`
}

type OA

type OA struct {
	OaUrl      string `toml:"oa_url"`
	TokenApi   string `toml:"token_api"`
	UserApi    string `toml:"user_api"`
	OaClient   string `toml:"oa_client"`
	OaSecret   string `toml:"oa_secret"`
	UserActive uint8  `toml:"user_active"`
}

type RedisConf

type RedisConf struct {
	Host     string `toml:"cache_host"`
	Port     string `toml:"cache_port"`
	DB       int    `toml:"cache_database"`
	Password string `toml:"cache_password"`
}

type TomlConfig

type TomlConfig struct {
	App   AppInfo   `toml:"app"`
	OA    OA        `toml:"oa"`
	Redis RedisConf `toml:"redis"`
	Mysql MysqlConf `toml:"mysql"`
	Log   LogConf   `toml:"log"`
}
var (

	// Conf global
	Conf *TomlConfig
)

func Init

func Init() (*TomlConfig, error)

Init, init conf

Jump to

Keyboard shortcuts

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