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.VhostRouteConfig) (err error)
func (*HTTPGroup) UnRegister ¶
type HTTPGroupController ¶
type HTTPGroupController struct {
// contains filtered or unexported fields
}
func NewHTTPGroupController ¶
func NewHTTPGroupController(vhostRouter *vhost.VhostRouters) *HTTPGroupController
func (*HTTPGroupController) Register ¶
func (ctl *HTTPGroupController) Register(proxyName, group, groupKey string, routeConfig vhost.VhostRouteConfig) (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 (*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
Click to show internal directories.
Click to hide internal directories.