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 ¶
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 ¶
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.