Documentation
¶
Index ¶
- Variables
- func PeekWormhole(br *bufio.Reader, conn net.Conn) (bool, error)
- type ConnectOp
- type DialOP
- type Dispatcher
- func (d *Dispatcher) Connect() error
- func (d *Dispatcher) DeleteExchange(name string)
- func (d *Dispatcher) Dispatch(ctx context.Context) error
- func (d *Dispatcher) LoadExchange(name string) (ExchangeCtl, bool)
- func (d *Dispatcher) LoadReq(reqId uint32) (ReqOperate, bool)
- func (d *Dispatcher) Read() error
- func (d *Dispatcher) Run() error
- func (d *Dispatcher) Send(o Operate)
- func (d *Dispatcher) SendAndWait(req ReqOperate) *RespOP
- type ExchangeCtl
- type ExchangeCtlStu
- type ExchangeOP
- type OpenProxy
- type Operate
- type ProxyCtl
- type ReqBase
- type ReqOperate
- type RespOP
- type RespOperate
- type Status
- type Type
- type Wormhole
Constants ¶
This section is empty.
Variables ¶
View Source
var DispatcherMap = &sync.Map{}
Functions ¶
Types ¶
type ConnectOp ¶
type ConnectOp struct {
*ReqBase
// contains filtered or unexported fields
}
func NewConnectOP ¶
type Dispatcher ¶
type Dispatcher struct {
Name string
Key string
ExchangeMap *sync.Map
ProxyMap *sync.Map
Wormhole *Wormhole
Channel chan Operate
// contains filtered or unexported fields
}
Dispatcher struct
func GetCliDispatcher ¶
func GetCliDispatcher(name string) *Dispatcher
func GetSerDispatcher ¶
func GetSerDispatcher(name string) *Dispatcher
func NewCliDispatcher ¶
func NewCliDispatcher(wormhole *Wormhole, name string) *Dispatcher
func NewSerDispatcher ¶
func NewSerDispatcher(wormhole *Wormhole, name string) *Dispatcher
func (*Dispatcher) Connect ¶
func (d *Dispatcher) Connect() error
func (*Dispatcher) DeleteExchange ¶
func (d *Dispatcher) DeleteExchange(name string)
func (*Dispatcher) LoadExchange ¶
func (d *Dispatcher) LoadExchange(name string) (ExchangeCtl, bool)
func (*Dispatcher) LoadReq ¶
func (d *Dispatcher) LoadReq(reqId uint32) (ReqOperate, bool)
func (*Dispatcher) Read ¶
func (d *Dispatcher) Read() error
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run() error
func (*Dispatcher) Send ¶
func (d *Dispatcher) Send(o Operate)
func (*Dispatcher) SendAndWait ¶
func (d *Dispatcher) SendAndWait(req ReqOperate) *RespOP
type ExchangeCtl ¶
type ExchangeCtlStu ¶
func NewExchangeCtl ¶
func NewExchangeCtl(name string, d *Dispatcher, raw net.Conn) *ExchangeCtlStu
func (*ExchangeCtlStu) Close ¶
func (c *ExchangeCtlStu) Close()
func (*ExchangeCtlStu) Read ¶
func (c *ExchangeCtlStu) Read() error
func (*ExchangeCtlStu) SendInvalid ¶
func (c *ExchangeCtlStu) SendInvalid()
func (*ExchangeCtlStu) Write ¶
func (c *ExchangeCtlStu) Write(b []byte) error
type ExchangeOP ¶
type ExchangeOP struct {
*ReqBase
// contains filtered or unexported fields
}
func NewExchangeOP ¶
func NewExchangeOP(name string, data []byte) *ExchangeOP
type OpenProxy ¶
func NewOpenProxyOP ¶
type Operate ¶
type Operate interface {
Encode(buf *bytes.Buffer) error
Decode(buf *bufio.Reader) error
Execute(ctx context.Context) error
}
Operate interface more
type ProxyCtl ¶
type ProxyCtl struct {
ShipName string
RemoteAddr string
LocalAddr string
// contains filtered or unexported fields
}
func NewProxyCtl ¶
func NewProxyCtl(dispatcher *Dispatcher, shipName, remoteAddr, localAddr string) *ProxyCtl
type ReqBase ¶
type ReqBase struct {
Type
// contains filtered or unexported fields
}
ReqBase struct
func NewReqBase ¶
func (*ReqBase) GetReqBase ¶
type ReqOperate ¶
type RespOperate ¶
Click to show internal directories.
Click to hide internal directories.