safe.pb.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. // Code generated by protoc-gen-go. DO NOT EDIT.
  2. // versions:
  3. // protoc-gen-go v1.25.0
  4. // protoc v3.9.0
  5. // source: safe.proto
  6. package proto
  7. import (
  8. context "context"
  9. proto "github.com/golang/protobuf/proto"
  10. grpc "google.golang.org/grpc"
  11. codes "google.golang.org/grpc/codes"
  12. status "google.golang.org/grpc/status"
  13. protoreflect "google.golang.org/protobuf/reflect/protoreflect"
  14. protoimpl "google.golang.org/protobuf/runtime/protoimpl"
  15. reflect "reflect"
  16. sync "sync"
  17. )
  18. const (
  19. // Verify that this generated code is sufficiently up-to-date.
  20. _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
  21. // Verify that runtime/protoimpl is sufficiently up-to-date.
  22. _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
  23. )
  24. // This is a compile-time assertion that a sufficiently up-to-date version
  25. // of the legacy proto package is being used.
  26. const _ = proto.ProtoPackageIsVersion4
  27. // The request message containing the user's name.
  28. type SafeGetRequest struct {
  29. state protoimpl.MessageState
  30. sizeCache protoimpl.SizeCache
  31. unknownFields protoimpl.UnknownFields
  32. Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  33. }
  34. func (x *SafeGetRequest) Reset() {
  35. *x = SafeGetRequest{}
  36. if protoimpl.UnsafeEnabled {
  37. mi := &file_safe_proto_msgTypes[0]
  38. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  39. ms.StoreMessageInfo(mi)
  40. }
  41. }
  42. func (x *SafeGetRequest) String() string {
  43. return protoimpl.X.MessageStringOf(x)
  44. }
  45. func (*SafeGetRequest) ProtoMessage() {}
  46. func (x *SafeGetRequest) ProtoReflect() protoreflect.Message {
  47. mi := &file_safe_proto_msgTypes[0]
  48. if protoimpl.UnsafeEnabled && x != nil {
  49. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  50. if ms.LoadMessageInfo() == nil {
  51. ms.StoreMessageInfo(mi)
  52. }
  53. return ms
  54. }
  55. return mi.MessageOf(x)
  56. }
  57. // Deprecated: Use SafeGetRequest.ProtoReflect.Descriptor instead.
  58. func (*SafeGetRequest) Descriptor() ([]byte, []int) {
  59. return file_safe_proto_rawDescGZIP(), []int{0}
  60. }
  61. func (x *SafeGetRequest) GetId() int32 {
  62. if x != nil {
  63. return x.Id
  64. }
  65. return 0
  66. }
  67. type SafePostRequest struct {
  68. state protoimpl.MessageState
  69. sizeCache protoimpl.SizeCache
  70. unknownFields protoimpl.UnknownFields
  71. Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  72. Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
  73. Position string `protobuf:"bytes,3,opt,name=position,proto3" json:"position,omitempty"`
  74. CreateTime string `protobuf:"bytes,4,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`
  75. Inspection string `protobuf:"bytes,5,opt,name=inspection,proto3" json:"inspection,omitempty"`
  76. }
  77. func (x *SafePostRequest) Reset() {
  78. *x = SafePostRequest{}
  79. if protoimpl.UnsafeEnabled {
  80. mi := &file_safe_proto_msgTypes[1]
  81. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  82. ms.StoreMessageInfo(mi)
  83. }
  84. }
  85. func (x *SafePostRequest) String() string {
  86. return protoimpl.X.MessageStringOf(x)
  87. }
  88. func (*SafePostRequest) ProtoMessage() {}
  89. func (x *SafePostRequest) ProtoReflect() protoreflect.Message {
  90. mi := &file_safe_proto_msgTypes[1]
  91. if protoimpl.UnsafeEnabled && x != nil {
  92. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  93. if ms.LoadMessageInfo() == nil {
  94. ms.StoreMessageInfo(mi)
  95. }
  96. return ms
  97. }
  98. return mi.MessageOf(x)
  99. }
  100. // Deprecated: Use SafePostRequest.ProtoReflect.Descriptor instead.
  101. func (*SafePostRequest) Descriptor() ([]byte, []int) {
  102. return file_safe_proto_rawDescGZIP(), []int{1}
  103. }
  104. func (x *SafePostRequest) GetId() int32 {
  105. if x != nil {
  106. return x.Id
  107. }
  108. return 0
  109. }
  110. func (x *SafePostRequest) GetCode() string {
  111. if x != nil {
  112. return x.Code
  113. }
  114. return ""
  115. }
  116. func (x *SafePostRequest) GetPosition() string {
  117. if x != nil {
  118. return x.Position
  119. }
  120. return ""
  121. }
  122. func (x *SafePostRequest) GetCreateTime() string {
  123. if x != nil {
  124. return x.CreateTime
  125. }
  126. return ""
  127. }
  128. func (x *SafePostRequest) GetInspection() string {
  129. if x != nil {
  130. return x.Inspection
  131. }
  132. return ""
  133. }
  134. // The response message containing the greetings
  135. type SafeReply struct {
  136. state protoimpl.MessageState
  137. sizeCache protoimpl.SizeCache
  138. unknownFields protoimpl.UnknownFields
  139. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
  140. Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
  141. Msg string `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"`
  142. }
  143. func (x *SafeReply) Reset() {
  144. *x = SafeReply{}
  145. if protoimpl.UnsafeEnabled {
  146. mi := &file_safe_proto_msgTypes[2]
  147. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  148. ms.StoreMessageInfo(mi)
  149. }
  150. }
  151. func (x *SafeReply) String() string {
  152. return protoimpl.X.MessageStringOf(x)
  153. }
  154. func (*SafeReply) ProtoMessage() {}
  155. func (x *SafeReply) ProtoReflect() protoreflect.Message {
  156. mi := &file_safe_proto_msgTypes[2]
  157. if protoimpl.UnsafeEnabled && x != nil {
  158. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  159. if ms.LoadMessageInfo() == nil {
  160. ms.StoreMessageInfo(mi)
  161. }
  162. return ms
  163. }
  164. return mi.MessageOf(x)
  165. }
  166. // Deprecated: Use SafeReply.ProtoReflect.Descriptor instead.
  167. func (*SafeReply) Descriptor() ([]byte, []int) {
  168. return file_safe_proto_rawDescGZIP(), []int{2}
  169. }
  170. func (x *SafeReply) GetCode() int32 {
  171. if x != nil {
  172. return x.Code
  173. }
  174. return 0
  175. }
  176. func (x *SafeReply) GetData() string {
  177. if x != nil {
  178. return x.Data
  179. }
  180. return ""
  181. }
  182. func (x *SafeReply) GetMsg() string {
  183. if x != nil {
  184. return x.Msg
  185. }
  186. return ""
  187. }
  188. var File_safe_proto protoreflect.FileDescriptor
  189. var file_safe_proto_rawDesc = []byte{
  190. 0x0a, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72,
  191. 0x6f, 0x74, 0x6f, 0x22, 0x20, 0x0a, 0x0e, 0x53, 0x61, 0x66, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65,
  192. 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
  193. 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x92, 0x01, 0x0a, 0x0f, 0x53, 0x61, 0x66, 0x65, 0x50, 0x6f,
  194. 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
  195. 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64,
  196. 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a,
  197. 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
  198. 0x08, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x72, 0x65,
  199. 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
  200. 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x6e,
  201. 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
  202. 0x69, 0x6e, 0x73, 0x70, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x45, 0x0a, 0x09, 0x53, 0x61,
  203. 0x66, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18,
  204. 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64,
  205. 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12,
  206. 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73,
  207. 0x67, 0x32, 0x78, 0x0a, 0x04, 0x53, 0x61, 0x66, 0x65, 0x12, 0x38, 0x0a, 0x0b, 0x67, 0x65, 0x74,
  208. 0x53, 0x61, 0x66, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
  209. 0x2e, 0x53, 0x61, 0x66, 0x65, 0x47, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
  210. 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x70, 0x6c,
  211. 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x08, 0x70, 0x6f, 0x73, 0x74, 0x53, 0x61, 0x66, 0x65, 0x12,
  212. 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x50, 0x6f, 0x73, 0x74,
  213. 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
  214. 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f,
  215. 0x74, 0x6f, 0x33,
  216. }
  217. var (
  218. file_safe_proto_rawDescOnce sync.Once
  219. file_safe_proto_rawDescData = file_safe_proto_rawDesc
  220. )
  221. func file_safe_proto_rawDescGZIP() []byte {
  222. file_safe_proto_rawDescOnce.Do(func() {
  223. file_safe_proto_rawDescData = protoimpl.X.CompressGZIP(file_safe_proto_rawDescData)
  224. })
  225. return file_safe_proto_rawDescData
  226. }
  227. var file_safe_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
  228. var file_safe_proto_goTypes = []interface{}{
  229. (*SafeGetRequest)(nil), // 0: proto.SafeGetRequest
  230. (*SafePostRequest)(nil), // 1: proto.SafePostRequest
  231. (*SafeReply)(nil), // 2: proto.SafeReply
  232. }
  233. var file_safe_proto_depIdxs = []int32{
  234. 0, // 0: proto.Safe.getSafeList:input_type -> proto.SafeGetRequest
  235. 1, // 1: proto.Safe.postSafe:input_type -> proto.SafePostRequest
  236. 2, // 2: proto.Safe.getSafeList:output_type -> proto.SafeReply
  237. 2, // 3: proto.Safe.postSafe:output_type -> proto.SafeReply
  238. 2, // [2:4] is the sub-list for method output_type
  239. 0, // [0:2] is the sub-list for method input_type
  240. 0, // [0:0] is the sub-list for extension type_name
  241. 0, // [0:0] is the sub-list for extension extendee
  242. 0, // [0:0] is the sub-list for field type_name
  243. }
  244. func init() { file_safe_proto_init() }
  245. func file_safe_proto_init() {
  246. if File_safe_proto != nil {
  247. return
  248. }
  249. if !protoimpl.UnsafeEnabled {
  250. file_safe_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  251. switch v := v.(*SafeGetRequest); i {
  252. case 0:
  253. return &v.state
  254. case 1:
  255. return &v.sizeCache
  256. case 2:
  257. return &v.unknownFields
  258. default:
  259. return nil
  260. }
  261. }
  262. file_safe_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  263. switch v := v.(*SafePostRequest); i {
  264. case 0:
  265. return &v.state
  266. case 1:
  267. return &v.sizeCache
  268. case 2:
  269. return &v.unknownFields
  270. default:
  271. return nil
  272. }
  273. }
  274. file_safe_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
  275. switch v := v.(*SafeReply); i {
  276. case 0:
  277. return &v.state
  278. case 1:
  279. return &v.sizeCache
  280. case 2:
  281. return &v.unknownFields
  282. default:
  283. return nil
  284. }
  285. }
  286. }
  287. type x struct{}
  288. out := protoimpl.TypeBuilder{
  289. File: protoimpl.DescBuilder{
  290. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  291. RawDescriptor: file_safe_proto_rawDesc,
  292. NumEnums: 0,
  293. NumMessages: 3,
  294. NumExtensions: 0,
  295. NumServices: 1,
  296. },
  297. GoTypes: file_safe_proto_goTypes,
  298. DependencyIndexes: file_safe_proto_depIdxs,
  299. MessageInfos: file_safe_proto_msgTypes,
  300. }.Build()
  301. File_safe_proto = out.File
  302. file_safe_proto_rawDesc = nil
  303. file_safe_proto_goTypes = nil
  304. file_safe_proto_depIdxs = nil
  305. }
  306. // Reference imports to suppress errors if they are not otherwise used.
  307. var _ context.Context
  308. var _ grpc.ClientConnInterface
  309. // This is a compile-time assertion to ensure that this generated file
  310. // is compatible with the grpc package it is being compiled against.
  311. const _ = grpc.SupportPackageIsVersion6
  312. // SafeClient is the client API for Safe service.
  313. //
  314. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  315. type SafeClient interface {
  316. // Sends a greeting
  317. GetSafeList(ctx context.Context, in *SafeGetRequest, opts ...grpc.CallOption) (*SafeReply, error)
  318. PostSafe(ctx context.Context, in *SafePostRequest, opts ...grpc.CallOption) (*SafeReply, error)
  319. }
  320. type safeClient struct {
  321. cc grpc.ClientConnInterface
  322. }
  323. func NewSafeClient(cc grpc.ClientConnInterface) SafeClient {
  324. return &safeClient{cc}
  325. }
  326. func (c *safeClient) GetSafeList(ctx context.Context, in *SafeGetRequest, opts ...grpc.CallOption) (*SafeReply, error) {
  327. out := new(SafeReply)
  328. err := c.cc.Invoke(ctx, "/proto.Safe/getSafeList", in, out, opts...)
  329. if err != nil {
  330. return nil, err
  331. }
  332. return out, nil
  333. }
  334. func (c *safeClient) PostSafe(ctx context.Context, in *SafePostRequest, opts ...grpc.CallOption) (*SafeReply, error) {
  335. out := new(SafeReply)
  336. err := c.cc.Invoke(ctx, "/proto.Safe/postSafe", in, out, opts...)
  337. if err != nil {
  338. return nil, err
  339. }
  340. return out, nil
  341. }
  342. // SafeServer is the server API for Safe service.
  343. type SafeServer interface {
  344. // Sends a greeting
  345. GetSafeList(context.Context, *SafeGetRequest) (*SafeReply, error)
  346. PostSafe(context.Context, *SafePostRequest) (*SafeReply, error)
  347. }
  348. // UnimplementedSafeServer can be embedded to have forward compatible implementations.
  349. type UnimplementedSafeServer struct {
  350. }
  351. func (*UnimplementedSafeServer) GetSafeList(context.Context, *SafeGetRequest) (*SafeReply, error) {
  352. return nil, status.Errorf(codes.Unimplemented, "method GetSafeList not implemented")
  353. }
  354. func (*UnimplementedSafeServer) PostSafe(context.Context, *SafePostRequest) (*SafeReply, error) {
  355. return nil, status.Errorf(codes.Unimplemented, "method PostSafe not implemented")
  356. }
  357. func RegisterSafeServer(s *grpc.Server, srv SafeServer) {
  358. s.RegisterService(&_Safe_serviceDesc, srv)
  359. }
  360. func _Safe_GetSafeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  361. in := new(SafeGetRequest)
  362. if err := dec(in); err != nil {
  363. return nil, err
  364. }
  365. if interceptor == nil {
  366. return srv.(SafeServer).GetSafeList(ctx, in)
  367. }
  368. info := &grpc.UnaryServerInfo{
  369. Server: srv,
  370. FullMethod: "/proto.Safe/GetSafeList",
  371. }
  372. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  373. return srv.(SafeServer).GetSafeList(ctx, req.(*SafeGetRequest))
  374. }
  375. return interceptor(ctx, in, info, handler)
  376. }
  377. func _Safe_PostSafe_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  378. in := new(SafePostRequest)
  379. if err := dec(in); err != nil {
  380. return nil, err
  381. }
  382. if interceptor == nil {
  383. return srv.(SafeServer).PostSafe(ctx, in)
  384. }
  385. info := &grpc.UnaryServerInfo{
  386. Server: srv,
  387. FullMethod: "/proto.Safe/PostSafe",
  388. }
  389. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  390. return srv.(SafeServer).PostSafe(ctx, req.(*SafePostRequest))
  391. }
  392. return interceptor(ctx, in, info, handler)
  393. }
  394. var _Safe_serviceDesc = grpc.ServiceDesc{
  395. ServiceName: "proto.Safe",
  396. HandlerType: (*SafeServer)(nil),
  397. Methods: []grpc.MethodDesc{
  398. {
  399. MethodName: "getSafeList",
  400. Handler: _Safe_GetSafeList_Handler,
  401. },
  402. {
  403. MethodName: "postSafe",
  404. Handler: _Safe_PostSafe_Handler,
  405. },
  406. },
  407. Streams: []grpc.StreamDesc{},
  408. Metadata: "safe.proto",
  409. }