config

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProdEnv  = "production" //线上环境
	BetaEnv  = "beta"       //beta环境
	DevEnv   = "develop"    //开发环境
	LocalEnv = "local"      //本地环境
)

Variables

This section is empty.

Functions

func GenPidFile

func GenPidFile(opts *Options) string

pid进程号的保存路径

func GetEnv

func GetEnv() string

当前环境,默认本地开发

func IsDebug

func IsDebug() bool

是否调试模式

func IsEnvEqual

func IsEnvEqual(env string) bool

是否当前环境

Types

type Config

type Config struct {
	Env   string             `toml:"Env"`
	Debug bool               `toml:"Debug"`
	Log   config.LogConfig   `toml:"Log"`
	Redis config.RedisConfig `toml:"Redis"`
	Mns   config.MnsConfig   `toml:"AliMns"`
	Db    config.DbConfig    `toml:"Db"`
	Api   config.ApiConfig   `toml:"Api"`
}

------------------------配置文件解析

func GetConf

func GetConf() *Config

当前配置

func Load

func Load(path string) (*Config, error)

------------------------ 加载配置 ------------------------//

type Options

type Options struct {
	ShowVersion bool
	Cmd         string
	ConfFile    string
	App         string
	PidPath     string
	Queue       string
}

------------------------启动命令配置

func GetOptions

func GetOptions() *Options

获取启动命令配置

Jump to

Keyboard shortcuts

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