libp2p

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 29 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 *trantorpbtypes.Membership)

func (*Transport) Connect

func (tr *Transport) Connect(membership *trantorpbtypes.Membership)

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) error

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