Documentation
¶
Overview ¶
Package internal provides internal utility functions and types used across the gencache package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type SafeCounter ¶
type SafeCounter struct {
// contains filtered or unexported fields
}
SafeCounter is a thread-safe counter
func NewSafeCounter ¶
func NewSafeCounter() *SafeCounter
NewSafeCounter creates a new thread-safe counter
func (*SafeCounter) Decrement ¶
func (c *SafeCounter) Decrement()
Decrement decreases the counter by 1
func (*SafeCounter) Increment ¶
func (c *SafeCounter) Increment()
Increment increases the counter by 1
type SafeMap ¶
type SafeMap[K comparable, V any] struct { // contains filtered or unexported fields }
SafeMap is a thread-safe map
func NewSafeMap ¶
func NewSafeMap[K comparable, V any]() *SafeMap[K, V]
NewSafeMap creates a new thread-safe map
func (*SafeMap[K, V]) Delete ¶
func (m *SafeMap[K, V]) Delete(key K)
Delete removes a value from the map
Click to show internal directories.
Click to hide internal directories.