mock

package
v1.17.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 16, 2019 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

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) Send

func (a *AgentCommunicator) Send(cmd *proto.Cmd) (*proto.Reply, error)

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) Connect

func (w *WebsocketClient) Connect(url string, origin string, header http.Header) error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL