catalog

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

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

Catalog manages the aggregated tool catalog from all upstream servers.

func New

func New(lister ToolLister, cachePath string) *Catalog

New creates a new Catalog.

func (*Catalog) AllTools

func (c *Catalog) AllTools() []types.ToolEntry

AllTools returns a copy of all tools in the catalog.

func (*Catalog) GetTool

func (c *Catalog) GetTool(prefixedName string) (*types.ToolEntry, error)

GetTool returns a tool by its prefixed name.

func (*Catalog) Load

func (c *Catalog) Load() error

Load reads the catalog from the disk cache. If the cache doesn't exist or is invalid, the catalog starts empty (no error).

func (*Catalog) RefreshAll

func (c *Catalog) RefreshAll(ctx context.Context) error

RefreshAll fetches tools from all upstream servers via the ToolLister, updates the in-memory catalog, and saves to disk cache.

func (*Catalog) ServerNames

func (c *Catalog) ServerNames() []string

ServerNames returns sorted list of server names that have tools.

func (*Catalog) ServerTools

func (c *Catalog) ServerTools(serverName string) []types.ToolEntry

ServerTools returns all tools for a given server.

func (*Catalog) ToolCount

func (c *Catalog) ToolCount() int

ToolCount returns the total number of tools.

type ToolLister

type ToolLister interface {
	ListToolsAll(ctx context.Context) (map[string][]types.ToolEntry, error)
}

ToolLister fetches tools from upstream servers. Implemented by transport.Manager.

Jump to

Keyboard shortcuts

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