cache

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultRecycleInterval = 1 * time.Minute

Variables

This section is empty.

Functions

This section is empty.

Types

type ThreadSafeMap

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

func NewThreadSafeMap

func NewThreadSafeMap[T any](condition func(item T, afterSetDurtion time.Duration) bool) *ThreadSafeMap[T]

func (*ThreadSafeMap[T]) Delete

func (c *ThreadSafeMap[T]) Delete(key string)

func (*ThreadSafeMap[T]) Get

func (c *ThreadSafeMap[T]) Get(key string) (item T, exists bool)

func (*ThreadSafeMap[T]) List

func (c *ThreadSafeMap[T]) List() []T

func (*ThreadSafeMap[T]) Set

func (c *ThreadSafeMap[T]) Set(key string, obj T)

Jump to

Keyboard shortcuts

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