1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | #ifndef NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
|
20 | #define NET_GRPC_NODE_CHANNEL_CREDENTIALS_H_
|
21 |
|
22 | #include <nan.h>
|
23 | #include <node.h>
|
24 | #include "grpc/grpc.h"
|
25 | #include "grpc/grpc_security.h"
|
26 |
|
27 | namespace grpc {
|
28 | namespace node {
|
29 |
|
30 |
|
31 | class ChannelCredentials : public Nan::ObjectWrap {
|
32 | public:
|
33 | static void Init(v8::Local<v8::Object> exports);
|
34 | static bool HasInstance(v8::Local<v8::Value> val);
|
35 |
|
36 | static v8::Local<v8::Value> WrapStruct(grpc_channel_credentials *credentials);
|
37 |
|
38 |
|
39 | grpc_channel_credentials *GetWrappedCredentials();
|
40 |
|
41 | private:
|
42 | explicit ChannelCredentials(grpc_channel_credentials *credentials);
|
43 | ~ChannelCredentials();
|
44 |
|
45 |
|
46 | ChannelCredentials(const ChannelCredentials &);
|
47 | ChannelCredentials &operator=(const ChannelCredentials &);
|
48 |
|
49 | static NAN_METHOD(New);
|
50 | static NAN_METHOD(CreateSsl);
|
51 | static NAN_METHOD(CreateInsecure);
|
52 |
|
53 | static NAN_METHOD(Compose);
|
54 | static Nan::Callback *constructor;
|
55 |
|
56 | static Nan::Persistent<v8::FunctionTemplate> fun_tpl;
|
57 |
|
58 | grpc_channel_credentials *wrapped_credentials;
|
59 | };
|
60 |
|
61 | }
|
62 | }
|
63 |
|
64 | #endif
|