Documentation ¶
Index ¶
- Variables
- func GetDefaultExpiresAt(expiration time.Duration) time.Duration
- func GetRootPath() (path string, err error)
- func LogDebug(msg string, obj ...interface{})
- func LogError(msg string, err error, obj ...interface{})
- func LogInformation(msg string, obj ...interface{})
- func NewLzqLog()
- func RandomNum(mix, max int) int
- func StringToUuid(str string) (uuid.UUID, error)
- func StructToJson(obj interface{}) (string, error)
- func StructToMap(obj interface{}, oneSeries bool) map[string]interface{}
- func TimeToDateStr(time time.Time) string
- func TimeToDateTimeStr(time time.Time) string
- func UrlJoint(path ...string) string
- func UuidCreate() string
- type LogConfig
- type RedisConfig
- type RedisHelper
- func (r *RedisHelper) Delete(key string)
- func (r *RedisHelper) Get(key string) string
- func (r *RedisHelper) HDelete(key string, fields ...string) interface{}
- func (r *RedisHelper) HGet(key, field string) interface{}
- func (r *RedisHelper) HGetAll(key string) interface{}
- func (r *RedisHelper) HSet(key, field string, value interface{}, duration time.Duration)
- func (r *RedisHelper) IncrBy(key string, increment int64) int64
- func (r *RedisHelper) Keys(pattern string) []string
- func (r *RedisHelper) MultiDelete(keys []string)
- func (r *RedisHelper) MultiGet(keys []string) []interface{}
- func (r *RedisHelper) SSet(key string, value interface{}, expiration time.Duration)
- func (r *RedisHelper) Set(key string, value interface{}, expiration time.Duration)
Constants ¶
This section is empty.
Variables ¶
View Source
var Fields logrus.Fields
View Source
var LzgLogger = &LogConfig{}
View Source
var RedisUtil = redisUtil{}
Functions ¶
func LogInformation ¶
func LogInformation(msg string, obj ...interface{})
func StructToJson ¶
StructToJson struct转为json 这里对应的 N 和 A 不能为小写,首字母必须为大写,这样才可对外提供访问,具体 json 匹配是通过后面的 tag 标签进行匹配的,与 N 和 A 没有关系 tag 标签中 json 后面跟着的是字段名称,都是字符串类型,要求必须加上双引号,否则 golang 是无法识别它的类型
func StructToMap ¶
StructToMap struct转为map
func TimeToDateStr ¶
func TimeToDateTimeStr ¶
func UuidCreate ¶
func UuidCreate() string
Types ¶
type LogConfig ¶
type LogConfig struct { ApplicationName string `mapstructure:"ApplicationName"` UseElasticSearch bool `mapstructure:"UseElasticSearch"` ElasticSearchUrl string `mapstructure:"ElasticSearchUrl"` ElasticSearchUser string `mapstructure:"ElasticSearchUser"` ElasticSearchPwd string `mapstructure:"ElasticSearchPwd"` }
type RedisConfig ¶
type RedisHelper ¶
type RedisHelper struct {
// contains filtered or unexported fields
}
func (*RedisHelper) Delete ¶
func (r *RedisHelper) Delete(key string)
func (*RedisHelper) Get ¶
func (r *RedisHelper) Get(key string) string
func (*RedisHelper) HDelete ¶
func (r *RedisHelper) HDelete(key string, fields ...string) interface{}
func (*RedisHelper) HGet ¶
func (r *RedisHelper) HGet(key, field string) interface{}
func (*RedisHelper) HGetAll ¶
func (r *RedisHelper) HGetAll(key string) interface{}
func (*RedisHelper) HSet ¶
func (r *RedisHelper) HSet(key, field string, value interface{}, duration time.Duration)
func (*RedisHelper) Keys ¶
func (r *RedisHelper) Keys(pattern string) []string
func (*RedisHelper) MultiDelete ¶
func (r *RedisHelper) MultiDelete(keys []string)
func (*RedisHelper) MultiGet ¶
func (r *RedisHelper) MultiGet(keys []string) []interface{}
Click to show internal directories.
Click to hide internal directories.