p2p

package
v1.0.21 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2PServer

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

func NewP2PServer

func NewP2PServer(ctx context.Context, address string, protocol string) (*P2PServer, error)

func (*P2PServer) Connect

func (p2p *P2PServer) Connect(peers ...string) error

func (*P2PServer) GetConnections added in v1.0.14

func (p2p *P2PServer) GetConnections() map[string]string

func (*P2PServer) MsgReceivedHandler

func (p2p *P2PServer) MsgReceivedHandler(handle func([]byte))

func (*P2PServer) OnParseMsgHandler

func (ws *P2PServer) OnParseMsgHandler(src *os.File)

func (*P2PServer) SetMsgReceivedHandler

func (p2p *P2PServer) SetMsgReceivedHandler(handle func([]byte))

func (*P2PServer) SetSendMsg

func (p2p *P2PServer) SetSendMsg(clientId string, msg []byte)

func (*P2PServer) Shutdown

func (p2p *P2PServer) Shutdown()

func (*P2PServer) Start

func (p2p *P2PServer) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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