Documentation
¶
Overview ¶
Package operation holds what the server, the client and the MCP generators share about an operation: the fields its parameters and bodies go in, the Go type of a body, the status code a response key names, how the runtime names a parameter's style, the encoding of a form body, and the parts the types of an operation are declared in.
Index ¶
- func BaseMediaType(mediaType string) string
- func BodyFields(bodies []gomodel.Content, n *naming.Namer) []string
- func BodyType(c gomodel.Content) gomodel.Type
- func Concrete(mediaType string) string
- func Doc(head string, op *spec.Operation, isDescribed bool) string
- func Encoding(c gomodel.Content, runtimePkg string) string
- func FirstBody(contents []gomodel.Content) (gomodel.Content, bool)
- func FrameType(c gomodel.Content) gomodel.Type
- func GroupField(in string, n *naming.Namer) string
- func IsJSONParam(p *spec.Parameter) bool
- func IsTextValue(t gomodel.Type) bool
- func PartsOf(types []gomodel.Type) []layout.PartID
- func QueryStringField(op *gomodel.Operation, n *naming.Namer) string
- func QueryStringType(qs *gomodel.QueryString) gomodel.Type
- func StatusOf(status string) int
- func Style(p *spec.Parameter) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseMediaType ¶
BaseMediaType is a media type in lower case and without its parameters.
func BodyFields ¶
BodyFields names the options field of each body: Body for one, else Body and the tag of its media type. Two media types with one tag, such as application/xml and text/xml, are told apart by the type, then by a number.
func BodyType ¶
BodyType is the Go type a body field holds: the schema's type, held by pointer unless it can be nil, or any for JSON without a schema, a string for text and bytes for anything else.
func Concrete ¶
Concrete is the media type a body under mediaType is sent as: the member of a range that has one, else mediaType without parameters.
func Doc ¶
Doc is head, then the summary and description when isDescribed, then any deprecation note.
func GroupField ¶
GroupField names the options field that holds the parameters of location in: PathParams, Query, Headers or Cookies.
func IsJSONParam ¶
IsJSONParam reports a parameter written as JSON: one with content application/json instead of a schema.
func IsTextValue ¶
IsTextValue reports a type a text body holds as its text: a builtin, any included, or a type from a package such as time.Time.
func QueryStringField ¶
QueryStringField names the options field of the querystring of op, QueryString added on a clash.
func QueryStringType ¶
func QueryStringType(qs *gomodel.QueryString) gomodel.Type
QueryStringType is the Go type of the querystring field, held as a body is, any without a schema.
Types ¶
This section is empty.