Documentation
¶
Overview ¶
Package libp2p implements the Mir transport interface using libp2p.
Index ¶
- Constants
- Variables
- type Params
- type Transport
- func (t *Transport) ApplyEvents(ctx context.Context, eventList *events.EventList) error
- func (t *Transport) CloseOldConnections(newNodes map[types.NodeID]types.NodeAddress)
- func (t *Transport) Connect(nodes map[types.NodeID]types.NodeAddress)
- func (t *Transport) ConnectSync(nodes map[types.NodeID]types.NodeAddress, n int)
- func (t *Transport) EventsOut() <-chan *events.EventList
- func (t *Transport) ImplementsModule()
- func (t *Transport) Send(dest types.NodeID, msg *messagepb.Message) error
- func (t *Transport) Start() error
- func (t *Transport) Stop()
- func (t *Transport) WaitFor(n int)
- type TransportMessage
Constants ¶
Variables ¶
View Source
var ErrNilStream = errors.New("stream has not been opened")
View Source
var ErrUnknownNode = errors.New("unknown node")
Functions ¶
This section is empty.
Types ¶
type Params ¶
type Params struct { ProtocolID protocol.ID MaxConnectingTimeout time.Duration MaxRetryTimeout time.Duration MaxRetries int NoLoggingErrorAttempts int PermanentAddrTTL time.Duration ConnWaitPollInterval time.Duration }
func DefaultParams ¶
func DefaultParams() Params
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func (*Transport) ApplyEvents ¶
func (*Transport) CloseOldConnections ¶
func (t *Transport) CloseOldConnections(newNodes map[types.NodeID]types.NodeAddress)
func (*Transport) ConnectSync ¶
ConnectSync is a convenience method that triggers the connection process and waits for n connections to be established before returning. Equivalent to calling Connect and WaitFor.
func (*Transport) ImplementsModule ¶
func (t *Transport) ImplementsModule()
type TransportMessage ¶
func (*TransportMessage) MarshalCBOR ¶
func (t *TransportMessage) MarshalCBOR(w io.Writer) error
func (*TransportMessage) UnmarshalCBOR ¶
func (t *TransportMessage) UnmarshalCBOR(r io.Reader) (err error)
Click to show internal directories.
Click to hide internal directories.