| 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; |