Documentation
¶
Index ¶
- Variables
- func DELETE(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func GET(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func PATCH(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func POST(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func PUT(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func ProxyRequest(w http.ResponseWriter, r *http.Request, url string, format string, ...)
- func ProxyRequestWithMiddlewares(w http.ResponseWriter, r *http.Request, url string, ...)
- type MiddlewareSet
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessControlPolicy = "*"
AccessControlPolicy is the default Access control policy
View Source
var ProxyMiddlewares = MiddlewareSet{ ErrorHandler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(500) }), RequestMiddlewares: nil, ResponseMiddlewares: nil, }
ProxyMiddlewares is the default error handler and middlewares to use when proxying a request
Functions ¶
func ProxyRequest ¶
ProxyRequest proxies the caller's request based on the url, format, and token
func ProxyRequestWithMiddlewares ¶
func ProxyRequestWithMiddlewares(w http.ResponseWriter, r *http.Request, url string, proxyMiddlewares MiddlewareSet)
ProxyRequestWithMiddlewares proxies the provided request using the given middlewares
Types ¶
type MiddlewareSet ¶
type MiddlewareSet struct { ErrorHandler http.Handler RequestMiddlewares []http.Handler ResponseMiddlewares []http.Handler }
MiddlewareSet contains the error handler and middlewares to use when proxying a request
func ProxyMiddlewaresFactory ¶
func ProxyMiddlewaresFactory(format string, token string) MiddlewareSet
ProxyMiddlewaresFactory a set of middlewares based on the provided format and token
Click to show internal directories.
Click to hide internal directories.