struct_to_map

package
v0.0.0-...-9b1b795 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TagName = "json"
)

Variables

View Source
var (
	ErrParam    = errors.New("参数不正确")
	ErrNotFound = errors.New("查询结果为0")
)
View Source
var (
	Nil = []byte("null")
)

Functions

func Decode

func Decode(dst interface{}, data map[string]string) error

func Encode

func Encode(data interface{}) []interface{}

func EncodeEle

func EncodeEle(data interface{}) bool

func Find

func Find(ctx context.Context, redisClient redis.Cmdable, dst interface{}, key string, fields []string) error

func GetTagByField

func GetTagByField(field reflect.StructField, fieldTag string) string

func Storge

func Storge(ctx context.Context, redisClient redis.Cmdable, key string, data ...interface{}) error

Types

type StructValue

type StructValue struct {
	// contains filtered or unexported fields
}

func Struct

func Struct(dst interface{}) (StructValue, error)

func (StructValue) Scan

func (s StructValue) Scan(key string, value string) error

Jump to

Keyboard shortcuts

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