discovery

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: Apache-2.0 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, opts ...Option) error
}

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

type Discoverer

type Discoverer interface {
	// FindPeers find peers who support the service which name is the given.
	// This is a persistent process, so you should call this method only once for each service name.
	// If you want to stop finding, the cancel function for context given should be call.
	FindPeers(ctx context.Context, serviceName string, opts ...Option) (<-chan ma.Multiaddr, error)
}

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

type Discovery

type Discovery interface {
	Announcer
	Discoverer
}

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

type Option

type Option func(options *Options) error

Option is a function for apply some value to Options.

type Options

type Options struct {
	Opts map[interface{}]interface{}
}

Options stores all custom parameter value for discovery service.

func (*Options) Apply

func (o *Options) Apply(opts ...Option) error

Apply the options to Options.

Jump to

Keyboard shortcuts

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