discovery

package
v0.0.0-...-0e8e39a Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Duration

func Duration(d time.Duration)

Duration sets the duration between discovery ping messages

func NewReceiver

func NewReceiver(ip string, port int, h Handler) (common.Runnable, error)

func NewSender

func NewSender(ip string, port int, ms MessageSupplier) (common.Runnable, error)

Types

type Handler

type Handler func(src *net.UDPAddr, message []byte) error

Handler handles incoming discovery message received from src

type MessageSupplier

type MessageSupplier func() ([]byte, error)

MessageSupplier produces discovery message on demand

Jump to

Keyboard shortcuts

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