adapter

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InterceptableTransport added in v1.3.0

type InterceptableTransport interface {
	Transport
	SendWithInterceptor(ctx context.Context, data *TransportData, intercept InterceptorFunc) error
}

type InterceptorFunc added in v1.3.0

type InterceptorFunc func(ctx context.Context, peerAddress primitives.NodeAddress, data *TransportData, transmit TransmitFunc) error

type TransmitFunc added in v1.3.0

type TransmitFunc func(ctx context.Context, peerAddress primitives.NodeAddress, data *TransportData)

type Transport

type Transport interface {
	supervised.GracefulShutdowner
	govnr.ShutdownWaiter
	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) Clone added in v1.3.0

func (d *TransportData) Clone() *TransportData

func (*TransportData) TotalSize added in v0.7.11

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

type TransportListener

type TransportListener interface {
	fmt.Stringer // TODO smelly
	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