container

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: GPL-3.0 Imports: 1 Imported by: 0

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