Documentation ¶
Index ¶
- type API
- func (a *API) Delete(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Document() *openapi3.Document
- func (a *API) Get(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Head(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Options(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Patch(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Post(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Put(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- func (a *API) Trace(pattern string, handler http.HandlerFunc, operation *openapi3.Operation)
- type APIConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API struct is a wrapper on top of multiplexer for registering operations.
func (*API) Delete ¶
Delete method registers an handler for HTTP DELETE requests matching the pattern and updates operations table in OpenAPI document.
func (*API) Document ¶
Document method returns pointer to serializable openapi3.Document. This document can be saved in the file system and used for code generation.
func (*API) Get ¶
Get method registers an handler for HTTP GET requests matching the pattern and updates operations table in OpenAPI document.
func (*API) Head ¶
Head method registers an handler for HTTP HEAD requests matching the pattern and updates operations table in OpenAPI document.
func (*API) Options ¶
Options method registers an handler for HTTP OPTIONS requests matching the pattern and updates operations table in OpenAPI document.
func (*API) Patch ¶
Patch method registers an handler for HTTP PATCH requests matching the pattern and updates operations table in OpenAPI document.
func (*API) Post ¶
Post method registers an handler for HTTP POST requests matching the pattern and updates operations table in OpenAPI document.
type APIConfig ¶
type APIConfig struct { // DocumentPath is the path to the API specification in JSON format. // // Default: "/api/openapi.json" DocumentPath string // SwaggerUIPath is the path to the API documentation UI. // // Default: "/api" SwaggerUIPath string // SwaggerUITitle is the title of API documentation UI page. // // Default: "Swagger UI" SwaggerUITitle string }
APIConfig struct describes configuration options for API.
func NewAPIConfig ¶
func NewAPIConfig() *APIConfig
NewAPIConfig method creates new APIConfig with default settings.
func (*APIConfig) SetDocumentPath ¶
SetDocumentPath method sets custom path for the API specification in JSON format.
func (*APIConfig) SetSwaggerUIPath ¶
SetSwaggerUIPath method sets custom path for the API documentation UI.
func (*APIConfig) SetSwaggerUITitle ¶
SetSwaggerUITitle method sets custom title of the API documentation UI page.