base

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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"
)

Variables

This section is empty.

Functions

func SetField

func SetField[T any](t *T, fieldName string, value interface{}) (err error)

SetField 是一个泛型函数,用于设置任何结构体中指定字段的值。

Types

type Base

type Base struct {
	Ctx context.Context
}

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)

func (*GenericsVarStructHelper) Var2ValueByType

func (s *GenericsVarStructHelper) Var2ValueByType(v *g.Var, val reflect.Value, fieldName string, vType string) (err error)

type TransactionHelper

type TransactionHelper struct {
	*Base
}

TransactionHelper Redis Transaction类型助手类

func NewTransactionHelper

func NewTransactionHelper(ctx context.Context) *TransactionHelper

NewTransactionHelper 实例化

func (TransactionHelper) Discard

func (s TransactionHelper) Discard() (v *gvar.Var, err error)

func (TransactionHelper) Exec

func (s TransactionHelper) Exec() (v *gvar.Var, err error)

func (TransactionHelper) Multi

func (s TransactionHelper) Multi() (v *gvar.Var, err error)

func (TransactionHelper) UnWatch

func (s TransactionHelper) UnWatch() (v *gvar.Var, err error)

func (TransactionHelper) Watch

func (s TransactionHelper) Watch(key string) (v *gvar.Var, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL