proxy

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RemoveElement = errors.New("Obsolete element")
View Source
var UnmappableUrl = errors.New("unmappable URL")

Functions

This section is empty.

Types

type HostRewriter

type HostRewriter interface {
	CanHandle(http.ResponseWriter) bool
	Rewrite([]byte, *url.URL) ([]byte, error)
	RewriteUrl(urlString string, reqUrl *url.URL) (string, error)
	Decorate(httprouter.Handle) httprouter.Handle
}

func NewHostRewriter

func NewHostRewriter(internalHost string, urlPatterns map[string]string, logger *logging.Logger) (HostRewriter, error)

type JsonHostRewriter

type JsonHostRewriter struct {
	InternalHost string
	Mappings     []mapping
	Logger       *logging.Logger
}

func (*JsonHostRewriter) CanHandle

func (j *JsonHostRewriter) CanHandle(res http.ResponseWriter) bool

func (*JsonHostRewriter) Decorate

func (j *JsonHostRewriter) Decorate(handler httprouter.Handle) httprouter.Handle

func (*JsonHostRewriter) Rewrite

func (j *JsonHostRewriter) Rewrite(body []byte, reqUrl *url.URL) ([]byte, error)

func (*JsonHostRewriter) RewriteUrl

func (j *JsonHostRewriter) RewriteUrl(urlString string, reqUrl *url.URL) (string, error)

type ProxyHandler

type ProxyHandler struct {
	Client *http.Client
	Logger *logging.Logger
	Config *config.Configuration
	// contains filtered or unexported fields
}

func NewProxyHandler

func NewProxyHandler(logger *logging.Logger, config *config.Configuration, metrics *monitoring.PromMetrics) *ProxyHandler

func (*ProxyHandler) HandleProxyRequest

func (p *ProxyHandler) HandleProxyRequest(rw http.ResponseWriter, req *http.Request, targetUrl string, appName string, appCfg *config.Application)

func (*ProxyHandler) UnavailableError

func (p *ProxyHandler) UnavailableError(rw http.ResponseWriter, req *http.Request, appName string)

Jump to

Keyboard shortcuts

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