gocrew

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func P added in v0.2.0

func P[T any](v T) *T

P wraps the value to a pointer

func Walk added in v0.2.0

func Walk(r chi.Routes, walkFn WalkFunc, onController ControllerFunc) error

Types

type ControllerFunc added in v0.2.0

type ControllerFunc func(controller goflag.ControllerFlag) error

type Generator

type Generator[T any] interface {
	Generate(router chi.Routes) (*T, error)
}

Generator generates a T documentation from a chi.Router

func OpenApi31 added in v0.1.0

func OpenApi31(title string, defaultTag *openapi31.Tag) Generator[OpenApi31Spec]

OpenApi31 returns a Generator that generates a OpenAPI v3.1.0 compliant specification

type OpenApi31Spec added in v0.1.0

type OpenApi31Spec openapi31.Spec

func (*OpenApi31Spec) ServeHTTP added in v0.1.0

func (spec *OpenApi31Spec) ServeHTTP(w http.ResponseWriter, _ *http.Request)

func (*OpenApi31Spec) WithUI added in v0.1.0

func (spec *OpenApi31Spec) WithUI(title string, basePath string, docPattern string, config *swg.Config) http.Handler

type WalkFunc added in v0.2.0

type WalkFunc func(method string, route string, handler http.Handler, controller goflag.ControllerFlag) error

Jump to

Keyboard shortcuts

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