ds

package
v0.12.2-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpMap added in v0.11.1

type ExpMap[T any] struct {
	// contains filtered or unexported fields
}

func MakeExpMap added in v0.11.1

func MakeExpMap[T any]() *ExpMap[T]

func (*ExpMap[T]) Get added in v0.11.1

func (em *ExpMap[T]) Get(key string) (T, bool)

func (*ExpMap[T]) Set added in v0.11.1

func (em *ExpMap[T]) Set(key string, value T, exp time.Time)

type SyncMap

type SyncMap[T any] struct {
	// contains filtered or unexported fields
}

func MakeSyncMap added in v0.11.0

func MakeSyncMap[T any]() *SyncMap[T]

func (*SyncMap[T]) Delete

func (sm *SyncMap[T]) Delete(key string)

func (*SyncMap[T]) Get

func (sm *SyncMap[T]) Get(key string) T

func (*SyncMap[T]) GetEx

func (sm *SyncMap[T]) GetEx(key string) (T, bool)

func (*SyncMap[T]) Set

func (sm *SyncMap[T]) Set(key string, value T)

func (*SyncMap[T]) SetUnless added in v0.12.0

func (sm *SyncMap[T]) SetUnless(key string, value T) bool

func (*SyncMap[T]) TestAndSet added in v0.12.0

func (sm *SyncMap[T]) TestAndSet(key string, newValue T, testFn func(T, bool) bool) bool

Jump to

Keyboard shortcuts

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