structures

package
v0.0.0-...-552ec64 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 1 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentMap

type ConcurrentMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*ConcurrentMap) Delete

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

Removes a value from the map.

func (*ConcurrentMap) Get

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

Gets the value associated with the specified key.

func (*ConcurrentMap) Iterate

func (c *ConcurrentMap) Iterate() <-chan Item

Safely iterates over the map. Provides the key/values to a channel that is returned for use by the client.

func (*ConcurrentMap) Length

func (c *ConcurrentMap) Length() int

Gives the number of items in the map.

func (*ConcurrentMap) Set

func (c *ConcurrentMap) Set(key, value interface{}) DistributedMap

Sets a value with an associated key.

type DistributedMap

type DistributedMap interface {
	Set(key, value interface{}) DistributedMap
	Get(key interface{}) interface{}
	Delete(key interface{})
	Iterate() <-chan Item
	Length() int
}

func NewConcurrentMap

func NewConcurrentMap(size ...int) DistributedMap

Returns a new ConcurrentMap.

type Item

type Item struct {
	Key   interface{}
	Value interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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