Documentation ¶
Index ¶
- func ToInterfaceSlice(slice interface{}) (is []interface{})
- type BitSet
- type Element
- type Fifo
- type HashMap
- func (hm *HashMap) Add(key Hashable, value interface{})
- func (hm *HashMap) Contains(h Hashable) bool
- func (hm *HashMap) Del(key Hashable)
- func (hm *HashMap) Get(h Hashable) (interface{}, bool)
- func (hm *HashMap) Items() (ci chan Item)
- func (hm *HashMap) Keys() (ch chan Hashable)
- func (hm *HashMap) Len() int
- func (hm *HashMap) Values() (ci chan interface{})
- type Hashable
- type Item
- type RingSet
- func (r *RingSet) Add(item interface{})
- func (r *RingSet) Contains(item ...interface{}) bool
- func (r *RingSet) Copy() *RingSet
- func (r *RingSet) GetItem(i int) interface{}
- func (r *RingSet) Len() int
- func (r *RingSet) MarshalJSON() ([]byte, error)
- func (r *RingSet) RingSlice() *RingSlice
- func (r *RingSet) Set() *Set
- func (r *RingSet) SetItem(i int, item interface{})
- func (r *RingSet) Slice() []interface{}
- func (r RingSet) String() string
- func (r *RingSet) UnmarshalJSON(data []byte) (err error)
- type RingSlice
- func (r *RingSlice) Add(item interface{})
- func (r *RingSlice) Copy() *RingSlice
- func (r *RingSlice) GetItem(i int) interface{}
- func (r *RingSlice) Len() int
- func (r *RingSlice) MarshalJSON() ([]byte, error)
- func (r *RingSlice) SetItem(i int, item interface{})
- func (r *RingSlice) Slice() []interface{}
- func (r RingSlice) String() string
- func (r *RingSlice) UnmarshalJSON(data []byte) (err error)
- type Set
- func (s *Set) Add(data ...interface{})
- func (s *Set) Contains(data ...interface{}) bool
- func (s *Set) Copy() *Set
- func (s *Set) Del(data ...interface{})
- func (s *Set) Equal(other *Set) bool
- func (s *Set) Intersect(other *Set) *Set
- func (s *Set) Items() (c chan interface{})
- func (s *Set) Len() int
- func (s *Set) MarshalJSON() (data []byte, err error)
- func (s *Set) Slice() []interface{}
- func (s *Set) SortSlice() []interface{}
- func (s *Set) Union(other *Set) *Set
- func (s *Set) UnmarshalJSON(data []byte) (err error)
- type Sortable
- type SortedSlice
- func (ss *SortedSlice) Control() bool
- func (ss *SortedSlice) Insert(e Sortable)
- func (ss *SortedSlice) Iter(idx ...int) (c chan Sortable)
- func (ss *SortedSlice) RangeLessThan(e Sortable) (int, int)
- func (ss *SortedSlice) ReversedIter(idx ...int) (c chan Sortable)
- func (ss *SortedSlice) Slice() []Sortable
- func (ss *SortedSlice) String() string
- type SyncedHashMap
- func (hm *SyncedHashMap) Add(key Hashable, value interface{})
- func (hm *SyncedHashMap) Contains(key Hashable) bool
- func (hm *SyncedHashMap) Del(key Hashable)
- func (hm *SyncedHashMap) Get(key Hashable) (interface{}, bool)
- func (hm *SyncedHashMap) Items() (ci chan Item)
- func (hm *SyncedHashMap) Keys() (ch chan Hashable)
- func (hm *SyncedHashMap) Len() int
- func (hm *SyncedHashMap) Values() (ci chan interface{})
- type SyncedMap
- func (s *SyncedMap) Add(key, value interface{})
- func (s *SyncedMap) Contains(key interface{}) (ok bool)
- func (s *SyncedMap) Del(key interface{})
- func (s *SyncedMap) Get(key interface{}) (value interface{}, ok bool)
- func (s *SyncedMap) Keys() (keys []interface{})
- func (s *SyncedMap) Len() int
- func (s *SyncedMap) Values() (values []interface{})
- type SyncedSet
- func (s *SyncedSet) Add(data ...interface{})
- func (s *SyncedSet) Contains(data ...interface{}) bool
- func (s *SyncedSet) Del(data ...interface{})
- func (s *SyncedSet) Equal(other *SyncedSet) bool
- func (s *SyncedSet) Intersect(other *SyncedSet) *SyncedSet
- func (s *SyncedSet) Items() (c chan interface{})
- func (s *SyncedSet) Len() int
- func (s *SyncedSet) MarshalJSON() (data []byte, err error)
- func (s *SyncedSet) Slice() []interface{}
- func (s *SyncedSet) Union(other *SyncedSet) *SyncedSet
- func (s *SyncedSet) UnmarshalJSON(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToInterfaceSlice ¶
func ToInterfaceSlice(slice interface{}) (is []interface{})
ToInterfaceSlice converts any slice object to an array of interface{} it can be usefull to initialize some datastructs
Types ¶
type BitSet ¶
type BitSet struct {
// contains filtered or unexported fields
}
BitSet structure definition
type HashMap ¶
type HashMap struct {
// contains filtered or unexported fields
}
func NewHashMap ¶
func NewHashMap() (hm *HashMap)
type RingSet ¶ added in v1.2.0
type RingSet struct {
// contains filtered or unexported fields
}
func NewRingSet ¶ added in v1.2.0
func (*RingSet) MarshalJSON ¶ added in v1.2.0
func (*RingSet) UnmarshalJSON ¶ added in v1.2.0
type RingSlice ¶ added in v1.1.9
type RingSlice struct {
// contains filtered or unexported fields
}
func NewRingSlice ¶ added in v1.1.9
func (*RingSlice) MarshalJSON ¶ added in v1.1.9
func (*RingSlice) UnmarshalJSON ¶ added in v1.1.9
type Set ¶ added in v1.2.0
type Set struct {
// contains filtered or unexported fields
}
Set datastruct that represent a thread safe set
func NewInitSet ¶ added in v1.2.0
func NewInitSet(data ...interface{}) *Set
NewInitSet constructs a new SyncedSet initialized with data
func (*Set) Del ¶ added in v1.2.0
func (s *Set) Del(data ...interface{})
Del deletes data from the set
func (*Set) Intersect ¶ added in v1.2.0
Intersect returns a pointer to a new set containing the intersection of current set and other
func (*Set) Items ¶ added in v1.2.0
func (s *Set) Items() (c chan interface{})
Items returns a channel with all the elements contained in the set
func (*Set) MarshalJSON ¶ added in v1.2.0
MarshalJSON implements json.Marshaler interface
func (*Set) Slice ¶ added in v1.3.0
func (s *Set) Slice() []interface{}
Slice returns a pointer to a new slice containing the data in the set
func (*Set) SortSlice ¶ added in v1.3.0
func (s *Set) SortSlice() []interface{}
SortSlice returns a new slice containing the data in the set sorted by order of insertion.
func (*Set) Union ¶ added in v1.2.0
Union returns a pointer to a new set containing the union of current set and other
func (*Set) UnmarshalJSON ¶ added in v1.2.0
UnmarshalJSON implements json.Unmarshaler interface
type SortedSlice ¶
type SortedSlice struct {
// contains filtered or unexported fields
}
SortedSlice structure by convention the smallest value is at the end
func NewSortedSlice ¶
func NewSortedSlice(opts ...int) *SortedSlice
NewSortedSlice returns an empty initialized slice. Opts takes len and cap in order to initialize the underlying slice
func (*SortedSlice) Control ¶
func (ss *SortedSlice) Control() bool
Control controls if the slice has been properly ordered. A return value of true means it is in good order
func (*SortedSlice) Insert ¶
func (ss *SortedSlice) Insert(e Sortable)
Insertion method in the slice for a structure implementing Sortable
func (*SortedSlice) Iter ¶
func (ss *SortedSlice) Iter(idx ...int) (c chan Sortable)
Iter returns a chan of Sortable in the slice. Start and Stop indexes can be specified via optional parameters
func (*SortedSlice) RangeLessThan ¶
func (ss *SortedSlice) RangeLessThan(e Sortable) (int, int)
RangeLessThan returns the indexes of the objects Less than Sortable
func (*SortedSlice) ReversedIter ¶
func (ss *SortedSlice) ReversedIter(idx ...int) (c chan Sortable)
Iter returns a chan of Sortable in the slice but in reverse order. Start and Stop indexes can be specified via optional parameters
func (*SortedSlice) Slice ¶
func (ss *SortedSlice) Slice() []Sortable
Slice returns the underlying slice
type SyncedHashMap ¶
SyncedHashMap is a thread safe HashMap
func NewSyncedHashMap ¶
func NewSyncedHashMap() (hm *SyncedHashMap)
NewSyncedHashMap SyncedHashMap constructor
func (*SyncedHashMap) Add ¶ added in v1.3.0
func (hm *SyncedHashMap) Add(key Hashable, value interface{})
Add sets key, value in the map
func (*SyncedHashMap) Contains ¶
func (hm *SyncedHashMap) Contains(key Hashable) bool
Contains returns true if the HashMap contains element referenced by key
func (*SyncedHashMap) Del ¶
func (hm *SyncedHashMap) Del(key Hashable)
Del deletes the key and its associated value
func (*SyncedHashMap) Get ¶
func (hm *SyncedHashMap) Get(key Hashable) (interface{}, bool)
Get the element referenced by key in the HashMap
func (*SyncedHashMap) Items ¶
func (hm *SyncedHashMap) Items() (ci chan Item)
Items returns a channel of Item contained in the HashMap
func (*SyncedHashMap) Keys ¶
func (hm *SyncedHashMap) Keys() (ch chan Hashable)
Keys returns a channel of Keys used by the HashMap
func (*SyncedHashMap) Len ¶
func (hm *SyncedHashMap) Len() int
Len returns the length of the HashMap
func (*SyncedHashMap) Values ¶
func (hm *SyncedHashMap) Values() (ci chan interface{})
Values returns a channel of Values contained in the HashMap
type SyncedMap ¶
func NewSyncedMap ¶
func NewSyncedMap() *SyncedMap
type SyncedSet ¶
SyncedSet datastruct that represent a thread safe set
func NewInitSyncedSet ¶
func NewInitSyncedSet(data ...interface{}) *SyncedSet
NewInitSyncedSet constructs a new SyncedSet initialized with data
func NewSyncedSet ¶
NewSyncedSet constructs a new SyncedSet
func (*SyncedSet) Intersect ¶
Intersect returns a pointer to a new set containing the intersection of current set and other
func (*SyncedSet) Items ¶ added in v1.1.1
func (s *SyncedSet) Items() (c chan interface{})
Items returns a channel with all the elements contained in the set
func (*SyncedSet) MarshalJSON ¶ added in v1.1.9
MarshalJSON implements json.Marshaler interface
func (*SyncedSet) Slice ¶ added in v1.3.0
func (s *SyncedSet) Slice() []interface{}
Slice returns a pointer to a new slice containing the data in the set
func (*SyncedSet) Union ¶
Union returns a pointer to a new set containing the union of current set and other
func (*SyncedSet) UnmarshalJSON ¶ added in v1.1.9
UnmarshalJSON implements json.Unmarshaler interface