acl/lib_acl_cpp/include/acl_cpp/redis/redis_connection.hpp

56 lines
1.1 KiB
C++
Raw Normal View History

#pragma once
#include "acl_cpp/acl_cpp_define.hpp"
#include "acl_cpp/redis/redis_command.hpp"
namespace acl
{
class redis_client;
2015-01-26 19:58:02 +08:00
/**
* redis Connection <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
* AUTH<EFBFBD><EFBFBD>ECHO<EFBFBD><EFBFBD>PING<EFBFBD><EFBFBD>QUIT<EFBFBD><EFBFBD>SELECT
*/
class ACL_CPP_API redis_connection : public redis_command
{
public:
redis_connection(redis_client* conn = NULL);
~redis_connection();
/////////////////////////////////////////////////////////////////////
2015-01-26 19:58:02 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis-server ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤
* @param passwd {const char*} <EFBFBD><EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> false <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD>֤ʧ<EFBFBD>ܻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
*/
bool auth(const char* passwd);
2015-01-26 19:58:02 +08:00
/**
* ѡ<EFBFBD><EFBFBD> redis-server <EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> ID
* @param dbnum {int} redis <EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> ID
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
*/
bool select(int dbnum);
2015-01-26 19:58:02 +08:00
/**
* ̽<EFBFBD><EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
bool ping();
2015-01-26 19:58:02 +08:00
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis-server <EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD>
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
*/
bool echo(const char* s);
2015-01-26 19:58:02 +08:00
/**
* <EFBFBD>ر<EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
* @return {bool}
*/
bool quit();
};
} // namespace acl