p2p

package
v0.0.0-...-d1e5265 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HandshakeProtocol     = "/handshake/1.0.0"
	MetadataProtocol      = "/metadata/1.0.0"
	FileTransferProtocol  = "/file-transfer/1.0.0"
	CompleteCheckProtocol = "/complete-check/1.0.0"
)

Variables

This section is empty.

Functions

func HandleReceive

func HandleReceive(ctx context.Context, node *Node, passphrase string) error

func HandleSend

func HandleSend(ctx context.Context, node *Node, filePath string) error

func NewHost

func NewHost(ctx context.Context) (host.Host, *dht.IpfsDHT, error)

Types

type Node

type Node struct {
	Host host.Host
	DHT  *dht.IpfsDHT
	// contains filtered or unexported fields
}

func NewNode

func NewNode(ctx context.Context) (*Node, error)

func (*Node) PublishAddress

func (n *Node) PublishAddress(ctx context.Context) error

func (*Node) QueryAddress

func (n *Node) QueryAddress(ctx context.Context) ([]peer.AddrInfo, error)

func (*Node) QueryAndConnect

func (n *Node) QueryAndConnect(ctx context.Context) (*peer.AddrInfo, error)

Jump to

Keyboard shortcuts

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