dht

package
v0.0.0-...-d617ca5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DHT

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

DHT is Distributed Hash Table, see https://en.wikipedia.org/wiki/Distributed_hash_table

func NewDHT

func NewDHT(m string, nodes []*node, bootNode []string) (*DHT, error)

NewDHT DHT create a DHT instance

func (*DHT) AddNode

func (d *DHT) AddNode(addrs []string)

AddNode add node addr to DHT

func (*DHT) GetPeers

func (d *DHT) GetPeers(infoHash [20]byte, peerC chan []string)

GetPeers query peers from DHT by infohash

func (*DHT) Run

func (d *DHT) Run()

Run start a DHT instance

Jump to

Keyboard shortcuts

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