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
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 (*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.