Documentation
¶
Index ¶
- type Binding
- func (b *Binding) Description() string
- func (b *Binding) In() Location
- func (b *Binding) IsAggregate() bool
- func (b *Binding) IsBlank() bool
- func (b *Binding) IsManual() bool
- func (b *Binding) Name() string
- func (b *Binding) Required() bool
- func (b *Binding) SetDescription(description string)
- func (b *Binding) SetIn(in Location)
- func (b *Binding) SetName(name string)
- func (b *Binding) SetType(typ string)
- func (b *Binding) Type() string
- type Location
- type Metadata
- type Operation
- type Parameter
- type Request
- type Response
- type Specification
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Binding ¶
type Binding struct {
Arg *ifacetool.Param // The method argument.
Params []*Parameter // The corresponding request parameters
}
Binding represents a binding from a method argument to one or more request parameters.
func (*Binding) Description ¶
func (*Binding) IsAggregate ¶
IsAggregate determines whether this binding is aggregate.
func (*Binding) IsManual ¶
IsManual determines whether this binding is specified manually (i.e. by handwritten annotations).
func (*Binding) SetDescription ¶
type Operation ¶
type Operation struct {
// In cases where multiple `//kun:op` are specified for one Go method,
// Name and GoMethodName will be different.
Name string
GoMethodName string
Method string
Pattern string
Request *Request
SuccessResponse *Response
FailureResponses []*Response
Description string
Tags []string
}
func NewOperation ¶
type Parameter ¶
type Parameter struct {
In Location // The location of the parameter.
Name string // The name of the parameter.
Required bool // Whether this parameter is mandatory.
Type string // The type of the parameter.
Description string // A brief description of the parameter.
}
Parameter represents a request parameter. See https://spec.openapis.org/oas/v3.1.0#parameter-object.
type Request ¶
type Request struct {
MediaType string
// The name of the request field whose value is mapped to the HTTP request body.
// Otherwise, all fields not located in path/query/header will be mapped to the HTTP body
BodyField string
Bindings []*Binding
}
func (*Request) GetBinding ¶
type Specification ¶
func (*Specification) OldSpec ¶
func (s *Specification) OldSpec() *openapi.Specification
Click to show internal directories.
Click to hide internal directories.