github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/network/underlay/noop.go (about)

     1  package underlay
     2  
     3  import (
     4  	"github.com/ipfs/go-datastore"
     5  	"github.com/libp2p/go-libp2p/core/protocol"
     6  
     7  	"github.com/onflow/flow-go/model/flow"
     8  	"github.com/onflow/flow-go/module"
     9  	"github.com/onflow/flow-go/network"
    10  	"github.com/onflow/flow-go/network/channels"
    11  )
    12  
    13  type NoopConduit struct{}
    14  
    15  var _ network.Conduit = (*NoopConduit)(nil)
    16  
    17  func (n *NoopConduit) ReportMisbehavior(network.MisbehaviorReport) {}
    18  
    19  func (n *NoopConduit) Publish(event interface{}, targetIDs ...flow.Identifier) error {
    20  	return nil
    21  }
    22  
    23  func (n *NoopConduit) Unicast(event interface{}, targetID flow.Identifier) error {
    24  	return nil
    25  }
    26  
    27  func (n *NoopConduit) Multicast(event interface{}, num uint, targetIDs ...flow.Identifier) error {
    28  	return nil
    29  }
    30  
    31  func (n *NoopConduit) Close() error {
    32  	return nil
    33  }
    34  
    35  type NoopEngineRegister struct {
    36  	module.NoopComponent
    37  }
    38  
    39  func (n NoopEngineRegister) Register(channel channels.Channel, messageProcessor network.MessageProcessor) (network.Conduit, error) {
    40  	return &NoopConduit{}, nil
    41  }
    42  
    43  func (n NoopEngineRegister) RegisterBlobService(channel channels.Channel, store datastore.Batching, opts ...network.BlobServiceOption) (network.BlobService, error) {
    44  	return nil, nil
    45  }
    46  
    47  func (n NoopEngineRegister) RegisterPingService(pingProtocolID protocol.ID, pingInfoProvider network.PingInfoProvider) (network.PingService, error) {
    48  	return nil, nil
    49  }
    50  
    51  var _ network.EngineRegistry = (*NoopEngineRegister)(nil)