group

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 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

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

func NewHTTPGroup

func NewHTTPGroup(ctl *HTTPGroupController) *HTTPGroup

func (*HTTPGroup) Register

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

func (*HTTPGroup) UnRegister

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

type HTTPGroupController

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

func NewHTTPGroupController

func NewHTTPGroupController(vhostRouter *vhost.Routers) *HTTPGroupController

func (*HTTPGroupController) Register

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

func (*HTTPGroupController) UnRegister

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.Manager) *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

type TCPMuxGroup

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

TCPMuxGroup route connections to different proxies

func NewTCPMuxGroup

func NewTCPMuxGroup(ctl *TCPMuxGroupCtl) *TCPMuxGroup

NewTCPMuxGroup return a new TCPMuxGroup

func (*TCPMuxGroup) Accept

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

func (*TCPMuxGroup) CloseListener

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

CloseListener remove the TCPMuxGroupListener from the TCPMuxGroup

func (*TCPMuxGroup) HTTPConnectListen

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

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

TCPMuxGroupCtl manage all TCPMuxGroups

func NewTCPMuxGroupCtl

func NewTCPMuxGroupCtl(tcpMuxHTTPConnectMuxer *tcpmux.HTTPConnectTCPMuxer) *TCPMuxGroupCtl

NewTCPMuxGroupCtl return a new TCPMuxGroupCtl

func (*TCPMuxGroupCtl) Listen

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

func (tmgc *TCPMuxGroupCtl) RemoveGroup(group string)

RemoveGroup remove TCPMuxGroup from controller

type TCPMuxGroupListener

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

TCPMuxGroupListener

func (*TCPMuxGroupListener) Accept

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

Accept will accept connections from TCPMuxGroup

func (*TCPMuxGroupListener) Addr

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

func (*TCPMuxGroupListener) Close

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