dnsdisc

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 11 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResolver

func GetResolver(ctx context.Context, nameserver string) *net.Resolver

GetResolver returns a *net.Resolver object using a custom nameserver, or the default system resolver if no nameserver is specified

func SetPrometheusRegisterer added in v0.8.0

func SetPrometheusRegisterer(reg prometheus.Registerer, logger *zap.Logger)

SetPrometheusRegisterer is used to setup a custom prometheus registerer for metrics

Types

type DNSDiscoveryOption added in v0.8.0

type DNSDiscoveryOption func(*dnsDiscoveryParameters)

func WithNameserver

func WithNameserver(nameserver string) DNSDiscoveryOption

WithNameserver is a DnsDiscoveryOption that configures the nameserver to use

type DiscoveredNode

type DiscoveredNode struct {
	PeerID   peer.ID
	PeerInfo peer.AddrInfo
	ENR      *enode.Node
}

func RetrieveNodes

func RetrieveNodes(ctx context.Context, url string, opts ...DNSDiscoveryOption) ([]DiscoveredNode, error)

RetrieveNodes returns a list of multiaddress given a url to a DNS discoverable ENR tree

type Metrics added in v0.8.0

type Metrics interface {
	RecordDiscoveredNodes(numNodes int)
	RecordError(err metricsErrCategory)
}

Metrics exposes the functions required to update prometheus metrics for dnsdisc protocol

Jump to

Keyboard shortcuts

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