-
Notifications
You must be signed in to change notification settings - Fork 105
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
Refactor v1 HTTP to use middlewares and http.HandlerFuncs #325
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
cdcc68d
pkg/store/ratelimited: Create HTTP middleware
metalmatze b237e41
pkg/http/server: Refactor to be Post to be HandleFunc, create Snappy …
metalmatze 75c27ea
pkg/validate: Create PartitionKey middleware
metalmatze 30f6c1a
Use new middlewares and use chi Router as HTTP mux
metalmatze ad1a1ee
Replace server.Post handler with foward.Handler entirely
metalmatze 1924379
Fix some staticcheck issues
metalmatze 5bf077f
pkg/http/server: Delete old and now unused Post handler
metalmatze 1d08da2
Delete unused store.Store interface
metalmatze b42fb6a
pkg/store/memstore: Delete unused memstore
metalmatze 7885e6d
Start moving HTTP API v1 files into pkg/server
metalmatze 2e1f41a
Consolidate Telemeter server middlewares and handlers into pkg/server
metalmatze 0f78d48
Refactor Validator to HTTP middleware
metalmatze fa52d2a
pkg/server: Add GoDoc comments to public functions
metalmatze a53a7ad
Use server.Validate middleware in Telemeter server
metalmatze 4db0156
Address comments about refactoring clean ups
metalmatze a284906
Rename PartitionKey to ClusterIDKey and pass around clusterID
metalmatze 7b6b0da
Update vendor/ folder to add missing go-chi/chi router
metalmatze 7696a7c
pkg/server: Fix reader assignment in snappy.go
metalmatze de659a9
Use ClusterID middleware in v1 handler
metalmatze a9d3ab5
Improve validator middleware to correctly forward http body
metalmatze 32e6e15
Do not use server.ClusterID middleware for v2 receive endpoint
metalmatze 220a33c
Pass transforms into validate middleware from main.go
metalmatze 2154269
Fix unit tests for http middlewares
metalmatze 69ea0e0
Improve GoDoc comment
metalmatze eba3200
Don't set a timeout on the HTTP client
metalmatze a072437
Improve error for rate limited cluster
metalmatze 28b3273
Improve and add back all test cases for snappy_test.go
metalmatze 3f24e56
Move clusterIDcontext to the top of the validator file
metalmatze b6fd58d
Limit the body size before reading it in the validator
metalmatze b516d66
Fix vlidator_test by passing known now func
metalmatze File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: above we call the router
r
and the muxinternal
and here we are following a different pattern. let's keep it consistent.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that the above still needs the internal to begin with. We need to refactor
telemeter_http.DebugRoutes
etc in another PR and then can have consistency.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no I simply mean we should call the router
r
in both cases