Documentation
¶
Overview ¶
Package resourceexec shares a resource request's processing deadline and pure wire sizing with module adapters, without exposing SDK types in the root API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Item ¶
type Item struct {
URI string `json:"uri"`
MIMEType string `json:"mimeType,omitempty"`
Text *string `json:"text,omitempty"`
Blob *[]byte `json:"blob,omitempty"`
Metadata map[string]json.RawMessage `json:"_meta,omitempty"`
}
Item is the fixed resource content representation. Pointers preserve empty text/blob variants; private authorization data has no field in this type.
type Response ¶
type Response struct {
Contents []Item `json:"contents"`
Metadata map[string]json.RawMessage `json:"_meta,omitempty"`
}
Response is the shared contents/report representation before JSON-RPC framing.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope belongs to exactly one read request and its adapter conversion/preflight. The adapter owns Close; a direct root read creates and closes its own scope.
func FromContext ¶
FromContext returns a supplied adapter scope, if present.
func New ¶
New starts elapsed processing time at adapter entry, before root execution. A nil sizing callback selects the concrete JSON representation above.
func (*Scope) Close ¶
func (s *Scope) Close()
Close ends the request. Root execution never closes an adapter-owned scope.
type Sizer ¶
Sizer must be pure, nonnegative and conservative. A single-item response size must bound that item's contribution to an aggregate response. Report responses include their own metadata, warning and container overhead. The final callback checks the assembled response; the adapter reserves its separate wire framing.