proxy

package
v12.4.0-rc1+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WebsocketProtocolFor

func WebsocketProtocolFor(httpProtocol string) string

WebsocketProtocolFor returns the proper Websocket protocol based on the HTTP protocol

Types

type MockPooler

type MockPooler struct {
	mock.Mock
}

MockPooler is an autogenerated mock type for the Pooler type

func (*MockPooler) Pool

func (_m *MockPooler) Pool() Pool

Pool provides a mock function with given fields:

type MockRequester

type MockRequester struct {
	mock.Mock
}

MockRequester is an autogenerated mock type for the ProxyRequester type

func (*MockRequester) ProxyRequest

func (_m *MockRequester) ProxyRequest(w http.ResponseWriter, r *http.Request, requestedURI string, port string, settings *Settings)

ProxyRequest provides a mock function with given fields: w, r, requestedURI, port, settings

type Pool

type Pool map[string]*Proxy

func NewPool

func NewPool() Pool

type Pooler

type Pooler interface {
	Pool() Pool
}

type Port

type Port struct {
	Number   int
	Protocol string
	Name     string
}

func (*Port) Scheme

func (p *Port) Scheme() (string, error)

type Proxy

type Proxy struct {
	Settings          *Settings
	ConnectionHandler Requester
}

type Requester

type Requester interface {
	ProxyRequest(w http.ResponseWriter, r *http.Request, requestedURI, port string, settings *Settings)
}

type Settings

type Settings struct {
	ServiceName string
	Ports       []Port
}

func NewProxySettings

func NewProxySettings(serviceName string, ports []Port) *Settings

func (*Settings) PortByNameOrNumber

func (p *Settings) PortByNameOrNumber(portNameOrNumber string) (Port, error)

PortByNameOrNumber accepts both a port number or a port name. It will try to convert the method into an integer and then search if there is any port number with that value or any port name by the param value.

Jump to

Keyboard shortcuts

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