Documentation
¶
Index ¶
- Constants
- type APISecurity
- type App
- func (a *App) Contact(name string, url string, email string)
- func (a *App) Description(description string)
- func (a *App) Include(path string, handler http.Handler)
- func (a *App) License(name string, url string)
- func (a *App) Middlewares(middlewares ...middlewares.Middleware)
- func (a *App) OpenapiDocsURL(docsUrl string)
- func (a *App) OpenapiSchemaURL(schemaUrl string)
- func (a *App) OptionalSecurity()
- func (a *App) Path(path string) *View
- func (a *App) Run(host string, port int) error
- func (a *App) RunNgrok(authtoken string) error
- func (a *App) RunTLS(host string, port int, certFile string, keyFile string) error
- func (a *App) Security(securiyProvider SecurityProvider)
- func (a *App) Tag(name string, description string)
- func (a *App) TermOfServiceURL(termOfServiceURL string)
- type AppHandler
- type Parameter
- type SecurityProvider
- type View
- func (v *View) Action(r AppHandler)
- func (v *View) Deprecated() *View
- func (v *View) Description(description string) *View
- func (v *View) Methods(methods ...string) *View
- func (v *View) Middlewares(middlewares ...middlewares.Middleware)
- func (v *View) Parameter(paramName string, in string, validators ...validators.Validator) *View
- func (v *View) Tags(tags ...string) *View
Constants ¶
const ( PATH = "path" QUERY = "query" HEADER = "header" COOKIE = "COOKIE" )
const ( GET string = http.MethodGet POST string = http.MethodPost PATCH string = http.MethodPatch DELETE string = http.MethodDelete PUT string = http.MethodPut HEAD string = http.MethodHead OPTIONS string = http.MethodOptions CONNECT string = http.MethodConnect TRACE string = http.MethodTrace )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APISecurity ¶
type APISecurity struct {
// contains filtered or unexported fields
}
func (APISecurity) GetName ¶
func (APISecurity) GetName() string
func (APISecurity) GetScopes ¶
func (APISecurity) GetScopes() []string
func (*APISecurity) IsAuthenticated ¶
func (sec *APISecurity) IsAuthenticated(r *request.Request) bool
type App ¶
type App struct {
// contains filtered or unexported fields
}
App represents the main application.
func (*App) Description ¶
Description sets the application description.
func (*App) License ¶
License sets the URL for the application's license. url is optional you can pass empty string.
func (*App) Middlewares ¶
func (a *App) Middlewares(middlewares ...middlewares.Middleware)
Add middlewares to all routes
func (*App) OpenapiDocsURL ¶
OpenapiDocsURL sets the URL path for the OpenAPI documentation. default to "/openapi.json".
func (*App) OpenapiSchemaURL ¶
OpenapiSchemaURL sets the URL path for the OpenAPI schema. default to "/docs"
func (*App) RunTLS ¶
Run starts the application and listens for incoming requests over HTTPS. This method will make the server to only support https requests, to support http and https connections do the following.
Run the app with without tls in a gorouting, and then run the app with TLS. NOTE: you can't use the same port for both, the known port for http is 80 and for https is 443.
func (*App) Security ¶
func (a *App) Security(securiyProvider SecurityProvider)
Add security provider
func (*App) Tag ¶
Tag add new tag information, used in the automatic docs. can be called multiple times for multiple tags.
func (*App) TermOfServiceURL ¶
TermOfServiceURL sets the URL for the application's terms of service.
type Parameter ¶
type Parameter struct {
// contains filtered or unexported fields
}
func NewParameter ¶
func NewParameter(name string, in string, validators []validators.Validator) Parameter
type SecurityProvider ¶
type View ¶
type View struct {
// contains filtered or unexported fields
}
func (*View) Action ¶
func (v *View) Action(r AppHandler)
func (*View) Description ¶
func (*View) Middlewares ¶
func (v *View) Middlewares(middlewares ...middlewares.Middleware)
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
current_path_serve
command
|
|
|
external_handler
command
|
|
|
math_api
command
|
|
|
ngrok_tunnel
command
|
|
|
redirect
command
|
|
|
smallest
command
|
|
|
template_response
command
|
|
|
tls
command
|
|
