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

Add consul-specific option for config (as registry) #542

Merged
merged 2 commits into from
Jun 25, 2019

Conversation

magodo
Copy link
Contributor

@magodo magodo commented Jun 25, 2019

Consul default http.Client use Timeout as 0, which might cause hang issue if server outage occur, as indicated by this blog.

User should have the ability to do finer grained config when using consul as config backend.

@@ -61,3 +63,13 @@ func WithToken(p string) source.Option {
o.Context = context.WithValue(o.Context, tokenKey{}, p)
}
}

// WithConsulConfig set consul-specific options
func WithConsulConfig(c *api.Config) source.Option {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify as WithConfig considering this is already in the consul package

@@ -11,6 +12,7 @@ type prefixKey struct{}
type stripPrefixKey struct{}
type dcKey struct{}
type tokenKey struct{}
type consulConfigKey struct{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

configKey

@asim asim merged commit 4cad769 into micro:master Jun 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants