Documentation
¶
Overview ¶
Package schema holds the published JSON Schema of the Agent Wire Protocol (v0/awp.schema.json) and validates lines against it.
The schema is generated from the wire package by go generate ./wire; it is the same document that https://agentwireprotocol.com/schema/v0/awp.schema.json serves. A test fails when the file is older than the package.
Index ¶
Constants ¶
const ID = "https://agentwireprotocol.com/schema/v0/awp.schema.json"
ID is the schema's $id.
Variables ¶
var ErrUnknownType = errors.New("unknown message type")
ErrUnknownType is wrapped by Line for a line whose type the schema does not know. Such a line is still checked against the envelope, since receivers must ignore unknown types (section 5) after reading it.
var V0 []byte
V0 is the schema document.
Functions ¶
This section is empty.
Types ¶
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator checks lines and objects against the schema. It is safe for concurrent use.
func (*Validator) Def ¶
func (v *Validator) Def(name string) (*jsonschema.Schema, error)
Def returns the compiled schema of one definition: "Hello", "Part", "Grant", "Presence", ...