Documentation ¶
Index ¶
- Constants
- func SetField[T any](t *T, fieldName string, value interface{}) (err error)
- type Base
- type GenericsVarStructHelper
- type TransactionHelper
- func (s TransactionHelper) Discard() (v *gvar.Var, err error)
- func (s TransactionHelper) Exec() (v *gvar.Var, err error)
- func (s TransactionHelper) Multi() (v *gvar.Var, err error)
- func (s TransactionHelper) UnWatch() (v *gvar.Var, err error)
- func (s TransactionHelper) Watch(key string) (v *gvar.Var, err error)
Constants ¶
View Source
const ( ValueTypeInt = "int" ValueTypeInt8 = "int8" ValueTypeInt16 = "int16" ValueTypeInt32 = "int32" ValueTypeInt64 = "int64" ValueTypeUint = "uint" ValueTypeUint8 = "uint8" ValueTypeUint16 = "uint16" ValueTypeUint32 = "uint32" ValueTypeUint64 = "uint64" ValueTypeFloat32 = "float32" ValueTypeFloat64 = "float64" ValueTypeBool = "bool" ValueTypeString = "string" ValueTypeTime = "time.Time" ValueTypeTimeP = "*time.Time" ValueTypeGTime = "gtime.Time" ValueTypeGTimeP = "*gtime.Time" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GenericsVarStructHelper ¶
type GenericsVarStructHelper struct { }
GenericsVarStructHelper 泛型值转换
func NewGenericsVarStructHelper ¶
func NewGenericsVarStructHelper() *GenericsVarStructHelper
func (*GenericsVarStructHelper) Reflect2ValueByType ¶
func (s *GenericsVarStructHelper) Reflect2ValueByType(val reflect.Value, fieldName string, vType string) (value interface{}, err error)
Reflect2ValueByType 反射获取值 用于写入redis 需将特殊类型转换字符串或整形时间戳等 总之必须是Redis支持的类型 其实最终都是string
func (*GenericsVarStructHelper) Var2ValueByType ¶
func (s *GenericsVarStructHelper) Var2ValueByType(v *g.Var, val reflect.Value, fieldName string, vType string) (err error)
Var2ValueByType 反射将 gvar.Var 转换为结构体字段的值
type TransactionHelper ¶
type TransactionHelper struct {
*Base
}
TransactionHelper Redis Transaction类型助手类
func NewTransactionHelper ¶
func NewTransactionHelper(base *Base) *TransactionHelper
NewTransactionHelper 实例化
Click to show internal directories.
Click to hide internal directories.