testnetwork

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockNet

type MockNet struct {
	MessageCh chan any
	// contains filtered or unexported fields
}

func NewMockNetwork

func NewMockNetwork() *MockNet

func (*MockNet) Receive

func (m *MockNet) Receive(msg any)

func (*MockNet) ReceivedChannel

func (m *MockNet) ReceivedChannel() <-chan any

func (*MockNet) ResetSentMessages

func (m *MockNet) ResetSentMessages(protocol string)

func (*MockNet) Send

func (m *MockNet) Send(ctx context.Context, msg any, receivers ...peer.ID) error

func (*MockNet) SentMessages

func (m *MockNet) SentMessages(protocol string) []PeerMessage

func (*MockNet) SetErrorState added in v0.2.0

func (m *MockNet) SetErrorState(err error)

type PeerMessage

type PeerMessage struct {
	peer.ID
	Message any
}

Jump to

Keyboard shortcuts

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