Documentation
¶
Index ¶
- type CollectionConstructor
- func (self CollectionConstructor) All() []Dataset
- func (self CollectionConstructor) Concat(collections ...CollectionConstructor)
- func (self CollectionConstructor) Delete(key string)
- func (self CollectionConstructor) DeleteAll()
- func (self CollectionConstructor) Exists(key string) bool
- func (self CollectionConstructor) Filter(callback func(value interface{}, key string) bool) CollectionConstructor
- func (self CollectionConstructor) Find(callback func(value interface{}, key string) bool) (value interface{}, found bool)
- func (self CollectionConstructor) ForEach(callback func(value interface{}, key string))
- func (self CollectionConstructor) Get(key string) (value interface{}, found bool)
- func (self CollectionConstructor) Keys() []string
- func (self CollectionConstructor) Length() int
- func (self CollectionConstructor) Map(callback func(value interface{}, key string) interface{}) CollectionConstructor
- func (self CollectionConstructor) Random() Dataset
- func (self CollectionConstructor) Set(key string, value interface{})
- func (self CollectionConstructor) Sweep(callback func(value interface{}, key string) bool)
- func (self CollectionConstructor) Values() []interface{}
- type Dataset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CollectionConstructor ¶
type CollectionConstructor struct {
// contains filtered or unexported fields
}
Structure for the collection constructor!
func Collection ¶
func Collection() CollectionConstructor
The main collection function which returns the collection constructor!
func (CollectionConstructor) All ¶
func (self CollectionConstructor) All() []Dataset
Returns an array of datasets containing all the registered keys and values!
func (CollectionConstructor) Concat ¶
func (self CollectionConstructor) Concat(collections ...CollectionConstructor)
Adds all the keys and values of other collections too!
func (CollectionConstructor) Delete ¶
func (self CollectionConstructor) Delete(key string)
Deletes the value by the key
func (CollectionConstructor) DeleteAll ¶
func (self CollectionConstructor) DeleteAll()
Deletes everything what is registered!
func (CollectionConstructor) Exists ¶
func (self CollectionConstructor) Exists(key string) bool
Returns a boolean stating the key is registered or not!
func (CollectionConstructor) Filter ¶
func (self CollectionConstructor) Filter(callback func(value interface{}, key string) bool) CollectionConstructor
Runs the callback on every registered key and value. Sends a new collection with the datasets which have passed the callback!
func (CollectionConstructor) Find ¶
func (self CollectionConstructor) Find(callback func(value interface{}, key string) bool) (value interface{}, found bool)
Runs the callback function with each registered key and value. If any dataset passes the test will return that key and value else will return false in the found tupule!
func (CollectionConstructor) ForEach ¶
func (self CollectionConstructor) ForEach(callback func(value interface{}, key string))
Runs the callback function with each registered key and value
func (CollectionConstructor) Get ¶
func (self CollectionConstructor) Get(key string) (value interface{}, found bool)
Returns the value of the key but in tupule in the form of (value, found). Found will be a boolean stating is the value found or not. Value will be nil if no id has been registered already!
func (CollectionConstructor) Keys ¶
func (self CollectionConstructor) Keys() []string
Returns an array of strings containing all registered keys!
func (CollectionConstructor) Length ¶
func (self CollectionConstructor) Length() int
Returns the number of keys registered!
func (CollectionConstructor) Map ¶
func (self CollectionConstructor) Map(callback func(value interface{}, key string) interface{}) CollectionConstructor
Runs the callback on every registered key and value. Replaces the values of each key with the value returned by the callback!
func (CollectionConstructor) Random ¶
func (self CollectionConstructor) Random() Dataset
Returns a random dataset from CollectionConstructor.All()! If not even 1 key is registered will return "Dataset{ "nil", nil }"
func (CollectionConstructor) Set ¶
func (self CollectionConstructor) Set(key string, value interface{})
Sets a value for the key!
func (CollectionConstructor) Sweep ¶
func (self CollectionConstructor) Sweep(callback func(value interface{}, key string) bool)
Runs the callback on every registered key and value. If it fails the callback, will delete it from the cache!
func (CollectionConstructor) Values ¶
func (self CollectionConstructor) Values() []interface{}
Returns an array of registered values!