Documentation ¶
Index ¶
- type BaseVisitor
- type ByProxyStatusResp
- type Control
- func (ctl *Control) Close() error
- func (ctl *Control) ClosedDoneCh() <-chan struct{}
- func (ctl *Control) HandleNewProxyResp(inMsg *msg.NewProxyResp)
- func (ctl *Control) HandleReqWorkConn(inMsg *msg.ReqWorkConn)
- func (ctl *Control) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf) error
- func (ctl *Control) Run()
- type GeneralResponse
- type ProxyStatusResp
- type Service
- func (svr *Service) Close()
- func (svr *Service) GetController() *Control
- func (svr *Service) IsClosed() bool
- func (svr *Service) ReloadConf(pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf) error
- func (svr *Service) Run(isCmd bool) error
- func (svr *Service) RunAdminServer(addr string, port int) (err error)
- func (svr *Service) SetOnCloseListener(listener ServiceClosedListener)
- func (svr *Service) SetProxyFailedFunc(proxyFailedFunc func(err error))
- type ServiceClosedListener
- type StatusResp
- type StcpVisitor
- type Visitor
- type VisitorManager
- type XtcpVisitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseVisitor ¶
type ByProxyStatusResp ¶
type ByProxyStatusResp []ProxyStatusResp
func (ByProxyStatusResp) Len ¶
func (a ByProxyStatusResp) Len() int
func (ByProxyStatusResp) Less ¶
func (a ByProxyStatusResp) Less(i, j int) bool
func (ByProxyStatusResp) Swap ¶
func (a ByProxyStatusResp) Swap(i, j int)
type Control ¶
type Control struct { log.Logger ProxyFunc func(err error) // contains filtered or unexported fields }
func NewControl ¶
func (*Control) ClosedDoneCh ¶
func (ctl *Control) ClosedDoneCh() <-chan struct{}
ClosedDoneCh returns a channel which will be closed after all resources are released
func (*Control) HandleNewProxyResp ¶
func (ctl *Control) HandleNewProxyResp(inMsg *msg.NewProxyResp)
func (*Control) HandleReqWorkConn ¶
func (ctl *Control) HandleReqWorkConn(inMsg *msg.ReqWorkConn)
func (*Control) ReloadConf ¶
type GeneralResponse ¶
type ProxyStatusResp ¶
type ProxyStatusResp struct { Name string `json:"name"` Type string `json:"type"` Status string `json:"status"` Err string `json:"err"` LocalAddr string `json:"local_addr"` Plugin string `json:"plugin"` RemoteAddr string `json:"remote_addr"` }
func NewProxyStatusResp ¶
func NewProxyStatusResp(status *proxy.ProxyStatus, serverAddr string) ProxyStatusResp
type Service ¶
type Service struct { ReConnectByCount bool // contains filtered or unexported fields }
Service is a client service.
func NewService ¶
func NewService(cfg config.ClientCommonConf, pxyCfgs map[string]config.ProxyConf, visitorCfgs map[string]config.VisitorConf, cfgFile string) (svr *Service, err error)
NewService creates a new client service with the given configuration.
func (*Service) GetController ¶
func (*Service) ReloadConf ¶
func (*Service) RunAdminServer ¶
func (*Service) SetOnCloseListener ¶
func (svr *Service) SetOnCloseListener(listener ServiceClosedListener)
func (*Service) SetProxyFailedFunc ¶
type ServiceClosedListener ¶
type ServiceClosedListener interface {
OnClosed(msg string)
}
type StatusResp ¶
type StatusResp struct { Tcp []ProxyStatusResp `json:"tcp"` Udp []ProxyStatusResp `json:"udp"` Http []ProxyStatusResp `json:"http"` Https []ProxyStatusResp `json:"https"` Stcp []ProxyStatusResp `json:"stcp"` Xtcp []ProxyStatusResp `json:"xtcp"` }
type StcpVisitor ¶
type StcpVisitor struct { *BaseVisitor // contains filtered or unexported fields }
func (*StcpVisitor) Close ¶
func (sv *StcpVisitor) Close()
func (*StcpVisitor) Run ¶
func (sv *StcpVisitor) Run() (err error)
type Visitor ¶
Visitor is used for forward traffics from local port tot remote service.
func NewVisitor ¶
func NewVisitor(ctl *Control, cfg config.VisitorConf) (visitor Visitor)
type VisitorManager ¶
type VisitorManager struct {
// contains filtered or unexported fields
}
func NewVisitorManager ¶
func NewVisitorManager(ctl *Control) *VisitorManager
func (*VisitorManager) Close ¶
func (vm *VisitorManager) Close()
func (*VisitorManager) Reload ¶
func (vm *VisitorManager) Reload(cfgs map[string]config.VisitorConf)
func (*VisitorManager) Run ¶
func (vm *VisitorManager) Run()
type XtcpVisitor ¶
type XtcpVisitor struct { *BaseVisitor // contains filtered or unexported fields }
func (*XtcpVisitor) Close ¶
func (sv *XtcpVisitor) Close()
func (*XtcpVisitor) Run ¶
func (sv *XtcpVisitor) Run() (err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.