config

package
v1.0.61 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 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"
	KDataPath = "dataPath"
	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
	MainConf string
	ConfPath string
	DataPath string
	Daemon   bool
	Forever  bool
	Pprof    bool
)

Functions

func ConfigureFileName added in v0.5.41

func ConfigureFileName() string

func ConfigureFileNameIn deprecated added in v0.6.2

func ConfigureFileNameIn(name string) string

Deprecated: instead of ConfigureFileNameWithEnv

func ConfigureFileNameInEnv

func ConfigureFileNameInEnv(name string) string

func ConfigureFileNameWithEnv added in v1.0.39

func ConfigureFileNameWithEnv(name string) string

func ConfigureFileNameWithoutEnv added in v1.0.39

func ConfigureFileNameWithoutEnv(name string) string

func ConfigureFilePath added in v0.5.41

func ConfigureFilePath() string

func DataFilePath added in v1.0.39

func DataFilePath() string

func IsDevEnvironment added in v1.0.51

func IsDevEnvironment() bool

func IsProdEnvironment added in v1.0.51

func IsProdEnvironment() bool

func IsTestEnvironment added in v1.0.51

func IsTestEnvironment() 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"`
	CompanyName  string        `json:"companyName" yaml:"companyName" xml:"companyName"`
	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