Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support plugins for resolving custom URLs to a list of peers #155

Closed
prashantv opened this issue Feb 21, 2017 · 1 comment
Closed

Support plugins for resolving custom URLs to a list of peers #155

prashantv opened this issue Feb 21, 2017 · 1 comment

Comments

@prashantv
Copy link
Contributor

prashantv commented Feb 21, 2017

Today, -p specifies a single peer, and for HTTP also happens to specify the URL template for the request including the protocol scheme of choice as well as the path. -P specifies a peer list, currently only supporting a file in YAML or JSON or flat text format. We propose to extend -P to accept a URI with multiple supported protocols including file: (to explicate the current behavior), and add http: to support grabbing the content via an HTTP request, and allow registering alternate protocols.

I think the right solution is to use the plugin support in go1.8 to load plugins that can provide custom peer providers.

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

Resolve returns an array of alternative flags for -p, which over HTTP continues to serve as the URL template and can be used in combination with -P. In the absence of a provided -p, the selected peer template string is used both for the address and the template.

$ yab -P alt://blah/blah:http --health
@kriskowal
Copy link
Contributor

Landed in #156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants