v1

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 7 Imported by: ? modules, 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

This section is empty.

Types

type Client

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

Client provides a programmatic interface to the PQSwitch scanner

func NewClient

func NewClient(cfg *config.Config) *Client

NewClient creates a new API client

func NewDefaultClient

func NewDefaultClient() *Client

NewDefaultClient creates a new client with default configuration

func (*Client) Close

func (c *Client) Close() error

Close cleans up client resources

func (*Client) GetRulesInfo

func (c *Client) GetRulesInfo(ctx context.Context) (*RulesResponse, error)

GetRulesInfo returns information about loaded rules

func (*Client) GetVersion

func (c *Client) GetVersion() string

GetVersion returns the client version

func (*Client) Health

func (c *Client) Health(ctx context.Context) (*HealthResponse, error)

Health returns the health status of the scanner

func (*Client) Scan

func (c *Client) Scan(ctx context.Context, request ScanRequest) (*ScanResponse, error)

Scan performs a cryptographic scan

func (*Client) ValidateConfig

func (c *Client) ValidateConfig() error

ValidateConfig validates the client configuration

type HealthResponse

type HealthResponse struct {
	Status    string            `json:"status"`
	Version   string            `json:"version"`
	Timestamp time.Time         `json:"timestamp"`
	Details   map[string]string `json:"details"`
}

HealthResponse represents a health check response

func (*HealthResponse) JSONResponse

func (r *HealthResponse) JSONResponse() ([]byte, error)

JSONResponse converts a health response to JSON

type RulesResponse

type RulesResponse struct {
	TotalRules  int                    `json:"total_rules"`
	RulesByType map[string]int         `json:"rules_by_type"`
	Statistics  map[string]interface{} `json:"statistics"`
	LastUpdated time.Time              `json:"last_updated"`
}

RulesResponse represents a rules information response

func (*RulesResponse) JSONResponse

func (r *RulesResponse) JSONResponse() ([]byte, error)

JSONResponse converts a rules response to JSON

type ScanRequest

type ScanRequest struct {
	Path         string            `json:"path"`
	OutputFormat string            `json:"output_format,omitempty"`
	RulesPath    string            `json:"rules_path,omitempty"`
	Options      map[string]string `json:"options,omitempty"`
}

ScanRequest represents a scan request

type ScanResponse

type ScanResponse struct {
	Success   bool              `json:"success"`
	Result    *types.ScanResult `json:"result,omitempty"`
	Error     string            `json:"error,omitempty"`
	RequestID string            `json:"request_id"`
	Timestamp time.Time         `json:"timestamp"`
}

ScanResponse represents a scan response

func (*ScanResponse) JSONResponse

func (r *ScanResponse) JSONResponse() ([]byte, error)

JSONResponse converts a response to JSON

Jump to

Keyboard shortcuts

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