cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 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 MemoryCache

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

MemoryCache is an in-memory cache implementation

func NewMemoryCache

func NewMemoryCache() *MemoryCache

NewMemoryCache creates a new memory cache

func (*MemoryCache) Clear

func (c *MemoryCache) Clear()

Clear removes all values from the cache

func (*MemoryCache) Delete

func (c *MemoryCache) Delete(key string)

Delete removes a value from the cache

func (*MemoryCache) Get

func (c *MemoryCache) Get(key string) (interface{}, bool)

Get retrieves a cached value

func (*MemoryCache) Set

func (c *MemoryCache) Set(key string, value interface{}, ttl time.Duration)

Set stores a value in the cache

func (*MemoryCache) Size

func (c *MemoryCache) Size() int

Size returns the number of items in the cache

Jump to

Keyboard shortcuts

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