spec

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(c Comment)

Register registers a comment to the default registry.

Types

type Comment

type Comment interface {
	Tag() string
	Usage() string
	ParseInto(c string, s *openapi.Extendable[openapi.OpenAPI]) error
}

type ExternalDocsDescriptionComment

type ExternalDocsDescriptionComment struct{}

func (*ExternalDocsDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ExternalDocsDescriptionComment) Tag

Tag implements Comment.

func (*ExternalDocsDescriptionComment) Usage

Usage implements Comment.

type ExternalDocsURLComment

type ExternalDocsURLComment struct{}

func (*ExternalDocsURLComment) ParseInto

ParseInto implements Comment.

func (*ExternalDocsURLComment) Tag

func (c *ExternalDocsURLComment) Tag() string

Tag implements Comment.

func (*ExternalDocsURLComment) Usage

func (c *ExternalDocsURLComment) Usage() string

Usage implements Comment.

type InfoContactEmailComment

type InfoContactEmailComment struct{}

func (*InfoContactEmailComment) ParseInto

ParseInto implements Comment.

func (*InfoContactEmailComment) Tag

Tag implements Comment.

func (*InfoContactEmailComment) Usage

func (c *InfoContactEmailComment) Usage() string

Usage implements Comment.

type InfoContactNameComment

type InfoContactNameComment struct{}

func (*InfoContactNameComment) ParseInto

ParseInto implements Comment.

func (*InfoContactNameComment) Tag

func (c *InfoContactNameComment) Tag() string

Tag implements Comment.

func (*InfoContactNameComment) Usage

func (c *InfoContactNameComment) Usage() string

Usage implements Comment.

type InfoContactURLComment

type InfoContactURLComment struct{}

func (*InfoContactURLComment) ParseInto

ParseInto implements Comment.

func (*InfoContactURLComment) Tag

func (c *InfoContactURLComment) Tag() string

Tag implements Comment.

func (*InfoContactURLComment) Usage

func (c *InfoContactURLComment) Usage() string

Usage implements Comment.

type InfoDescriptionComment

type InfoDescriptionComment struct{}

func (*InfoDescriptionComment) ParseInto

ParseInto implements Comment.

func (*InfoDescriptionComment) Tag

func (c *InfoDescriptionComment) Tag() string

Tag implements Comment.

func (*InfoDescriptionComment) Usage

func (c *InfoDescriptionComment) Usage() string

Usage implements Comment.

type InfoLicenseIdentifierComment

type InfoLicenseIdentifierComment struct{}

func (*InfoLicenseIdentifierComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseIdentifierComment) Tag

Tag implements Comment.

func (*InfoLicenseIdentifierComment) Usage

Usage implements Comment.

type InfoLicenseNameComment

type InfoLicenseNameComment struct{}

func (*InfoLicenseNameComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseNameComment) Tag

func (c *InfoLicenseNameComment) Tag() string

Tag implements Comment.

func (*InfoLicenseNameComment) Usage

func (c *InfoLicenseNameComment) Usage() string

Usage implements Comment.

type InfoLicenseURLComment

type InfoLicenseURLComment struct{}

func (*InfoLicenseURLComment) ParseInto

ParseInto implements Comment.

func (*InfoLicenseURLComment) Tag

func (c *InfoLicenseURLComment) Tag() string

Tag implements Comment.

func (*InfoLicenseURLComment) Usage

func (c *InfoLicenseURLComment) Usage() string

Usage implements Comment.

type InfoSummaryComment

type InfoSummaryComment struct{}

func (*InfoSummaryComment) ParseInto

ParseInto implements Comment.

func (*InfoSummaryComment) Tag

func (c *InfoSummaryComment) Tag() string

Tag implements Comment.

func (*InfoSummaryComment) Usage

func (c *InfoSummaryComment) Usage() string

Usage implements Comment.

type InfoTermsOfServiceComment

type InfoTermsOfServiceComment struct{}

func (*InfoTermsOfServiceComment) ParseInto

ParseInto implements Comment.

func (*InfoTermsOfServiceComment) Tag

Tag implements Comment.

func (*InfoTermsOfServiceComment) Usage

func (c *InfoTermsOfServiceComment) Usage() string

Usage implements Comment.

type InfoTitleComment

type InfoTitleComment struct{}

func (*InfoTitleComment) ParseInto

func (c *InfoTitleComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*InfoTitleComment) Tag

func (c *InfoTitleComment) Tag() string

InfoTitleComment implements Comment.

func (*InfoTitleComment) Usage

func (c *InfoTitleComment) Usage() string

Usage implements Comment.

type InfoVersionComment

type InfoVersionComment struct{}

func (*InfoVersionComment) ParseInto

ParseInto implements Comment.

func (*InfoVersionComment) Tag

func (c *InfoVersionComment) Tag() string

Tag implements Comment.

func (*InfoVersionComment) Usage

func (c *InfoVersionComment) Usage() string

Usage implements Comment.

type MockComment

type MockComment struct {
	mock.Mock
}

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) ParseInto

func (_mock *MockComment) ParseInto(c string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto provides a mock function for the type MockComment

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{}, s interface{}) *MockComment_ParseInto_Call

ParseInto is a helper method to define mock.On call

  • c string
  • s *openapi.Extendable[openapi.OpenAPI]

func (*MockComment_Expecter) Tag

Tag is a helper method to define mock.On call

func (*MockComment_Expecter) Usage

Usage is a helper method to define mock.On call

type MockComment_ParseInto_Call

type MockComment_ParseInto_Call struct {
	*mock.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 (*MockComment_ParseInto_Call) Run

func (*MockComment_ParseInto_Call) RunAndReturn

type MockComment_Tag_Call

type MockComment_Tag_Call struct {
	*mock.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 (*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

type MockComment_Usage_Call struct {
	*mock.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 (*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

type MockRegistry struct {
	mock.Mock
}

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) Parse

func (_mock *MockRegistry) Parse(line string, spec *openapi.Extendable[openapi.OpenAPI]) error

Parse provides a mock function for the type MockRegistry

func (*MockRegistry) Register

func (_mock *MockRegistry) Register(c Comment)

Register provides a mock function for the type MockRegistry

type MockRegistry_Comments_Call

type MockRegistry_Comments_Call struct {
	*mock.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 (*MockRegistry_Comments_Call) Run

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

Comments is a helper method to define mock.On call

func (*MockRegistry_Expecter) Parse

func (_e *MockRegistry_Expecter) Parse(line interface{}, spec interface{}) *MockRegistry_Parse_Call

Parse is a helper method to define mock.On call

  • line string
  • spec *openapi.Extendable[openapi.OpenAPI]

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

type MockRegistry_Parse_Call struct {
	*mock.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 (*MockRegistry_Parse_Call) Run

func (*MockRegistry_Parse_Call) RunAndReturn

type MockRegistry_Register_Call

type MockRegistry_Register_Call struct {
	*mock.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 (*MockRegistry_Register_Call) Run

func (*MockRegistry_Register_Call) RunAndReturn

func (_c *MockRegistry_Register_Call) RunAndReturn(run func(c Comment)) *MockRegistry_Register_Call

type Registry

type Registry interface {
	Register(c Comment)
	Parse(line string, spec *openapi.Extendable[openapi.OpenAPI]) error
	Comments() []Comment
}

Registry allows to register and parse comments.

func Default

func Default() Registry

func NewRegistry

func NewRegistry() Registry

NewRegistry creates a new Registry.

type SecurityComment

type SecurityComment struct{}

SecurityComment is a comment that updates the security of the global specification.

func (*SecurityComment) ParseInto

func (c *SecurityComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*SecurityComment) Tag

func (c *SecurityComment) Tag() string

Tag implements Comment.

func (*SecurityComment) Usage

func (c *SecurityComment) Usage() string

Usage implements Comment.

type SecuritySchemeBearerFormatComment

type SecuritySchemeBearerFormatComment struct{}

SecuritySchemeBearerFormatComment is a comment that updates the 'bearerFormat' property of a security scheme.

func (*SecuritySchemeBearerFormatComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeBearerFormatComment) Tag

Tag implements Comment.

func (*SecuritySchemeBearerFormatComment) Usage

Usage implements Comment.

type SecuritySchemeComment

type SecuritySchemeComment struct{}

SecuritySchemeComment is a comment that adds a security scheme to the specification.

func (*SecuritySchemeComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeComment) Tag

func (c *SecuritySchemeComment) Tag() string

Tag implements Comment.

func (*SecuritySchemeComment) Usage

func (c *SecuritySchemeComment) Usage() string

Usage implements Comment.

type SecuritySchemeInComment

type SecuritySchemeInComment struct{}

SecuritySchemeInComment is a comment that updates the 'in' property of a security scheme.

func (*SecuritySchemeInComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeInComment) Tag

Tag implements Comment.

func (*SecuritySchemeInComment) Usage

func (c *SecuritySchemeInComment) Usage() string

Usage implements Comment.

type SecuritySchemeNameComment

type SecuritySchemeNameComment struct{}

SecuritySchemeNameComment is a comment that updates the name of a security scheme.

func (*SecuritySchemeNameComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeNameComment) Tag

Tag implements Comment.

func (*SecuritySchemeNameComment) Usage

func (c *SecuritySchemeNameComment) Usage() string

Usage implements Comment.

type SecuritySchemeSchemeComment

type SecuritySchemeSchemeComment struct{}

SecuritySchemeSchemeComment is a comment that updates the 'scheme' property of a security scheme.

func (*SecuritySchemeSchemeComment) ParseInto

ParseInto implements Comment.

func (*SecuritySchemeSchemeComment) Tag

Tag implements Comment.

func (*SecuritySchemeSchemeComment) Usage

Usage implements Comment.

type ServerDescriptionComment

type ServerDescriptionComment struct{}

ServerDescriptionComment is a comment that updates the description of the last added server.

func (*ServerDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ServerDescriptionComment) Tag

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 global specification.

func (*ServerURLComment) ParseInto

func (c *ServerURLComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*ServerURLComment) Tag

func (c *ServerURLComment) Tag() string

Tag implements Comment.

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.

func (*ServerVariableDefaultComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableDefaultComment) Tag

Tag implements Comment.

func (*ServerVariableDefaultComment) Usage

Usage implements Comment.

type ServerVariableDescriptionComment

type ServerVariableDescriptionComment struct{}

ServerVariableDescriptionComment sets the description for a server variable.

func (*ServerVariableDescriptionComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableDescriptionComment) Tag

Tag implements Comment.

func (*ServerVariableDescriptionComment) Usage

Usage implements Comment.

type ServerVariableEnumComment

type ServerVariableEnumComment struct{}

ServerVariableEnumComment sets the enum values for a server variable.

func (*ServerVariableEnumComment) ParseInto

ParseInto implements Comment.

func (*ServerVariableEnumComment) Tag

Tag implements Comment.

func (*ServerVariableEnumComment) Usage

func (c *ServerVariableEnumComment) Usage() string

Usage implements Comment.

type TagDescriptionComment

type TagDescriptionComment struct{}

func (*TagDescriptionComment) ParseInto

ParseInto implements Comment.

func (*TagDescriptionComment) Tag

func (c *TagDescriptionComment) Tag() string

Tag implements Comment.

func (*TagDescriptionComment) Usage

func (c *TagDescriptionComment) Usage() string

Usage implements Comment.

type TagExternalDocsDescriptionComment

type TagExternalDocsDescriptionComment struct{}

func (*TagExternalDocsDescriptionComment) ParseInto

ParseInto implements Comment.

func (*TagExternalDocsDescriptionComment) Tag

Tag implements Comment.

func (*TagExternalDocsDescriptionComment) Usage

Usage implements Comment.

type TagExternalDocsURLComment

type TagExternalDocsURLComment struct{}

func (*TagExternalDocsURLComment) ParseInto

ParseInto implements Comment.

func (*TagExternalDocsURLComment) Tag

Tag implements Comment.

func (*TagExternalDocsURLComment) Usage

func (c *TagExternalDocsURLComment) Usage() string

Usage implements Comment.

type TagNameComment

type TagNameComment struct{}

func (*TagNameComment) ParseInto

func (c *TagNameComment) ParseInto(line string, s *openapi.Extendable[openapi.OpenAPI]) error

ParseInto implements Comment.

func (*TagNameComment) Tag

func (c *TagNameComment) Tag() string

Tag implements Comment.

func (*TagNameComment) Usage

func (c *TagNameComment) Usage() string

Usage implements Comment.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL