Documentation
¶
Overview ¶
Package catalog is the operation index shared by the runtime, the MCP server, and a generated client.
Index ¶
- Constants
- func ApplyRelations(cat *Catalog, rels []Relation) error
- func Facts(cat *Catalog) map[string]OpFact
- func SurfaceRegressions(base, next map[string]OpFact, confirmationChanged map[string]bool, ...) []string
- type Auth
- type Catalog
- type Edge
- type Graph
- type Kind
- type Match
- type Node
- type NodeKind
- type OpFact
- type OpLink
- type Operation
- type Param
- type Relation
- type SchemaUse
- type Selection
- type Server
- type SideEffect
Constants ¶
const ( KindRead Kind = "read" KindCreate Kind = "create" KindUpdate Kind = "update" KindDelete Kind = "delete" KindAction Kind = "action" SideEffectNone SideEffect = "none" SideEffectWrite SideEffect = "write" SideEffectDestructive SideEffect = "destructive" // ExposureDirect is a pinned tool. ExposureGrouped is one tool for the resource. ExposureDiscovery stays on search and describe. ExposureDirect = "direct" ExposureGrouped = "grouped" ExposureDiscovery = "discovery-only" )
const ( NodeResource NodeKind = "resource" NodeOperation NodeKind = "operation" NodeSchema NodeKind = "schema" EdgeOwns = "owns" EdgeUses = "uses" EdgeLinks = "links" EdgeRelates = "relates" )
Variables ¶
This section is empty.
Functions ¶
func ApplyRelations ¶
A field name in a spec does not create an edge. This declaration does.
Types ¶
type Auth ¶
type Auth struct {
Name string `json:"Name"`
Header string `json:"Header"`
Query string `json:"Query"`
Kind string `json:"Kind"`
Scopes []string `json:"Scopes"`
UserHeader string `json:"UserHeader"`
Type string `json:"-"` // OpenAPI security scheme type
Scheme string `json:"-"` // OpenAPI http scheme, such as basic
}
Auth is one scheme in a security requirement. Header is set for header placement. Query is set for an apiKey in query. UserHeader is set when the contract names a separate header for the person token.
type Catalog ¶
type Catalog struct {
Title string
Version string
Operations []Operation
Links []OpLink
Uses []SchemaUse
Graph Graph
// contains filtered or unexported fields
}
func (*Catalog) ClearConfirmation ¶
func (c *Catalog) ClearConfirmation()
ClearConfirmation turns the confirmation gate off for every operation.
func (*Catalog) Select ¶ added in v0.1.1
Select removes every operation s does not keep, with the links and relations that point at it.
func (*Catalog) SelectServer ¶
type Edge ¶
Owns is resource to operation. Uses is operation to schema. Links is operation to operation.
type Graph ¶
func (Graph) OperationsForResource ¶
type Operation ¶
type Operation struct {
ID string `json:"ID"`
Name string `json:"Name"`
Summary string `json:"-"`
Description string `json:"Description"`
IDFallback bool `json:"-"`
IDCollision string `json:"-"`
Group string `json:"Group"`
Kind Kind `json:"Kind"`
Method string `json:"Method"`
PathTemplate string `json:"PathTemplate"`
Params []Param `json:"Params"`
ResponseSummary string `json:"ResponseSummary"`
SideEffect SideEffect `json:"SideEffect"`
RequiresConfirmation bool `json:"RequiresConfirmation"`
Permissions []string `json:"Permissions"`
Idempotency string `json:"Idempotency"`
Retry string `json:"Retry"`
Exposure string `json:"Exposure"`
BaseURL string `json:"BaseURL"`
Servers []Server `json:"Servers"`
Page map[string]string `json:"Page"`
Auth []Auth `json:"Auth"`
Requirements [][]Auth `json:"Requirements"` // OR of AND groups. Auth is the first group.
Tags []string `json:"Tags"`
ResponseFields []string `json:"ResponseFields"`
ResponseRequired []string `json:"ResponseRequired,omitempty"`
}
func (Operation) AuthSchemes ¶
AuthSchemes returns each scheme name once, across every requirement.
func (Operation) CheckParams ¶ added in v0.1.1
CheckParams reports a missing required value, a parameter the call cannot send, a body that is not the declared JSON object, or a query, path, or header value that is not the declared schema.
type Param ¶
type Param struct {
Name string `json:"Name"`
In string `json:"In"` // path, query, header, body
Required bool `json:"Required"`
Description string `json:"Description"`
Schema string `json:"Schema"`
MediaType string `json:"MediaType"`
Default string `json:"Default"`
Style string `json:"Style"`
Explode bool `json:"Explode"`
// contains filtered or unexported fields
}
func (Param) Structured ¶ added in v0.1.1
Structured reports an array or object schema.
func (Param) Unserializable ¶ added in v0.1.1
Unserializable reports why a parameter cannot be placed on the request. An empty string means the call can send it.
type Relation ¶
type Relation struct {
Schema string `yaml:"schema"`
Field string `yaml:"field"`
To string `yaml:"to"`
}
func ParseRelations ¶
type Selection ¶ added in v0.1.1
Selection is the part of a contract a deployment exposes; the zero value keeps every operation.
type SideEffect ¶
type SideEffect string