proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2019 License: NCSA Imports: 9 Imported by: 1

Documentation

Index

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 DELETE

func DELETE(w http.ResponseWriter, r *http.Request, url string, format string, token string)

DELETE proxies a DELETE request

func GET

func GET(w http.ResponseWriter, r *http.Request, url string, format string, token string)

GET proxies a GET request

func PATCH

func PATCH(w http.ResponseWriter, r *http.Request, url string, format string, token string)

PATCH proxies a PATCH request

func POST

func POST(w http.ResponseWriter, r *http.Request, url string, format string, token string)

POST proxies a POST request

func PUT

func PUT(w http.ResponseWriter, r *http.Request, url string, format string, token string)

PUT proxies a PUT request

func ProxyRequest

func ProxyRequest(w http.ResponseWriter, r *http.Request, url string, format string, token string)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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