cmap

package module
v0.0.0-...-da98dff Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package cmap implements a yet another concurrent map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHasher

func DefaultHasher(key interface{}) uint32

DefaultHasher is a hash function for a value of an arbitrary type. It is not encouraged to use this function to values of composit types, because it is slow on such values.

Types

type Map

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

Map is a concurrent map.

func NewMap

func NewMap(hasher func(key interface{}) uint32) (m *Map)

NewMap returns an empty hash map whose keys are hashed by the given function.

func (*Map) Delete

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

Delete logically removes the given key and its associated value.

func (*Map) Load

func (m *Map) Load(key interface{}) (value interface{}, ok bool)

Load returns the value associated with the given key and true if the key exists. Otherwise, it returns nil and false.

func (*Map) Range

func (m *Map) Range(f func(key, value interface{}) bool)

Range iteratively applies the given function to each key-value pair until the function returns false.

func (*Map) Store

func (m *Map) Store(key, value interface{})

Store sets the given value to the given key.

Directories

Path Synopsis
Package hmap implements a non-resizable concurrency-aware hash map.
Package hmap implements a non-resizable concurrency-aware hash map.

Jump to

Keyboard shortcuts

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