handler

package
v0.1.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2020 License: MIT Imports: 20 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.

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) HandlePurge

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

HandlePurge - Purges the cache for the requested URI.

func (RequestCall) HandleRequestAndProxy

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

HandleRequestAndProxy - Handles the requests and proxies to backend server.

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