cache

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LRUCache

type LRUCache[T any] struct {
	Head *Node[T]
	Tail *Node[T]
	// contains filtered or unexported fields
}

func NewLRUCache

func NewLRUCache[T any](size int, logger *logger.Logger) *LRUCache[T]

func (*LRUCache[T]) DebugGet

func (nlru *LRUCache[T]) DebugGet() map[string]T

func (*LRUCache[T]) Delete

func (lru *LRUCache[T]) Delete(key string) (ok bool)

func (*LRUCache[T]) Destroy added in v0.1.1

func (nlru *LRUCache[T]) Destroy()

Destroys completely - cannot be used after this

func (*LRUCache[T]) Get

func (lru *LRUCache[T]) Get(key string) (ansval T, ok bool)

func (*LRUCache[T]) PrintList

func (nlru *LRUCache[T]) PrintList() string

func (*LRUCache[T]) Reset

func (nlru *LRUCache[T]) Reset()

Resets but keeps the cache operational

func (*LRUCache[T]) Set

func (lru *LRUCache[T]) Set(key string, val T, ttl time.Duration)

func (*LRUCache[T]) Stop added in v0.1.1

func (nlru *LRUCache[T]) Stop()

type Node

type Node[T any] struct {
	Left  *Node[T]
	Right *Node[T]
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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