Documentation ¶
Index ¶
- Constants
- Variables
- type HashHelper
- func (s HashHelper) HDel(key, field string) (v *gvar.Var, err error)
- func (s HashHelper) HDelM(key string, fields []string) (v *gvar.Var, err error)
- func (s HashHelper) HDelOnlyError(key, field string) (err error)
- func (s HashHelper) HExists(key, field string) (v *gvar.Var, err error)
- func (s HashHelper) HExistsNoError(key, field string) (v *gvar.Var)
- func (s HashHelper) HGet(key, field string) (v *gvar.Var, err error)
- func (s HashHelper) HIncrby(key string, field string, increment int64) (v *gvar.Var, err error)
- func (s HashHelper) HMGet(key string, fields []string) (v *gvar.Var, err error)
- func (s HashHelper) HMSet(key string, fv g.Map) (v *gvar.Var, err error)
- func (s HashHelper) HScan(key string, field string, ...) (err error)
- func (s HashHelper) HSet(key, field string, value interface{}) (v *gvar.Var, err error)
- func (s HashHelper) HSetNx(key, field string, value interface{}) (v *gvar.Var, err error)
- type HashMapIUDHelper
- type HashStructHelper
Constants ¶
View Source
const ( DefaultTag = "redis" DefaultTagHashKey = "redis_hash_key" DefaultTagHashField = "redis_hash_field" )
Variables ¶
View Source
var ( ErrorNoTagFound = errors.New("no tag found") ErrorCacheDataIsNil = errors.New("CacheData is nil") ErrorCacheDataIsEmpty = errors.New("CacheData is empty") ErrorCacheDataIsError = errors.New("CacheData is error") ErrorCacheDataExistedEmptyData = errors.New("CacheData existed empty data") )
Functions ¶
This section is empty.
Types ¶
type HashHelper ¶
HashHelper Redis Hash类型助手类
func (HashHelper) HDelOnlyError ¶
func (s HashHelper) HDelOnlyError(key, field string) (err error)
func (HashHelper) HExistsNoError ¶
func (s HashHelper) HExistsNoError(key, field string) (v *gvar.Var)
func (HashHelper) HScan ¶
func (s HashHelper) HScan(key string, field string, callback func(key string, fieldVals g.MapStrStr) error, count ...int) (err error)
HScan 批量获取field 【注意】field里需要有通配符 比如:a:*
type HashMapIUDHelper ¶ added in v1.0.9
func NewHashMapIUDHelper ¶ added in v1.0.9
func NewHashMapIUDHelper(b *base.Base) *HashMapIUDHelper
type HashStructHelper ¶
func NewHashStructHelper ¶
func NewHashStructHelper[T any](b *base.Base) *HashStructHelper[T]
func (*HashStructHelper[T]) Get ¶
func (s *HashStructHelper[T]) Get(key string) (data *T, err error)
Get 获取数据到结构体 For example:
type User struct { Name string `redis_hash_field:"name"` Age int `redis_hash_field:"age"` }
func (*HashStructHelper[T]) Set ¶
func (s *HashStructHelper[T]) Set(key string, data *T) (err error)
Click to show internal directories.
Click to hide internal directories.