Documentation ¶
Index ¶
- Variables
- func AddGetDataToUrl(urlString string, data url.Values) string
- func Black(str string) string
- func Blue(str string) string
- func CloseDB() error
- func CmdExecute() error
- func Cyan(str string) string
- func DestroyConf()
- func Encode(data string) (string, error)
- func GetBoolConf(key string) bool
- func GetCmdConfPath() string
- func GetCmdPanelType() string
- func GetConf(key string) interface{}
- func GetConfEnv() string
- func GetConfFilePath(fileName string) string
- func GetConfPath(fileName string) string
- func GetDBPool(name string) (*sql.DB, error)
- func GetDurationConf(key string) time.Duration
- func GetFloat64Conf(key string) float64
- func GetGormPool(name string) (*gorm.DB, error)
- func GetIntConf(key string) int
- func GetLocalIPs() (ips []net.IP)
- func GetMd5Hash(text string) string
- func GetStringConf(key string) string
- func GetStringMapConf(key string) map[string]interface{}
- func GetStringMapStringConf(key string) map[string]string
- func GetStringSliceConf(key string) []string
- func GetTimeConf(key string) time.Time
- func Green(str string) string
- func HttpGET(traceContext *trace.Trace, urlString string, urlParams url.Values, ...) (*http.Response, []byte, error)
- func HttpJSON(traceContext *trace.Trace, urlString string, jsonContent string, msTimeout int, ...) (*http.Response, []byte, error)
- func HttpPOST(traceContext *trace.Trace, urlString string, urlParams url.Values, ...) (*http.Response, []byte, error)
- func InArrayString(s string, arr []string) bool
- func InitBaseConf(path string) error
- func InitConf(configPath string) error
- func InitDBPool(path string) error
- func InitRedisConf(path string) error
- func InitViperConf() error
- func IsSetConf(key string) bool
- func ParseConfPath(config string) error
- func ParseConfig(path string, conf interface{}) error
- func ParseLocalConfig(fileName string, st interface{}) error
- func PathExists(path string) (bool, error)
- func Purple(str string) string
- func Red(str string) string
- func RedisConfDo(traceContext *trace.Trace, name string, commandName string, ...) (interface{}, error)
- func RedisConnFactory(name string) (redis.Conn, error)
- func RedisLogDo(traceContext *trace.Trace, c redis.Conn, commandName string, ...) (interface{}, error)
- func SetCmdConfPath(path string)
- func SetCmdPanelType(paneltype string)
- func Substr(str string, start int64, end int64) string
- func White(str string) string
- func Yellow(str string) string
- type BaseConf
- type LogConfConsoleWriter
- type LogConfFileWriter
- type LogConfig
- type Logger
- type MySQLConf
- type MysqlGormLogger
- type MysqlMapConf
- type RedisConf
- type RedisMapConf
- type ZeroLogConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConfBase *BaseConf DBMapPool map[string]*sql.DB GORMMapPool map[string]*gorm.DB ConfRedis *RedisConf ConfRedisMap *RedisMapConf ViperConfMap map[string]*viper.Viper TimeLocation *time.Location TimeFormat = "2006-01-02 15:04:05" DateFormat = "2006-01-02" LocalIP = net.ParseIP("127.0.0.1") ConfEnvPath string ConfEnv string ZLog *ddlog.DiLogHandle )
Functions ¶
func CmdExecute ¶
func CmdExecute() error
func DestroyConf ¶
func DestroyConf()
func GetBoolConf ¶
func GetCmdConfPath ¶
func GetCmdConfPath() string
func GetCmdPanelType ¶
func GetCmdPanelType() string
func GetConfEnv ¶
func GetConfEnv() string
func GetConfFilePath ¶
func GetConfPath ¶
func GetDurationConf ¶
func GetFloat64Conf ¶
func GetIntConf ¶
func GetLocalIPs ¶
func GetMd5Hash ¶
func GetStringConf ¶
func GetStringMapConf ¶
func GetStringMapStringConf ¶
func GetStringSliceConf ¶
func GetTimeConf ¶
func InArrayString ¶
func InitBaseConf ¶
func InitDBPool ¶
func InitRedisConf ¶
func InitViperConf ¶
func InitViperConf() error
func ParseConfPath ¶
func ParseConfig ¶
func ParseLocalConfig ¶
func PathExists ¶
func RedisConfDo ¶
func RedisLogDo ¶
func SetCmdConfPath ¶
func SetCmdConfPath(path string)
func SetCmdPanelType ¶
func SetCmdPanelType(paneltype string)
Types ¶
type BaseConf ¶
type BaseConf struct { TimeLocation string `toml:"time_location"` Log ZeroLogConfig `toml:"log"` Base struct { DebugMode string `toml:"debug_mode"` TimeLocation string `toml:"time_location"` SerName string `toml:"ser_name"` } `toml:"base"` }
type LogConfConsoleWriter ¶
type LogConfFileWriter ¶
type LogConfig ¶
type LogConfig struct { Level string `toml:"log_level"` FW LogConfFileWriter `toml:"file_writer"` CW LogConfConsoleWriter `toml:"console_writer"` }
type Logger ¶
type Logger struct { }
var Log *Logger
type MysqlGormLogger ¶
func (*MysqlGormLogger) CtxPrint ¶
func (logger *MysqlGormLogger) CtxPrint(s *gorm.DB, values ...interface{})
func (*MysqlGormLogger) LogFormatter ¶
func (logger *MysqlGormLogger) LogFormatter(values ...interface{}) (messages map[string]interface{})
func (*MysqlGormLogger) NowFunc ¶
func (logger *MysqlGormLogger) NowFunc() time.Time
type MysqlMapConf ¶
type RedisMapConf ¶
type ZeroLogConfig ¶
type ZeroLogConfig struct { On bool `toml:"on"` Level string `toml:"level"` FilePrefix string `toml:"file_prefix"` FileDir string `toml:"file_dir"` AutoClear bool `toml:"auto_clear"` ClearHours int32 `toml:"clear_hours"` ClearStep int32 `toml:"clear_step"` Separate bool `toml:"separate"` DisableLink bool `toml:"disable_link"` }
Click to show internal directories.
Click to hide internal directories.