logic

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package logic is a generated GoMock package.

Package logic is a generated GoMock package.

Package logic is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MessageGateway

type MessageGateway interface {
	Send(peer transport.PeerID, envelope *protobuf.NetworkMessage)
	Broadcast(envelope *protobuf.NetworkMessage)
}

MessageGateway defines functions for sending network messages.

type MockMessageGateway

type MockMessageGateway struct {
	// contains filtered or unexported fields
}

MockMessageGateway is a mock of MessageGateway interface.

func NewMockMessageGateway

func NewMockMessageGateway(ctrl *gomock.Controller) *MockMessageGateway

NewMockMessageGateway creates a new mock instance.

func (*MockMessageGateway) Broadcast

func (m *MockMessageGateway) Broadcast(envelope *protobuf.NetworkMessage)

Broadcast mocks base method.

func (*MockMessageGateway) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockMessageGateway) Send

func (m *MockMessageGateway) Send(peer transport.PeerID, envelope *protobuf.NetworkMessage)

Send mocks base method.

type MockMessageGatewayMockRecorder

type MockMessageGatewayMockRecorder struct {
	// contains filtered or unexported fields
}

MockMessageGatewayMockRecorder is the mock recorder for MockMessageGateway.

func (*MockMessageGatewayMockRecorder) Broadcast

func (mr *MockMessageGatewayMockRecorder) Broadcast(envelope interface{}) *gomock.Call

Broadcast indicates an expected call of Broadcast.

func (*MockMessageGatewayMockRecorder) Send

func (mr *MockMessageGatewayMockRecorder) Send(peer, envelope interface{}) *gomock.Call

Send indicates an expected call of Send.

type MockPeerOmnihashQueue

type MockPeerOmnihashQueue struct {
	// contains filtered or unexported fields
}

MockPeerOmnihashQueue is a mock of PeerOmnihashQueue interface.

func NewMockPeerOmnihashQueue

func NewMockPeerOmnihashQueue(ctrl *gomock.Controller) *MockPeerOmnihashQueue

NewMockPeerOmnihashQueue creates a new mock instance.

func (*MockPeerOmnihashQueue) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockPeerOmnihashQueue) Get

Get mocks base method.

type MockPeerOmnihashQueueMockRecorder

type MockPeerOmnihashQueueMockRecorder struct {
	// contains filtered or unexported fields
}

MockPeerOmnihashQueueMockRecorder is the mock recorder for MockPeerOmnihashQueue.

func (*MockPeerOmnihashQueueMockRecorder) Get

Get indicates an expected call of Get.

type MockProtocol

type MockProtocol struct {
	// contains filtered or unexported fields
}

MockProtocol is a mock of Protocol interface.

func NewMockProtocol

func NewMockProtocol(ctrl *gomock.Controller) *MockProtocol

NewMockProtocol creates a new mock instance.

func (*MockProtocol) Configure

func (m *MockProtocol) Configure(advertHashesInterval, advertDiagnosticsInterval, collectMissingPayloadsInterval time.Duration, peerID transport.PeerID)

Configure mocks base method.

func (*MockProtocol) Diagnostics

func (m *MockProtocol) Diagnostics() []core.DiagnosticResult

Diagnostics mocks base method.

func (*MockProtocol) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockProtocol) Handle

func (m *MockProtocol) Handle(peer transport.Peer, envelope interface{}) error

Handle mocks base method.

func (*MockProtocol) PeerDiagnostics

func (m *MockProtocol) PeerDiagnostics() map[transport.PeerID]transport.Diagnostics

PeerDiagnostics mocks base method.

func (*MockProtocol) Start

func (m *MockProtocol) Start()

Start mocks base method.

func (*MockProtocol) Stop

func (m *MockProtocol) Stop()

Stop mocks base method.

type MockProtocolMockRecorder

type MockProtocolMockRecorder struct {
	// contains filtered or unexported fields
}

MockProtocolMockRecorder is the mock recorder for MockProtocol.

func (*MockProtocolMockRecorder) Configure

func (mr *MockProtocolMockRecorder) Configure(advertHashesInterval, advertDiagnosticsInterval, collectMissingPayloadsInterval, peerID interface{}) *gomock.Call

Configure indicates an expected call of Configure.

func (*MockProtocolMockRecorder) Diagnostics

func (mr *MockProtocolMockRecorder) Diagnostics() *gomock.Call

Diagnostics indicates an expected call of Diagnostics.

func (*MockProtocolMockRecorder) Handle

func (mr *MockProtocolMockRecorder) Handle(peer, envelope interface{}) *gomock.Call

Handle indicates an expected call of Handle.

func (*MockProtocolMockRecorder) PeerDiagnostics

func (mr *MockProtocolMockRecorder) PeerDiagnostics() *gomock.Call

PeerDiagnostics indicates an expected call of PeerDiagnostics.

func (*MockProtocolMockRecorder) Start

func (mr *MockProtocolMockRecorder) Start() *gomock.Call

Start indicates an expected call of Start.

func (*MockProtocolMockRecorder) Stop

func (mr *MockProtocolMockRecorder) Stop() *gomock.Call

Stop indicates an expected call of Stop.

type MockmessageSender

type MockmessageSender struct {
	// contains filtered or unexported fields
}

MockmessageSender is a mock of messageSender interface.

func NewMockmessageSender

func NewMockmessageSender(ctrl *gomock.Controller) *MockmessageSender

NewMockmessageSender creates a new mock instance.

func (*MockmessageSender) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockmessageSenderMockRecorder

type MockmessageSenderMockRecorder struct {
	// contains filtered or unexported fields
}

MockmessageSenderMockRecorder is the mock recorder for MockmessageSender.

type MockmissingPayloadCollector

type MockmissingPayloadCollector struct {
	// contains filtered or unexported fields
}

MockmissingPayloadCollector is a mock of missingPayloadCollector interface.

func NewMockmissingPayloadCollector

func NewMockmissingPayloadCollector(ctrl *gomock.Controller) *MockmissingPayloadCollector

NewMockmissingPayloadCollector creates a new mock instance.

func (*MockmissingPayloadCollector) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

type MockmissingPayloadCollectorMockRecorder

type MockmissingPayloadCollectorMockRecorder struct {
	// contains filtered or unexported fields
}

MockmissingPayloadCollectorMockRecorder is the mock recorder for MockmissingPayloadCollector.

type PeerOmnihash

type PeerOmnihash struct {
	// Peer holds the ID of the peer we got the hash from.
	Peer transport.PeerID
	// Hash holds the actual hash.
	Hash hash.SHA256Hash
}

PeerOmnihash describes a peer and its DAG reduced to a single hash.

type PeerOmnihashQueue

type PeerOmnihashQueue interface {
	// Get blocks until there's an PeerOmnihash available and returns it.
	Get() *PeerOmnihash
}

PeerOmnihashQueue is a queue which contains the omnihashes (DAG reduced to a single hash) from our peers.

type Protocol

type Protocol interface {
	core.Diagnosable
	// Configure configures the Protocol. Must be called before Start().
	Configure(advertHashesInterval time.Duration, advertDiagnosticsInterval time.Duration, collectMissingPayloadsInterval time.Duration, peerID transport.PeerID)
	// Start the Protocol (sending and receiving of messages).
	Start()
	// Stop the Protocol.
	Stop()
	// PeerDiagnostics returns a map containing diagnostic information of the node's peers. The key contains the remote peer's ID.
	PeerDiagnostics() map[transport.PeerID]transport.Diagnostics
	// Handle handles a received message.
	Handle(peer transport.Peer, envelope interface{}) error
}

Protocol defines the API for the protocol layer, which is a high-level interface to interact with the network. It responds from (peer) messages received through the P2P layer. TODO: Since refactoring the networking to support multiple protocol versions, this type name has become ambiguous. Maybe something like `Messaging` is better.

func NewProtocol

func NewProtocol(gateway MessageGateway, connections grpc.ConnectionList, state dag.State, diagnosticsProvider func() transport.Diagnostics) Protocol

NewProtocol creates a new instance of Protocol

Jump to

Keyboard shortcuts

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