Documentation ¶
Index ¶
- type Conduit
- func (c *Conduit) Close() error
- func (c *Conduit) Multicast(event interface{}, num uint, targetIDs ...flow.Identifier) error
- func (c *Conduit) Publish(event interface{}, targetIDs ...flow.Identifier) error
- func (c *Conduit) ReportMisbehavior(report network.MisbehaviorReport)
- func (c *Conduit) Unicast(event interface{}, targetID flow.Identifier) error
- type DefaultConduitFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conduit ¶
type Conduit struct {
// contains filtered or unexported fields
}
Conduit is a helper of the overlay layer which functions as an accessor for sending messages within a single engine process. It sends all messages to what can be considered a bus reserved for that specific engine.
func (*Conduit) Multicast ¶
func (c *Conduit) Multicast(event interface{}, num uint, targetIDs ...flow.Identifier) error
Multicast unreliably sends the specified event to the specified number of recipients selected from the specified subset. The recipients are selected randomly from targetIDs
func (*Conduit) Publish ¶
func (c *Conduit) Publish(event interface{}, targetIDs ...flow.Identifier) error
Publish sends an event to the network layer for unreliable delivery to subscribers of the given event on the network layer. It uses a publish-subscribe layer and can thus not guarantee that the specified recipients received the event.
func (*Conduit) ReportMisbehavior ¶ added in v0.31.0
func (c *Conduit) ReportMisbehavior(report network.MisbehaviorReport)
ReportMisbehavior reports the misbehavior of a node on sending a message to the current node that appears valid based on the networking layer but is considered invalid by the current node based on the Flow protocol. The misbehavior is reported to the networking layer to penalize the misbehaving node. The implementation must be thread-safe and non-blocking.
type DefaultConduitFactory ¶
type DefaultConduitFactory struct {
// contains filtered or unexported fields
}
DefaultConduitFactory is a wrapper around the network ConduitAdapter. It directly passes the incoming messages to the corresponding methods of the network ConduitAdapter.
func NewDefaultConduitFactory ¶
func NewDefaultConduitFactory() *DefaultConduitFactory
NewDefaultConduitFactory creates a new DefaultConduitFactory, this is the default conduit factory used by the node. Args:
none
Returns:
a new instance of the DefaultConduitFactory.
func (*DefaultConduitFactory) NewConduit ¶
func (d *DefaultConduitFactory) NewConduit(ctx context.Context, channel channels.Channel) (network.Conduit, error)
NewConduit creates a conduit on the specified channel. Prior to creating any conduit, the factory requires an ConduitAdapter to be registered with it.
func (*DefaultConduitFactory) RegisterAdapter ¶
func (d *DefaultConduitFactory) RegisterAdapter(adapter network.ConduitAdapter) error
RegisterAdapter sets the ConduitAdapter component of the factory. The ConduitAdapter is a wrapper around the Network layer that only exposes the set of methods that are needed by a conduit.