collections

package
v0.0.0-...-52bbd4c Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2019 License: GPL-3.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyValuePair

type KeyValuePair struct {
	Key   interface{}
	Value interface{}
}

KeyValuePair is used by the Map iterator

type List

type List struct {
	// contains filtered or unexported fields
}

List is a concurrent list

func NewConcurrentList

func NewConcurrentList() *List

NewConcurrentList creates a new concurrent list

func (*List) Add

func (l *List) Add(item interface{})

Add adds an item to the list

func (*List) Count

func (l *List) Count() int

Count returns the length of the list

func (*List) Get

func (l *List) Get(i int) interface{}

Get gets the item with index i

func (*List) Iterator

func (l *List) Iterator() <-chan interface{}

Iterator can be used for 'for' loops

type Map

type Map struct {
	// contains filtered or unexported fields
}

Map is a concurrent map

func NewConcurrentMap

func NewConcurrentMap() *Map

NewConcurrentMap creates a new Map

func (*Map) Count

func (c *Map) Count() int

Count returns how many elements are stored in the map

func (*Map) Delete

func (c *Map) Delete(key interface{}) interface{}

Delete deletes an item with the specified key

func (*Map) Get

func (c *Map) Get(key interface{}) interface{}

Get gets an item from the map with the specified key

func (*Map) KIterator

func (c *Map) KIterator() <-chan interface{}

KIterator is the key iterator of the map

func (*Map) KVIterator

func (c *Map) KVIterator() <-chan KeyValuePair

KVIterator is the key-value iterator of the map

func (*Map) Put

func (c *Map) Put(key interface{}, value interface{})

Put puts a key value pair into the map

func (*Map) Reset

func (c *Map) Reset()

Reset resets the map, losing all its previous data in the process

func (*Map) ToList

func (c *Map) ToList() []interface{}

ToList converts the map into a list

func (*Map) VIterator

func (c *Map) VIterator() <-chan interface{}

VIterator is the value iterator of the map

Jump to

Keyboard shortcuts

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