Documentation ¶
Index ¶
- func AllFieldTags(req interface{}, key string) []string
- func AllTagsValues(req interface{}, key string) map[string]interface{}
- func IsZeroValue(v reflect.Value) bool
- func NonzeroFieldTags(req interface{}, key string) []string
- func ReflectValue(valueType string, value interface{}) (reflect.Value, error)
- func RetrieveStructField(req interface{}, name string) string
- func TruncateBytes(req interface{}) interface{}
- func TrySetStructFiled(req interface{}, name, value string)
- type ErrUnsupportedType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFieldTags ¶ added in v0.0.34
func AllTagsValues ¶ added in v0.0.34
only get export Fields
func IsZeroValue ¶ added in v0.0.33
cmd/compile/internal/gc/dump.go
func NonzeroFieldTags ¶ added in v0.0.33
req must be struct(Not pointer to struct), or return nil(tt.Field() will panic) key for tag , db or json, if key is empty, use field name instead
func ReflectValue ¶ added in v0.0.60
ReflectValue converts interface{} to reflect.Value based on string type
func RetrieveStructField ¶
func TruncateBytes ¶ added in v0.0.57
func TruncateBytes(req interface{}) interface{}
https://stackoverflow.com/questions/6395076/using-reflect-how-do-you-set-the-value-of-a-struct-field truncate []byte, [][]byte, not support others, eg: [][][]byte struct must use pointer of sturct, or not rewrite it
func TrySetStructFiled ¶
func TrySetStructFiled(req interface{}, name, value string)
Types ¶
type ErrUnsupportedType ¶ added in v0.0.60
type ErrUnsupportedType struct {
// contains filtered or unexported fields
}
ErrUnsupportedType ...
func NewErrUnsupportedType ¶ added in v0.0.60
func NewErrUnsupportedType(valueType string) ErrUnsupportedType
NewErrUnsupportedType returns new ErrUnsupportedType
func (ErrUnsupportedType) Error ¶ added in v0.0.60
func (e ErrUnsupportedType) Error() string
Error method so we implement the error interface
Click to show internal directories.
Click to hide internal directories.