reflectKit

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: MIT Imports: 4 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 StructToMapSI added in v0.0.8

func StructToMapSI(v interface{}) map[string]interface{}

StructToMapSI 结构体转换为map[string]string @param v 待转换的结构体 @return map[string]interface

func StructToMapSS added in v0.0.8

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

StructToMapSS 结构体转换为map[string]string @param request 待转换的结构体 @return 通常在参数上使用

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