Documentation ¶
Index ¶
- Constants
- Variables
- type Byteser
- type Entry
- type HashMap
- type IntHashMap
- type List
- func (l *List) Append(val interface{}) *List
- func (l *List) Each(f func(i interface{}))
- func (l *List) End() bool
- func (l *List) Filter(f func(*List) bool) *List
- func (l *List) Index(i int) (interface{}, error)
- func (l *List) Len() int
- func (l *List) Next() *List
- func (l *List) Prepend(val interface{}) *List
- func (l *List) String() string
- func (l *List) Val() interface{}
- type TNode
- type Trie
- func (t *Trie) Del(key []byte) (*Trie, interface{})
- func (t *Trie) Each(f func([]byte, interface{}))
- func (t *Trie) Get(key []byte) (interface{}, bool)
- func (t *Trie) Keys() [][]byte
- func (t *Trie) Put(key []byte, val interface{}) *Trie
- func (t *Trie) Size() int
- func (t *Trie) Values() []interface{}
- type UintHashMap
- type Vector
Constants ¶
const ( Int = iota UInt Float String )
Variables ¶
var (
IndexOutOfRange = errors.New("index out of range")
)
Functions ¶
This section is empty.
Types ¶
type Byteser ¶
type Byteser interface {
Bytes() []byte
}
Byteser returns the []bytes representation of the type. Note this does not need to be able to be decoded, just needs to be a unique identifier for the value.
type Entry ¶
type Entry struct {
// contains filtered or unexported fields
}
A TNodeKey stores both the hashed value and the key that created the value
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
HashMap maps anything to anything using the immutible trie type
func (*HashMap) Each ¶
func (h *HashMap) Each(f func(k, v interface{}))
Each funs a function on each k,v pair
func (*HashMap) Keys ¶
func (h *HashMap) Keys() []interface{}
Keys returns the keys stored in the hash map
type IntHashMap ¶
type IntHashMap struct {
// contains filtered or unexported fields
}
IntHashMap maps an int to anything using an immutable trie
func (*IntHashMap) Get ¶
func (i *IntHashMap) Get(k int) (interface{}, bool)
Get the value stored at the given key
func (*IntHashMap) Put ¶
func (i *IntHashMap) Put(k int64, v interface{}) *IntHashMap
Put a kv pair into the map
type List ¶
type List struct {
// contains filtered or unexported fields
}
A List is an immutable singly linked list that is safe for concurrent use
func NewList ¶
func NewList(val interface{}) *List
NewList creates and returns an new list with the given value at the first node
func (*List) Append ¶
Append the given value to the end of the list. This will reallocate the whole list
type TNode ¶
type TNode struct {
// contains filtered or unexported fields
}
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
A Trie is an immutible implementation of of trie Inspired by Rich Hickey's implementation in clojure. Read about it at http://hypirion.com/musings/understanding-persistent-vector-pt-2
func (*Trie) Del ¶
Del remove the value stored at the given key and return the value that was stored there
type UintHashMap ¶
type UintHashMap struct {
// contains filtered or unexported fields
}
UintHashMap maps an int to anything using an immutable trie
func NewUintHashMap ¶
func NewUintHashMap() *UintHashMap
func (*UintHashMap) Get ¶
func (i *UintHashMap) Get(k uint64) (interface{}, bool)
Get the value stored at the given key
func (*UintHashMap) Put ¶
func (i *UintHashMap) Put(k uint64, v interface{}) *UintHashMap
Put a kv pair into the map