hashmap

package
v0.0.0-...-94d2ec4 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashMap

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

func New

func New() *HashMap

New creates a new hashmap.

func (*HashMap) Clear

func (h *HashMap) Clear(name string) int

Clear removes all the element within map. It returns 1 if map exists, returns 0 otherwise.

func (*HashMap) Get

func (h *HashMap) Get(name, key string) []byte

Get returns the value associated with key within specific map.

func (*HashMap) Put

func (h *HashMap) Put(name, key string, value []byte) (result int)

Put Puts value at a key location under a specified map. It initializes an empty map if name does not exist. It returns zero if there is already a value at specified key, returns 1 otherwise.

func (*HashMap) PutIfAbsent

func (h *HashMap) PutIfAbsent(name, key string, value []byte) (result int)

PutIfAbsent Puts value at a key location under a specified map if it does not exist. It returns zero if there is already a value at specified key, returns 1 otherwise.

func (*HashMap) Remove

func (h *HashMap) Remove(name, key string) int

Remove removes value specified by key from a map. It ignores if key is not in the map. It returns 1 if removal is successful, returns 0 otherwise.

Jump to

Keyboard shortcuts

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