Documentation
¶
Index ¶
- type Collection
- func (a *Collection) AddMap(key interface{}, value interface{}) *Collection
- func (a *Collection) Exists(key string) bool
- func (a *Collection) First() interface{}
- func (a *Collection) Get(key interface{}) interface{}
- func (a *Collection) Has(key string) bool
- func (a *Collection) Index(key int) interface{}
- func (a *Collection) IsValid() bool
- func (a *Collection) Last() interface{}
- func (a *Collection) Only(values ...interface{}) interface{}
- func (a *Collection) ToBytes() []byte
- func (a *Collection) ToJson() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
Data interface{}
}
create a type of array with array data
func (*Collection) AddMap ¶
func (a *Collection) AddMap(key interface{}, value interface{}) *Collection
add a map into array data
func (*Collection) Exists ¶
func (a *Collection) Exists(key string) bool
check exists index of array data
func (*Collection) Get ¶
func (a *Collection) Get(key interface{}) interface{}
get a index from map array data
func (*Collection) Has ¶
func (a *Collection) Has(key string) bool
check array has key in slice and map array data
func (*Collection) Index ¶
func (a *Collection) Index(key int) interface{}
get index from slice array data
func (*Collection) Only ¶
func (a *Collection) Only(values ...interface{}) interface{}
get only keys need in one array in return
func (*Collection) ToBytes ¶
func (a *Collection) ToBytes() []byte
Convert the given data to json string bytes
func (*Collection) ToJson ¶
func (a *Collection) ToJson() string
Convert the given data to json string
Click to show internal directories.
Click to hide internal directories.