util

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandString

func RandString(n int) string

func RandStrings

func RandStrings(length, count int) []string

Types

type SyncMap

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

func NewSyncMap

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

func (*SyncMap[K, V]) ComputeIfAbsent

func (s *SyncMap[K, V]) ComputeIfAbsent(key K, valFunc func(K) V) V

func (*SyncMap[K, V]) Delete

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

func (*SyncMap[K, V]) Keys

func (s *SyncMap[K, V]) Keys() iter.Seq[K]

func (*SyncMap[K, V]) Load

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

func (*SyncMap[K, V]) Pairs

func (s *SyncMap[K, V]) Pairs() iter.Seq[SyncMapPair[K, V]]

func (*SyncMap[K, V]) Store

func (s *SyncMap[K, V]) Store(key K, val V)

func (*SyncMap[K, V]) Values

func (s *SyncMap[K, V]) Values() iter.Seq[V]

type SyncMapPair

type SyncMapPair[K comparable, V any] struct {
	Key K
	Val V
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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