group

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

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 v1.0.0

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

func NewHTTPGroup added in v1.0.0

func NewHTTPGroup(ctl *HTTPGroupController) *HTTPGroup

func (*HTTPGroup) Register added in v1.0.0

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

func (*HTTPGroup) UnRegister added in v1.0.0

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

type HTTPGroupController added in v1.0.0

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

func NewHTTPGroupController added in v1.0.0

func NewHTTPGroupController(vhostRouter *vhost.Routers) *HTTPGroupController

func (*HTTPGroupController) Register added in v1.0.0

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

func (*HTTPGroupController) UnRegister added in v1.0.0

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

type TCPGroup added in v1.0.0

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

TCPGroup route connections to different proxies

func NewTCPGroup added in v1.0.0

func NewTCPGroup(ctl *TCPGroupCtl) *TCPGroup

NewTCPGroup return a new TCPGroup

func (*TCPGroup) Accept added in v1.0.0

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

func (*TCPGroup) CloseListener added in v1.0.0

func (tg *TCPGroup) CloseListener(ln *TCPGroupListener)

CloseListener remove the TCPGroupListener from the TCPGroup

func (*TCPGroup) Listen added in v1.0.0

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 added in v1.0.0

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

TCPGroupCtl manage all TCPGroups

func NewTCPGroupCtl added in v1.0.0

func NewTCPGroupCtl(portManager *ports.Manager) *TCPGroupCtl

NewTCPGroupCtl return a new TcpGroupCtl

func (*TCPGroupCtl) Listen added in v1.0.0

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 added in v1.0.0

func (tgc *TCPGroupCtl) RemoveGroup(group string)

RemoveGroup remove TCPGroup from controller

type TCPGroupListener added in v1.0.0

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

TCPGroupListener

func (*TCPGroupListener) Accept added in v1.0.0

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

Accept will accept connections from TCPGroup

func (*TCPGroupListener) Addr added in v1.0.0

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

func (*TCPGroupListener) Close added in v1.0.0

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

Close close the listener

type TCPMuxGroup added in v1.0.0

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

TCPMuxGroup route connections to different proxies

func NewTCPMuxGroup added in v1.0.0

func NewTCPMuxGroup(ctl *TCPMuxGroupCtl) *TCPMuxGroup

NewTCPMuxGroup return a new TCPMuxGroup

func (*TCPMuxGroup) Accept added in v1.0.0

func (tmg *TCPMuxGroup) Accept() <-chan net.Conn

func (*TCPMuxGroup) CloseListener added in v1.0.0

func (tmg *TCPMuxGroup) CloseListener(ln *TCPMuxGroupListener)

CloseListener remove the TCPMuxGroupListener from the TCPMuxGroup

func (*TCPMuxGroup) HTTPConnectListen added in v1.0.0

func (tmg *TCPMuxGroup) HTTPConnectListen(ctx context.Context, group string, groupKey string, domain string) (ln *TCPMuxGroupListener, err error)

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

type TCPMuxGroupCtl added in v1.0.0

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

TCPMuxGroupCtl manage all TCPMuxGroups

func NewTCPMuxGroupCtl added in v1.0.0

func NewTCPMuxGroupCtl(tcpMuxHTTPConnectMuxer *tcpmux.HTTPConnectTCPMuxer) *TCPMuxGroupCtl

NewTCPMuxGroupCtl return a new TCPMuxGroupCtl

func (*TCPMuxGroupCtl) Listen added in v1.0.0

func (tmgc *TCPMuxGroupCtl) Listen(ctx context.Context, multiplexer string, group string, groupKey string,
	domain string) (l net.Listener, err error)

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

func (*TCPMuxGroupCtl) RemoveGroup added in v1.0.0

func (tmgc *TCPMuxGroupCtl) RemoveGroup(group string)

RemoveGroup remove TCPMuxGroup from controller

type TCPMuxGroupListener added in v1.0.0

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

TCPMuxGroupListener

func (*TCPMuxGroupListener) Accept added in v1.0.0

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

Accept will accept connections from TCPMuxGroup

func (*TCPMuxGroupListener) Addr added in v1.0.0

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

func (*TCPMuxGroupListener) Close added in v1.0.0

func (ln *TCPMuxGroupListener) 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