Versions in this module Expand all Collapse all v0 v0.0.1 Nov 6, 2024 Changes in this version + var ErrMockMarshaller = errors.New("MarshallerMock generic error") + var ErrNilObjectToMarshal = errors.New("nil object to serialize from") + func NewHttpTestEchoHandler() *httptest.Server + type ConnectionsHandlerStub struct + AddressesCalled func() []string + BootstrapCalled func() error + CloseCalled func() error + ConnectToPeerCalled func(address string) error + ConnectedAddressesCalled func() []string + ConnectedPeersCalled func() []core.PeerID + ConnectedPeersOnTopicCalled func(topic string) []core.PeerID + GetConnectedPeersInfoCalled func() *p2p.ConnectedPeersInfo + HasCompatibleProtocolIDCalled func(address string) bool + IsConnectedCalled func(peerID core.PeerID) bool + IsConnectedToTheNetworkCalled func() bool + PeerAddressesCalled func(pid core.PeerID) []string + PeersCalled func() []core.PeerID + SetPeerDenialEvaluatorCalled func(handler p2p.PeerDenialEvaluator) error + SetPeerShardResolverCalled func(peerShardResolver p2p.PeerShardResolver) error + SetThresholdMinConnectedPeersCalled func(minConnectedPeers int) error + ThresholdMinConnectedPeersCalled func() int + WaitForConnectionsCalled func(maxWaitingTime time.Duration, minNumOfPeers uint32) + func (stub *ConnectionsHandlerStub) Addresses() []string + func (stub *ConnectionsHandlerStub) Bootstrap() error + func (stub *ConnectionsHandlerStub) Close() error + func (stub *ConnectionsHandlerStub) ConnectToPeer(address string) error + func (stub *ConnectionsHandlerStub) ConnectedAddresses() []string + func (stub *ConnectionsHandlerStub) ConnectedPeers() []core.PeerID + func (stub *ConnectionsHandlerStub) ConnectedPeersOnTopic(topic string) []core.PeerID + func (stub *ConnectionsHandlerStub) GetConnectedPeersInfo() *p2p.ConnectedPeersInfo + func (stub *ConnectionsHandlerStub) HasCompatibleProtocolID(address string) bool + func (stub *ConnectionsHandlerStub) IsConnected(peerID core.PeerID) bool + func (stub *ConnectionsHandlerStub) IsConnectedToTheNetwork() bool + func (stub *ConnectionsHandlerStub) IsInterfaceNil() bool + func (stub *ConnectionsHandlerStub) PeerAddresses(pid core.PeerID) []string + func (stub *ConnectionsHandlerStub) Peers() []core.PeerID + func (stub *ConnectionsHandlerStub) SetPeerDenialEvaluator(handler p2p.PeerDenialEvaluator) error + func (stub *ConnectionsHandlerStub) SetPeerShardResolver(peerShardResolver p2p.PeerShardResolver) error + func (stub *ConnectionsHandlerStub) SetThresholdMinConnectedPeers(minConnectedPeers int) error + func (stub *ConnectionsHandlerStub) ThresholdMinConnectedPeers() int + func (stub *ConnectionsHandlerStub) WaitForConnections(maxWaitingTime time.Duration, minNumOfPeers uint32) + type HttpServerStub struct + ListenAndServeCalled func() error + ShutdownCalled func(ctx context.Context) error + func (h *HttpServerStub) ListenAndServe() error + func (h *HttpServerStub) Shutdown(ctx context.Context) error + type LoggerMock struct + func (c LoggerMock) Debug(message string, args ...interface{}) + func (c LoggerMock) Error(message string, args ...interface{}) + func (c LoggerMock) Info(message string, args ...interface{}) + func (c LoggerMock) IsInterfaceNil() bool + func (c LoggerMock) LogIfError(err error, args ...interface{}) + func (c LoggerMock) Trace(message string, args ...interface{}) + func (c LoggerMock) Warn(message string, args ...interface{}) + type LoggerStub struct + DebugCalled func(message string, args ...interface{}) + ErrorCalled func(message string, args ...interface{}) + GetLevelCalled func() logger.LogLevel + InfoCalled func(message string, args ...interface{}) + LogIfErrorCalled func(err error, args ...interface{}) + TraceCalled func(message string, args ...interface{}) + WarnCalled func(message string, args ...interface{}) + func (stub *LoggerStub) Debug(message string, args ...interface{}) + func (stub *LoggerStub) Error(message string, args ...interface{}) + func (stub *LoggerStub) GetLevel() logger.LogLevel + func (stub *LoggerStub) Info(message string, args ...interface{}) + func (stub *LoggerStub) IsInterfaceNil() bool + func (stub *LoggerStub) LogIfError(err error, args ...interface{}) + func (stub *LoggerStub) Trace(message string, args ...interface{}) + func (stub *LoggerStub) Warn(message string, args ...interface{}) + type MarshallerMock struct + Fail bool + func (mm *MarshallerMock) IsInterfaceNil() bool + func (mm *MarshallerMock) Marshal(obj interface{}) ([]byte, error) + func (mm *MarshallerMock) Unmarshal(obj interface{}, buff []byte) error + type MarshallerStub struct + MarshalCalled func(obj interface{}) ([]byte, error) + UnmarshalCalled func(obj interface{}, buff []byte) error + func (ms *MarshallerStub) IsInterfaceNil() bool + func (ms *MarshallerStub) Marshal(obj interface{}) ([]byte, error) + func (ms *MarshallerStub) Unmarshal(obj interface{}, buff []byte) error + type PayloadHandlerStub struct + CloseCalled func() error + ProcessPayloadCalled func(payload []byte, topic string, version uint32) error + func (ph *PayloadHandlerStub) Close() error + func (ph *PayloadHandlerStub) IsInterfaceNil() bool + func (ph *PayloadHandlerStub) ProcessPayload(payload []byte, topic string, version uint32) error + type ProtoMarshallerMock struct + func (pmm *ProtoMarshallerMock) IsInterfaceNil() bool + func (pmm *ProtoMarshallerMock) Marshal(obj interface{}) ([]byte, error) + func (pmm *ProtoMarshallerMock) Unmarshal(obj interface{}, buff []byte) error + type WebsocketConnectionStub struct + CloseCalled func() error + GetIDCalled func() string + IsOpenCalled func() bool + OpenConnectionCalled func(url string) error + ReadMessageCalled func() (messageType int, payload []byte, err error) + WriteMessageCalled func(messageType int, data []byte) error + func (w *WebsocketConnectionStub) Close() error + func (w *WebsocketConnectionStub) GetID() string + func (w *WebsocketConnectionStub) IsInterfaceNil() bool + func (w *WebsocketConnectionStub) IsOpen() bool + func (w *WebsocketConnectionStub) OpenConnection(url string) error + func (w *WebsocketConnectionStub) ReadMessage() (messageType int, payload []byte, err error) + func (w *WebsocketConnectionStub) WriteMessage(messageType int, data []byte) error