cache

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 23, 2025 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(defaultExpiration, cleanupInterval time.Duration) *Cache

func (*Cache) Get

func (c *Cache) Get(key string) (any, bool)

func (*Cache) Set

func (c *Cache) Set(key string, value any, expiration time.Duration)

type ExpirationHeap

type ExpirationHeap []*Item

func (ExpirationHeap) Len

func (eh ExpirationHeap) Len() int

func (ExpirationHeap) Less

func (eh ExpirationHeap) Less(i, j int) bool

func (*ExpirationHeap) Pop

func (eh *ExpirationHeap) Pop() any

func (*ExpirationHeap) Push

func (eh *ExpirationHeap) Push(x any)

func (ExpirationHeap) Swap

func (eh ExpirationHeap) Swap(i, j int)

type Item

type Item struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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