|
Ring Daemon
|
#include <namedirectory.h>

Public Types | |
| using | LookupCallback = std::function< void(const std::string &name, const std::string &address, Response response)> |
| using | RegistrationCallback = std::function< void(RegistrationResponse response, const std::string &name)> |
| enum class | RegistrationResponse : int { success = 0 , invalidName , invalidCredentials , alreadyTaken , error , incompleteRequest , signatureVerificationFailed , unsupported } |
| enum class | Response : int { found = 0 , invalidResponse , notFound , error } |
| using | SearchCallback = std::function< void(const SearchResult &result, Response response)> |
| using | SearchResult = std::vector< std::map< std::string, std::string > > |
Public Member Functions | |
| void | load () |
| void | lookupAddress (const std::string &addr, LookupCallback cb) |
| void | lookupName (const std::string &name, LookupCallback cb) |
| NameDirectory (const std::string &serverUrl, std::shared_ptr< dht::Logger > l={}) | |
| void | registerName (const std::string &addr, const std::string &name, const std::string &owner, RegistrationCallback cb, const std::string &signedname, const std::string &publickey) |
| bool | searchName (const std::string &, SearchCallback) |
| void | setToken (std::string token) |
| ~NameDirectory () | |
Static Public Member Functions | |
| static NameDirectory & | instance () |
| static NameDirectory & | instance (const std::string &serverUrl, std::shared_ptr< dht::Logger > l={}) |
| static void | lookupUri (std::string_view uri, const std::string &default_server, LookupCallback cb) |
Definition at line 51 of file namedirectory.h.
| using jami::NameDirectory::LookupCallback = std::function<void(const std::string& name, const std::string& address, Response response)> |
Definition at line 66 of file namedirectory.h.
| using jami::NameDirectory::RegistrationCallback = std::function<void(RegistrationResponse response, const std::string& name)> |
Definition at line 69 of file namedirectory.h.
| using jami::NameDirectory::SearchCallback = std::function<void(const SearchResult& result, Response response)> |
Definition at line 68 of file namedirectory.h.
| using jami::NameDirectory::SearchResult = std::vector<std::map<std::string, std::string> > |
Definition at line 67 of file namedirectory.h.
| Enumerator | |
|---|---|
| success | |
| invalidName | |
| invalidCredentials | |
| alreadyTaken | |
| error | |
| incompleteRequest | |
| signatureVerificationFailed | |
| unsupported | |
Definition at line 55 of file namedirectory.h.
|
strong |
| Enumerator | |
|---|---|
| found | |
| invalidResponse | |
| notFound | |
| error | |
Definition at line 54 of file namedirectory.h.
| jami::NameDirectory::NameDirectory | ( | const std::string & | serverUrl, |
| std::shared_ptr< dht::Logger > | l = {} |
||
| ) |
Definition at line 103 of file namedirectory.cpp.
References jami::CACHE_DIRECTORY, jami::emitSignal(), and jami::fileutils::get_cache_dir().

| jami::NameDirectory::~NameDirectory | ( | ) |
Definition at line 115 of file namedirectory.cpp.
References jami::emitSignal().

|
static |
Definition at line 80 of file namedirectory.cpp.
References jami::DEFAULT_SERVER_HOST, and instance().
Referenced by jami::ServerAccountManager::initAuthentication(), instance(), libjami::lookupAddress(), libjami::lookupName(), and lookupUri().

|
static |
Definition at line 143 of file namedirectory.cpp.
References jami::canonicalName(), jami::DEFAULT_SERVER_HOST, and jami::emitSignal().

| void jami::NameDirectory::load | ( | ) |
Definition at line 127 of file namedirectory.cpp.
| void jami::NameDirectory::lookupAddress | ( | const std::string & | addr, |
| LookupCallback | cb | ||
| ) |
Definition at line 169 of file namedirectory.cpp.
References jami::emitSignal(), error, found, invalidResponse, JAMI_ERROR, and jami::QUERY_ADDR.
Referenced by libjami::lookupAddress().

| void jami::NameDirectory::lookupName | ( | const std::string & | name, |
| LookupCallback | cb | ||
| ) |
Definition at line 241 of file namedirectory.cpp.
References JAMI_ERROR, jami::QUERY_NAME, and jami::urlEncode().
Referenced by libjami::lookupName(), and lookupUri().

|
static |
Definition at line 86 of file namedirectory.cpp.
References jami::DEFAULT_SERVER_HOST, jami::emitSignal(), instance(), invalidResponse, JAMI_ERROR, lookupName(), std::regex_match(), and jami::URI_VALIDATOR.
Referenced by libjami::lookupName().

| void jami::NameDirectory::registerName | ( | const std::string & | addr, |
| const std::string & | name, | ||
| const std::string & | owner, | ||
| RegistrationCallback | cb, | ||
| const std::string & | signedname, | ||
| const std::string & | publickey | ||
| ) |
Definition at line 323 of file namedirectory.cpp.
References JAMI_DEBUG, JAMI_ERROR, JAMI_WARNING, jami::QUERY_NAME, jami::toLower(), and jami::urlEncode().

|
inline |
Definition at line 84 of file namedirectory.h.
|
inline |
Definition at line 78 of file namedirectory.h.