group

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGroupAuthFailed    = errors.New("group auth failed")
	ErrGroupParamsInvalid = errors.New("group params invalid")
	ErrListenerClosed     = errors.New("group listener closed")
	ErrGroupDifferentPort = errors.New("group should have same remote port")
	ErrProxyRepeated      = errors.New("group proxy repeated")
)

Functions

This section is empty.

Types

type HTTPGroup added in v0.28.0

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

func NewHTTPGroup added in v0.28.0

func NewHTTPGroup(ctl *HTTPGroupController) *HTTPGroup

func (*HTTPGroup) Register added in v0.28.0

func (g *HTTPGroup) Register(proxyName, group, groupKey string,
	routeConfig vhost.VhostRouteConfig) (err error)

func (*HTTPGroup) UnRegister added in v0.28.0

func (g *HTTPGroup) UnRegister(proxyName string) (isEmpty bool)

type HTTPGroupController added in v0.28.0

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

func NewHTTPGroupController added in v0.28.0

func NewHTTPGroupController(vhostRouter *vhost.VhostRouters) *HTTPGroupController

func (*HTTPGroupController) Register added in v0.28.0

func (ctl *HTTPGroupController) Register(proxyName, group, groupKey string,
	routeConfig vhost.VhostRouteConfig) (err error)

func (*HTTPGroupController) UnRegister added in v0.28.0

func (ctl *HTTPGroupController) UnRegister(proxyName, group, domain, location string)

type TcpGroup

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

TcpGroup route connections to different proxies

func NewTcpGroup

func NewTcpGroup(ctl *TcpGroupCtl) *TcpGroup

NewTcpGroup return a new TcpGroup

func (*TcpGroup) Accept

func (tg *TcpGroup) Accept() <-chan net.Conn

func (*TcpGroup) CloseListener

func (tg *TcpGroup) CloseListener(ln *TcpGroupListener)

CloseListener remove the TcpGroupListener from the TcpGroup

func (*TcpGroup) Listen

func (tg *TcpGroup) Listen(proxyName string, group string, groupKey string, addr string, port int) (ln *TcpGroupListener, realPort int, err error)

Listen will return a new TcpGroupListener if TcpGroup already has a listener, just add a new TcpGroupListener to the queues otherwise, listen on the real address

type TcpGroupCtl

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

TcpGroupCtl manage all TcpGroups

func NewTcpGroupCtl

func NewTcpGroupCtl(portManager *ports.PortManager) *TcpGroupCtl

NewTcpGroupCtl return a new TcpGroupCtl

func (*TcpGroupCtl) Listen

func (tgc *TcpGroupCtl) Listen(proxyName string, group string, groupKey string,
	addr string, port int) (l net.Listener, realPort int, err error)

Listen is the wrapper for TcpGroup's Listen If there are no group, we will create one here

func (*TcpGroupCtl) RemoveGroup

func (tgc *TcpGroupCtl) RemoveGroup(group string)

RemoveGroup remove TcpGroup from controller

type TcpGroupListener

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

TcpGroupListener

func (*TcpGroupListener) Accept

func (ln *TcpGroupListener) Accept() (c net.Conn, err error)

Accept will accept connections from TcpGroup

func (*TcpGroupListener) Addr

func (ln *TcpGroupListener) Addr() net.Addr

func (*TcpGroupListener) Close

func (ln *TcpGroupListener) Close() (err error)

Close close the listener

Jump to

Keyboard shortcuts

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