openapi2

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Docs

func Docs(routes []*Route) (*spec.Swagger, error)

func LogJSON

func LogJSON(v any)

func LogYAML

func LogYAML(v any)

func MarshalJSON

func MarshalJSON(v interface{}) ([]byte, error)

func MarshalYAML

func MarshalYAML(v interface{}) ([]byte, error)

func RegisterRoute

func RegisterRoute(parser *swag.Parser, route *Route) error

func SetOperation

func SetOperation(pathItem *spec.PathItem, method string, operation *spec.Operation)

func WriteDocs

func WriteDocs(docs *spec.Swagger, cfg *GenConfig) error

Types

type GenConfig

type GenConfig = gen.GenConfig

type Route

type Route struct {
	Method      string
	Path        string
	Params      []spec.Parameter
	Handler     http.Handler
	Middlewares []func(http.Handler) http.Handler
}

Jump to

Keyboard shortcuts

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