cache

package
v0.27.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryCache

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

InMemoryCache is a simple, concurrent-safe in-memory key-value store.

func NewInMemoryCache

func NewInMemoryCache() *InMemoryCache

NewInMemoryCache creates and returns a new InMemoryCache.

func (*InMemoryCache) Delete

func (c *InMemoryCache) Delete(key string)

Delete removes a value from the cache.

func (*InMemoryCache) Get

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

Get retrieves a value from the cache. It returns the value and true if the key exists, otherwise nil and false.

func (*InMemoryCache) Set

func (c *InMemoryCache) Set(key string, value any)

Set adds or updates a value in the cache.

Jump to

Keyboard shortcuts

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