Versions in this module Expand all Collapse all v1 v1.0.0 Oct 29, 2021 Changes in this version + var ConfBase *BaseConf + var ConfEnv string + var ConfEnvPath string + var ConfRedis *RedisConf + var ConfRedisMap *RedisMapConf + var DBMapPool map[string]*sql.DB + var DateFormat = "2006-01-02" + var GORMMapPool map[string]*gorm.DB + var LocalIP = net.ParseIP("127.0.0.1") + var TimeFormat = "2006-01-02 15:04:05" + var TimeLocation *time.Location + var ViperConfMap map[string]*viper.Viper + var ZLog *ddlog.DiLogHandle + 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 struct + Base struct{ ... } + Log ZeroLogConfig + TimeLocation string + type LogConfConsoleWriter struct + Color bool + On bool + type LogConfFileWriter struct + LogPath string + On bool + RotateLogPath string + RotateWfLogPath string + WfLogPath string + type LogConfig struct + CW LogConfConsoleWriter + FW LogConfFileWriter + Level string + type Logger struct + var Log *Logger + func (l *Logger) TagError(traceContext *trace.Trace, dltag string, m map[string]interface{}) + func (l *Logger) TagInfo(traceContext *trace.Trace, dltag string, m map[string]interface{}) + func (l *Logger) TagWarn(traceContext *trace.Trace, dltag string, m map[string]interface{}) + type MySQLConf struct + DataSourceName string + DriverName string + MaxConnLifeTime int + MaxIdleConn int + MaxOpenConn int + type MysqlGormLogger struct + Trace *trace.Trace + func (logger *MysqlGormLogger) CtxPrint(s *gorm.DB, values ...interface{}) + func (logger *MysqlGormLogger) LogFormatter(values ...interface{}) (messages map[string]interface{}) + func (logger *MysqlGormLogger) NowFunc() time.Time + type MysqlMapConf struct + List map[string]*MySQLConf + type RedisConf struct + ConnTimeout int + Db int + Password string + ProxyList []string + ReadTimeout int + WriteTimeout int + type RedisMapConf struct + List map[string]*RedisConf + type ZeroLogConfig struct + AutoClear bool + ClearHours int32 + ClearStep int32 + DisableLink bool + FileDir string + FilePrefix string + Level string + On bool + Separate bool