Documentation ¶
Index ¶
Constants ¶
View Source
const AuthorizationApiKeyHeaderName = "x-api-key"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authorization ¶
type Authorization struct {
Token string
}
func (*Authorization) Auth ¶
func (auth *Authorization) Auth(bearerToken string, ctx echo.Context) (bool, error)
To enhance security, we use token-based authentication to connect to the cache server in order to prevent unauthorized connections from third-party applications. Currently, the cache server only supports `x-api-key` token, the value of which can be any text.
func (*Authorization) MiddlewareFunc ¶
func (auth *Authorization) MiddlewareFunc() echo.MiddlewareFunc
type ReverseProxy ¶
type ReverseProxy struct { ServerURL *url.URL Rewrite func(*httputil.ProxyRequest) ModifyResponse func(resp *http.Response) error ErrorHandler func(http.ResponseWriter, *http.Request, error) }
func (*ReverseProxy) NewRequest ¶
func (reverseProxy *ReverseProxy) NewRequest(ctx echo.Context, targetURL *url.URL) error
func (ReverseProxy) WithModifyResponse ¶
func (reverseProxy ReverseProxy) WithModifyResponse(fn func(resp *http.Response) error) *ReverseProxy
func (ReverseProxy) WithRewrite ¶
func (reverseProxy ReverseProxy) WithRewrite(fn func(req *httputil.ProxyRequest)) *ReverseProxy
Click to show internal directories.
Click to hide internal directories.