Documentation ¶
Index ¶
- type Callback
- type Collection
- func (c *Collection) All() []interface{}
- func (c *Collection) Count() int
- func (c *Collection) Delete(key interface{})
- func (c *Collection) Foreach() <-chan Item
- func (c *Collection) Get(key interface{}) interface{}
- func (c *Collection) Has(key interface{}) bool
- func (c *Collection) Keys() []interface{}
- func (c *Collection) Map(callback Callback) *Collection
- func (c *Collection) Set(key interface{}, value interface{})
- func (c *Collection) Transform(callback Callback)
- type Item
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Callback ¶
type Callback func(item interface{}, key interface{}) interface{}
Callback is a function that will be accepted on iterate methods.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection struct.
func NewWithItems ¶
func NewWithItems(items map[interface{}]interface{}) *Collection
NewWithItems to init collection with the set of items.
func (*Collection) Foreach ¶
func (c *Collection) Foreach() <-chan Item
Foreach iterates through collection via a channel. Returns Item struct for every iteration.
func (*Collection) Map ¶
func (c *Collection) Map(callback Callback) *Collection
Map iterates through collection, applying callback function on every item. Returns new instance.
func (*Collection) Transform ¶
func (c *Collection) Transform(callback Callback)
Transform iterates through collection, applying callback function on every item. Rather then Map method, transform changes collection itself.
Click to show internal directories.
Click to hide internal directories.