Collections
parody of some of the basic python core features (collections package)
Install / Use
/learn @marcsantiago/CollectionsREADME
collections
import "github.com/marcsantiago/collections"
<a name="pkg-overview">Overview</a>
<a name="pkg-index">Index</a>
- func StringEncoder(encoder *bytes.Buffer, data Data, t Type)
- type CounterMap
- type Data
- type Element
- type ElementsByKeyIntAsc
- type ElementsByKeyIntDesc
- type ElementsByKeyStringAsc
- type ElementsByKeyStringDesc
- type ElementsByValueIntAsc
- type ElementsByValueIntDesc
- type ElementsByValueStringAsc
- type ElementsByValueStringDesc
- type FloatValue32
- type FloatValue64
- type FloatValues32
- type FloatValues64
- type GenericMap
- func NewGenericMap() GenericMap
- func (i GenericMap) Delete(key Data)
- func (i GenericMap) Get(key Data) (Data, bool)
- func (i GenericMap) Items() []Element
- func (i GenericMap) Iterate() <-chan Element
- func (i GenericMap) Len() int
- func (i GenericMap) Set(key Data, value Data)
- func (i GenericMap) String() string
- type IntValue
- type IntValue32
- type IntValue64
- type IntValues
- type IntValues32
- type IntValues64
- type Iterable
- type Map
- type RuneValue
- type RuneValues
- type StringValue
- type StringValues
- type Type
<a name="pkg-files">Package files</a>
data.go element_sorters.go generic_map.go interable.go map.go primitive_conversions.go string_encoder.go types.go
<a name="StringEncoder">func</a> StringEncoder
func StringEncoder(encoder *bytes.Buffer, data Data, t Type)
StringEncoder writes data into a bytes buffer, used in the String method
<a name="CounterMap">type</a> CounterMap
type CounterMap interface {
Map
MostCommon(n int) []Element
Subtract(value Data)
Update(value Data)
}
CounterMap mimics the Python Counter definitions this also implements the collections.Map interface to be able to convert into a ChainMap
<a name="Data">type</a> Data
type Data interface {
Int() int
Int32() int32
Int64() int64
Float32() float32
Float64() float64
String() string
}
Data interface for casting and getting data values used to avoid reflection
<a name="Element">type</a> Element
type Element struct {
Key Data
Value Data
}
Element represents (key, value) with backed by the Data interface
<a name="ElementsByKeyIntAsc">type</a> ElementsByKeyIntAsc
type ElementsByKeyIntAsc []Element
ElementsByKeyIntAsc used to used low to high where key is of type string
<a name="ElementsByKeyIntAsc.Len">func</a> (ElementsByKeyIntAsc) Len
func (e ElementsByKeyIntAsc) Len() int
<a name="ElementsByKeyIntAsc.Less">func</a> (ElementsByKeyIntAsc) Less
func (e ElementsByKeyIntAsc) Less(i, j int) bool
<a name="ElementsByKeyIntAsc.Swap">func</a> (ElementsByKeyIntAsc) Swap
func (e ElementsByKeyIntAsc) Swap(i, j int)
<a name="ElementsByKeyIntDesc">type</a> ElementsByKeyIntDesc
type ElementsByKeyIntDesc []Element
ElementsByKeyIntDesc used to used high to low where key is of type string
<a name="ElementsByKeyIntDesc.Len">func</a> (ElementsByKeyIntDesc) Len
func (e ElementsByKeyIntDesc) Len() int
