adapter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrCorruptData

type ErrCorruptData struct {
}

func (*ErrCorruptData) Error

func (e *ErrCorruptData) Error() string

type ErrTransportFailed

type ErrTransportFailed struct {
	Data *TransportData
}

func (*ErrTransportFailed) Error

func (e *ErrTransportFailed) Error() string

type Transport

type Transport interface {
	RegisterListener(listener TransportListener, listenerNodeAddress primitives.NodeAddress)
	Send(ctx context.Context, data *TransportData) error // TODO don't return error. misleading meaning. use panics instead
}

type TransportData

type TransportData struct {
	SenderNodeAddress      primitives.NodeAddress
	RecipientMode          gossipmessages.RecipientsListMode
	RecipientNodeAddresses []primitives.NodeAddress
	Payloads               [][]byte // the first payload is normally gossipmessages.Header
}

func (*TransportData) TotalSize added in v0.7.11

func (d *TransportData) TotalSize() (res int)

type TransportListener

type TransportListener interface {
	OnTransportMessageReceived(ctx context.Context, payloads [][]byte)
}

Directories

Path Synopsis
Package memory provides an in-memory implementation of the Gossip Transport adapter, meant for usage in fast tests that should not use the TCP-based adapter, such as acceptance tests or sociable unit tests, or in other in-process network use cases
Package memory provides an in-memory implementation of the Gossip Transport adapter, meant for usage in fast tests that should not use the TCP-based adapter, such as acceptance tests or sociable unit tests, or in other in-process network use cases
Package testkit extends the in-process transport adapter with Tampering capabilities, intended to be used by system-wide acceptance tests
Package testkit extends the in-process transport adapter with Tampering capabilities, intended to be used by system-wide acceptance tests

Jump to

Keyboard shortcuts

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