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.
Click to show internal directories.
Click to hide internal directories.