mux

package
v0.0.0-...-a355528 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2017 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(listen string, advertiseHostPort string,
	plugins func() discovery.Plugins, options Options) (rpc_server.Stoppable, error)

NewServer returns a tcp server listening at the listen address (e.g. ':8080'), or error

func SavePID

func SavePID(listen string) (string, error)

SavePID makes sure the directory exists and writes the pid to a file

Types

type Options

type Options struct {
	Leadership <-chan leader.Leadership
	Registry   leader.Store
}

Options capture additional configurations and objects that the mux will use

type ReverseProxy

type ReverseProxy struct {
	http.Handler
	// contains filtered or unexported fields
}

ReverseProxy is the mux reverse proxy that is able to multiplex calls to this to different backends, including socket-based plugins.

func NewReverseProxy

func NewReverseProxy(plugins func() discovery.Plugins) *ReverseProxy

NewReverseProxy creates a mux reverse proxy

func (*ReverseProxy) ForwardTo

func (rp *ReverseProxy) ForwardTo(u *url.URL)

ForwardTo sends the traffic to this url (host:port) instead of local plugins

func (*ReverseProxy) ServeHTTP

func (rp *ReverseProxy) ServeHTTP(resp http.ResponseWriter, req *http.Request)

ServeHTTP implements HTTP handler

Jump to

Keyboard shortcuts

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