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

Get QueryMeta with KV request #44

Closed
bugthesystem opened this issue Oct 6, 2016 · 2 comments
Closed

Get QueryMeta with KV request #44

bugthesystem opened this issue Oct 6, 2016 · 2 comments

Comments

@bugthesystem
Copy link

Consul go api providing QueryMeta it would be good to implement in this package

@silas silas closed this as completed in f8ad047 Oct 6, 2016
@silas
Copy link
Owner

silas commented Oct 6, 2016

I couldn't think of a classy interface that was backwards compatible, so I just created a helper method for parsing the http response.

consul.kv.get('one', function(err, body, res) {
  if (err) throw err;
  console.log(consul.parseQueryMeta(res));
});

Results

{ LastIndex: '14', LastContact: 0, KnownLeader: true }

@bugthesystem
Copy link
Author

hi @silas thanks for quick update 👍

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

No branches or pull requests

2 participants