peerprovider

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPeerProvider

func RegisterPeerProvider(scheme string, pp PeerProvider)

RegisterPeerProvider registers a peer provider for a resolver protocol

func Resolve

func Resolve(ctx context.Context, u *url.URL) ([]string, error)

Resolve resolves a peer list from a URL, using the registered peer provider for that protocol scheme, albeit "file", "http", etc.

func Schemes

func Schemes() []string

Schemes returns supported peer provider protocol schemes.

Types

type PeerProvider

type PeerProvider interface {
	Resolve(context.Context, *url.URL) ([]string, error)
}

PeerProvider provides a list of peers for a given peer provider URL. Implementations are expected to define the behavior for the URL name space and return strings suitable for passing to `--peer` for whatever protocol the name specifies.

Jump to

Keyboard shortcuts

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