lrucache

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 2 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 struct {
	// contains filtered or unexported fields
}

LRUCache is a wrapper to implement the httpcache.Cache interface

func NewLRUCache

func NewLRUCache(size int) *LRUCache

NewLRUCache creates a new LRUCache with the specified size

func (*LRUCache) Delete

func (c *LRUCache) Delete(key string)

Delete removes a value from the cache

func (*LRUCache) Get

func (c *LRUCache) Get(key string) ([]byte, bool)

Get retrieves a value from the cache

func (*LRUCache) Set

func (c *LRUCache) Set(key string, value []byte)

Set adds a value to the cache

func (*LRUCache) Size

func (c *LRUCache) Size() int

Size returns the current size of the cache

Jump to

Keyboard shortcuts

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