util

package
v0.1.31 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package util holds custom structs and functions to handle common operations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapKeys

func MapKeys[K comparable, V any](m map[K]V) []K

Types

type SyncMap

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

SyncMap is a typed sync.Map implementation

func NewSyncMap

func NewSyncMap[K comparable, V comparable]() *SyncMap[K, V]

NewSyncMap creates a new typed concurrent map

func (*SyncMap[K, V]) Range

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

Range calls f sequentially for each key and value in the map. If f returns false, range stops the iteration.

func (*SyncMap[K, V]) Store

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

Store sets the value for a key

Jump to

Keyboard shortcuts

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