toolstore

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CacheValidDuration = 24 * time.Hour

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	GetTools(serverName string) ([]CachedTool, error)
	SetTools(serverName string, tools []CachedTool) error
	Invalidate(serverName string) error
	GetCacheDir() string
}

type CachedTool

type CachedTool struct {
	Name        string          `json:"name"`
	Description string          `json:"description"`
	InputSchema json.RawMessage `json:"inputSchema"`
}

type FileCache

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

func NewFileCache

func NewFileCache(logger *slog.Logger) (*FileCache, error)

func (*FileCache) GetCacheDir

func (c *FileCache) GetCacheDir() string

func (*FileCache) GetTools

func (c *FileCache) GetTools(serverName string) ([]CachedTool, error)

func (*FileCache) Invalidate

func (c *FileCache) Invalidate(serverName string) error

func (*FileCache) ListCachedServers

func (c *FileCache) ListCachedServers() ([]string, error)

func (*FileCache) SetTools

func (c *FileCache) SetTools(serverName string, tools []CachedTool) error

type NoOpCache

type NoOpCache struct{}

func NewNoOpCache

func NewNoOpCache() *NoOpCache

func (*NoOpCache) GetCacheDir

func (c *NoOpCache) GetCacheDir() string

func (*NoOpCache) GetTools

func (c *NoOpCache) GetTools(serverName string) ([]CachedTool, error)

func (*NoOpCache) Invalidate

func (c *NoOpCache) Invalidate(serverName string) error

func (*NoOpCache) SetTools

func (c *NoOpCache) SetTools(serverName string, tools []CachedTool) error

Jump to

Keyboard shortcuts

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