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

Routes #68

Merged
merged 5 commits into from
Oct 30, 2020
Merged

Routes #68

merged 5 commits into from
Oct 30, 2020

Conversation

j-mai
Copy link
Contributor

@j-mai j-mai commented Oct 29, 2020

This PR:

  • Changes the PUT creation route to a POST
  • Adds a PUT route to update a specific resource
  • Changes the way IDs are generated for resources

Fixes #65

@j-mai j-mai requested review from kcajmagic and joe94 October 29, 2020 22:52
@@ -0,0 +1,16 @@

Copy link
Member

Choose a reason for hiding this comment

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

I don't think we want the docker-compose folder here

return base64.RawURLEncoding.EncodeToString(checkSum[:])
func generateID() string {
uuidWithHyphen := uuid.New()
return strings.Replace(uuidWithHyphen.String(), "-", "", -1)
Copy link
Member

Choose a reason for hiding this comment

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

We can keep the hyphens. They're URL safe and don't need encoding.

store/provide.go Outdated
@@ -58,7 +61,8 @@ func Provide(unmarshaller config.Unmarshaller, in StoreIn) StoreOut {
validateItemTTLConfig(&itemTTL)

return StoreOut{
SetItemHandler: newPushItemHandler(itemTTL, in.Store),
PushItemHandler: newPushItemHandler(itemTTL, in.Store),
SetItemHandler: newUpdateItemHandler(itemTTL, in.Store),
Copy link
Member

Choose a reason for hiding this comment

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

Might be a good idea to rename SetItemHandler to UpdateItemHandler` for consistency.

@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #68 into main will decrease coverage by 0.51%.
The diff coverage is 40.32%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #68      +/-   ##
==========================================
- Coverage   40.05%   39.54%   -0.52%     
==========================================
  Files          15       15              
  Lines         739      789      +50     
==========================================
+ Hits          296      312      +16     
- Misses        427      461      +34     
  Partials       16       16              
Impacted Files Coverage Δ
chrysom/client.go 0.00% <0.00%> (ø)
store/handler.go 0.00% <0.00%> (ø)
store/provide.go 0.00% <0.00%> (ø)
store/endpoint.go 100.00% <100.00%> (ø)
store/transport.go 84.37% <100.00%> (+1.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a73715...f54714f. Read the comment docs.

@j-mai j-mai requested a review from joe94 October 30, 2020 19:57
Copy link
Member

@joe94 joe94 left a comment

Choose a reason for hiding this comment

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

🎆

@joe94 joe94 merged commit aef858c into xmidt-org:main Oct 30, 2020
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.

Don't change the identifier in the item saved to the store
2 participants