Documentation
¶
Overview ¶
Package schemair is a serialized form of an SDK service's smithy-go schema graph, so the graph can be rebuilt on first use instead of by the SDK schemas package's init functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrModel = errors.New("schemair: invalid model")
ErrModel marks an invalid or mismatched schema model.
Functions ¶
func Equivalent ¶
Equivalent reports the first difference between the graph rooted at a and the one rooted at b, as every trait view and member the protocols read.
Types ¶
type Member ¶
type Member struct {
Name string `json:"name"`
Traits []Trait `json:"traits,omitempty"`
Target int `json:"to"`
}
Member is a member schema; Traits are those declared on the member itself.
type Model ¶
type Model struct {
Ops map[string]Op `json:"ops"`
Version string `json:"version"`
Shapes []Shape `json:"shapes"`
Service int `json:"service"`
}
Model is one service's schema graph.
func Encode ¶
Encode captures the graph reachable from svc and ops. pool is every shape the SDK package declares; member targets are found in it by shape ID.
type Op ¶
type Op struct {
Token string `json:"token,omitempty"`
Schema int `json:"op"`
In int `json:"in"`
Out int `json:"out"`
}
Op references an operation's schemas by Shapes index; -1 means none.
type Operation ¶
type Operation struct {
Schema *smithy.OperationSchema
Token string
}
Operation is a decoded operation.
type Service ¶
type Service struct {
Schema *smithy.ServiceSchema
Ops map[string]Operation
}
Service is a decoded service.
type Shape ¶
type Shape struct {
Prelude string `json:"prelude,omitempty"`
Namespace string `json:"ns,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Traits []Trait `json:"traits,omitempty"`
Members []Member `json:"members,omitempty"`
}
Shape is a schema: a prelude shape when Prelude is set, else a declared one.
type Trait ¶
type Trait struct {
Name string `json:"n"`
Value json.RawMessage `json:"v,omitempty"`
}
Trait is a smithy-go trait by codec name and JSON-encoded fields.