respec

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: MIT Imports: 6 Imported by: 0

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

func GetByHandler(handler types.Object) *Builder

GetByHandler is called by the static analyzer.

func (*Builder) GetDescription

func (b *Builder) GetDescription() string

func (*Builder) GetSecurity

func (b *Builder) GetSecurity() []string

func (*Builder) GetSummary

func (b *Builder) GetSummary() string

func (*Builder) GetTags

func (b *Builder) GetTags() []string

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

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

Jump to

Keyboard shortcuts

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