Documentation
¶
Index ¶
- Constants
- func FinalizeAuditForTermination(audit *ProbeAudit)
- func KnownErrorCode(code string) bool
- type Config
- type DerivationError
- type DerivedConfig
- type EmittedCounts
- type ExtractorAudit
- type ExtractorConfig
- type JSONPath
- type ProbeAudit
- type Prober
- func (p *Prober) AllRequiredResolved(vars map[string]string) bool
- func (p *Prober) ApplyMissingPolicies(vars map[string]string, audit *ProbeAudit) (routingClass string, requiredFailed bool)
- func (p *Prober) ApplyMissingPoliciesDetailed(vars map[string]string, audit *ProbeAudit, failures map[string]error) (routingClass string, requiredFailed bool, failureErr error)
- func (p *Prober) HasPriorityExtractors() bool
- func (p *Prober) HasRequiredExtractors() bool
- func (p *Prober) Probe(data []byte) (map[string]string, error)
- func (p *Prober) ProbeDetailed(data []byte, bytesRead int64, terminationReason string) (*Result, error)
- func (p *Prober) ProbeDetailedAllowIncomplete(data []byte, bytesRead int64, terminationReason string, ...) (*Result, error)
- func (p *Prober) ProbeDetailedAllowIncompleteWithVars(data []byte, bytesRead int64, terminationReason string, ...) (*Result, error)
- func (p *Prober) ProbeDetailedWithVars(data []byte, bytesRead int64, terminationReason string, ...) (*Result, error)
- func (p *Prober) RequiredResolvedForTermination(res *Result) bool
- func (p *Prober) UnresolvedResult(bytesRead int64, terminationReason string) *Result
- type ReadStrategyConfig
- type Result
- type RoutingCounts
- type Summary
- type XMLXPath
Constants ¶
const ( ReadStrategyFixedWindow = "fixed_window" ReadStrategyUntilResolved = "until_resolved" DefaultChunkBytes int64 = 64 * 1024 OnMissingFail = "fail" OnMissingQuarantine = "quarantine" TransformSubstring = "substring" TransformRegexCapture = "regex_capture" TransformFormat = "format" TransformPad = "pad" TransformLowercase = "lowercase" TransformUppercase = "uppercase" TransformLookup = "lookup" LookupMatchModeRegex = "regex" LookupMatchModePrefix = "prefix" LookupMatchModeExact = "exact" MaxPadWidth = 1024 )
const ( TerminationAllRequiredResolved = "all_required_resolved" TerminationMaxBytesReached = "max_bytes_reached" TerminationStreamExhausted = "stream_exhausted" TerminationParseError = "parse_error" TerminationFixedWindow = "fixed_window" )
const SummaryRecordType = "gonimbus.content.probe.summary.v1"
SummaryRecordType identifies terminal content-probe control evidence.
Variables ¶
This section is empty.
Functions ¶
func FinalizeAuditForTermination ¶
func FinalizeAuditForTermination(audit *ProbeAudit)
func KnownErrorCode ¶
KnownErrorCode bounds the published histogram vocabulary. Rejected codes must not be echoed into a diagnostic or used as a map key.
Types ¶
type Config ¶
type Config struct {
ReadStrategy ReadStrategyConfig `json:"read_strategy,omitempty" yaml:"read_strategy,omitempty"`
QuarantinePrefix string `json:"quarantine_prefix,omitempty" yaml:"quarantine_prefix,omitempty"`
Extract []ExtractorConfig `json:"extract" yaml:"extract"`
Derived []DerivedConfig `json:"derived,omitempty" yaml:"derived,omitempty"`
}
Config controls content probing and derived field extraction.
The intent is to support generic extraction without embedding dataset-specific logic. Extractors are applied to the provided byte window (usually a header read).
func (*Config) ValidateWithRewriteCaptures ¶
type DerivationError ¶
func (*DerivationError) Error ¶
func (e *DerivationError) Error() string
type DerivedConfig ¶
type DerivedConfig struct {
Name string `json:"name" yaml:"name"`
From string `json:"from" yaml:"from"`
Transform string `json:"transform" yaml:"transform"`
Args map[string]any `json:"args,omitempty" yaml:"args,omitempty"`
Required *bool `json:"required,omitempty" yaml:"required,omitempty"`
OnMissing string `json:"on_missing,omitempty" yaml:"on_missing,omitempty"`
// contains filtered or unexported fields
}
func (DerivedConfig) RequiredValue ¶
func (d DerivedConfig) RequiredValue() bool
type EmittedCounts ¶
type ExtractorAudit ¶
type ExtractorAudit struct {
Name string `json:"name"`
Type string `json:"type"`
Resolved bool `json:"resolved"`
Required bool `json:"required"`
OnMissing string `json:"on_missing,omitempty"`
BytesAtResolution *int64 `json:"bytes_at_resolution"`
ResolvedPriority *int `json:"resolved_priority,omitempty"`
ResolvedXPath string `json:"resolved_xpath,omitempty"`
TruncatedFallback bool `json:"truncated_fallback,omitempty"`
}
type ExtractorConfig ¶
type ExtractorConfig struct {
Name string `json:"name" yaml:"name"`
Type string `json:"type" yaml:"type"`
Required bool `json:"required,omitempty" yaml:"required,omitempty"`
OnMissing string `json:"on_missing,omitempty" yaml:"on_missing,omitempty"`
// For type=xml_xpath.
XPath string `json:"xpath" yaml:"xpath"`
XPathPriority []string `json:"xpath_priority,omitempty" yaml:"xpath_priority,omitempty"`
// For type=regex.
Pattern string `json:"pattern" yaml:"pattern"`
Group int `json:"group" yaml:"group"`
// For type=json_path.
JSONPath string `json:"json_path" yaml:"json_path"`
}
type JSONPath ¶
type JSONPath struct {
// contains filtered or unexported fields
}
JSONPath is a small JSON path selector.
Supported forms: - $.a.b.c - a.b.c - a[0].b
This is intentionally minimal for v0.1.x.
func CompileJSONPath ¶
type ProbeAudit ¶
type ProbeAudit struct {
Extractors []ExtractorAudit `json:"extractors"`
BytesRead int64 `json:"bytes_read"`
TerminationReason string `json:"termination_reason"`
TruncatedFallbackCount int `json:"truncated_fallback_count,omitempty"`
}
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
Prober executes configured extractors against a byte window.
func NewNormalizedWithRewriteCaptures ¶
NewNormalizedWithRewriteCaptures validates cfg in place and builds a prober from the normalized config. Callers that need config-derived runtime values after construction, such as read_strategy byte limits, should use this form.
func NewWithRewriteCaptures ¶
func (*Prober) AllRequiredResolved ¶
func (*Prober) ApplyMissingPolicies ¶
func (*Prober) ApplyMissingPoliciesDetailed ¶
func (*Prober) HasPriorityExtractors ¶
func (*Prober) HasRequiredExtractors ¶
func (*Prober) ProbeDetailed ¶
func (*Prober) ProbeDetailedAllowIncomplete ¶
func (*Prober) ProbeDetailedAllowIncompleteWithVars ¶
func (*Prober) ProbeDetailedWithVars ¶
func (*Prober) RequiredResolvedForTermination ¶
type ReadStrategyConfig ¶
type ReadStrategyConfig struct {
Mode string `json:"mode,omitempty" yaml:"mode,omitempty"`
MaxBytes string `json:"max_bytes,omitempty" yaml:"max_bytes,omitempty"`
ChunkBytes string `json:"chunk_bytes,omitempty" yaml:"chunk_bytes,omitempty"`
MaxBytesValue int64 `json:"-" yaml:"-"`
ChunkBytesValue int64 `json:"-" yaml:"-"`
}
type Result ¶
type Result struct {
Vars map[string]string
Audit ProbeAudit
Failures map[string]error
}
type RoutingCounts ¶
type Summary ¶
type Summary struct {
Inputs int64 `json:"inputs"`
Enumerated int64 `json:"enumerated"`
Processed int64 `json:"processed"`
Emitted EmittedCounts `json:"emitted"`
Routing RoutingCounts `json:"routing"`
Errors int64 `json:"errors"`
ErrorsByCode map[string]int64 `json:"errors_by_code"`
InvalidInputs int64 `json:"invalid_inputs"`
Termination string `json:"termination"`
ExitCode int `json:"exit_code"`
BytesRead int64 `json:"bytes_read"`
WallMS int64 `json:"wall_ms"`
}
Summary reports handled termination, not provider custody or pipeline success. All counters are present even for empty or failed invocations.
func ParseSummary ¶
func ParseSummary(raw json.RawMessage) (Summary, error)
ParseSummary validates the exact control payload without treating it as an object or accepting arbitrary unknown record types. Errors never echo data.
type XMLXPath ¶
type XMLXPath struct {
// contains filtered or unexported fields
}
XMLXPath is a deliberately small XPath-like selector.
Supported forms: - //TagName (match any element with local name TagName) - /a/b/c (match exact element path)
Predicates, attributes, and namespaces are not supported.