cache

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 2 Imported by: 0

Documentation

Overview

Package cache provides caching utilities for the MCP server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryCache

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

EntryCache provides thread-safe LRU caching for full SessionEntry objects.

func NewEntryCache

func NewEntryCache(maxItems int) (*EntryCache, error)

NewEntryCache creates a new LRU cache with the specified maximum number of items.

func (*EntryCache) Get

func (c *EntryCache) Get(entryID string) (*client.SessionEntry, bool)

Get retrieves an entry from the cache by its ID. Returns the entry and true if found, nil and false otherwise.

func (*EntryCache) Len

func (c *EntryCache) Len() int

Len returns the current number of items in the cache.

func (*EntryCache) Put

func (c *EntryCache) Put(entryID string, entry *client.SessionEntry)

Put adds or updates an entry in the cache.

Jump to

Keyboard shortcuts

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