peer

package
v0.0.1-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2022 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 List

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

List is a set of peers.

func Refresh

func Refresh(ctx context.Context, wg *sync.WaitGroup, global bool) *List

Refresh returns a refreshing list of peers.

global controls whether the returned List will be refreshed with global or local instances.

After ctx is done and the list has stopped being refreshed, Done will be called on wg.

func (*List) Broadcast

func (l *List) Broadcast(conn net.PacketConn, msg []byte)

Broadcast relays the message to all of the peers in l via conn.

Jump to

Keyboard shortcuts

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