Documentation ¶
Overview ¶
Package zarray provides array operations
Index ¶
- func GetInterface(arr []interface{}, index int, def ...interface{}) (value interface{}, err error)
- type Array
- func (array *Array) Add(index int, value interface{}) (err error)
- func (array *Array) CapLength() int
- func (array *Array) Clear()
- func (array *Array) Contains(value interface{}) bool
- func (array *Array) Format() (format string)
- func (array *Array) Get(index int, def ...interface{}) (value interface{}, err error)
- func (array *Array) Index(value interface{}) int
- func (array *Array) IsEmpty() bool
- func (array *Array) Length() int
- func (array *Array) Map(fn func(interface{}) interface{}) *Array
- func (array *Array) Pop() (interface{}, error)
- func (array *Array) Push(values ...interface{})
- func (array *Array) Raw() []interface{}
- func (array *Array) Remove(index int, l ...int) (value []interface{}, err error)
- func (array *Array) RemoveValue(value interface{}) (e interface{}, err error)
- func (array *Array) Set(index int, value interface{}) (err error)
- func (array *Array) Shift() (interface{}, error)
- func (array *Array) Unshift(value interface{}) error
- type DefData
- func (kv DefData) Bool(name string, defaultValue bool) bool
- func (kv DefData) Float64(name string, defaultValue float64) float64
- func (kv DefData) FuncSingle(name string, defaultValue func()) func()
- func (kv DefData) Int(name string, defaultValue int) int
- func (kv DefData) String(name string, defaultValue string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetInterface ¶
GetInterface 获取 []interface{} 对应 index 位置的元素
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
Array 数组的插入、删除、按照下标随机访问操作,数据是interface类型的
func (*Array) RemoveValue ¶
RemoveValue 从数组中删除指定元素
Click to show internal directories.
Click to hide internal directories.