d2p

package
v0.0.0-...-7d0b5db Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenKey

func GenKey() *ecdsa.PrivateKey

Types

type Config

type Config struct {
	// These settings are required and configure the UDP listener:
	PrivateKey *ecdsa.PrivateKey

	Unhandled chan<- ReadPacket // unhandled packets are sent on this channel
	// The options below are useful in very specific cases, like in unit tests.
	V5ProtocolID *[6]byte
	Log          log.Logger         // if set, log messages go here
	ValidSchemes enr.IdentityScheme // allowed identity schemes
	Clock        mclock.Clock
}

func (Config) WithDefaults

func (cfg Config) WithDefaults() Config

type ReadPacket

type ReadPacket struct {
	Data []byte
	Addr *net.UDPAddr
}

ReadPacket is a packet that couldn't be handled. Those packets are sent to the unhandled channel if configured.

type UDPConn

type UDPConn interface {
	ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
	WriteToUDP(b []byte, addr *net.UDPAddr) (n int, err error)
	Close() error
	LocalAddr() net.Addr
}

Directories

Path Synopsis
protocol
eth

Jump to

Keyboard shortcuts

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