scanner

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Audit

func Audit(insight *insight.InsightManager) http.HandlerFunc

Audit handles the auditing process based on the specified resource group.

@Summary Audit based on resource group. @Description This endpoint audits based on the specified resource group. @Tags insight @Produce json @Param cluster query string false "The specified cluster name, such as 'example-cluster'" @Param apiVersion query string false "The specified apiVersion, such as 'apps/v1'" @Param kind query string false "The specified kind, such as 'Deployment'" @Param namespace query string false "The specified namespace, such as 'default'" @Param name query string false "The specified resource name, such as 'foo'" @Param forceNew query bool false "Switch for forced scanning, default is 'false'" @Success 200 {object} ai.AuditData "Audit results" @Failure 400 {string} string "Bad Request" @Failure 401 {string} string "Unauthorized" @Failure 429 {string} string "Too Many Requests" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /rest-api/v1/insight/audit [get]

func InterpretIssues added in v0.6.0

func InterpretIssues(aiMgr *ai.AIManager, c *server.CompletedConfig) http.HandlerFunc

InterpretIssues returns an HTTP handler function that performs AI interpretation on scanner issues

@Summary Interpret scanner issues using AI @Description This endpoint analyzes scanner issues using AI to provide detailed interpretation and insights @Tags insight @Accept json @Produce text/event-stream @Param request body InterpretRequest true "The audit data to interpret" @Success 200 {object} ai.InterpretEvent @Failure 400 {string} string "Bad Request" @Failure 401 {string} string "Unauthorized" @Failure 429 {string} string "Too Many Requests" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /insight/issue/interpret/stream [post]

func Score

func Score(insightMgr *insight.InsightManager) http.HandlerFunc

Score returns an HTTP handler function that calculates a score for the audited manifest. It utilizes an AuditManager to compute the score based on detected issues.

@Summary ScoreHandler calculates a score for the audited manifest. @Description This endpoint calculates a score for the provided manifest based on the number and severity of issues detected during the audit. @Tags insight @Produce json @Param cluster query string false "The specified cluster name, such as 'example-cluster'" @Param apiVersion query string false "The specified apiVersion, such as 'apps/v1'" @Param kind query string false "The specified kind, such as 'Deployment'" @Param namespace query string false "The specified namespace, such as 'default'" @Param name query string false "The specified resource name, such as 'foo'" @Param forceNew query bool false "Switch for forced compute score, default is 'false'" @Success 200 {object} insight.ScoreData "Score calculation result" @Failure 400 {string} string "Bad Request" @Failure 401 {string} string "Unauthorized" @Failure 429 {string} string "Too Many Requests" @Failure 404 {string} string "Not Found" @Failure 500 {string} string "Internal Server Error" @Router /rest-api/v1/insight/score [get]

Types

type InterpretRequest added in v0.6.0

type InterpretRequest struct {
	AuditData *ai.AuditData `json:"auditData"` // The audit data to interpret
	Language  string        `json:"language"`  // Language for interpretation
}

InterpretRequest represents the request body for issue interpretation

Jump to

Keyboard shortcuts

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