discovery

package
v0.0.0-...-d151d1d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Announcer

type Announcer interface {
	// Announce announces a service.
	Announce(ctx context.Context, serviceName string) error
}

Announcer provides a way to announce the services supported by us to the discovery service network.

type Discoverer

type Discoverer interface {
	// SearchPeers finds peers who support the service with the given name.
	// This is a persistent process, so you should call this method only once for each service name.
	// If you want to stop finding, you should call the cancel function provided in the context.
	SearchPeers(ctx context.Context, serviceName string) (<-chan []ma.Multiaddr, error)
}

Discoverer provides a way to find peers who support the service with the given name.

type Discovery

type Discovery interface {
	Announcer
	Discoverer
}

Discovery contains an Announcer and a Discoverer. Discovery provides a way to tell others how to find us and also provides a way to find others.

Jump to

Keyboard shortcuts

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