Documentation
¶
Index ¶
- func NewRouterComment() *routerComment
- func Register(c Comment)
- type Comment
- type DeprecatedComment
- type DescriptionComment
- type ExternalDocsDescriptionComment
- type ExternalDocsURLComment
- type IDComment
- type Operation
- type ParamAllowEmptyValueComment
- type ParamAllowReservedComment
- type ParamComment
- type ParamDeprecatedComment
- type ParamRequiredComment
- type Registry
- type RequestBodyComment
- type ResponseComment
- type Route
- type Routes
- type SecurityComment
- type SecurityNoneComment
- type ServerDescriptionComment
- type ServerURLComment
- type ServerVariableDefaultComment
- type ServerVariableDescriptionComment
- type ServerVariableEnumComment
- type SummaryComment
- type TagsComment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRouterComment ¶
func NewRouterComment() *routerComment
Types ¶
type Comment ¶
type Comment interface {
Tag() string
Usage() string
ParseInto(c string, f *ast.File, op *Operation) error
}
Comment defines the interface for operation-level OpenAPI annotations.
type DeprecatedComment ¶
type DeprecatedComment struct{}
DeprecatedComment marks an operation as deprecated.
func NewDeprecatedComment ¶
func NewDeprecatedComment() *DeprecatedComment
func (*DeprecatedComment) Tag ¶
func (c *DeprecatedComment) Tag() string
func (*DeprecatedComment) Usage ¶
func (c *DeprecatedComment) Usage() string
type DescriptionComment ¶
type DescriptionComment struct{}
DescriptionComment sets the description of an operation.
func NewDescriptionComment ¶
func NewDescriptionComment() *DescriptionComment
func (*DescriptionComment) Tag ¶
func (c *DescriptionComment) Tag() string
func (*DescriptionComment) Usage ¶
func (c *DescriptionComment) Usage() string
type ExternalDocsDescriptionComment ¶
type ExternalDocsDescriptionComment struct{}
ExternalDocsDescriptionComment sets the description for an operation's external documentation.
func NewExternalDocsDescriptionComment ¶
func NewExternalDocsDescriptionComment() *ExternalDocsDescriptionComment
func (*ExternalDocsDescriptionComment) Tag ¶
func (c *ExternalDocsDescriptionComment) Tag() string
func (*ExternalDocsDescriptionComment) Usage ¶
func (c *ExternalDocsDescriptionComment) Usage() string
type ExternalDocsURLComment ¶
type ExternalDocsURLComment struct{}
ExternalDocsURLComment sets the URL for an operation's external documentation.
func NewExternalDocsURLComment ¶
func NewExternalDocsURLComment() *ExternalDocsURLComment
func (*ExternalDocsURLComment) Tag ¶
func (c *ExternalDocsURLComment) Tag() string
func (*ExternalDocsURLComment) Usage ¶
func (c *ExternalDocsURLComment) Usage() string
type IDComment ¶
type IDComment struct{}
IDComment sets the operationId of an operation.
func NewIDComment ¶
func NewIDComment() *IDComment
type Operation ¶
type Operation struct {
Builder *openapi.OperationBuilder
ResponsesBuilder *openapi.ResponsesBuilder
Routes Routes
Resolver resolver.Resolver
}
Operation holds an operation being built
func NewOperation ¶
NewOperation builds a new operation
type ParamAllowEmptyValueComment ¶
type ParamAllowEmptyValueComment struct {
// contains filtered or unexported fields
}
ParamAllowEmptyValueComment sets the allowEmptyValue flag for a parameter in an operation.
func NewParamAllowEmptyValueComment ¶
func NewParamAllowEmptyValueComment() *ParamAllowEmptyValueComment
type ParamAllowReservedComment ¶
type ParamAllowReservedComment struct {
// contains filtered or unexported fields
}
ParamAllowReservedComment sets the allowReserved flag for a parameter in an operation.
func NewParamAllowReservedComment ¶
func NewParamAllowReservedComment() *ParamAllowReservedComment
type ParamComment ¶
type ParamComment struct{}
ParamComment adds a parameter to an operation.
func NewParamComment ¶
func NewParamComment() *ParamComment
func (*ParamComment) Tag ¶
func (c *ParamComment) Tag() string
func (*ParamComment) Usage ¶
func (c *ParamComment) Usage() string
type ParamDeprecatedComment ¶
type ParamDeprecatedComment struct {
// contains filtered or unexported fields
}
ParamDeprecatedComment sets the deprecated flag for a parameter in an operation.
func NewParamDeprecatedComment ¶
func NewParamDeprecatedComment() *ParamDeprecatedComment
type ParamRequiredComment ¶
type ParamRequiredComment struct {
// contains filtered or unexported fields
}
ParamRequiredComment sets the required flag for a parameter in an operation.
func NewParamRequiredComment ¶
func NewParamRequiredComment() *ParamRequiredComment
type Registry ¶
type Registry interface {
Register(c Comment)
Parse(line string, f *ast.File, op *Operation) error
Comments() []Comment
}
Registry allows to register and parse comments.
type RequestBodyComment ¶
type RequestBodyComment struct{}
RequestBodyComment defines the request body for an operation.
func NewRequestBodyComment ¶
func NewRequestBodyComment() *RequestBodyComment
func (*RequestBodyComment) Tag ¶
func (c *RequestBodyComment) Tag() string
func (*RequestBodyComment) Usage ¶
func (c *RequestBodyComment) Usage() string
type ResponseComment ¶
type ResponseComment struct{}
ResponseComment adds a response to an operation.
func NewResponseComment ¶
func NewResponseComment() *ResponseComment
func (*ResponseComment) Tag ¶
func (c *ResponseComment) Tag() string
func (*ResponseComment) Usage ¶
func (c *ResponseComment) Usage() string
type SecurityComment ¶
type SecurityComment struct{}
SecurityComment is a comment that updates the security of an operation.
func NewSecurityComment ¶
func NewSecurityComment() *SecurityComment
func (*SecurityComment) Tag ¶
func (d *SecurityComment) Tag() string
func (*SecurityComment) Usage ¶
func (d *SecurityComment) Usage() string
type SecurityNoneComment ¶
type SecurityNoneComment struct{}
SecurityNoneComment is a comment that clears the security of an operation.
func NewSecurityNoneComment ¶
func NewSecurityNoneComment() *SecurityNoneComment
func (*SecurityNoneComment) Tag ¶
func (d *SecurityNoneComment) Tag() string
func (*SecurityNoneComment) Usage ¶
func (d *SecurityNoneComment) Usage() string
type ServerDescriptionComment ¶
type ServerDescriptionComment struct{}
ServerDescriptionComment sets the description for the last added server of an operation.
func (*ServerDescriptionComment) Tag ¶
func (c *ServerDescriptionComment) Tag() string
Tag implements Comment.
func (*ServerDescriptionComment) Usage ¶
func (c *ServerDescriptionComment) Usage() string
Usage implements Comment.
type ServerURLComment ¶
type ServerURLComment struct{}
ServerURLComment is a comment that adds a new server to the operation.
func (*ServerURLComment) Usage ¶
func (c *ServerURLComment) Usage() string
Usage implements Comment.
type ServerVariableDefaultComment ¶
type ServerVariableDefaultComment struct{}
ServerVariableDefaultComment sets the default value for a server variable on an operation.
func (*ServerVariableDefaultComment) Tag ¶
func (c *ServerVariableDefaultComment) Tag() string
Tag implements Comment.
func (*ServerVariableDefaultComment) Usage ¶
func (c *ServerVariableDefaultComment) Usage() string
Usage implements Comment.
type ServerVariableDescriptionComment ¶
type ServerVariableDescriptionComment struct{}
ServerVariableDescriptionComment sets the description for a server variable on an operation.
func (*ServerVariableDescriptionComment) ParseInto ¶
func (c *ServerVariableDescriptionComment) ParseInto(content string, f *ast.File, op *Operation) error
ParseInto implements Comment.
func (*ServerVariableDescriptionComment) Tag ¶
func (c *ServerVariableDescriptionComment) Tag() string
Tag implements Comment.
func (*ServerVariableDescriptionComment) Usage ¶
func (c *ServerVariableDescriptionComment) Usage() string
Usage implements Comment.
type ServerVariableEnumComment ¶
type ServerVariableEnumComment struct{}
ServerVariableEnumComment sets the enum values for a server variable on an operation.
func (*ServerVariableEnumComment) Tag ¶
func (c *ServerVariableEnumComment) Tag() string
Tag implements Comment.
func (*ServerVariableEnumComment) Usage ¶
func (c *ServerVariableEnumComment) Usage() string
Usage implements Comment.
type SummaryComment ¶
type SummaryComment struct{}
SummaryComment sets the summary of an operation.
func NewSummaryComment ¶
func NewSummaryComment() *SummaryComment
func (*SummaryComment) Tag ¶
func (c *SummaryComment) Tag() string
func (*SummaryComment) Usage ¶
func (c *SummaryComment) Usage() string
type TagsComment ¶
type TagsComment struct{}
TagsComment adds tags to an operation.
func NewTagsComment ¶
func NewTagsComment() *TagsComment
func (*TagsComment) Tag ¶
func (c *TagsComment) Tag() string
func (*TagsComment) Usage ¶
func (c *TagsComment) Usage() string
Source Files
¶
- comment.go
- deprecated.go
- description.go
- externaldocs_description.go
- externaldocs_url.go
- id.go
- operation.go
- param.go
- param_allow_empty.go
- param_allow_reserved.go
- param_bool_flags.go
- param_deprecated.go
- param_required.go
- registry.go
- request_body.go
- response.go
- route.go
- router.go
- security.go
- security_none.go
- server_description.go
- server_url.go
- server_variable_default.go
- server_variable_description.go
- server_variable_enum.go
- summary.go
- tags.go