MCPcopy Create free account
hub / github.com/apache/brpc / default_method

Method default_method

src/brpc/builtin/vlog_service.cpp:64–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62};
63
64void VLogService::default_method(::google::protobuf::RpcController* cntl_base,
65 const ::brpc::VLogRequest*,
66 ::brpc::VLogResponse*,
67 ::google::protobuf::Closure* done) {
68 ClosureGuard done_guard(done);
69 Controller *cntl = static_cast<Controller*>(cntl_base);
70 const bool use_html = UseHTML(cntl->http_request());
71 butil::IOBufBuilder os;
72
73 cntl->http_response().set_content_type(
74 use_html ? "text/html" : "text/plain");
75 if (use_html) {
76 os << "<!DOCTYPE html><html><head>" << gridtable_style()
77 << "<script src=\"/js/sorttable\"></script></head><body>"
78 "<table class=\"gridtable\" border=\"1\"><tr>"
79 "<th>Module</th><th>Current</th><th>Required</th>"
80 "<th>Status</th></tr>\n";
81 } else {
82 os << "Module | Current | Required | Status\n";
83 }
84 VLogPrinter printer(use_html, os);
85 print_vlog_sites(&printer);
86 if (use_html) {
87 os << "</table>\n";
88 }
89
90 if (use_html) {
91 os << "</body></html>\n";
92 }
93 os.move_to(cntl->response_attachment());
94}
95
96} // namespace brpc
97

Callers

nothing calls this directly

Calls 5

UseHTMLFunction · 0.85
gridtable_styleFunction · 0.85
print_vlog_sitesFunction · 0.85
set_content_typeMethod · 0.80
move_toMethod · 0.45

Tested by

no test coverage detected