Documentation ¶
Index ¶
- Constants
- func GetDefaultValue(mode int, valueType reflect.Type) any
- func NewCSVAdapter(structType *RTStruct, value reflect.Value) csv.Adapter
- type CSVAdapter
- func (csva *CSVAdapter) Deref() csv.Adapter
- func (csva *CSVAdapter) Field(index int) csv.Adapter
- func (csva *CSVAdapter) Get() any
- func (csva *CSVAdapter) GetTag(key string) string
- func (csva *CSVAdapter) IsNil() bool
- func (csva *CSVAdapter) IsPointer() bool
- func (csva *CSVAdapter) IsStruct() bool
- func (csva *CSVAdapter) Kind() reflect.Kind
- func (csva *CSVAdapter) New() csv.Adapter
- func (csva *CSVAdapter) NumField() int
- func (csva *CSVAdapter) Set(value any)
- func (csva *CSVAdapter) SetBool(value bool)
- func (csva *CSVAdapter) SetFloat(value float64)
- func (csva *CSVAdapter) SetInt(value int64)
- func (csva *CSVAdapter) SetString(value string)
- func (csva *CSVAdapter) SetUint(value uint64)
- func (csva *CSVAdapter) SetValue(value any)
- type ExtendOption
- type RTField
- func (rvf *RTField) AsStruct() *RTStruct
- func (rtf *RTField) GetTag(name string) (string, bool)
- func (rvf *RTField) IsStruct() bool
- func (rtf *RTField) Name() string
- func (rtf *RTField) RemoveTag(name string)
- func (rtf *RTField) SetTag(name string, value string) *RTField
- func (rtf *RTField) Tags() map[string]string
- type RTStruct
- func (rts *RTStruct) AddField(field *RTField) error
- func (rts *RTStruct) AddFields(fields ...*RTField) error
- func (rts *RTStruct) Extend(extendOptions ...ExtendOption) error
- func (rts *RTStruct) FieldByIndex(index int) *RTField
- func (rts *RTStruct) FieldByName(name string) *RTField
- func (rts *RTStruct) New() *RVStruct
- func (rts *RTStruct) NumField() int
- func (rts *RTStruct) SortedString() string
- func (rts *RTStruct) String() string
- type RVField
- func (rvf *RVField) AsStruct() *RVStruct
- func (rvf *RVField) Get() any
- func (rvf *RVField) IsInterface() bool
- func (rvf *RVField) IsMap() bool
- func (rvf *RVField) IsNil() bool
- func (rvf *RVField) IsPointer() bool
- func (rvf *RVField) IsSlice() bool
- func (rvf *RVField) IsStruct() bool
- func (rvf *RVField) Kind() reflect.Kind
- func (rvf *RVField) Set(value any)
- func (rvf *RVField) String() string
- func (rvf *RVField) ToJson() ([]byte, error)
- func (rvf *RVField) Type() *RTField
- type RVStruct
- func (rvs *RVStruct) FieldByIndex(index int) *RVField
- func (rvs *RVStruct) FieldByName(name string) *RVField
- func (rvs *RVStruct) FieldsListByTag(tag string) []*RVField
- func (rvs *RVStruct) FieldsMapByTag(tag string) map[string]*RVField
- func (rvs *RVStruct) String() string
- func (rvs *RVStruct) ToJson(tag string) ([]byte, error)
- func (rvs *RVStruct) ToMap(tag string) map[string]any
- func (rvs *RVStruct) Type() *RTStruct
Constants ¶
View Source
const ( CommonFlatMode = iota NestedFlatMode )
View Source
const ( ZeroDefaultValueMode = iota NilDefaultValueMode )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSVAdapter ¶
type CSVAdapter struct {
// contains filtered or unexported fields
}
func (*CSVAdapter) Deref ¶
func (csva *CSVAdapter) Deref() csv.Adapter
func (*CSVAdapter) Get ¶
func (csva *CSVAdapter) Get() any
func (*CSVAdapter) GetTag ¶
func (csva *CSVAdapter) GetTag(key string) string
func (*CSVAdapter) IsNil ¶
func (csva *CSVAdapter) IsNil() bool
func (*CSVAdapter) IsPointer ¶
func (csva *CSVAdapter) IsPointer() bool
func (*CSVAdapter) IsStruct ¶
func (csva *CSVAdapter) IsStruct() bool
func (*CSVAdapter) Kind ¶
func (csva *CSVAdapter) Kind() reflect.Kind
func (*CSVAdapter) New ¶
func (csva *CSVAdapter) New() csv.Adapter
func (*CSVAdapter) NumField ¶
func (csva *CSVAdapter) NumField() int
func (*CSVAdapter) Set ¶
func (csva *CSVAdapter) Set(value any)
func (*CSVAdapter) SetBool ¶
func (csva *CSVAdapter) SetBool(value bool)
func (*CSVAdapter) SetFloat ¶
func (csva *CSVAdapter) SetFloat(value float64)
func (*CSVAdapter) SetInt ¶
func (csva *CSVAdapter) SetInt(value int64)
func (*CSVAdapter) SetString ¶
func (csva *CSVAdapter) SetString(value string)
func (*CSVAdapter) SetUint ¶
func (csva *CSVAdapter) SetUint(value uint64)
func (*CSVAdapter) SetValue ¶
func (csva *CSVAdapter) SetValue(value any)
type ExtendOption ¶
type ExtendOption struct { // Value of extend type. Value any // Tag conversion map. Tags map[string]string // Tags prefix map. TagsPrefix map[string]string // Use true to remove all tags modifiers. IsPureTag bool // Uses '.' by default. PrefixDelimiter rune // Makes the nested structure flat. IsFlat bool // Use NestedFlatMode to preserve nesting in tags. FlatMode int // ZeroDefaultValueMode to fill values with zero type values, NilDefaultValueMode to fill all fields with nil. DefaultValueMode int // List of types that will be ignored in nested logic. IgnoreNested []any }
type RTStruct ¶
type RTStruct struct {
// contains filtered or unexported fields
}
func (*RTStruct) Extend ¶
func (rts *RTStruct) Extend(extendOptions ...ExtendOption) error
func (*RTStruct) FieldByIndex ¶
func (*RTStruct) FieldByName ¶
func (*RTStruct) SortedString ¶
type RVField ¶
type RVField struct {
// contains filtered or unexported fields
}
func (*RVField) IsInterface ¶
type RVStruct ¶
type RVStruct struct {
// contains filtered or unexported fields
}
func (*RVStruct) FieldByIndex ¶
func (*RVStruct) FieldByName ¶
func (*RVStruct) FieldsListByTag ¶
func (*RVStruct) FieldsMapByTag ¶
Click to show internal directories.
Click to hide internal directories.