Documentation
¶
Index ¶
- func Int16Slice(s interface{}) []int16
- func Int32Slice(s interface{}) []int32
- func Int64Slice(s interface{}) []int64
- func Int8Slice(s interface{}) []int8
- func IntSlice(s interface{}) []int
- func KeysIntOfMap(m interface{}) []int64
- func KeysOfMap(m interface{}) []string
- func StructStringSlice(s interface{}, fieldName string) []string
- func StructsInt64Slice(s interface{}, fieldName string) []int64
- func StructsIntSlice(s interface{}, fieldName string) []int
- func StructsUint64Slice(s interface{}, fieldName string) []uint64
- func StructsUintSlice(s interface{}, fieldName string) []uint
- func Uint16Slice(s interface{}) []uint16
- func Uint32Slice(s interface{}) []uint32
- func Uint64Slice(s interface{}) []uint64
- func Uint8Slice(s interface{}) []uint8
- func UintSlice(s interface{}) []uint
- type Slice
- func (sf *Slice) Int16Slice() []int16
- func (sf *Slice) Int32Slice() []int32
- func (sf *Slice) Int64Slice() []int64
- func (sf *Slice) Int8Slice() []int8
- func (sf *Slice) IntSlice() []int
- func (sf *Slice) Name() string
- func (sf *Slice) StructInt64Slice(fieldName string) []int64
- func (sf *Slice) StructIntSlice(fieldName string) []int
- func (sf *Slice) StructStringSlice(fieldName string) []string
- func (sf *Slice) StructUint64Slice(fieldName string) []uint64
- func (sf *Slice) StructUintSlice(fieldName string) []uint
- func (sf *Slice) Uint16Slice() []uint16
- func (sf *Slice) Uint32Slice() []uint32
- func (sf *Slice) Uint64Slice() []uint64
- func (sf *Slice) Uint8Slice() []uint8
- func (sf *Slice) UintSlice() []uint
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Int16Slice ¶
func Int16Slice(s interface{}) []int16
Int16Slice returns a slice of int16. For more info refer to Slice types Int16Slice() method.
func Int32Slice ¶
func Int32Slice(s interface{}) []int32
Int32Slice returns a slice of int32. For more info refer to Slice types Int32Slice() method.
func Int64Slice ¶
func Int64Slice(s interface{}) []int64
Int64Slice returns a slice of int64. For more info refer to Slice types Int64Slice() method.
func Int8Slice ¶
func Int8Slice(s interface{}) []int8
Int8Slice returns a slice of int8. For more info refer to Slice types Int8Slice() method.
func IntSlice ¶
func IntSlice(s interface{}) []int
IntSlice returns a slice of int. For more info refer to Slice types IntSlice() method.
func KeysIntOfMap ¶
func KeysIntOfMap(m interface{}) []int64
KeysIntOfMap 获取map m的key的切片,要求m为map且key为数值 (int,int8,int16,int32,int64,uint,uint8,uint16,uint32,uint64).
func KeysOfMap ¶
func KeysOfMap(m interface{}) []string
KeysOfMap 获取map m的key的切片,要求m为map且key为字符串(string).
func StructStringSlice ¶
StructStringSlice returns a slice of int64. For more info refer to Slice types StructStringSlice() method.
func StructsInt64Slice ¶
StructsInt64Slice returns a slice of int64. For more info refer to Slice types StructInt64Slice() method.
func StructsIntSlice ¶
StructsIntSlice returns a slice of int. For more info refer to Slice types StructIntSlice() method.
func StructsUint64Slice ¶
StructsUint64Slice returns a slice of int64. For more info refer to Slice types StructUint64Slice() method.
func StructsUintSlice ¶
StructsUintSlice returns a slice of int. For more info refer to Slice types v() method.
func Uint16Slice ¶
func Uint16Slice(s interface{}) []uint16
Uint16Slice returns a slice of uint16. For more info refer to Slice types Uint16Slice() method.
func Uint32Slice ¶
func Uint32Slice(s interface{}) []uint32
Uint32Slice returns a slice of uint32. For more info refer to Slice types Uint32Slice() method.
func Uint64Slice ¶
func Uint64Slice(s interface{}) []uint64
Uint64Slice returns a slice of uint64. For more info refer to Slice types Uint64Slice() method.
func Uint8Slice ¶
func Uint8Slice(s interface{}) []uint8
Uint8Slice returns a slice of uint8. For more info refer to Slice types Uint8Slice() method.
Types ¶
type Slice ¶
type Slice struct {
// contains filtered or unexported fields
}
Slice hold a slice reflect.value
func NewSlice ¶
func NewSlice(s interface{}) *Slice
NewSlice returns a new *Slice with the slice s. It panics if the s's kind is not slice.
func (*Slice) Int16Slice ¶
Int16Slice extracts the given s slice's every element, which is integer or float, to []int16 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Int32Slice ¶
Int32Slice extracts the given s slice's every element, which is integer or float, to []int32 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Int64Slice ¶
Int64Slice extracts the given s slice's every element, which is integer or float, to []int64 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Int8Slice ¶
Int8Slice extracts the given s slice's every element, which is integer or float, to []int8 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) IntSlice ¶
IntSlice extracts the given s slice's every element, which is integer or float, to []int by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Name ¶
Name returns the slice's type name within its package. For more info refer to Name() function.
func (*Slice) StructInt64Slice ¶
StructInt64Slice extracts the given s slice's every element, which is struct, to []int64 by the field. It panics if the s's element is not struct, or field is not exits, or the value of field is not integer.
func (*Slice) StructIntSlice ¶
StructIntSlice extracts the given s slice's every element, which is struct, to []int by the field. It panics if the s's element is not struct, or field is not exits, or the value of field is not integer.
func (*Slice) StructStringSlice ¶
StructStringSlice extracts the given s slice's every element, which is struct, to []string by the field. It panics if the s's element is not struct, or field is not exits, or the value of field is not integer or string.
func (*Slice) StructUint64Slice ¶
StructUint64Slice extracts the given s slice's every element, which is struct, to []int64 by the field. It panics if the s's element is not struct, or field is not exits, or the value of field is not integer.
func (*Slice) StructUintSlice ¶
StructUintSlice extracts the given s slice's every element, which is struct, to []uint by the field. It panics if the s's element is not struct, or field is not exits, or the value of field is not integer.
func (*Slice) Uint16Slice ¶
Uint16Slice extracts the given s slice's every element, which is integer or float, to []uint16 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Uint32Slice ¶
Uint32Slice extracts the given s slice's every element, which is integer or float, to []uint32 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Uint64Slice ¶
Uint64Slice extracts the given s slice's every element, which is integer or float, to []uint64 by the field. It panics if the s's element is not integer or float, or field is not invalid.
func (*Slice) Uint8Slice ¶
Uint8Slice extracts the given s slice's every element, which is integer or float, to []uint8 by the field. It panics if the s's element is not integer or float, or field is not invalid.
type Values ¶
Values maps a string key to a list of values. It is typically used for query parameters and form values. Unlike in the http.Header map, the keys in a Values map are case-sensitive.
func ParseValue ¶
ParseValue parses the URL-encoded query string and returns a map listing the values specified for each key. ParseQuery always returns a non-nil map containing all the valid query parameters found; err describes the first decoding error encountered, if any.
func (Values) Add ¶
Add adds the value to key. It appends to any existing values associated with key.
func (Values) Encode ¶
Encode encodes the values into form (separator="=" delimiter="&") ("bar=baz&foo=quux") sorted by key.