Documentation
¶
Index ¶
- func NewRouterComment() *routerComment
- func Register(c Comment)
- type Comment
- type DeprecatedComment
- type DescriptionComment
- type ExternalDocsDescriptionComment
- type ExternalDocsURLComment
- type IDComment
- type MockComment
- type MockComment_Expecter
- type MockComment_ParseInto_Call
- func (_c *MockComment_ParseInto_Call) Return(err error) *MockComment_ParseInto_Call
- func (_c *MockComment_ParseInto_Call) Run(run func(c string, f *ast.File, op *Operation)) *MockComment_ParseInto_Call
- func (_c *MockComment_ParseInto_Call) RunAndReturn(run func(c string, f *ast.File, op *Operation) error) *MockComment_ParseInto_Call
- type MockComment_Tag_Call
- type MockComment_Usage_Call
- type MockRegistry
- type MockRegistry_Comments_Call
- type MockRegistry_Expecter
- type MockRegistry_Parse_Call
- func (_c *MockRegistry_Parse_Call) Return(err error) *MockRegistry_Parse_Call
- func (_c *MockRegistry_Parse_Call) Run(run func(line string, f *ast.File, op *Operation)) *MockRegistry_Parse_Call
- func (_c *MockRegistry_Parse_Call) RunAndReturn(run func(line string, f *ast.File, op *Operation) error) *MockRegistry_Parse_Call
- type MockRegistry_Register_Call
- 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 MockComment ¶
MockComment is an autogenerated mock type for the Comment type
func NewMockComment ¶
func NewMockComment(t interface {
mock.TestingT
Cleanup(func())
}) *MockComment
NewMockComment creates a new instance of MockComment. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockComment) EXPECT ¶
func (_m *MockComment) EXPECT() *MockComment_Expecter
func (*MockComment) Tag ¶
func (_mock *MockComment) Tag() string
Tag provides a mock function for the type MockComment
func (*MockComment) Usage ¶
func (_mock *MockComment) Usage() string
Usage provides a mock function for the type MockComment
type MockComment_Expecter ¶
type MockComment_Expecter struct {
// contains filtered or unexported fields
}
func (*MockComment_Expecter) ParseInto ¶
func (_e *MockComment_Expecter) ParseInto(c interface{}, f interface{}, op interface{}) *MockComment_ParseInto_Call
ParseInto is a helper method to define mock.On call
- c string
- f *ast.File
- op *Operation
func (*MockComment_Expecter) Tag ¶
func (_e *MockComment_Expecter) Tag() *MockComment_Tag_Call
Tag is a helper method to define mock.On call
func (*MockComment_Expecter) Usage ¶
func (_e *MockComment_Expecter) Usage() *MockComment_Usage_Call
Usage is a helper method to define mock.On call
type MockComment_ParseInto_Call ¶
MockComment_ParseInto_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ParseInto'
func (*MockComment_ParseInto_Call) Return ¶
func (_c *MockComment_ParseInto_Call) Return(err error) *MockComment_ParseInto_Call
func (*MockComment_ParseInto_Call) Run ¶
func (_c *MockComment_ParseInto_Call) Run(run func(c string, f *ast.File, op *Operation)) *MockComment_ParseInto_Call
func (*MockComment_ParseInto_Call) RunAndReturn ¶
func (_c *MockComment_ParseInto_Call) RunAndReturn(run func(c string, f *ast.File, op *Operation) error) *MockComment_ParseInto_Call
type MockComment_Tag_Call ¶
MockComment_Tag_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Tag'
func (*MockComment_Tag_Call) Return ¶
func (_c *MockComment_Tag_Call) Return(s string) *MockComment_Tag_Call
func (*MockComment_Tag_Call) Run ¶
func (_c *MockComment_Tag_Call) Run(run func()) *MockComment_Tag_Call
func (*MockComment_Tag_Call) RunAndReturn ¶
func (_c *MockComment_Tag_Call) RunAndReturn(run func() string) *MockComment_Tag_Call
type MockComment_Usage_Call ¶
MockComment_Usage_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Usage'
func (*MockComment_Usage_Call) Return ¶
func (_c *MockComment_Usage_Call) Return(s string) *MockComment_Usage_Call
func (*MockComment_Usage_Call) Run ¶
func (_c *MockComment_Usage_Call) Run(run func()) *MockComment_Usage_Call
func (*MockComment_Usage_Call) RunAndReturn ¶
func (_c *MockComment_Usage_Call) RunAndReturn(run func() string) *MockComment_Usage_Call
type MockRegistry ¶
MockRegistry is an autogenerated mock type for the Registry type
func NewMockRegistry ¶
func NewMockRegistry(t interface {
mock.TestingT
Cleanup(func())
}) *MockRegistry
NewMockRegistry creates a new instance of MockRegistry. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockRegistry) Comments ¶
func (_mock *MockRegistry) Comments() []Comment
Comments provides a mock function for the type MockRegistry
func (*MockRegistry) EXPECT ¶
func (_m *MockRegistry) EXPECT() *MockRegistry_Expecter
func (*MockRegistry) Register ¶
func (_mock *MockRegistry) Register(c Comment)
Register provides a mock function for the type MockRegistry
type MockRegistry_Comments_Call ¶
MockRegistry_Comments_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Comments'
func (*MockRegistry_Comments_Call) Return ¶
func (_c *MockRegistry_Comments_Call) Return(comments []Comment) *MockRegistry_Comments_Call
func (*MockRegistry_Comments_Call) Run ¶
func (_c *MockRegistry_Comments_Call) Run(run func()) *MockRegistry_Comments_Call
func (*MockRegistry_Comments_Call) RunAndReturn ¶
func (_c *MockRegistry_Comments_Call) RunAndReturn(run func() []Comment) *MockRegistry_Comments_Call
type MockRegistry_Expecter ¶
type MockRegistry_Expecter struct {
// contains filtered or unexported fields
}
func (*MockRegistry_Expecter) Comments ¶
func (_e *MockRegistry_Expecter) Comments() *MockRegistry_Comments_Call
Comments is a helper method to define mock.On call
func (*MockRegistry_Expecter) Parse ¶
func (_e *MockRegistry_Expecter) Parse(line interface{}, f interface{}, op interface{}) *MockRegistry_Parse_Call
Parse is a helper method to define mock.On call
- line string
- f *ast.File
- op *Operation
func (*MockRegistry_Expecter) Register ¶
func (_e *MockRegistry_Expecter) Register(c interface{}) *MockRegistry_Register_Call
Register is a helper method to define mock.On call
- c Comment
type MockRegistry_Parse_Call ¶
MockRegistry_Parse_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Parse'
func (*MockRegistry_Parse_Call) Return ¶
func (_c *MockRegistry_Parse_Call) Return(err error) *MockRegistry_Parse_Call
func (*MockRegistry_Parse_Call) Run ¶
func (_c *MockRegistry_Parse_Call) Run(run func(line string, f *ast.File, op *Operation)) *MockRegistry_Parse_Call
func (*MockRegistry_Parse_Call) RunAndReturn ¶
func (_c *MockRegistry_Parse_Call) RunAndReturn(run func(line string, f *ast.File, op *Operation) error) *MockRegistry_Parse_Call
type MockRegistry_Register_Call ¶
MockRegistry_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register'
func (*MockRegistry_Register_Call) Return ¶
func (_c *MockRegistry_Register_Call) Return() *MockRegistry_Register_Call
func (*MockRegistry_Register_Call) Run ¶
func (_c *MockRegistry_Register_Call) Run(run func(c Comment)) *MockRegistry_Register_Call
func (*MockRegistry_Register_Call) RunAndReturn ¶
func (_c *MockRegistry_Register_Call) RunAndReturn(run func(c Comment)) *MockRegistry_Register_Call
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
- comment_mock.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
- registry_mock.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