kms.pb.go 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.26.0
  4. // protoc v3.17.3
  5. // source: kms/proto/kms.proto
  6. package proto
  7. import (
  8. context "context"
  9. grpc "google.golang.org/grpc"
  10. codes "google.golang.org/grpc/codes"
  11. status "google.golang.org/grpc/status"
  12. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  13. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  14. reflect "reflect"
  15. sync "sync"
  16. )
  17. const (
  18. // Verify that this generated code is sufficiently up-to-date.
  19. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  20. // Verify that runtime/protoimpl is sufficiently up-to-date.
  21. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  22. )
  23. type EncryptRequest struct {
  24. state protoimpl.MessageState
  25. sizeCache protoimpl.SizeCache
  26. unknownFields protoimpl.UnknownFields
  27. Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
  28. AdditionalData string `protobuf:"bytes,2,opt,name=additional_data,json=additionalData,proto3" json:"additional_data,omitempty"`
  29. Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url,omitempty"`
  30. MasterKey string `protobuf:"bytes,4,opt,name=master_key,json=masterKey,proto3" json:"master_key,omitempty"`
  31. }
  32. func (x *EncryptRequest) Reset() {
  33. *x = EncryptRequest{}
  34. if protoimpl.UnsafeEnabled {
  35. mi := &file_kms_proto_kms_proto_msgTypes[0]
  36. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  37. ms.StoreMessageInfo(mi)
  38. }
  39. }
  40. func (x *EncryptRequest) String() string {
  41. return protoimpl.X.MessageStringOf(x)
  42. }
  43. func (*EncryptRequest) ProtoMessage() {}
  44. func (x *EncryptRequest) ProtoReflect() protoreflect.Message {
  45. mi := &file_kms_proto_kms_proto_msgTypes[0]
  46. if protoimpl.UnsafeEnabled && x != nil {
  47. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  48. if ms.LoadMessageInfo() == nil {
  49. ms.StoreMessageInfo(mi)
  50. }
  51. return ms
  52. }
  53. return mi.MessageOf(x)
  54. }
  55. // Deprecated: Use EncryptRequest.ProtoReflect.Descriptor instead.
  56. func (*EncryptRequest) Descriptor() ([]byte, []int) {
  57. return file_kms_proto_kms_proto_rawDescGZIP(), []int{0}
  58. }
  59. func (x *EncryptRequest) GetPayload() string {
  60. if x != nil {
  61. return x.Payload
  62. }
  63. return ""
  64. }
  65. func (x *EncryptRequest) GetAdditionalData() string {
  66. if x != nil {
  67. return x.AdditionalData
  68. }
  69. return ""
  70. }
  71. func (x *EncryptRequest) GetUrl() string {
  72. if x != nil {
  73. return x.Url
  74. }
  75. return ""
  76. }
  77. func (x *EncryptRequest) GetMasterKey() string {
  78. if x != nil {
  79. return x.MasterKey
  80. }
  81. return ""
  82. }
  83. type EncryptResponse struct {
  84. state protoimpl.MessageState
  85. sizeCache protoimpl.SizeCache
  86. unknownFields protoimpl.UnknownFields
  87. Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
  88. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  89. Mode int32 `protobuf:"varint,3,opt,name=mode,proto3" json:"mode,omitempty"`
  90. }
  91. func (x *EncryptResponse) Reset() {
  92. *x = EncryptResponse{}
  93. if protoimpl.UnsafeEnabled {
  94. mi := &file_kms_proto_kms_proto_msgTypes[1]
  95. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  96. ms.StoreMessageInfo(mi)
  97. }
  98. }
  99. func (x *EncryptResponse) String() string {
  100. return protoimpl.X.MessageStringOf(x)
  101. }
  102. func (*EncryptResponse) ProtoMessage() {}
  103. func (x *EncryptResponse) ProtoReflect() protoreflect.Message {
  104. mi := &file_kms_proto_kms_proto_msgTypes[1]
  105. if protoimpl.UnsafeEnabled && x != nil {
  106. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  107. if ms.LoadMessageInfo() == nil {
  108. ms.StoreMessageInfo(mi)
  109. }
  110. return ms
  111. }
  112. return mi.MessageOf(x)
  113. }
  114. // Deprecated: Use EncryptResponse.ProtoReflect.Descriptor instead.
  115. func (*EncryptResponse) Descriptor() ([]byte, []int) {
  116. return file_kms_proto_kms_proto_rawDescGZIP(), []int{1}
  117. }
  118. func (x *EncryptResponse) GetPayload() string {
  119. if x != nil {
  120. return x.Payload
  121. }
  122. return ""
  123. }
  124. func (x *EncryptResponse) GetKey() string {
  125. if x != nil {
  126. return x.Key
  127. }
  128. return ""
  129. }
  130. func (x *EncryptResponse) GetMode() int32 {
  131. if x != nil {
  132. return x.Mode
  133. }
  134. return 0
  135. }
  136. type DecryptRequest struct {
  137. state protoimpl.MessageState
  138. sizeCache protoimpl.SizeCache
  139. unknownFields protoimpl.UnknownFields
  140. Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
  141. Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
  142. AdditionalData string `protobuf:"bytes,3,opt,name=additional_data,json=additionalData,proto3" json:"additional_data,omitempty"`
  143. Mode int32 `protobuf:"varint,4,opt,name=mode,proto3" json:"mode,omitempty"`
  144. Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url,omitempty"`
  145. MasterKey string `protobuf:"bytes,6,opt,name=master_key,json=masterKey,proto3" json:"master_key,omitempty"`
  146. }
  147. func (x *DecryptRequest) Reset() {
  148. *x = DecryptRequest{}
  149. if protoimpl.UnsafeEnabled {
  150. mi := &file_kms_proto_kms_proto_msgTypes[2]
  151. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  152. ms.StoreMessageInfo(mi)
  153. }
  154. }
  155. func (x *DecryptRequest) String() string {
  156. return protoimpl.X.MessageStringOf(x)
  157. }
  158. func (*DecryptRequest) ProtoMessage() {}
  159. func (x *DecryptRequest) ProtoReflect() protoreflect.Message {
  160. mi := &file_kms_proto_kms_proto_msgTypes[2]
  161. if protoimpl.UnsafeEnabled && x != nil {
  162. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  163. if ms.LoadMessageInfo() == nil {
  164. ms.StoreMessageInfo(mi)
  165. }
  166. return ms
  167. }
  168. return mi.MessageOf(x)
  169. }
  170. // Deprecated: Use DecryptRequest.ProtoReflect.Descriptor instead.
  171. func (*DecryptRequest) Descriptor() ([]byte, []int) {
  172. return file_kms_proto_kms_proto_rawDescGZIP(), []int{2}
  173. }
  174. func (x *DecryptRequest) GetPayload() string {
  175. if x != nil {
  176. return x.Payload
  177. }
  178. return ""
  179. }
  180. func (x *DecryptRequest) GetKey() string {
  181. if x != nil {
  182. return x.Key
  183. }
  184. return ""
  185. }
  186. func (x *DecryptRequest) GetAdditionalData() string {
  187. if x != nil {
  188. return x.AdditionalData
  189. }
  190. return ""
  191. }
  192. func (x *DecryptRequest) GetMode() int32 {
  193. if x != nil {
  194. return x.Mode
  195. }
  196. return 0
  197. }
  198. func (x *DecryptRequest) GetUrl() string {
  199. if x != nil {
  200. return x.Url
  201. }
  202. return ""
  203. }
  204. func (x *DecryptRequest) GetMasterKey() string {
  205. if x != nil {
  206. return x.MasterKey
  207. }
  208. return ""
  209. }
  210. type DecryptResponse struct {
  211. state protoimpl.MessageState
  212. sizeCache protoimpl.SizeCache
  213. unknownFields protoimpl.UnknownFields
  214. Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"`
  215. }
  216. func (x *DecryptResponse) Reset() {
  217. *x = DecryptResponse{}
  218. if protoimpl.UnsafeEnabled {
  219. mi := &file_kms_proto_kms_proto_msgTypes[3]
  220. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  221. ms.StoreMessageInfo(mi)
  222. }
  223. }
  224. func (x *DecryptResponse) String() string {
  225. return protoimpl.X.MessageStringOf(x)
  226. }
  227. func (*DecryptResponse) ProtoMessage() {}
  228. func (x *DecryptResponse) ProtoReflect() protoreflect.Message {
  229. mi := &file_kms_proto_kms_proto_msgTypes[3]
  230. if protoimpl.UnsafeEnabled && x != nil {
  231. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  232. if ms.LoadMessageInfo() == nil {
  233. ms.StoreMessageInfo(mi)
  234. }
  235. return ms
  236. }
  237. return mi.MessageOf(x)
  238. }
  239. // Deprecated: Use DecryptResponse.ProtoReflect.Descriptor instead.
  240. func (*DecryptResponse) Descriptor() ([]byte, []int) {
  241. return file_kms_proto_kms_proto_rawDescGZIP(), []int{3}
  242. }
  243. func (x *DecryptResponse) GetPayload() string {
  244. if x != nil {
  245. return x.Payload
  246. }
  247. return ""
  248. }
  249. var File_kms_proto_kms_proto protoreflect.FileDescriptor
  250. var file_kms_proto_kms_proto_rawDesc = []byte{
  251. 0x0a, 0x13, 0x6b, 0x6d, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6b, 0x6d, 0x73, 0x2e,
  252. 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x84, 0x01, 0x0a,
  253. 0x0e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
  254. 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
  255. 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64,
  256. 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01,
  257. 0x28, 0x09, 0x52, 0x0e, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x61,
  258. 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
  259. 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6b,
  260. 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
  261. 0x4b, 0x65, 0x79, 0x22, 0x51, 0x0a, 0x0f, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65,
  262. 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61,
  263. 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
  264. 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
  265. 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
  266. 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0xaa, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x63, 0x72, 0x79,
  267. 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79,
  268. 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c,
  269. 0x6f, 0x61, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
  270. 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f,
  271. 0x6e, 0x61, 0x6c, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e,
  272. 0x61, 0x64, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x44, 0x61, 0x74, 0x61, 0x12, 0x12,
  273. 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x6d, 0x6f,
  274. 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
  275. 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x6b,
  276. 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72,
  277. 0x4b, 0x65, 0x79, 0x22, 0x2b, 0x0a, 0x0f, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65,
  278. 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61,
  279. 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
  280. 0x32, 0x79, 0x0a, 0x03, 0x4b, 0x4d, 0x53, 0x12, 0x38, 0x0a, 0x07, 0x45, 0x6e, 0x63, 0x72, 0x79,
  281. 0x70, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79,
  282. 0x70, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74,
  283. 0x6f, 0x2e, 0x45, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
  284. 0x65, 0x12, 0x38, 0x0a, 0x07, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x12, 0x15, 0x2e, 0x70,
  285. 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x72, 0x79, 0x70, 0x74, 0x52, 0x65, 0x71, 0x75,
  286. 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x44, 0x65, 0x63, 0x72,
  287. 0x79, 0x70, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x16, 0x5a, 0x14, 0x73,
  288. 0x64, 0x6b, 0x2f, 0x70, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x2f, 0x6b, 0x6d, 0x73, 0x2f, 0x70, 0x72,
  289. 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  290. }
  291. var (
  292. file_kms_proto_kms_proto_rawDescOnce sync.Once
  293. file_kms_proto_kms_proto_rawDescData = file_kms_proto_kms_proto_rawDesc
  294. )
  295. func file_kms_proto_kms_proto_rawDescGZIP() []byte {
  296. file_kms_proto_kms_proto_rawDescOnce.Do(func() {
  297. file_kms_proto_kms_proto_rawDescData = protoimpl.X.CompressGZIP(file_kms_proto_kms_proto_rawDescData)
  298. })
  299. return file_kms_proto_kms_proto_rawDescData
  300. }
  301. var file_kms_proto_kms_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
  302. var file_kms_proto_kms_proto_goTypes = []interface{}{
  303. (*EncryptRequest)(nil), // 0: proto.EncryptRequest
  304. (*EncryptResponse)(nil), // 1: proto.EncryptResponse
  305. (*DecryptRequest)(nil), // 2: proto.DecryptRequest
  306. (*DecryptResponse)(nil), // 3: proto.DecryptResponse
  307. }
  308. var file_kms_proto_kms_proto_depIdxs = []int32{
  309. 0, // 0: proto.KMS.Encrypt:input_type -> proto.EncryptRequest
  310. 2, // 1: proto.KMS.Decrypt:input_type -> proto.DecryptRequest
  311. 1, // 2: proto.KMS.Encrypt:output_type -> proto.EncryptResponse
  312. 3, // 3: proto.KMS.Decrypt:output_type -> proto.DecryptResponse
  313. 2, // [2:4] is the sub-list for method output_type
  314. 0, // [0:2] is the sub-list for method input_type
  315. 0, // [0:0] is the sub-list for extension type_name
  316. 0, // [0:0] is the sub-list for extension extendee
  317. 0, // [0:0] is the sub-list for field type_name
  318. }
  319. func init() { file_kms_proto_kms_proto_init() }
  320. func file_kms_proto_kms_proto_init() {
  321. if File_kms_proto_kms_proto != nil {
  322. return
  323. }
  324. if !protoimpl.UnsafeEnabled {
  325. file_kms_proto_kms_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  326. switch v := v.(*EncryptRequest); i {
  327. case 0:
  328. return &v.state
  329. case 1:
  330. return &v.sizeCache
  331. case 2:
  332. return &v.unknownFields
  333. default:
  334. return nil
  335. }
  336. }
  337. file_kms_proto_kms_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  338. switch v := v.(*EncryptResponse); i {
  339. case 0:
  340. return &v.state
  341. case 1:
  342. return &v.sizeCache
  343. case 2:
  344. return &v.unknownFields
  345. default:
  346. return nil
  347. }
  348. }
  349. file_kms_proto_kms_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
  350. switch v := v.(*DecryptRequest); i {
  351. case 0:
  352. return &v.state
  353. case 1:
  354. return &v.sizeCache
  355. case 2:
  356. return &v.unknownFields
  357. default:
  358. return nil
  359. }
  360. }
  361. file_kms_proto_kms_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
  362. switch v := v.(*DecryptResponse); i {
  363. case 0:
  364. return &v.state
  365. case 1:
  366. return &v.sizeCache
  367. case 2:
  368. return &v.unknownFields
  369. default:
  370. return nil
  371. }
  372. }
  373. }
  374. type x struct{}
  375. out := protoimpl.TypeBuilder{
  376. File: protoimpl.DescBuilder{
  377. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  378. RawDescriptor: file_kms_proto_kms_proto_rawDesc,
  379. NumEnums: 0,
  380. NumMessages: 4,
  381. NumExtensions: 0,
  382. NumServices: 1,
  383. },
  384. GoTypes: file_kms_proto_kms_proto_goTypes,
  385. DependencyIndexes: file_kms_proto_kms_proto_depIdxs,
  386. MessageInfos: file_kms_proto_kms_proto_msgTypes,
  387. }.Build()
  388. File_kms_proto_kms_proto = out.File
  389. file_kms_proto_kms_proto_rawDesc = nil
  390. file_kms_proto_kms_proto_goTypes = nil
  391. file_kms_proto_kms_proto_depIdxs = nil
  392. }
  393. // Reference imports to suppress errors if they are not otherwise used.
  394. var _ context.Context
  395. var _ grpc.ClientConnInterface
  396. // This is a compile-time assertion to ensure that this generated file
  397. // is compatible with the grpc package it is being compiled against.
  398. const _ = grpc.SupportPackageIsVersion6
  399. // KMSClient is the client API for KMS service.
  400. //
  401. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  402. type KMSClient interface {
  403. Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error)
  404. Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error)
  405. }
  406. type kMSClient struct {
  407. cc grpc.ClientConnInterface
  408. }
  409. func NewKMSClient(cc grpc.ClientConnInterface) KMSClient {
  410. return &kMSClient{cc}
  411. }
  412. func (c *kMSClient) Encrypt(ctx context.Context, in *EncryptRequest, opts ...grpc.CallOption) (*EncryptResponse, error) {
  413. out := new(EncryptResponse)
  414. err := c.cc.Invoke(ctx, "/proto.KMS/Encrypt", in, out, opts...)
  415. if err != nil {
  416. return nil, err
  417. }
  418. return out, nil
  419. }
  420. func (c *kMSClient) Decrypt(ctx context.Context, in *DecryptRequest, opts ...grpc.CallOption) (*DecryptResponse, error) {
  421. out := new(DecryptResponse)
  422. err := c.cc.Invoke(ctx, "/proto.KMS/Decrypt", in, out, opts...)
  423. if err != nil {
  424. return nil, err
  425. }
  426. return out, nil
  427. }
  428. // KMSServer is the server API for KMS service.
  429. type KMSServer interface {
  430. Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error)
  431. Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error)
  432. }
  433. // UnimplementedKMSServer can be embedded to have forward compatible implementations.
  434. type UnimplementedKMSServer struct {
  435. }
  436. func (*UnimplementedKMSServer) Encrypt(context.Context, *EncryptRequest) (*EncryptResponse, error) {
  437. return nil, status.Errorf(codes.Unimplemented, "method Encrypt not implemented")
  438. }
  439. func (*UnimplementedKMSServer) Decrypt(context.Context, *DecryptRequest) (*DecryptResponse, error) {
  440. return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented")
  441. }
  442. func RegisterKMSServer(s *grpc.Server, srv KMSServer) {
  443. s.RegisterService(&_KMS_serviceDesc, srv)
  444. }
  445. func _KMS_Encrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  446. in := new(EncryptRequest)
  447. if err := dec(in); err != nil {
  448. return nil, err
  449. }
  450. if interceptor == nil {
  451. return srv.(KMSServer).Encrypt(ctx, in)
  452. }
  453. info := &grpc.UnaryServerInfo{
  454. Server: srv,
  455. FullMethod: "/proto.KMS/Encrypt",
  456. }
  457. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  458. return srv.(KMSServer).Encrypt(ctx, req.(*EncryptRequest))
  459. }
  460. return interceptor(ctx, in, info, handler)
  461. }
  462. func _KMS_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  463. in := new(DecryptRequest)
  464. if err := dec(in); err != nil {
  465. return nil, err
  466. }
  467. if interceptor == nil {
  468. return srv.(KMSServer).Decrypt(ctx, in)
  469. }
  470. info := &grpc.UnaryServerInfo{
  471. Server: srv,
  472. FullMethod: "/proto.KMS/Decrypt",
  473. }
  474. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  475. return srv.(KMSServer).Decrypt(ctx, req.(*DecryptRequest))
  476. }
  477. return interceptor(ctx, in, info, handler)
  478. }
  479. var _KMS_serviceDesc = grpc.ServiceDesc{
  480. ServiceName: "proto.KMS",
  481. HandlerType: (*KMSServer)(nil),
  482. Methods: []grpc.MethodDesc{
  483. {
  484. MethodName: "Encrypt",
  485. Handler: _KMS_Encrypt_Handler,
  486. },
  487. {
  488. MethodName: "Decrypt",
  489. Handler: _KMS_Decrypt_Handler,
  490. },
  491. },
  492. Streams: []grpc.StreamDesc{},
  493. Metadata: "kms/proto/kms.proto",
  494. }