Documentation ¶
Index ¶
- Constants
- func ExpandInterface(val interface{}) []interface{}
- func FillEmbededStructValue(container reflect.Value, embed reflect.Value) bool
- func FindAnonymouStructPointer(data interface{}, targetPtr interface{}) error
- func FindStructFieldInterface(dataValue reflect.Value, name string) (interface{}, bool)
- func FindStructFieldValue(dataValue reflect.Value, name string) (reflect.Value, bool)
- func SetStructFieldValue(structValue reflect.Value, fieldName string, val reflect.Value) bool
- func StructContains(type1 reflect.Type, type2 reflect.Type) bool
- type SEmbedStructFieldValue
- type SStructFieldInfo
- type SStructFieldValue
- type SStructFieldValueSet
- func FetchAllStructFieldValueSet(dataValue reflect.Value) SStructFieldValueSet
- func FetchAllStructFieldValueSetForWrite(dataValue reflect.Value) SStructFieldValueSet
- func FetchStructFieldValueSet(dataValue reflect.Value) SStructFieldValueSet
- func FetchStructFieldValueSetForWrite(dataValue reflect.Value) SStructFieldValueSet
- func (set SStructFieldValueSet) GetInterface(name string) (interface{}, bool)
- func (fields SStructFieldValueSet) GetStructFieldIndex(name string) int
- func (fields SStructFieldValueSet) GetStructFieldIndexes(name string) []int
- func (fields SStructFieldValueSet) GetStructFieldIndexes2(name string, strictMode bool) []int
- func (fields SStructFieldValueSet) GetStructFieldIndexesMap() map[string][]int
- func (set SStructFieldValueSet) GetValue(name string) (reflect.Value, bool)
Constants ¶
View Source
const ( TAG_AMBIGUOUS_PREFIX = "yunion-ambiguous-prefix" TAG_DEPRECATED_BY = "yunion-deprecated-by" TAG_OLD_DEPRECATED_BY = "deprecated-by" )
Variables ¶
This section is empty.
Functions ¶
func ExpandInterface ¶
func ExpandInterface(val interface{}) []interface{}
func FillEmbededStructValue ¶
func FindAnonymouStructPointer ¶
func FindAnonymouStructPointer(data interface{}, targetPtr interface{}) error
func FindStructFieldValue ¶
func SetStructFieldValue ¶
Types ¶
type SEmbedStructFieldValue ¶ added in v1.10.0
type SStructFieldInfo ¶
type SStructFieldInfo struct { // True if the field has json tag `json:"-"` Ignore bool OmitEmpty bool OmitFalse bool OmitZero bool // Name can take the following values, in descreasing preference // // 1. value of "name" tag, e.g. `name:"a-name"` // 2. name of "json" tag, when it's not for ignoration // 3. kebab form of FieldName concatenated with "_" when Ignore is false // 4. empty string Name string FieldName string ForceString bool Tags map[string]string // contains filtered or unexported fields }
SStructFieldInfo describes struct field, especially behavior for (json) marshal
This struct has unexported fields initialized by exported functions in this package. Do not construct a literal or modify the exported fields in an unmanaged way
func ParseFieldJsonInfo ¶
func ParseFieldJsonInfo(name string, tag reflect.StructTag) SStructFieldInfo
func ParseStructFieldJsonInfo ¶
func ParseStructFieldJsonInfo(sf reflect.StructField) SStructFieldInfo
func (*SStructFieldInfo) MarshalName ¶
func (info *SStructFieldInfo) MarshalName() string
MarshalName returns Name when it's not empty, otherwise it returns kebab form of the field name concatenated with "_"
type SStructFieldValue ¶
type SStructFieldValue struct { Info *SStructFieldInfo Value reflect.Value Parent *SEmbedStructFieldValue }
type SStructFieldValueSet ¶
type SStructFieldValueSet []SStructFieldValue
func FetchAllStructFieldValueSet ¶
func FetchAllStructFieldValueSet(dataValue reflect.Value) SStructFieldValueSet
func FetchAllStructFieldValueSetForWrite ¶
func FetchAllStructFieldValueSetForWrite(dataValue reflect.Value) SStructFieldValueSet
func FetchStructFieldValueSet ¶
func FetchStructFieldValueSet(dataValue reflect.Value) SStructFieldValueSet
func FetchStructFieldValueSetForWrite ¶
func FetchStructFieldValueSetForWrite(dataValue reflect.Value) SStructFieldValueSet
func (SStructFieldValueSet) GetInterface ¶
func (set SStructFieldValueSet) GetInterface(name string) (interface{}, bool)
func (SStructFieldValueSet) GetStructFieldIndex ¶
func (fields SStructFieldValueSet) GetStructFieldIndex(name string) int
func (SStructFieldValueSet) GetStructFieldIndexes ¶
func (fields SStructFieldValueSet) GetStructFieldIndexes(name string) []int
func (SStructFieldValueSet) GetStructFieldIndexes2 ¶
func (fields SStructFieldValueSet) GetStructFieldIndexes2(name string, strictMode bool) []int
func (SStructFieldValueSet) GetStructFieldIndexesMap ¶
func (fields SStructFieldValueSet) GetStructFieldIndexesMap() map[string][]int
Click to show internal directories.
Click to hide internal directories.