api

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServer

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

APIServer provides HTTP API for querying scan results and triggering operations

func NewAPIServer

func NewAPIServer(cfg *config.APIConfig, store statestore.StateStoreQuery, queue queue.TaskQueue, regsyncPath string, logger *slog.Logger) *APIServer

NewAPIServer creates a new API server instance

func (*APIServer) Shutdown

func (s *APIServer) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the API server

func (*APIServer) Start

func (s *APIServer) Start(ctx context.Context) error

Start starts the API server

type ReevaluatePolicyRequest

type ReevaluatePolicyRequest struct {
	Repository string `json:"repository,omitempty"`
}

ReevaluatePolicyRequest represents the request body for policy re-evaluation

type ReevaluatePolicyResponse

type ReevaluatePolicyResponse struct {
	Queued     int    `json:"queued"`
	Repository string `json:"repository,omitempty"`
}

ReevaluatePolicyResponse represents the response for policy re-evaluation

type TriggerScanRequest

type TriggerScanRequest struct {
	Digest     string `json:"digest,omitempty"`
	Repository string `json:"repository,omitempty"`
}

TriggerScanRequest represents the request body for triggering a scan

type TriggerScanResponse

type TriggerScanResponse struct {
	Queued int    `json:"queued"`
	TaskID string `json:"task_id,omitempty"`
}

TriggerScanResponse represents the response for a triggered scan

Jump to

Keyboard shortcuts

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