reflectKit

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package reflectKit Default将默认值应用于零值的struct字段。 本文件引用zzjcool/goutils项目,引用地址为:https://github.com/zzjcool/goutils/blob/main/defaults/defauls.go

Package reflectKit 主要用于生成一个Record

Package reflectKit 反射工具包

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StructDefault

func StructDefault(t interface{}) error

StructDefault 给结构体增加默认值 @param t 结构体 @return 返回错误信息

func StructToMap

func StructToMap(body interface{}) map[string]string

StructToMap 结构体转换为map[string]string @param request 待转换的结构体 @return map[string]string,由于value中类型的可能性太多了,为了防止出口后太麻烦统一为string

Types

type ErrNotAStructPointer

type ErrNotAStructPointer string

ErrNotAStructPointer 一个指向struct的指针,

func (ErrNotAStructPointer) Error

func (e ErrNotAStructPointer) Error() string

Error 实现错误接口

type ErrorUnsettable

type ErrorUnsettable string

ErrorUnsettable 当不能设置字段时使用

func (ErrorUnsettable) Error

func (e ErrorUnsettable) Error() string

Error 实现错误接口

type ErrorUnsupportedType

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

ErrorUnsupportedType 指示结构字段的类型还不是此包中的支持

func (ErrorUnsupportedType) Error

func (e ErrorUnsupportedType) Error() string

Error 实现错误接口

type Record

type Record struct {
}

Jump to

Keyboard shortcuts

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