handler

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToRequestCallDTO

func ConvertToRequestCallDTO(rc RequestCall) storage.RequestCallDTO

ConvertToRequestCallDTO - Generates a storage DTO containing request, response and cache settings.

func HandleHealthcheck

func HandleHealthcheck(res http.ResponseWriter, req *http.Request)

HandleHealthcheck - Returns healthcheck status.

func HandleRequest

func HandleRequest(res http.ResponseWriter, req *http.Request)

HandleRequest - Handles the entrypoint and directs the traffic to the right handler.

func PushProxiedResources added in v0.2.0

func PushProxiedResources(lwr *response.LoggedResponseWriter)

PushProxiedResources - Start HTTP/2 Push of the resources needed.

Types

type RequestCall

type RequestCall struct {
	Response *response.LoggedResponseWriter
	Request  *http.Request
}

RequestCall - Main object containing request and response.

func (*RequestCall) FixRequest

func (rc *RequestCall) FixRequest(url url.URL, upstream config.Upstream)

FixRequest - Fixes the Request in order to use the load balanced host.

func (RequestCall) GetScheme

func (rc RequestCall) GetScheme() string

GetScheme - Returns current request scheme. For server requests the URL is parsed from the URI supplied on the Request-Line as stored in RequestURI. For most requests, fields other than Path and RawQuery will be empty. (See RFC 7230, Section 5.3) Ref: https://github.com/golang/go/issues/28940

func (RequestCall) HandleHTTPRequestAndProxy added in v0.2.0

func (rc RequestCall) HandleHTTPRequestAndProxy(domainConfig *config.Configuration)

HandleHTTPRequestAndProxy - Handles the HTTP requests and proxies to backend server.

func (RequestCall) HandlePurge

func (rc RequestCall) HandlePurge(domainConfig *config.Configuration)

HandlePurge - Purges the cache for the requested URI.

func (RequestCall) HandleWSRequestAndProxy added in v0.2.0

func (rc RequestCall) HandleWSRequestAndProxy(domainConfig *config.Configuration)

HandleWSRequestAndProxy - Handles the websocket requests and proxies to backend server.

func (RequestCall) IsWebSocket added in v0.2.0

func (rc RequestCall) IsWebSocket() bool

IsWebSocket - Checks whether a request is a websocket.

func (RequestCall) RedirectToHTTPS

func (rc RequestCall) RedirectToHTTPS(redirectStatusCode int)

RedirectToHTTPS - Redirects from HTTP to HTTPS.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL