scraper

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultBootstrapAddrs = []string{
	"/dnsaddr/sjc-2.bootstrap.libp2p.io/p2p/QmZa1sAxajnQjVM8WjWXoMbmPd7NsWhfKsPkErzpm9wGkp",
	"/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
	"/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
	"/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
	"/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
	"/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
}

DefaultBootstrapAddrs are the set of bootstrap addresses the scraper will connect to by default.

Functions

This section is empty.

Types

type PeerStat

type PeerStat struct {
	PeerID       string   `json:"peerID"`
	Addresses    []string `json:"addresses"`
	Protocols    []string `json:"protocols"`
	AgentVersion string   `json:"agentVersion"`
}

PeerStat contains information about a seen peer.

type Scraper

type Scraper interface {
	// Scrape starts a new scraping process.
	Scrape(ctx context.Context) <-chan PeerStat
}

Scraper is a DHT scraper.

func New

func New() (Scraper, error)

New creates a new DHT scraper.

func NewAggregatingScraper

func NewAggregatingScraper(s Scraper) Scraper

NewAggregatingScraper wraps an existing scraper aggregating calls to Scrape and distributing them

Jump to

Keyboard shortcuts

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