safemap

package
v0.0.0-...-25be970 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package safemap provides a generic, thread safe map

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeMap

type SafeMap[T, U any] interface {
	// Get returns a value
	Get(t T) (U, bool)
	// Set sets a value
	Set(t T, u U)
	// Keys lists all available keys
	Keys() []T
}

SafeMap is an interface for a generic, thread safe map.

func NewSafeMap

func NewSafeMap[T, U any]() SafeMap[T, U]

NewSafeMap returns an implementation of SafeMap.

Jump to

Keyboard shortcuts

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