search

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler provides high-level helpers around the vulnerability search endpoint. It mirrors the design of pkg/tools/id.Handler for consistency across tools.

All methods are thin wrappers over the corresponding cvemap.Client helpers so that business logic remains decoupled from CLI concerns. The type is intentionally small to keep instantiation and use lightweight.

Example:

h := search.NewHandler(client)
resp, err := h.Search(cvemap.SearchParams{Query: cvemap.Ptr("severity:critical")})

The zero value of Handler is not valid; always use NewHandler.

func NewHandler

func NewHandler(client *cvemap.Client) *Handler

NewHandler returns a new Handler instance that uses the provided cvemap.Client for all network operations.

func (*Handler) MCPHandler

func (h *Handler) MCPHandler(client *cvemap.Client) func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error)

MCPHandler returns the MCP handler for this tool.

func (*Handler) MCPToolSpec

func (h *Handler) MCPToolSpec() mcp.Tool

MCPToolSpec returns the MCP tool spec for registration.

func (*Handler) Search

func (h *Handler) Search(params cvemap.SearchParams) (cvemap.SearchResponse, error)

Search performs a full-text search across vulnerabilities using the supplied parameters. It delegates the heavy-lifting to cvemap.Client.SearchVulnerabilities and simply forwards the request context.

Jump to

Keyboard shortcuts

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