Documentation ¶
Index ¶
- type AgentCommunicator
- type AgentDirectory
- func (d *AgentDirectory) Add(agentId uint, comm shared.AgentCommunicator) error
- func (d *AgentDirectory) Find(agentId uint) (shared.AgentCommunicator, error)
- func (d *AgentDirectory) Get(agentId uint) shared.AgentCommunicator
- func (d *AgentDirectory) Refresh(timeLimit time.Duration)
- func (d *AgentDirectory) Remove(agentId uint)
- type CommProcessor
- type Multiplexer
- type WebsocketClient
- type WebsocketConnector
- func (c *WebsocketConnector) Conn(conn *websocket.Conn) *websocket.Conn
- func (c *WebsocketConnector) Connect()
- func (c *WebsocketConnector) ConnectChan() chan bool
- func (c *WebsocketConnector) ConnectOnce(timeout uint) error
- func (c *WebsocketConnector) Disconnect() error
- func (c *WebsocketConnector) Recv(data interface{}, timeout uint) error
- func (c *WebsocketConnector) RecvBytes(timeout uint) ([]byte, error)
- func (c *WebsocketConnector) RecvChan() chan []byte
- func (c *WebsocketConnector) RecvError(err error)
- func (c *WebsocketConnector) RecvErrorChan() chan ws.Error
- func (c *WebsocketConnector) Send(data interface{}, timeout uint) error
- func (c *WebsocketConnector) SendBytes(bytes []byte, timeout uint) error
- func (c *WebsocketConnector) SendChan() chan []byte
- func (c *WebsocketConnector) SendErrorChan() chan ws.Error
- func (c *WebsocketConnector) Start()
- func (c *WebsocketConnector) Stop()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentCommunicator ¶
type AgentCommunicator struct { Alive bool Sent []*proto.Cmd // contains filtered or unexported fields }
func NewAgentCommunicator ¶
func NewAgentCommunicator(replies map[string]*proto.Reply) *AgentCommunicator
func (*AgentCommunicator) Done ¶
func (a *AgentCommunicator) Done() chan bool
func (*AgentCommunicator) IsAlive ¶
func (a *AgentCommunicator) IsAlive() bool
func (*AgentCommunicator) Start ¶
func (a *AgentCommunicator) Start() error
func (*AgentCommunicator) Stop ¶
func (a *AgentCommunicator) Stop()
type AgentDirectory ¶
type AgentDirectory struct {
// contains filtered or unexported fields
}
func NewAgentDirectory ¶
func NewAgentDirectory(comms map[uint]shared.AgentCommunicator) *AgentDirectory
func (*AgentDirectory) Add ¶
func (d *AgentDirectory) Add(agentId uint, comm shared.AgentCommunicator) error
func (*AgentDirectory) Find ¶
func (d *AgentDirectory) Find(agentId uint) (shared.AgentCommunicator, error)
func (*AgentDirectory) Get ¶
func (d *AgentDirectory) Get(agentId uint) shared.AgentCommunicator
func (*AgentDirectory) Refresh ¶
func (d *AgentDirectory) Refresh(timeLimit time.Duration)
func (*AgentDirectory) Remove ¶
func (d *AgentDirectory) Remove(agentId uint)
type CommProcessor ¶
type CommProcessor struct { BeforeSendFunc func(data interface{}) (id string, bytes []byte, err error) AfterRecvFunc func([]byte) (id string, data interface{}, err error) }
func (*CommProcessor) AfterRecv ¶
func (p *CommProcessor) AfterRecv(bytes []byte) (id string, data interface{}, err error)
func (*CommProcessor) BeforeSend ¶
func (p *CommProcessor) BeforeSend(data interface{}) (id string, bytes []byte, err error)
func (*CommProcessor) Timeout ¶
func (p *CommProcessor) Timeout(id string)
type Multiplexer ¶
type Multiplexer struct {
// contains filtered or unexported fields
}
func NewMultiplexer ¶
func NewMultiplexer(sendChan chan interface{}, recvChan chan interface{}) *Multiplexer
func (*Multiplexer) Done ¶
func (m *Multiplexer) Done() chan bool
func (*Multiplexer) Send ¶
func (m *Multiplexer) Send(msg interface{}) (interface{}, error)
func (*Multiplexer) Start ¶
func (m *Multiplexer) Start() error
func (*Multiplexer) Stop ¶
func (m *Multiplexer) Stop()
type WebsocketClient ¶
type WebsocketClient struct { // -- SendErr error RecvErr error // contains filtered or unexported fields }
func NewWebsocketClient ¶
func NewWebsocketClient(sendChan chan interface{}, recvChan chan []byte) *WebsocketClient
func (*WebsocketClient) Close ¶
func (w *WebsocketClient) Close()
func (*WebsocketClient) CloseChan ¶
func (w *WebsocketClient) CloseChan() chan bool
func (*WebsocketClient) RecvChan ¶
func (w *WebsocketClient) RecvChan() chan []byte
func (*WebsocketClient) SendChan ¶
func (w *WebsocketClient) SendChan() chan interface{}
type WebsocketConnector ¶
type WebsocketConnector struct {
// contains filtered or unexported fields
}
func NewWebsocketConnector ¶
func NewWebsocketConnector(sendDataChan chan interface{}, recvDataChan chan interface{}, sendBytesChan chan []byte, recvBytesChan chan []byte) *WebsocketConnector
func (*WebsocketConnector) Conn ¶
func (c *WebsocketConnector) Conn(conn *websocket.Conn) *websocket.Conn
func (*WebsocketConnector) Connect ¶
func (c *WebsocketConnector) Connect()
func (*WebsocketConnector) ConnectChan ¶
func (c *WebsocketConnector) ConnectChan() chan bool
func (*WebsocketConnector) ConnectOnce ¶
func (c *WebsocketConnector) ConnectOnce(timeout uint) error
func (*WebsocketConnector) Disconnect ¶
func (c *WebsocketConnector) Disconnect() error
func (*WebsocketConnector) Recv ¶
func (c *WebsocketConnector) Recv(data interface{}, timeout uint) error
func (*WebsocketConnector) RecvBytes ¶
func (c *WebsocketConnector) RecvBytes(timeout uint) ([]byte, error)
func (*WebsocketConnector) RecvChan ¶
func (c *WebsocketConnector) RecvChan() chan []byte
func (*WebsocketConnector) RecvError ¶
func (c *WebsocketConnector) RecvError(err error)
func (*WebsocketConnector) RecvErrorChan ¶
func (c *WebsocketConnector) RecvErrorChan() chan ws.Error
func (*WebsocketConnector) Send ¶
func (c *WebsocketConnector) Send(data interface{}, timeout uint) error
func (*WebsocketConnector) SendBytes ¶
func (c *WebsocketConnector) SendBytes(bytes []byte, timeout uint) error
func (*WebsocketConnector) SendChan ¶
func (c *WebsocketConnector) SendChan() chan []byte
func (*WebsocketConnector) SendErrorChan ¶
func (c *WebsocketConnector) SendErrorChan() chan ws.Error
func (*WebsocketConnector) Start ¶
func (c *WebsocketConnector) Start()
func (*WebsocketConnector) Stop ¶
func (c *WebsocketConnector) Stop()
Click to show internal directories.
Click to hide internal directories.