Documentation ¶
Index ¶
- type Var
- func (that *Var) Array() []interface{}
- func (that *Var) Bool() bool
- func (that *Var) Bytes() []byte
- func (that *Var) Clone() *Var
- func (that *Var) Duration() time.Duration
- func (that *Var) Float32() float32
- func (that *Var) Float32s() []float32
- func (that *Var) Float64() float64
- func (that *Var) Float64s() []float64
- func (that *Var) Floats() []float64
- func (that *Var) GTime(format ...string) *dtime.Time
- func (that *Var) Int() int
- func (that *Var) Int16() int16
- func (that *Var) Int32() int32
- func (that *Var) Int64() int64
- func (that *Var) Int64s() []int64
- func (that *Var) Int8() int8
- func (that *Var) Interface() interface{}
- func (that *Var) Interfaces() []interface{}
- func (that *Var) Ints() []int
- func (that *Var) IsEmpty() bool
- func (that *Var) IsFloat() bool
- func (that *Var) IsInt() bool
- func (that *Var) IsMap() bool
- func (that *Var) IsNil() bool
- func (that *Var) IsSlice() bool
- func (that *Var) IsStruct() bool
- func (that *Var) IsUint() bool
- func (that *Var) ListItemValues(key interface{}) (values []interface{})
- func (that *Var) ListItemValuesUnique(key string) []interface{}
- func (that *Var) Map(tags ...string) map[string]interface{}
- func (that *Var) MapDeep(tags ...string) map[string]interface{}
- func (that *Var) MapStrAny() map[string]interface{}
- func (that *Var) MapStrStr(tags ...string) map[string]string
- func (that *Var) MapStrStrDeep(tags ...string) map[string]string
- func (that *Var) MapStrVar(tags ...string) map[string]*Var
- func (that *Var) MapStrVarDeep(tags ...string) map[string]*Var
- func (that *Var) MapToMap(pointer interface{}, mapping ...map[string]string) (err error)
- func (that *Var) MapToMaps(pointer interface{}, mapping ...map[string]string) (err error)
- func (that *Var) MapToMapsDeep(pointer interface{}, mapping ...map[string]string) (err error)
- func (that *Var) Maps(tags ...string) []map[string]interface{}
- func (that *Var) MarshalJSON() ([]byte, error)
- func (that *Var) Scan(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) ScanDeep(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) Set(value interface{}) (old interface{})
- func (that *Var) Slice() []interface{}
- func (that *Var) String() string
- func (that *Var) Strings() []string
- func (that *Var) Struct(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) StructDeep(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) Structs(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) StructsDeep(pointer interface{}, mapping ...map[string]string) error
- func (that *Var) Time(format ...string) time.Time
- func (that *Var) Uint() uint
- func (that *Var) Uint16() uint16
- func (that *Var) Uint32() uint32
- func (that *Var) Uint64() uint64
- func (that *Var) Uint64s() []uint64
- func (that *Var) Uint8() uint8
- func (that *Var) Uints() []uint
- func (that *Var) UnmarshalJSON(b []byte) error
- func (that *Var) UnmarshalValue(value interface{}) error
- func (that *Var) Val() interface{}
- func (that *Var) Vars() []*Var
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Var ¶
type Var struct {
// contains filtered or unexported fields
}
func (*Var) Array ¶ added in v0.0.9
func (that *Var) Array() []interface{}
Array is alias of Interfaces.
func (*Var) Duration ¶ added in v0.0.3
Duration converts and returns <v> as time.Duration. If value of <v> is string, then it uses time.ParseDuration for conversion.
func (*Var) GTime ¶ added in v0.0.9
GTime converts and returns <v> as *gtime.Time. The parameter <format> specifies the format of the time string using gtime, eg: Y-m-d H:i:s.
func (*Var) Interfaces ¶ added in v0.0.9
func (that *Var) Interfaces() []interface{}
Interfaces converts and returns <v> as []interfaces{}.
func (*Var) ListItemValues ¶ added in v0.0.9
func (that *Var) ListItemValues(key interface{}) (values []interface{})
ListItemValues 检索并返回键值为<键值>的所有item struct/map的元素。 注意,参数应该是包含map或struct元素的slice类型,否则返回一个空的slice。
func (*Var) ListItemValuesUnique ¶ added in v0.0.9
ListItemValuesUnique 检索并返回所有struct/map中key 的唯一元素。 注意参数应该是包含map或struct元素的slice类型,否则返回一个空的slice。
func (*Var) MapStrStrDeep ¶ added in v0.0.9
MapStrStrDeep 返回var转换成map[string]string
func (*Var) MapStrVarDeep ¶ added in v0.0.9
MapStrVarDeep 返回var转换成 map[string]*Var
func (*Var) MapToMap ¶ added in v0.0.9
MapToMap converts any map type variable <params> to another map type variable <pointer>. See gconv.MapToMap.
func (*Var) MapToMaps ¶ added in v0.0.9
MapToMaps converts any map type variable <params> to another map type variable <pointer>. See gconv.MapToMaps.
func (*Var) MapToMapsDeep ¶ added in v0.0.9
MapToMapsDeep converts any map type variable <params> to another map type variable <pointer> recursively. See gconv.MapToMapsDeep.
func (*Var) MarshalJSON ¶
MarshalJSON implements the interface MarshalJSON for json.Marshal.
func (*Var) Scan ¶ added in v0.0.9
Scan automatically calls Struct or Structs function according to the type of parameter <pointer> to implement the converting. It calls function Struct if <pointer> is type of *struct/**struct to do the converting. It calls function Structs if <pointer> is type of *[]struct/*[]*struct to do the converting.
func (*Var) ScanDeep ¶ added in v0.0.9
ScanDeep automatically calls StructDeep or StructsDeep function according to the type of parameter <pointer> to implement the converting. It calls function StructDeep if <pointer> is type of *struct/**struct to do the converting. It calls function StructsDeep if <pointer> is type of *[]struct/*[]*struct to do the converting.
func (*Var) Slice ¶ added in v0.0.9
func (that *Var) Slice() []interface{}
Slice is alias of Interfaces.
func (*Var) Struct ¶ added in v0.0.9
Struct maps value of <v> to <pointer>. The parameter <pointer> should be a pointer to a struct instance. The parameter <mapping> is used to specify the key-to-attribute mapping rules.
func (*Var) StructDeep ¶ added in v0.0.9
StructDeep maps value of <v> to <pointer> recursively. The parameter <pointer> should be a pointer to a struct instance. The parameter <mapping> is used to specify the key-to-attribute mapping rules. Deprecated, use Struct instead.
func (*Var) StructsDeep ¶ added in v0.0.9
StructsDeep converts and returns <v> as given struct slice recursively. Deprecated, use Struct instead.
func (*Var) Time ¶ added in v0.0.9
Time converts and returns <v> as time.Time. The parameter <format> specifies the format of the time string using gtime, eg: Y-m-d H:i:s.
func (*Var) UnmarshalJSON ¶
UnmarshalJSON implements the interface UnmarshalJSON for json.Unmarshal.
func (*Var) UnmarshalValue ¶
UnmarshalValue is an interface implement which sets any type of value for Var.