libp2p

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConnectionTTL = time.Duration(math.MaxInt64 - iota)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	ProtocolID           protocol.ID
	ConnectionTTL        time.Duration
	ConnectionBufferSize int
	StreamWriteTimeout   time.Duration
	ReconnectionPeriod   time.Duration
}

func DefaultParams

func DefaultParams() Params

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func NewTransport

func NewTransport(params Params, ownID t.NodeID, h host.Host, logger logging.Logger) *Transport

func (*Transport) ApplyEvents

func (tr *Transport) ApplyEvents(_ context.Context, eventList *events.EventList) error

func (*Transport) CloseOldConnections

func (tr *Transport) CloseOldConnections(newMembership map[t.NodeID]t.NodeAddress)

func (*Transport) Connect

func (tr *Transport) Connect(nodes map[t.NodeID]t.NodeAddress)

func (*Transport) EventsOut

func (tr *Transport) EventsOut() <-chan *events.EventList

func (*Transport) ImplementsModule

func (tr *Transport) ImplementsModule()

func (*Transport) Send

func (tr *Transport) Send(dest t.NodeID, msg *messagepb.Message) error

func (*Transport) Start

func (tr *Transport) Start() error

func (*Transport) Stop

func (tr *Transport) Stop()

func (*Transport) WaitFor

func (tr *Transport) WaitFor(n int)

type TransportMessage

type TransportMessage struct {
	Sender  string
	Payload []byte
}

func (*TransportMessage) MarshalCBOR

func (t *TransportMessage) MarshalCBOR(w io.Writer) error

func (*TransportMessage) UnmarshalCBOR

func (t *TransportMessage) UnmarshalCBOR(r io.Reader) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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