reflector

package
v0.0.0-...-20fbe64 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildOpenAPIRoute

func BuildOpenAPIRoute(list []ConvertedHandler) map[string]spec.PathItem

func Register

func Register(mux *mux.MethodServeMux, swagger *spec.Swagger, prefix string, parents []string, controller any) error

func SchemaOfType

func SchemaOfType(t reflect.Type) *spec.Schema

Types

type Argv

type Argv struct {
	Loc  argloc
	Typ  reflect.Type
	Name string // name in path, query, header, form
}

type ConvertedHandler

type ConvertedHandler struct {
	Method   string
	Path     string
	Desc     string // openapi description
	Resource string // openapi resource name
	ReqArgs  []Argv
	RespArgs []Argv
	Handler  http.Handler
}

func RegisterController

func RegisterController(prefix string, parents []string, controller any) ([]ConvertedHandler, error)

Jump to

Keyboard shortcuts

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