Documentation
¶
Index ¶
- Constants
- Variables
- func GetLogPrefix(traceId string, msgList ...string) string
- func NewZapLogger(filename string, maxSize int, maxBackups int, maxAge int, compress bool)
- type CKHandler
- func (c *CKHandler) BatchInsertData(query string, dataArrays [][]interface{}) (bool, error)
- func (c *CKHandler) InitClickHouse()
- func (c *CKHandler) InitInsertSQL()
- func (c *CKHandler) InsertData(query string, data ...interface{}) (bool, error)
- func (c *CKHandler) QueryData(items interface{}, query string) error
- type ClickhouseConf
- type ModelRedisHandler
- func (r *ModelRedisHandler) AppendList(key string, value interface{}) bool
- func (r *ModelRedisHandler) BFAdd(key string, value string) (bool, bool)
- func (r *ModelRedisHandler) BFExists(key string, value string) bool
- func (r *ModelRedisHandler) EmptyList(key string) bool
- func (r *ModelRedisHandler) Get(key string) (string, bool)
- func (r *ModelRedisHandler) GetList(key string, start, stop int64) ([]string, bool)
- func (r *ModelRedisHandler) HashDel(key string, fields ...string) bool
- func (r *ModelRedisHandler) HashGet(key, field string) (string, bool)
- func (r *ModelRedisHandler) HashLen(key string) int64
- func (r *ModelRedisHandler) HashMGET(key string, fields ...string) ([]interface{}, bool)
- func (r *ModelRedisHandler) HashMSet(key string, values ...interface{}) bool
- func (r *ModelRedisHandler) HashSet(key string, values ...interface{}) bool
- func (r *ModelRedisHandler) Pipeline() (redis.Pipeliner, context.Context)
- func (r *ModelRedisHandler) PipelineExecute(pipe redis.Pipeliner, ctx context.Context) ([]redis.Cmder, error)
- func (r *ModelRedisHandler) Set(key string, value interface{}, ex time.Duration) bool
- func (r *ModelRedisHandler) ShutdownRedisHandler() error
- type RedisConf
- type ZapLogger
Constants ¶
View Source
const ( ClientMaxBlockSize int = 100000 ClientReadTimeout int = 90 ClientReadTimeoutDuration = 90 * time.Second )
View Source
const ( NilType = redis.Nil PoolSize int = 800 MinIdles int = 50 )
View Source
const LogConsoleSeparator string = "|-|"
LogConsoleSeparator 分隔符
Variables ¶
View Source
var Logger *zap.Logger
Functions ¶
func GetLogPrefix ¶
Types ¶
type CKHandler ¶
type CKHandler struct { ClickhouseConf InsertSql string // contains filtered or unexported fields }
func NewCKHandler ¶
func NewCKHandler(ckConf *ClickhouseConf) *CKHandler
func (*CKHandler) BatchInsertData ¶
func (*CKHandler) InitClickHouse ¶
func (c *CKHandler) InitClickHouse()
func (*CKHandler) InitInsertSQL ¶
func (c *CKHandler) InitInsertSQL()
func (*CKHandler) InsertData ¶
type ClickhouseConf ¶
type ModelRedisHandler ¶
type ModelRedisHandler struct { RedisConf RedisClient *redis.Client RedisClusterClient *redis.ClusterClient }
func NewRedisHandler ¶
func NewRedisHandler(redisConf *RedisConf) *ModelRedisHandler
func (*ModelRedisHandler) AppendList ¶
func (r *ModelRedisHandler) AppendList(key string, value interface{}) bool
func (*ModelRedisHandler) BFAdd ¶
func (r *ModelRedisHandler) BFAdd(key string, value string) (bool, bool)
func (*ModelRedisHandler) BFExists ¶
func (r *ModelRedisHandler) BFExists(key string, value string) bool
func (*ModelRedisHandler) EmptyList ¶
func (r *ModelRedisHandler) EmptyList(key string) bool
func (*ModelRedisHandler) GetList ¶
func (r *ModelRedisHandler) GetList(key string, start, stop int64) ([]string, bool)
func (*ModelRedisHandler) HashDel ¶
func (r *ModelRedisHandler) HashDel(key string, fields ...string) bool
func (*ModelRedisHandler) HashGet ¶
func (r *ModelRedisHandler) HashGet(key, field string) (string, bool)
func (*ModelRedisHandler) HashLen ¶
func (r *ModelRedisHandler) HashLen(key string) int64
func (*ModelRedisHandler) HashMGET ¶
func (r *ModelRedisHandler) HashMGET(key string, fields ...string) ([]interface{}, bool)
func (*ModelRedisHandler) HashMSet ¶
func (r *ModelRedisHandler) HashMSet(key string, values ...interface{}) bool
func (*ModelRedisHandler) HashSet ¶
func (r *ModelRedisHandler) HashSet(key string, values ...interface{}) bool
HashSet accepts values in following formats:
- HashSet("myhash", "key1", "value1", "key2", "value2")
- HashSet("myhash", []string{"key1", "value1", "key2", "value2"})
- HashSet("myhash", map[string]interface{}{"key1": "value1", "key2": "value2"})
Note that it requires Redis v4 for multiple field/value pairs support.
func (*ModelRedisHandler) Pipeline ¶
func (r *ModelRedisHandler) Pipeline() (redis.Pipeliner, context.Context)
Pipeline pipeline
func (*ModelRedisHandler) PipelineExecute ¶
func (r *ModelRedisHandler) PipelineExecute(pipe redis.Pipeliner, ctx context.Context) ([]redis.Cmder, error)
PipelineExecute pipeline 执行
func (*ModelRedisHandler) Set ¶
func (r *ModelRedisHandler) Set(key string, value interface{}, ex time.Duration) bool
func (*ModelRedisHandler) ShutdownRedisHandler ¶
func (r *ModelRedisHandler) ShutdownRedisHandler() error
ShutdownRedisHandler 关闭 Redis 连接
Click to show internal directories.
Click to hide internal directories.