Documentation
¶
Index ¶
- func Cfg() *gcfg.Config
- func GetIP() string
- func GetOS() string
- func GetResourcesDir() string
- func GetRootDir() string
- func GetServerMode() string
- func GetServerName() string
- func GetServerType() string
- func GetServerVersion() string
- func Init(e *Env)
- func IsDebug() bool
- func IsLinux() bool
- func IsMac() bool
- func IsNormal() bool
- func IsRelease() bool
- func IsUnknown() bool
- func IsWin() bool
- func Port() int
- type Config
- type Env
- type LogConfig
- type Var
- func (v *Var) Any() any
- func (v *Var) Bool() bool
- func (v *Var) Float32() float32
- func (v *Var) Float64() float64
- func (v *Var) Int() int
- func (v *Var) Int64() int64
- func (v *Var) IsNil() bool
- func (v *Var) Map() map[string]any
- func (v *Var) MapStrStr() map[string]string
- func (v *Var) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Env ¶
type Env struct {
Version string
ServerName string `json:"server_name"`
ServerVersion string `json:"server_version"`
Mode string `json:"mode"`
OS string
Port int `json:"port"`
IP string `json:"ip"`
Address string
Arch string
SystemVersion string
CPU int
PID int
Hostname string
RootDir string `json:"root_dir"`
ResourcesDir string `json:"resources_dir"`
ServerType string `json:"server_type"`
Cfg *gcfg.Config
Var map[string]any
}
环境
type LogConfig ¶
type LogConfig struct {
Path string `json:"path"`
File string `json:"file"`
Prefix string `json:"prefix"`
Level string `json:"level"`
TimeFormat string `json:"time_format"`
CtxKeys []string `json:"ctx_keys"`
Header bool `json:"header"`
Stdout bool `json:"stdout"`
StdoutColorDisabled bool `json:"stdout_color_disabled"`
WriterColorEnable bool `json:"writer_color_enable"`
}
Click to show internal directories.
Click to hide internal directories.