Documentation
¶
Overview ¶
Package source validates immutable declarations of original HTTP resources. Validation never fetches a resource, authorizes execution or retains its data.
Index ¶
Constants ¶
const Format = "ovdb-http-source/1"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Definition ¶
type Definition struct {
Format string `json:"format"`
Provider Provider `json:"provider"`
Resources map[string]Resource `json:"resources"`
Recordsets map[string]Recordset `json:"recordsets"`
Rights Rights `json:"rights"`
ReadEvidence ReadEvidence `json:"readEvidence"`
Admission Admission `json:"admission"`
}
func Parse ¶
func Parse(data []byte) (*Definition, error)
Parse refuses missing/null fields, unknown/case-folded/duplicate keys, retention, execution admission and secret-bearing resource URLs. The schema deliberately has no pass/enable state: runtime and consumer enforcement plus semantic, source-rights and paid applicability reviews require a later contract.
func (Definition) Matches ¶
func (d Definition) Matches(names []string, entities map[string]string) error
Matches binds this definition to the existing manifest's native recordsets and ModelSpec entities. Field meanings and decoder correctness remain gates.
func (Definition) MatchesTerms ¶
func (d Definition) MatchesTerms(declaration license.Declaration) error
MatchesTerms enforces one shared normalized linked declaration. This version supports no recordset overrides, replacement text or inferred output licence.
func (Definition) RequireExecution ¶
func (d Definition) RequireExecution() error
RequireExecution is a hard refusal in this preparatory contract, even if a caller mutates the decoded struct. A valid definition is not runtime admission.
type Evidence ¶
type Evidence struct {
Origin string `json:"origin"`
InputVerification string `json:"inputVerification"`
Manifest license.Pin `json:"manifest"`
}
Evidence verifies declaration bytes only. It is never a SourceRight, a read receipt, proof of upstream authenticity, or an execution/copy authorization.
type ReadEvidence ¶
type Recordset ¶
type Recordset struct {
ProviderSourceID string `json:"providerSourceId"`
Resource string `json:"resource"`
Decoder string `json:"decoder"`
Entity string `json:"entity"`
KeyFields []string `json:"keyFields"`
FieldMapping map[string]string `json:"fieldMapping"`
Context map[string]string `json:"context"`
}
type Resource ¶
type Resource struct {
URL string `json:"url"`
Method string `json:"method"`
ContentType string `json:"contentType"`
TimeoutMs int `json:"timeoutMs"`
MaxBytes int `json:"maxBytes"`
Mode string `json:"mode"`
Retention string `json:"retention"`
Cache string `json:"cache"`
Redirect string `json:"redirect"`
BrowserAccess string `json:"browserAccess"`
}