Skip to content

Commit

Permalink
Implement nextChunk within sub classes of Request
Browse files Browse the repository at this point in the history
Signed-off-by: Demitri Swan <demitriswan@google.com>
  • Loading branch information
miroswan committed May 25, 2024
1 parent 06785a6 commit cc840be
Show file tree
Hide file tree
Showing 4 changed files with 668 additions and 18 deletions.
11 changes: 10 additions & 1 deletion source/server/admin/clusters_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@ Admin::RequestPtr ClustersHandler::makeRequest(AdminStream& admin_stream) {
if (code != Http::Code::OK) {
return Admin::makeStaticTextRequest(response, code);
}
return std::make_unique<ClustersRequest>(ClustersRequest::DefaultChunkLimit, server_, params);
switch (params.format_) {
case ClustersParams::Format::Text:
return std::make_unique<TextClustersRequest>(ClustersRequest::DefaultChunkLimit, server_,
params);
case ClustersParams::Format::Json:
return std::make_unique<JsonClustersRequest>(ClustersRequest::DefaultChunkLimit, server_,
params);
default:
return Admin::makeStaticTextRequest("unknown format type", Http::Code::BadRequest);
}
}

// Helper method that ensures that we've setting flags based on all the health flag values on the
Expand Down

0 comments on commit cc840be

Please sign in to comment.