safe.pb.go 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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 SafeRequest 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 *SafeRequest) Reset() {
  35. *x = SafeRequest{}
  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 *SafeRequest) String() string {
  43. return protoimpl.X.MessageStringOf(x)
  44. }
  45. func (*SafeRequest) ProtoMessage() {}
  46. func (x *SafeRequest) 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 SafeRequest.ProtoReflect.Descriptor instead.
  58. func (*SafeRequest) Descriptor() ([]byte, []int) {
  59. return file_safe_proto_rawDescGZIP(), []int{0}
  60. }
  61. func (x *SafeRequest) GetId() int32 {
  62. if x != nil {
  63. return x.Id
  64. }
  65. return 0
  66. }
  67. // The response message containing the greetings
  68. type SafeReply struct {
  69. state protoimpl.MessageState
  70. sizeCache protoimpl.SizeCache
  71. unknownFields protoimpl.UnknownFields
  72. Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
  73. Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
  74. Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
  75. }
  76. func (x *SafeReply) Reset() {
  77. *x = SafeReply{}
  78. if protoimpl.UnsafeEnabled {
  79. mi := &file_safe_proto_msgTypes[1]
  80. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  81. ms.StoreMessageInfo(mi)
  82. }
  83. }
  84. func (x *SafeReply) String() string {
  85. return protoimpl.X.MessageStringOf(x)
  86. }
  87. func (*SafeReply) ProtoMessage() {}
  88. func (x *SafeReply) ProtoReflect() protoreflect.Message {
  89. mi := &file_safe_proto_msgTypes[1]
  90. if protoimpl.UnsafeEnabled && x != nil {
  91. ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
  92. if ms.LoadMessageInfo() == nil {
  93. ms.StoreMessageInfo(mi)
  94. }
  95. return ms
  96. }
  97. return mi.MessageOf(x)
  98. }
  99. // Deprecated: Use SafeReply.ProtoReflect.Descriptor instead.
  100. func (*SafeReply) Descriptor() ([]byte, []int) {
  101. return file_safe_proto_rawDescGZIP(), []int{1}
  102. }
  103. func (x *SafeReply) GetCode() int32 {
  104. if x != nil {
  105. return x.Code
  106. }
  107. return 0
  108. }
  109. func (x *SafeReply) GetData() string {
  110. if x != nil {
  111. return x.Data
  112. }
  113. return ""
  114. }
  115. func (x *SafeReply) GetMessage() string {
  116. if x != nil {
  117. return x.Message
  118. }
  119. return ""
  120. }
  121. var File_safe_proto protoreflect.FileDescriptor
  122. var file_safe_proto_rawDesc = []byte{
  123. 0x0a, 0x0a, 0x73, 0x61, 0x66, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 0x72,
  124. 0x6f, 0x74, 0x6f, 0x22, 0x1d, 0x0a, 0x0b, 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
  125. 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02,
  126. 0x69, 0x64, 0x22, 0x4d, 0x0a, 0x09, 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12,
  127. 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63,
  128. 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x02, 0x20, 0x01, 0x28,
  129. 0x09, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
  130. 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
  131. 0x65, 0x32, 0x3d, 0x0a, 0x04, 0x53, 0x61, 0x66, 0x65, 0x12, 0x35, 0x0a, 0x0b, 0x67, 0x65, 0x74,
  132. 0x53, 0x61, 0x66, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
  133. 0x2e, 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70,
  134. 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x53, 0x61, 0x66, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00,
  135. 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
  136. }
  137. var (
  138. file_safe_proto_rawDescOnce sync.Once
  139. file_safe_proto_rawDescData = file_safe_proto_rawDesc
  140. )
  141. func file_safe_proto_rawDescGZIP() []byte {
  142. file_safe_proto_rawDescOnce.Do(func() {
  143. file_safe_proto_rawDescData = protoimpl.X.CompressGZIP(file_safe_proto_rawDescData)
  144. })
  145. return file_safe_proto_rawDescData
  146. }
  147. var file_safe_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
  148. var file_safe_proto_goTypes = []interface{}{
  149. (*SafeRequest)(nil), // 0: proto.SafeRequest
  150. (*SafeReply)(nil), // 1: proto.SafeReply
  151. }
  152. var file_safe_proto_depIdxs = []int32{
  153. 0, // 0: proto.Safe.getSafeList:input_type -> proto.SafeRequest
  154. 1, // 1: proto.Safe.getSafeList:output_type -> proto.SafeReply
  155. 1, // [1:2] is the sub-list for method output_type
  156. 0, // [0:1] is the sub-list for method input_type
  157. 0, // [0:0] is the sub-list for extension type_name
  158. 0, // [0:0] is the sub-list for extension extendee
  159. 0, // [0:0] is the sub-list for field type_name
  160. }
  161. func init() { file_safe_proto_init() }
  162. func file_safe_proto_init() {
  163. if File_safe_proto != nil {
  164. return
  165. }
  166. if !protoimpl.UnsafeEnabled {
  167. file_safe_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
  168. switch v := v.(*SafeRequest); i {
  169. case 0:
  170. return &v.state
  171. case 1:
  172. return &v.sizeCache
  173. case 2:
  174. return &v.unknownFields
  175. default:
  176. return nil
  177. }
  178. }
  179. file_safe_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
  180. switch v := v.(*SafeReply); i {
  181. case 0:
  182. return &v.state
  183. case 1:
  184. return &v.sizeCache
  185. case 2:
  186. return &v.unknownFields
  187. default:
  188. return nil
  189. }
  190. }
  191. }
  192. type x struct{}
  193. out := protoimpl.TypeBuilder{
  194. File: protoimpl.DescBuilder{
  195. GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
  196. RawDescriptor: file_safe_proto_rawDesc,
  197. NumEnums: 0,
  198. NumMessages: 2,
  199. NumExtensions: 0,
  200. NumServices: 1,
  201. },
  202. GoTypes: file_safe_proto_goTypes,
  203. DependencyIndexes: file_safe_proto_depIdxs,
  204. MessageInfos: file_safe_proto_msgTypes,
  205. }.Build()
  206. File_safe_proto = out.File
  207. file_safe_proto_rawDesc = nil
  208. file_safe_proto_goTypes = nil
  209. file_safe_proto_depIdxs = nil
  210. }
  211. // Reference imports to suppress errors if they are not otherwise used.
  212. var _ context.Context
  213. var _ grpc.ClientConnInterface
  214. // This is a compile-time assertion to ensure that this generated file
  215. // is compatible with the grpc package it is being compiled against.
  216. const _ = grpc.SupportPackageIsVersion6
  217. // SafeClient is the client API for Safe service.
  218. //
  219. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
  220. type SafeClient interface {
  221. // Sends a greeting
  222. GetSafeList(ctx context.Context, in *SafeRequest, opts ...grpc.CallOption) (*SafeReply, error)
  223. }
  224. type safeClient struct {
  225. cc grpc.ClientConnInterface
  226. }
  227. func NewSafeClient(cc grpc.ClientConnInterface) SafeClient {
  228. return &safeClient{cc}
  229. }
  230. func (c *safeClient) GetSafeList(ctx context.Context, in *SafeRequest, opts ...grpc.CallOption) (*SafeReply, error) {
  231. out := new(SafeReply)
  232. err := c.cc.Invoke(ctx, "/proto.Safe/getSafeList", in, out, opts...)
  233. if err != nil {
  234. return nil, err
  235. }
  236. return out, nil
  237. }
  238. // SafeServer is the server API for Safe service.
  239. type SafeServer interface {
  240. // Sends a greeting
  241. GetSafeList(context.Context, *SafeRequest) (*SafeReply, error)
  242. }
  243. // UnimplementedSafeServer can be embedded to have forward compatible implementations.
  244. type UnimplementedSafeServer struct {
  245. }
  246. func (*UnimplementedSafeServer) GetSafeList(context.Context, *SafeRequest) (*SafeReply, error) {
  247. return nil, status.Errorf(codes.Unimplemented, "method GetSafeList not implemented")
  248. }
  249. func RegisterSafeServer(s *grpc.Server, srv SafeServer) {
  250. s.RegisterService(&_Safe_serviceDesc, srv)
  251. }
  252. func _Safe_GetSafeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
  253. in := new(SafeRequest)
  254. if err := dec(in); err != nil {
  255. return nil, err
  256. }
  257. if interceptor == nil {
  258. return srv.(SafeServer).GetSafeList(ctx, in)
  259. }
  260. info := &grpc.UnaryServerInfo{
  261. Server: srv,
  262. FullMethod: "/proto.Safe/GetSafeList",
  263. }
  264. handler := func(ctx context.Context, req interface{}) (interface{}, error) {
  265. return srv.(SafeServer).GetSafeList(ctx, req.(*SafeRequest))
  266. }
  267. return interceptor(ctx, in, info, handler)
  268. }
  269. var _Safe_serviceDesc = grpc.ServiceDesc{
  270. ServiceName: "proto.Safe",
  271. HandlerType: (*SafeServer)(nil),
  272. Methods: []grpc.MethodDesc{
  273. {
  274. MethodName: "getSafeList",
  275. Handler: _Safe_GetSafeList_Handler,
  276. },
  277. },
  278. Streams: []grpc.StreamDesc{},
  279. Metadata: "safe.proto",
  280. }