generic

package
v6.3.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 22, 2014 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(collection, item interface{}) bool

func Each

func Each(collection Map, cb Iterator)

func IsMappable

func IsMappable(value interface{}) bool

helper functions

func IsSliceable

func IsSliceable(value interface{}) bool

Types

type ConcreteMap

type ConcreteMap map[interface{}]interface{}

concrete map type

func (*ConcreteMap) Count

func (data *ConcreteMap) Count() int

func (*ConcreteMap) Delete

func (data *ConcreteMap) Delete(key interface{})

func (*ConcreteMap) Except

func (data *ConcreteMap) Except(keys []interface{}) Map

func (*ConcreteMap) Get

func (data *ConcreteMap) Get(key interface{}) interface{}

func (*ConcreteMap) Has

func (data *ConcreteMap) Has(key interface{}) bool

func (*ConcreteMap) IsEmpty

func (data *ConcreteMap) IsEmpty() bool

implementing interface methods

func (*ConcreteMap) IsNil

func (data *ConcreteMap) IsNil(key interface{}) bool

func (*ConcreteMap) Keys

func (data *ConcreteMap) Keys() (keys []interface{})

func (*ConcreteMap) NotNil

func (data *ConcreteMap) NotNil(key interface{}) bool

func (*ConcreteMap) Set

func (data *ConcreteMap) Set(key, value interface{})

func (*ConcreteMap) String

func (data *ConcreteMap) String() string

type Iterator

type Iterator func(key, val interface{})

type Map

type Map interface {
	IsEmpty() bool
	Count() int
	Keys() []interface{}
	Has(key interface{}) bool
	Except(keys []interface{}) Map
	IsNil(key interface{}) bool
	NotNil(key interface{}) bool
	Get(key interface{}) interface{}
	Set(key interface{}, value interface{})
	Delete(key interface{})
	String() string
}

interface declaration

func DeepMerge

func DeepMerge(maps ...Map) Map

func Merge

func Merge(collection, otherCollection Map) Map

func NewMap

func NewMap(data ...interface{}) Map

func Reduce

func Reduce(collections []Map, resultVal Map, cb Reducer) Map

type Reducer

type Reducer func(key, val interface{}, reducedVal Map) Map

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL