container

package
v1.2.19 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: GPL-3.0 Imports: 1 Imported by: 1 module, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MutexMap

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

MutexMap represents a concurrent safe map

func NewMutexMap

func NewMutexMap() *MutexMap

NewMutexMap returns a new instance of a mutex map

func (*MutexMap) Get

func (mm *MutexMap) Get(key interface{}) (interface{}, bool)

Get returns the element stored with provided key

func (*MutexMap) Insert

func (mm *MutexMap) Insert(key interface{}, val interface{}) bool

Insert adds the (key, val) tuple if the key does not exist returns true operation succeeded

func (*MutexMap) Keys

func (mm *MutexMap) Keys() []interface{}

Keys returns all stored keys. The order is not guaranteed

func (*MutexMap) Len

func (mm *MutexMap) Len() int

Len returns the inner map size

func (*MutexMap) Remove

func (mm *MutexMap) Remove(key interface{})

Remove deletes a (key, val) tuple (if exists)

func (*MutexMap) Set

func (mm *MutexMap) Set(key interface{}, val interface{})

Set stores the (key, val) tuple, rewriting data if existing

func (*MutexMap) Values

func (mm *MutexMap) Values() []interface{}

Values returns all stored values. The order is not guaranteed

Jump to

Keyboard shortcuts

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