libp2p

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Libp2pConnector

type Libp2pConnector struct {
	Host          host.Host
	ServerAddress *multiaddr.Multiaddr
	Peer          *peer.AddrInfo
}

func NewLibp2pConnector

func NewLibp2pConnector(serverAddress string, opts ...libp2p.Option) (*Libp2pConnector, error)

func (*Libp2pConnector) Connect

func (lc *Libp2pConnector) Connect(ctx context.Context) error

func (*Libp2pConnector) Disconnect

func (lc *Libp2pConnector) Disconnect() error

func (*Libp2pConnector) OpenStream

func (lc *Libp2pConnector) OpenStream(ctx context.Context, protocolID string) (types.Stream, error)

type Libp2pStream

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

func New

func New(stream network.Stream, ctx context.Context) *Libp2pStream

func (*Libp2pStream) Close

func (ls *Libp2pStream) Close() error

func (*Libp2pStream) Context

func (ls *Libp2pStream) Context() context.Context

func (*Libp2pStream) Read

func (ls *Libp2pStream) Read(msg []byte) (int, error)

func (*Libp2pStream) Write

func (ls *Libp2pStream) Write(msg []byte) (int, error)

Jump to

Keyboard shortcuts

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