analyzer

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 6 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

View Source
const (
	StatusCompleted = "COMPLETED"
	StatusRunning   = "RUNNING"
	StatusAborted   = "ABORTED"
	StatusFailed    = "FAILED"
)

Execution statuses reported by the analyzer API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer struct {
	Name         string            `json:"name"`
	DisplayName  string            `json:"displayName"`
	Description  string            `json:"description,omitempty"`
	Category     *AnalyzerCategory `json:"category,omitempty"`
	Type         string            `json:"type,omitempty"`
	BaseAnalyzer string            `json:"baseAnalyzer,omitempty"`
}

Analyzer represents an analyzer definition

type AnalyzerCategory

type AnalyzerCategory struct {
	DisplayName string `json:"displayName"`
}

AnalyzerCategory represents the category of an analyzer

type AnalyzerDefinition

type AnalyzerDefinition struct {
	Name         string            `json:"name"`
	DisplayName  string            `json:"displayName"`
	Description  string            `json:"description,omitempty"`
	Category     *AnalyzerCategory `json:"category,omitempty"`
	Type         string            `json:"type,omitempty"`
	BaseAnalyzer string            `json:"baseAnalyzer,omitempty"`
	Labels       []string          `json:"labels,omitempty"`
	Input        json.RawMessage   `json:"input,omitempty"`
	Output       json.RawMessage   `json:"output,omitempty"`
	AnalyzerCall json.RawMessage   `json:"analyzerCall,omitempty"`
}

AnalyzerDefinition represents detailed analyzer definition

type AnalyzerList

type AnalyzerList struct {
	Analyzers   []Analyzer `json:"analyzers"`
	TotalCount  int        `json:"totalCount"`
	NextPageKey string     `json:"nextPageKey,omitempty"`
}

AnalyzerList represents a list of analyzers

type AnalyzerResult

type AnalyzerResult struct {
	ResultID        string                   `json:"resultId"`
	ResultStatus    string                   `json:"resultStatus"`
	ExecutionStatus string                   `json:"executionStatus"`
	Input           map[string]interface{}   `json:"input,omitempty"`
	Output          []map[string]interface{} `json:"output,omitempty"`
	Data            []map[string]interface{} `json:"data,omitempty"`
	Logs            []ExecutionLog           `json:"logs,omitempty"`
}

AnalyzerResult represents the result of an analyzer execution

type ExecuteRequest

type ExecuteRequest struct {
	Input map[string]interface{} `json:"input"`
}

ExecuteRequest represents an analyzer execution request

type ExecuteResult

type ExecuteResult struct {
	RequestToken string          `json:"requestToken,omitempty"`
	TTLInSeconds int64           `json:"ttlInSeconds,omitempty"`
	Result       *AnalyzerResult `json:"result"`
}

ExecuteResult represents an analyzer execution result

type ExecutionLog

type ExecutionLog struct {
	Level   string `json:"level"`
	Message string `json:"message"`
	Path    string `json:"path,omitempty"`
}

ExecutionLog represents an execution log entry

type Handler

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

Handler handles Davis analyzer resources

func NewHandler

func NewHandler(c *httpclient.Client) *Handler

NewHandler creates a new analyzer handler

func (*Handler) Cancel

func (h *Handler) Cancel(ctx context.Context, name string, requestToken string) (*ExecuteResult, error)

Cancel cancels a running analyzer execution

func (*Handler) Execute

func (h *Handler) Execute(ctx context.Context, name string, input map[string]interface{}, timeoutSeconds int) (*ExecuteResult, error)

Execute runs an analyzer with the given input

func (*Handler) ExecuteAndWait

func (h *Handler) ExecuteAndWait(ctx context.Context, name string, input map[string]interface{}, maxWaitSeconds int) (*ExecuteResult, error)

ExecuteAndWait runs an analyzer and waits for completion. The context can be used to cancel a long-running poll (e.g. on SIGINT).

Only COMPLETED is a success; ABORTED and FAILED are errors. Any other status that comes with a request token is polled, because a status added to the API later is more likely in flight than terminal.

func (*Handler) Get

func (h *Handler) Get(ctx context.Context, name string) (*AnalyzerDefinition, error)

Get retrieves a specific analyzer definition

func (*Handler) GetDocumentation

func (h *Handler) GetDocumentation(ctx context.Context, name string) (string, error)

GetDocumentation retrieves the documentation for an analyzer

func (*Handler) GetInputSchema

func (h *Handler) GetInputSchema(ctx context.Context, name string) (map[string]interface{}, error)

GetInputSchema retrieves the JSON schema for analyzer input

func (*Handler) GetResultSchema

func (h *Handler) GetResultSchema(ctx context.Context, name string) (map[string]interface{}, error)

GetResultSchema retrieves the JSON schema for analyzer result

func (*Handler) List

func (h *Handler) List(ctx context.Context, filter string) (*AnalyzerList, error)

List retrieves all available analyzers

func (*Handler) Poll

func (h *Handler) Poll(ctx context.Context, name string, requestToken string, timeoutSeconds int) (*ExecuteResult, error)

Poll polls for the result of a started analyzer execution

func (*Handler) Validate

func (h *Handler) Validate(ctx context.Context, name string, input map[string]interface{}) (*ValidationResult, error)

Validate validates the input for an analyzer execution

type ValidationResult

type ValidationResult struct {
	Valid   bool                   `json:"valid"`
	Details map[string]interface{} `json:"details,omitempty"`
}

ValidationResult represents the result of input validation

Jump to

Keyboard shortcuts

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