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 Dictionary Info GET method. #122

Merged
merged 8 commits into from
Oct 9, 2019

Conversation

jmhobbs
Copy link
Contributor

@jmhobbs jmhobbs commented Jun 12, 2019

Adds the DictionaryInfo struct and the method to retrieve it from the API.

This one is a bit odd, as the timestamp format is not standardized to the rest of the API. I reported this irregularity and the current fix was to update the documentation for now, with the API changing at an undetermined point in the future.

As such, I had to shoehorn in some different timestamp parsing. Please let me know if there is a better way to do that, as I'm not terribly familiar with where I can hook into mapstructure. I had hoped to add another struct tag to target only this field, but I couldn't sort that out.

Thanks!

url: https://api.fastly.com/service/7i6HN3TK9wS159v2gPAZ8A/version/682/dictionary/6mJXuCi2Mf19uHRefZJZBg/info
method: GET
response:
body: '{"last_updated": "2019-06-04 19:23:11", "digest": "44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a", "item_count": 4}'
Copy link
Contributor Author

@jmhobbs jmhobbs Jun 12, 2019

Choose a reason for hiding this comment

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

I pulled these values from the API documentation, but confirmed the format with our Fastly setup.

Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

Hey @jmaingard, thank you for your contribution and apologies it's taken so long for us to review your changes. All looks good to me other than some minor consistency comments.

fastly/dictionary_info.go Outdated Show resolved Hide resolved
fastly/dictionary_info.go Outdated Show resolved Hide resolved
@jmhobbs
Copy link
Contributor Author

jmhobbs commented Oct 2, 2019

Thanks for rounding back to this one @phamann. I've made the suggested changes.

Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@phamann
Copy link
Member

phamann commented Oct 2, 2019

@philippschulte Unless you have any further comments, this could also be merged for our upcoming release.

Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

@jmhobbs thanks for your contribution! I have reviewed the PR and found only minor changes before we can finally merge the PR. Let me know if you have any questions about my comments or if you need help.

fastly/dictionary_info.go Outdated Show resolved Hide resolved
fastly/dictionary_info_test.go Show resolved Hide resolved
Copy link
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

Wonderful! Thank you for your contribution! We'll take care of the testing documentation.

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.

3 participants