router

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProxyHandler added in v0.3.0

func NewProxyHandler(url string) fasthttp.RequestHandler

NewRedirectHandler returns a new redirect handler

func NewRedirectHandler added in v0.1.0

func NewRedirectHandler(url string, code int) fasthttp.RequestHandler

NewRedirectHandler returns a new redirect handler

Types

type ProxyHandler added in v0.3.0

type ProxyHandler struct {
	// contains filtered or unexported fields
}

RedirectHandler stores the URL and HTTP code of a redirect

func (*ProxyHandler) ServeHTTP added in v0.3.0

func (r *ProxyHandler) ServeHTTP(ctx *fasthttp.RequestCtx)

ServerHTTP writes a redirect to an HTTP response

type RedirectHandler added in v0.1.0

type RedirectHandler struct {
	// contains filtered or unexported fields
}

RedirectHandler stores the URL and HTTP code of a redirect

func (*RedirectHandler) ServeHTTP added in v0.1.0

func (r *RedirectHandler) ServeHTTP(ctx *fasthttp.RequestCtx)

ServerHTTP writes a redirect to an HTTP response

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router holds the current routing table

func NewRouter

func NewRouter() *Router

NewRouter returns a new instance of the router

func (*Router) CertificateForService added in v0.1.0

func (r *Router) CertificateForService(address string) (*tls.Certificate, bool)

CertificateForService returns the certificate for a service (if one exists)

func (*Router) RouteToService added in v0.1.0

func (r *Router) RouteToService(address string, secure bool) (fasthttp.RequestHandler, bool)

RouteToService returns the correct HTTP handler for a given service's DNS name

func (*Router) UpdateTable

func (r *Router) UpdateTable(services []service.Service)

UpdateTable is an atomic operation to update the routing table

Jump to

Keyboard shortcuts

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