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

Method Auth

example/redis_c++/redis_server.cpp:65–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 }
64
65 bool Auth(const std::string& db_name, const std::string& password) {
66 if (_user_password.find(db_name) == _user_password.end()) {
67 return false;
68 } else {
69 if (_user_password[db_name] != password) {
70 return false;
71 }
72 }
73 return true;
74 }
75
76 bool Get(const std::string& db_name, const std::string& key, std::string* value) {
77 int slot = butil::crc32c::Value(key.c_str(), key.size()) % kHashSlotNum;

Callers 1

RunMethod · 0.80

Calls 2

findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected