Documentation ¶
Index ¶
- func DefaultError(bc *BuildContext, typ interface{})
- type BuildContext
- func (bc *BuildContext) BuildHandler(ctx context.Context) (http.Handler, error)
- func (bc *BuildContext) BuildOpenAPIDoc(ctx context.Context) (*openapi3.T, error)
- func (bc *BuildContext) Doc() *openapi3.T
- func (bc *BuildContext) EmitDoc(ctx context.Context, w io.Writer) error
- func (bc *BuildContext) ReflectOpenAPIManager() *reflectopenapi.Manager
- func (bc *BuildContext) Router() chi.Router
- type DocModifier
- type EndpointModifier
- func Delete[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Get[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Head[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Method[I any, O any](bc *BuildContext, method, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Options[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Patch[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Post[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func Put[I any, O any](bc *BuildContext, path string, action quickapi.Action[I, O], ...) *EndpointModifier
- func (m *EndpointModifier) After(f func(op *openapi3.Operation)) *EndpointModifier
- func (m *EndpointModifier) AnotherError(bc *BuildContext, code int, typ interface{}, description string) *EndpointModifier
- func (m *EndpointModifier) Description(description string) *EndpointModifier
- func (a *EndpointModifier) Example(code int, title string, value interface{}) *EndpointModifier
- func (m *EndpointModifier) Status(code int) *EndpointModifier
- type TypeModifier
- func Enum[T any](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
- func IntEnum[T ~int](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
- func StringEnum[T ~string](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
- func Type(bc *BuildContext, typ interface{}) *TypeModifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultError ¶
func DefaultError(bc *BuildContext, typ interface{})
----------------------------------------
Types ¶
type BuildContext ¶
type BuildContext struct {
// contains filtered or unexported fields
}
func MustBuildContext ¶
func MustBuildContext(docM DocModifier, r chi.Router) *BuildContext
func NewBuildContext ¶
func NewBuildContext(docM DocModifier, r chi.Router) (*BuildContext, error)
func (*BuildContext) BuildHandler ¶
func (*BuildContext) BuildOpenAPIDoc ¶
func (*BuildContext) Doc ¶
func (bc *BuildContext) Doc() *openapi3.T
Doc returns internal github.com/getkin/kin-openapi/openapi3.T
func (*BuildContext) ReflectOpenAPIManager ¶
func (bc *BuildContext) ReflectOpenAPIManager() *reflectopenapi.Manager
ReflectOpenAPIManager returns internal github.com/podhmo/reflect-openapi/Manager
func (*BuildContext) Router ¶
func (bc *BuildContext) Router() chi.Router
Router returns internal github.com/go-chi/chi.Router
type DocModifier ¶
func Doc ¶
func Doc() DocModifier
func (DocModifier) After ¶
func (m DocModifier) After(f func(doc *openapi3.T)) DocModifier
func (DocModifier) Server ¶
func (m DocModifier) Server(url string, description string) DocModifier
func (DocModifier) Title ¶
func (m DocModifier) Title(title string) DocModifier
func (DocModifier) Version ¶
func (m DocModifier) Version(version string) DocModifier
type EndpointModifier ¶
type EndpointModifier reflectopenapi.RegisterFuncAction
func (*EndpointModifier) After ¶
func (m *EndpointModifier) After(f func(op *openapi3.Operation)) *EndpointModifier
func (*EndpointModifier) AnotherError ¶
func (m *EndpointModifier) AnotherError(bc *BuildContext, code int, typ interface{}, description string) *EndpointModifier
func (*EndpointModifier) Description ¶
func (m *EndpointModifier) Description(description string) *EndpointModifier
func (*EndpointModifier) Example ¶
func (a *EndpointModifier) Example(code int, title string, value interface{}) *EndpointModifier
func (*EndpointModifier) Status ¶
func (m *EndpointModifier) Status(code int) *EndpointModifier
type TypeModifier ¶
type TypeModifier reflectopenapi.RegisterTypeAction
func Enum ¶
func Enum[T any](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
func IntEnum ¶
func IntEnum[T ~int](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
func StringEnum ¶
func StringEnum[T ~string](bc *BuildContext, defaultValue T, values ...T) *TypeModifier
func Type ¶
func Type(bc *BuildContext, typ interface{}) *TypeModifier
func (*TypeModifier) After ¶
func (m *TypeModifier) After(f func(ref *openapi3.SchemaRef)) *TypeModifier
func (*TypeModifier) Before ¶
func (m *TypeModifier) Before(f func(s *openapi3.Schema)) *TypeModifier
func (*TypeModifier) Example ¶
func (a *TypeModifier) Example(value interface{}) *TypeModifier
Click to show internal directories.
Click to hide internal directories.