generic

package
v0.3.25 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map[F any, T any](inputs []F, f func(F) T) []T

Map transforms a slice into a slice of another type

Types

type SyncMap

type SyncMap[K comparable, V any] struct {
	sync.Map
}

A SyncMap is a concurrency-safe sync.Map that uses strongly-typed method signatures to ensure the types of its stored data are known.

func SyncMapFromMap

func SyncMapFromMap[K comparable, V any](m map[K]V) *SyncMap[K, V]

func (*SyncMap[K, V]) Get

func (m *SyncMap[K, V]) Get(key K) (V, bool)

func (*SyncMap[K, V]) Iter

func (m *SyncMap[K, V]) Iter(ranger func(key K, value V) bool)

func (*SyncMap[K, V]) Put

func (m *SyncMap[K, V]) Put(key K, value V)

func (*SyncMap[K, V]) String added in v0.3.25

func (m *SyncMap[K, V]) String() string

Jump to

Keyboard shortcuts

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