package bkmaps

import "github.com/moby/buildkit/util/bkmaps"

Index

Types

type SyncMap

type SyncMap[K comparable, V any] struct {
	// contains filtered or unexported fields
}

SyncMap provides a typed wrapper around sync.Map.

func (*SyncMap[K, V]) Delete

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

Delete removes the value for a key.

func (*SyncMap[K, V]) Load

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

Load returns the value stored in the map for a key, if any.

func (*SyncMap[K, V]) LoadOrStore

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

LoadOrStore returns the existing value for the key if present. Otherwise it stores and returns the given value.

func (*SyncMap[K, V]) Range

func (m *SyncMap[K, V]) Range(fn func(K, V) bool)

Range calls fn sequentially for each key and value present in the map.

func (*SyncMap[K, V]) Store

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

Store sets the value for a key.

Source Files

syncmap.go

Version
v0.29.0-rc1
Published
Mar 25, 2026
Platform
js/wasm
Imports
1 packages
Last checked
1 minute ago

Tools for package owners.