github.com/klaytn/klaytn@v1.12.1/networks/grpc/klaytn.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // source: klaytn.proto 3 4 package grpc 5 6 import ( 7 context "context" 8 fmt "fmt" 9 math "math" 10 11 proto "github.com/golang/protobuf/proto" 12 grpc "google.golang.org/grpc" 13 ) 14 15 // Reference imports to suppress errors if they are not otherwise used. 16 var _ = proto.Marshal 17 var _ = fmt.Errorf 18 var _ = math.Inf 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the proto package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // proto package needs to be updated. 24 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package 25 26 type Empty struct { 27 XXX_NoUnkeyedLiteral struct{} `json:"-"` 28 XXX_unrecognized []byte `json:"-"` 29 XXX_sizecache int32 `json:"-"` 30 } 31 32 func (m *Empty) Reset() { *m = Empty{} } 33 func (m *Empty) String() string { return proto.CompactTextString(m) } 34 func (*Empty) ProtoMessage() {} 35 func (*Empty) Descriptor() ([]byte, []int) { 36 return fileDescriptor_c6d8429895d2d55b, []int{0} 37 } 38 39 func (m *Empty) XXX_Unmarshal(b []byte) error { 40 return xxx_messageInfo_Empty.Unmarshal(m, b) 41 } 42 func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 43 return xxx_messageInfo_Empty.Marshal(b, m, deterministic) 44 } 45 func (m *Empty) XXX_Merge(src proto.Message) { 46 xxx_messageInfo_Empty.Merge(m, src) 47 } 48 func (m *Empty) XXX_Size() int { 49 return xxx_messageInfo_Empty.Size(m) 50 } 51 func (m *Empty) XXX_DiscardUnknown() { 52 xxx_messageInfo_Empty.DiscardUnknown(m) 53 } 54 55 var xxx_messageInfo_Empty proto.InternalMessageInfo 56 57 type RPCRequest struct { 58 Service string `protobuf:"bytes,1,opt,name=service,proto3" json:"service,omitempty"` 59 Method string `protobuf:"bytes,2,opt,name=method,proto3" json:"method,omitempty"` 60 Params []byte `protobuf:"bytes,3,opt,name=params,proto3" json:"params,omitempty"` 61 XXX_NoUnkeyedLiteral struct{} `json:"-"` 62 XXX_unrecognized []byte `json:"-"` 63 XXX_sizecache int32 `json:"-"` 64 } 65 66 func (m *RPCRequest) Reset() { *m = RPCRequest{} } 67 func (m *RPCRequest) String() string { return proto.CompactTextString(m) } 68 func (*RPCRequest) ProtoMessage() {} 69 func (*RPCRequest) Descriptor() ([]byte, []int) { 70 return fileDescriptor_c6d8429895d2d55b, []int{1} 71 } 72 73 func (m *RPCRequest) XXX_Unmarshal(b []byte) error { 74 return xxx_messageInfo_RPCRequest.Unmarshal(m, b) 75 } 76 func (m *RPCRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 77 return xxx_messageInfo_RPCRequest.Marshal(b, m, deterministic) 78 } 79 func (m *RPCRequest) XXX_Merge(src proto.Message) { 80 xxx_messageInfo_RPCRequest.Merge(m, src) 81 } 82 func (m *RPCRequest) XXX_Size() int { 83 return xxx_messageInfo_RPCRequest.Size(m) 84 } 85 func (m *RPCRequest) XXX_DiscardUnknown() { 86 xxx_messageInfo_RPCRequest.DiscardUnknown(m) 87 } 88 89 var xxx_messageInfo_RPCRequest proto.InternalMessageInfo 90 91 func (m *RPCRequest) GetService() string { 92 if m != nil { 93 return m.Service 94 } 95 return "" 96 } 97 98 func (m *RPCRequest) GetMethod() string { 99 if m != nil { 100 return m.Method 101 } 102 return "" 103 } 104 105 func (m *RPCRequest) GetParams() []byte { 106 if m != nil { 107 return m.Params 108 } 109 return nil 110 } 111 112 type RPCResponse struct { 113 Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` 114 XXX_NoUnkeyedLiteral struct{} `json:"-"` 115 XXX_unrecognized []byte `json:"-"` 116 XXX_sizecache int32 `json:"-"` 117 } 118 119 func (m *RPCResponse) Reset() { *m = RPCResponse{} } 120 func (m *RPCResponse) String() string { return proto.CompactTextString(m) } 121 func (*RPCResponse) ProtoMessage() {} 122 func (*RPCResponse) Descriptor() ([]byte, []int) { 123 return fileDescriptor_c6d8429895d2d55b, []int{2} 124 } 125 126 func (m *RPCResponse) XXX_Unmarshal(b []byte) error { 127 return xxx_messageInfo_RPCResponse.Unmarshal(m, b) 128 } 129 func (m *RPCResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 130 return xxx_messageInfo_RPCResponse.Marshal(b, m, deterministic) 131 } 132 func (m *RPCResponse) XXX_Merge(src proto.Message) { 133 xxx_messageInfo_RPCResponse.Merge(m, src) 134 } 135 func (m *RPCResponse) XXX_Size() int { 136 return xxx_messageInfo_RPCResponse.Size(m) 137 } 138 func (m *RPCResponse) XXX_DiscardUnknown() { 139 xxx_messageInfo_RPCResponse.DiscardUnknown(m) 140 } 141 142 var xxx_messageInfo_RPCResponse proto.InternalMessageInfo 143 144 func (m *RPCResponse) GetPayload() []byte { 145 if m != nil { 146 return m.Payload 147 } 148 return nil 149 } 150 151 func init() { 152 proto.RegisterType((*Empty)(nil), "grpc.Empty") 153 proto.RegisterType((*RPCRequest)(nil), "grpc.RPCRequest") 154 proto.RegisterType((*RPCResponse)(nil), "grpc.RPCResponse") 155 } 156 157 func init() { proto.RegisterFile("klaytn.proto", fileDescriptor_c6d8429895d2d55b) } 158 159 var fileDescriptor_c6d8429895d2d55b = []byte{ 160 // 244 bytes of a gzipped FileDescriptorProto 161 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x90, 0x41, 0x4b, 0xc3, 0x30, 162 0x18, 0x86, 0xfd, 0x66, 0xed, 0xd8, 0x67, 0x61, 0x9a, 0x83, 0x14, 0x4f, 0xa3, 0x17, 0x0b, 0x62, 163 0x19, 0xce, 0x5f, 0xd0, 0xe1, 0x49, 0x90, 0x12, 0xc1, 0x7b, 0xda, 0x7e, 0x68, 0xb1, 0x59, 0x62, 164 0x92, 0x09, 0xfd, 0x3b, 0x1e, 0xfc, 0x9d, 0x92, 0xd8, 0x51, 0x8f, 0x7a, 0x7c,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c, 0x01, 0x00, 0x00, 177 } 178 179 // Reference imports to suppress errors if they are not otherwise used. 180 var _ context.Context 181 var _ grpc.ClientConn 182 183 // This is a compile-time assertion to ensure that this generated file 184 // is compatible with the grpc package it is being compiled against. 185 const _ = grpc.SupportPackageIsVersion4 186 187 // KlaytnNodeClient is the client API for KlaytnNode service. 188 // 189 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 190 type KlaytnNodeClient interface { 191 Call(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (*RPCResponse, error) 192 Subscribe(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (KlaytnNode_SubscribeClient, error) 193 BiCall(ctx context.Context, opts ...grpc.CallOption) (KlaytnNode_BiCallClient, error) 194 } 195 196 type klaytnNodeClient struct { 197 cc *grpc.ClientConn 198 } 199 200 func NewKlaytnNodeClient(cc *grpc.ClientConn) KlaytnNodeClient { 201 return &klaytnNodeClient{cc} 202 } 203 204 func (c *klaytnNodeClient) Call(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (*RPCResponse, error) { 205 out := new(RPCResponse) 206 err := c.cc.Invoke(ctx, "/grpc.KlaytnNode/Call", in, out, opts...) 207 if err != nil { 208 return nil, err 209 } 210 return out, nil 211 } 212 213 func (c *klaytnNodeClient) Subscribe(ctx context.Context, in *RPCRequest, opts ...grpc.CallOption) (KlaytnNode_SubscribeClient, error) { 214 stream, err := c.cc.NewStream(ctx, &_KlaytnNode_serviceDesc.Streams[0], "/grpc.KlaytnNode/Subscribe", opts...) 215 if err != nil { 216 return nil, err 217 } 218 x := &klaytnNodeSubscribeClient{stream} 219 if err := x.ClientStream.SendMsg(in); err != nil { 220 return nil, err 221 } 222 if err := x.ClientStream.CloseSend(); err != nil { 223 return nil, err 224 } 225 return x, nil 226 } 227 228 type KlaytnNode_SubscribeClient interface { 229 Recv() (*RPCResponse, error) 230 grpc.ClientStream 231 } 232 233 type klaytnNodeSubscribeClient struct { 234 grpc.ClientStream 235 } 236 237 func (x *klaytnNodeSubscribeClient) Recv() (*RPCResponse, error) { 238 m := new(RPCResponse) 239 if err := x.ClientStream.RecvMsg(m); err != nil { 240 return nil, err 241 } 242 return m, nil 243 } 244 245 func (c *klaytnNodeClient) BiCall(ctx context.Context, opts ...grpc.CallOption) (KlaytnNode_BiCallClient, error) { 246 stream, err := c.cc.NewStream(ctx, &_KlaytnNode_serviceDesc.Streams[1], "/grpc.KlaytnNode/BiCall", opts...) 247 if err != nil { 248 return nil, err 249 } 250 x := &klaytnNodeBiCallClient{stream} 251 return x, nil 252 } 253 254 type KlaytnNode_BiCallClient interface { 255 Send(*RPCRequest) error 256 Recv() (*RPCResponse, error) 257 grpc.ClientStream 258 } 259 260 type klaytnNodeBiCallClient struct { 261 grpc.ClientStream 262 } 263 264 func (x *klaytnNodeBiCallClient) Send(m *RPCRequest) error { 265 return x.ClientStream.SendMsg(m) 266 } 267 268 func (x *klaytnNodeBiCallClient) Recv() (*RPCResponse, error) { 269 m := new(RPCResponse) 270 if err := x.ClientStream.RecvMsg(m); err != nil { 271 return nil, err 272 } 273 return m, nil 274 } 275 276 // KlaytnNodeServer is the server API for KlaytnNode service. 277 type KlaytnNodeServer interface { 278 Call(context.Context, *RPCRequest) (*RPCResponse, error) 279 Subscribe(*RPCRequest, KlaytnNode_SubscribeServer) error 280 BiCall(KlaytnNode_BiCallServer) error 281 } 282 283 func RegisterKlaytnNodeServer(s *grpc.Server, srv KlaytnNodeServer) { 284 s.RegisterService(&_KlaytnNode_serviceDesc, srv) 285 } 286 287 func _KlaytnNode_Call_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 288 in := new(RPCRequest) 289 if err := dec(in); err != nil { 290 return nil, err 291 } 292 if interceptor == nil { 293 return srv.(KlaytnNodeServer).Call(ctx, in) 294 } 295 info := &grpc.UnaryServerInfo{ 296 Server: srv, 297 FullMethod: "/grpc.KlaytnNode/Call", 298 } 299 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 300 return srv.(KlaytnNodeServer).Call(ctx, req.(*RPCRequest)) 301 } 302 return interceptor(ctx, in, info, handler) 303 } 304 305 func _KlaytnNode_Subscribe_Handler(srv interface{}, stream grpc.ServerStream) error { 306 m := new(RPCRequest) 307 if err := stream.RecvMsg(m); err != nil { 308 return err 309 } 310 return srv.(KlaytnNodeServer).Subscribe(m, &klaytnNodeSubscribeServer{stream}) 311 } 312 313 type KlaytnNode_SubscribeServer interface { 314 Send(*RPCResponse) error 315 grpc.ServerStream 316 } 317 318 type klaytnNodeSubscribeServer struct { 319 grpc.ServerStream 320 } 321 322 func (x *klaytnNodeSubscribeServer) Send(m *RPCResponse) error { 323 return x.ServerStream.SendMsg(m) 324 } 325 326 func _KlaytnNode_BiCall_Handler(srv interface{}, stream grpc.ServerStream) error { 327 return srv.(KlaytnNodeServer).BiCall(&klaytnNodeBiCallServer{stream}) 328 } 329 330 type KlaytnNode_BiCallServer interface { 331 Send(*RPCResponse) error 332 Recv() (*RPCRequest, error) 333 grpc.ServerStream 334 } 335 336 type klaytnNodeBiCallServer struct { 337 grpc.ServerStream 338 } 339 340 func (x *klaytnNodeBiCallServer) Send(m *RPCResponse) error { 341 return x.ServerStream.SendMsg(m) 342 } 343 344 func (x *klaytnNodeBiCallServer) Recv() (*RPCRequest, error) { 345 m := new(RPCRequest) 346 if err := x.ServerStream.RecvMsg(m); err != nil { 347 return nil, err 348 } 349 return m, nil 350 } 351 352 var _KlaytnNode_serviceDesc = grpc.ServiceDesc{ 353 ServiceName: "grpc.KlaytnNode", 354 HandlerType: (*KlaytnNodeServer)(nil), 355 Methods: []grpc.MethodDesc{ 356 { 357 MethodName: "Call", 358 Handler: _KlaytnNode_Call_Handler, 359 }, 360 }, 361 Streams: []grpc.StreamDesc{ 362 { 363 StreamName: "Subscribe", 364 Handler: _KlaytnNode_Subscribe_Handler, 365 ServerStreams: true, 366 }, 367 { 368 StreamName: "BiCall", 369 Handler: _KlaytnNode_BiCall_Handler, 370 ServerStreams: true, 371 ClientStreams: true, 372 }, 373 }, 374 Metadata: "klaytn.proto", 375 }