-
Notifications
You must be signed in to change notification settings - Fork 5.3k
admin: Add an API on Server to initiate a programmatic admin request. #3667
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
034b5ff
Add an API on Server to initiate a programmatic admin request.
jmarantz 1f45160
Cleanup and get compiling with g++ for coverage.
jmarantz d9ac410
Copy args when posting. Add test for adminRequest with query-params.
jmarantz a22b7de
Restore missing semicolon to get things to format properly.
jmarantz 61d532f
Merge branch 'master' into admin-port-as-callback
jmarantz 355e071
Remove the threading/posting layer from the new admin API, and instea…
jmarantz a7e84e2
Merge branch 'master' into admin-port-as-callback
jmarantz 3b2f6b4
separately test query-param serializing, and other misc cleanups.
jmarantz be5aa96
Merge branch 'master' into admin-port-as-callback
jmarantz 1228879
Merge branch 'master' into admin-port-as-callback, and experimentally…
jmarantz c7d9f6e
Remove toString from the Buffer interface, but leaving it in Buffer::…
jmarantz 7b0ea3f
Add a few more corner-cases to the buffer toString test.
jmarantz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include <map> | ||
| #include <string> | ||
|
|
||
| namespace Envoy { | ||
| namespace Http { | ||
| namespace Utility { | ||
|
|
||
| // TODO(jmarantz): this should probably be a proper class, with methods to serialize | ||
| // using proper formatting. Perhaps similar to | ||
| // https://github.com/apache/incubator-pagespeed-mod/blob/master/pagespeed/kernel/http/query_params.h | ||
|
|
||
| typedef std::map<std::string, std::string> QueryParams; | ||
|
|
||
| } // namespace Utility | ||
| } // namespace Http | ||
| } // namespace Envoy |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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.
How is this different to
linearize()? Do we need both variants?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.
I looked at linearize and though they seem similar, I don't see how either can be efficiently implemented on the other.
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.
well, you could linearize and then create a
std;;stringwith the now linearized buffer. This would involve two copies, but is still O(n) and might be fine for the applications we would use this for, with the assumption being that you don't want to dotoString()or linearize for anything performance sensitive anyway. There's also the option of just doing anabsl::string_viewaround the linearized buffer.Uh oh!
There was an error while loading. Please reload this page.
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.
linearize mutates the buffer IIUC; I thought it made sense to have a simple observer that can return the fully flattened string.
Moreover it exists in the codebase now, in a test helper, and I'm mostly just moving it. However per your other comment -- I don't really need this in the interface, as everywhere in tests and in admin.cc where it's needed, I have an OwnedImpl. Removed.
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.
I think mutating is a benefit here, it's kind of like defragging. At least naively, it seems you should be able to implement it about as efficiently as the
toString()operation.