cmap

package
v0.0.0-...-4553cd5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cmap Concurrent safe Map based on map and sync.RWMutex

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmap

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

Cmap concurrent safe map

func New

func New() *Cmap

New new cmap

func (*Cmap) Clear

func (cm *Cmap) Clear()

Clear removes all items from the set

func (*Cmap) Delete

func (cm *Cmap) Delete(k interface{})

Delete delete k in cmap

func (*Cmap) Get

func (cm *Cmap) Get(k interface{}) (interface{}, bool)

Get get from cmap return k's value

func (*Cmap) Has

func (cm *Cmap) Has(k interface{}) bool

Has returns true if k exists in the map

func (*Cmap) IsEmpty

func (cm *Cmap) IsEmpty() bool

IsEmpty checks for emptiness

func (*Cmap) Keys

func (cm *Cmap) Keys() []interface{}

Keys return all the keys in cmap

func (*Cmap) Len

func (cm *Cmap) Len() int

Len returns the number of items in a set.

func (*Cmap) Set

func (cm *Cmap) Set(k interface{}, v interface{}) bool

Set maps the given key and value. Return false if the key is already in the map.

func (*Cmap) Values

func (cm *Cmap) Values() []interface{}

Values return all the values in cmap

Jump to

Keyboard shortcuts

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