forked from qicosmos/rest_rpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.h
43 lines (36 loc) · 826 Bytes
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef REST_RPC_COMMON_H_
#define REST_RPC_COMMON_H_
#include <vector>
#include <string>
#include <cstdint>
#include <msgpack.hpp>
namespace rest_rpc {
struct PredictParams {
int64_t tag_id;
int32_t encode_case;
int32_t data_type;
std::string data_id;
std::string data_name;
std::vector<std::string> buffers;
std::string version;
MSGPACK_DEFINE(tag_id, encode_case, data_type, data_id, data_name, buffers, version);
};
namespace rpc_service {
enum class result_code : int16_t {
OK = 0,
FAIL = 1,
};
enum class error_code {
OK,
UNKNOWN,
FAIL,
TIMEOUT,
CANCEL,
BADCONNECTION,
};
static const size_t MAX_BUF_LEN = 1048576 * 10;
static const size_t HEAD_LEN = 4;
static const size_t PAGE_SIZE = 1024 * 1024;
} // namespace rpc_service
} // namespace rest_rpc
#endif // REST_RPC_COMMON_H_