Documentation
¶
Overview ¶
Package driver implements the out-of-process JSON/NDJSON subject driver client backed by the containment supervisor.
Index ¶
Constants ¶
const ProtocolVersion = "docpresser-driver/v0"
ProtocolVersion identifies the Wave 1 stdin/stdout driver wire contract.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Name string
Role string
Version string
Command string
Args []string
DriverSHA256 string
}
Client invokes an out-of-process subject driver under containment supervision.
func NewClient ¶
NewClient constructs a subject driver client from a specification string "name=command [args...]" and role ("target" or "baseline").
func (*Client) ExecuteCase ¶
func (c *Client) ExecuteCase(ctx context.Context, pc model.PackCase, inputBytes []byte) (model.Observation, error)
ExecuteCase runs a single PackCase against the subject driver inside the containment supervisor.
func (*Client) Metadata ¶
func (c *Client) Metadata() model.SubjectMetadata
Metadata returns the SubjectMetadata for run-manifest.json.
type Request ¶
type Request struct {
Version string `json:"version"`
CaseID string `json:"case_id"`
Format string `json:"format"`
Operation string `json:"operation"`
Profile string `json:"profile,omitempty"`
InputBase64 string `json:"input_base64"`
Budgets *model.CaseBudgets `json:"budgets,omitempty"`
}
Request is sent as a single JSON line on stdin to a subject driver.
type Response ¶
type Response struct {
Version string `json:"version"`
CaseID string `json:"case_id"`
Subject string `json:"subject,omitempty"`
SubjectVersion string `json:"subject_version,omitempty"`
Status string `json:"status"`
OutputSHA256 string `json:"output_sha256,omitempty"`
OutputBytes int64 `json:"output_bytes,omitempty"`
DocumentCount int `json:"document_count,omitempty"`
EventCount int `json:"event_count,omitempty"`
CanonicalValue string `json:"canonical_value,omitempty"`
ErrorPhase string `json:"error_phase,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
ParseNs int64 `json:"parse_ns,omitempty"`
EmitNs int64 `json:"emit_ns,omitempty"`
HazardsFound []string `json:"hazards_found,omitempty"`
}
Response is emitted as a single JSON line on stdout by a subject driver.