libp2p

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
}

func CreateClient

func CreateClient() *Client

type Messenger

type Messenger struct {
	Node p2p.Node
	// contains filtered or unexported fields
}

func CreateMessenger

func CreateMessenger(port int, name string) (*Messenger, error)

func CreateMessengerWithBindAddr

func CreateMessengerWithBindAddr(bindAddr string, port int, name string) (*Messenger, error)

func (*Messenger) ListenForever

func (m *Messenger) ListenForever(msgChan chan p2p.Message, ctx context.Context) error

func (*Messenger) Send

func (m *Messenger) Send(msg p2p.Message, ctx context.Context) error

type Server

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

func CreateServer

func CreateServer(port int, handler func(msg p2p.Message)) (*Server, error)

func (*Server) ServerForever

func (s *Server) ServerForever()

func (*Server) Shutdown

func (s *Server) Shutdown()

Jump to

Keyboard shortcuts

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