Documentation
¶
Overview ¶
Package respec provides a fluent API for adding OpenAPI metadata to http.HandlerFuncs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func GetByHandler ¶ added in v0.2.0
GetByHandler is called by the static analyzer.
func (*Builder) GetDescription ¶
func (*Builder) GetSecurity ¶
func (*Builder) GetSummary ¶
type DecoratedHandler ¶ added in v0.2.3
type DecoratedHandler http.HandlerFunc
DecoratedHandler is a custom type for http.HandlerFunc that allows chaining metadata methods.
func Handler ¶ added in v0.2.1
func Handler(handler http.HandlerFunc) DecoratedHandler
Handler wraps an http.HandlerFunc, allowing metadata to be chained to it. This is the main entry point for developers adding endpoint-specific metadata. Usage: r.Post("/users", respec.Handler(myHandler).Tag("Users"))
func (DecoratedHandler) Description ¶ added in v0.2.3
func (dh DecoratedHandler) Description(d string) DecoratedHandler
Description sets the description for the operation.
func (DecoratedHandler) Security ¶ added in v0.2.3
func (dh DecoratedHandler) Security(schemeName string) DecoratedHandler
Security applies a security scheme to the operation.
func (DecoratedHandler) Summary ¶ added in v0.2.3
func (dh DecoratedHandler) Summary(s string) DecoratedHandler
Summary sets the summary for the operation.
func (DecoratedHandler) Tag ¶ added in v0.2.3
func (dh DecoratedHandler) Tag(tags ...string) DecoratedHandler
Tag adds one or more tags to the operation.
type GroupBuilder ¶ added in v0.2.1
type GroupBuilder struct {
// contains filtered or unexported fields
}
func Meta ¶ added in v0.2.2
func Meta(router interface{}) *GroupBuilder
Meta provides a way to attach metadata to a router instance within a specific scope. This is a marker for the static analyzer.
func NewGroupBuilder ¶ added in v0.2.2
func NewGroupBuilder() *GroupBuilder
func (*GroupBuilder) GetSecurity ¶ added in v0.2.2
func (b *GroupBuilder) GetSecurity() []string
func (*GroupBuilder) GetTags ¶ added in v0.2.2
func (b *GroupBuilder) GetTags() []string
func (*GroupBuilder) Security ¶ added in v0.2.1
func (b *GroupBuilder) Security(schemeName string) *GroupBuilder
func (*GroupBuilder) Tag ¶ added in v0.2.1
func (b *GroupBuilder) Tag(tags ...string) *GroupBuilder