config

package
v1.0.36 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Zlib Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	EProd = "prod"
	ETest = "test"
	EDev  = "dev"
)
View Source
const (
	KForever = "forever"
	KDaemon  = "daemon"
	KPprof   = "pprof"
	KPath    = "path"
	KEnv     = "env"
	KConf    = "conf"
	KAppId   = "appid"
	KServer  = "server"
	KLog     = "log"
	KGinMode = "mode"
	KRedis   = "redis"
	KDb      = "db"
	KMq      = "mq"
)

Variables

View Source
var (
	Version  = "1.0.0"
	AppName  = "unknown"
	AppId    string
	SeqId    int64 = 0
	Source   string
	Env      = EDev
	WorkDir  string
	Conf     string
	ConfPath string
	Daemon   bool
	Forever  bool
	Pprof    bool
)

Functions

func ConfigureFileName added in v0.5.41

func ConfigureFileName() string

func ConfigureFileNameIn added in v0.6.2

func ConfigureFileNameIn(name string) string

func ConfigureFileNameInEnv

func ConfigureFileNameInEnv(name string) string

func ConfigureFilePath added in v0.5.41

func ConfigureFilePath() string

func IsRelease

func IsRelease() bool

Types

type Config

type Config struct {
	LogConfig    logger.Config `json:"log" yaml:"log" xml:"log"`
	GinMode      string        `json:"mode" yaml:"mode" xml:"mode"`
	Server       string        `json:"server" yaml:"server" xml:"server"`
	PubIP        string        `json:"publicIp" yaml:"publicIp" xml:"publicIp"`
	EnabledRedis bool          `json:"enabledRedis" yaml:"enabledRedis" xml:"enabledRedis"`
	EnabledDb    bool          `json:"enabledDb" yaml:"enabledDb" xml:"enabledDb"`
	EnabledMQ    bool          `json:"enabledMQ" yaml:"enabledMQ" xml:"enabledMQ"`
}

func (*Config) Init

func (cfg *Config) Init()

Jump to

Keyboard shortcuts

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