github.com/newrelic/go-agent@v3.26.0+incompatible/_integrations/nrgrpc/example/sampleapp/sampleapp.pb.go (about) 1 // Copyright 2020 New Relic Corporation. All rights reserved. 2 // SPDX-License-Identifier: Apache-2.0 3 4 // Code generated by protoc-gen-go. DO NOT EDIT. 5 // source: sampleapp.proto 6 7 package sampleapp 8 9 import ( 10 context "context" 11 fmt "fmt" 12 proto "github.com/golang/protobuf/proto" 13 grpc "google.golang.org/grpc" 14 codes "google.golang.org/grpc/codes" 15 status "google.golang.org/grpc/status" 16 math "math" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var _ = proto.Marshal 21 var _ = fmt.Errorf 22 var _ = math.Inf 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the proto package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // proto package needs to be updated. 28 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 29 30 type Message struct { 31 Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"` 32 XXX_NoUnkeyedLiteral struct{} `json:"-"` 33 XXX_unrecognized []byte `json:"-"` 34 XXX_sizecache int32 `json:"-"` 35 } 36 37 func (m *Message) Reset() { *m = Message{} } 38 func (m *Message) String() string { return proto.CompactTextString(m) } 39 func (*Message) ProtoMessage() {} 40 func (*Message) Descriptor() ([]byte, []int) { 41 return fileDescriptor_38ae74b4e52ac4e0, []int{0} 42 } 43 44 func (m *Message) XXX_Unmarshal(b []byte) error { 45 return xxx_messageInfo_Message.Unmarshal(m, b) 46 } 47 func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 48 return xxx_messageInfo_Message.Marshal(b, m, deterministic) 49 } 50 func (m *Message) XXX_Merge(src proto.Message) { 51 xxx_messageInfo_Message.Merge(m, src) 52 } 53 func (m *Message) XXX_Size() int { 54 return xxx_messageInfo_Message.Size(m) 55 } 56 func (m *Message) XXX_DiscardUnknown() { 57 xxx_messageInfo_Message.DiscardUnknown(m) 58 } 59 60 var xxx_messageInfo_Message proto.InternalMessageInfo 61 62 func (m *Message) GetText() string { 63 if m != nil { 64 return m.Text 65 } 66 return "" 67 } 68 69 func init() { 70 proto.RegisterType((*Message)(nil), "Message") 71 } 72 73 func init() { proto.RegisterFile("sampleapp.proto", fileDescriptor_38ae74b4e52ac4e0) } 74 75 var fileDescriptor_38ae74b4e52ac4e0 = []byte{ 76 // 153 bytes of a gzipped FileDescriptorProto 77 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2f, 0x4e, 0xcc, 0x2d, 78 0xc8, 0x49, 0x4d, 0x2c, 0x28, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x92, 0xe5, 0x62, 0xf7, 79 0x4d, 0x2d, 0x2e, 0x4e, 0x4c, 0x4f, 0x15, 0x12, 0xe2, 0x62, 0x29, 0x49, 0xad, 0x28, 0x91, 0x60, 80 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x8d, 0xb6, 0x33, 0x72, 0x09, 0x06, 0x83, 0xb5, 0x38, 81 0x16, 0x14, 0xe4, 0x64, 0x26, 0x27, 0x96, 0x64, 0xe6, 0xe7, 0x09, 0xa9, 0x70, 0xf1, 0xb8, 0xe4, 82 0x87, 0xe6, 0x25, 0x16, 0x55, 0x82, 0x09, 0x21, 0x0e, 0x3d, 0xa8, 0x19, 0x52, 0x70, 0x96, 0x12, 83 0x83, 0x90, 0x3a, 0x17, 0x2f, 0x54, 0x55, 0x70, 0x49, 0x51, 0x6a, 0x62, 0x2e, 0x76, 0x65, 0x06, 84 0x8c, 0x10, 0x85, 0x10, 0x35, 0x78, 0xcc, 0xd3, 0x60, 0x14, 0xd2, 0xe2, 0xe2, 0x83, 0x29, 0xc4, 85 0x67, 0xa4, 0x06, 0xa3, 0x01, 0x63, 0x12, 0x1b, 0xd8, 0x7f, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 86 0xff, 0xe8, 0x8b, 0x56, 0x80, 0xf2, 0x00, 0x00, 0x00, 87 } 88 89 // Reference imports to suppress errors if they are not otherwise used. 90 var _ context.Context 91 var _ grpc.ClientConn 92 93 // This is a compile-time assertion to ensure that this generated file 94 // is compatible with the grpc package it is being compiled against. 95 const _ = grpc.SupportPackageIsVersion4 96 97 // SampleApplicationClient is the client API for SampleApplication service. 98 // 99 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 100 type SampleApplicationClient interface { 101 DoUnaryUnary(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) 102 DoUnaryStream(ctx context.Context, in *Message, opts ...grpc.CallOption) (SampleApplication_DoUnaryStreamClient, error) 103 DoStreamUnary(ctx context.Context, opts ...grpc.CallOption) (SampleApplication_DoStreamUnaryClient, error) 104 DoStreamStream(ctx context.Context, opts ...grpc.CallOption) (SampleApplication_DoStreamStreamClient, error) 105 } 106 107 type sampleApplicationClient struct { 108 cc *grpc.ClientConn 109 } 110 111 func NewSampleApplicationClient(cc *grpc.ClientConn) SampleApplicationClient { 112 return &sampleApplicationClient{cc} 113 } 114 115 func (c *sampleApplicationClient) DoUnaryUnary(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) { 116 out := new(Message) 117 err := c.cc.Invoke(ctx, "/SampleApplication/DoUnaryUnary", in, out, opts...) 118 if err != nil { 119 return nil, err 120 } 121 return out, nil 122 } 123 124 func (c *sampleApplicationClient) DoUnaryStream(ctx context.Context, in *Message, opts ...grpc.CallOption) (SampleApplication_DoUnaryStreamClient, error) { 125 stream, err := c.cc.NewStream(ctx, &_SampleApplication_serviceDesc.Streams[0], "/SampleApplication/DoUnaryStream", opts...) 126 if err != nil { 127 return nil, err 128 } 129 x := &sampleApplicationDoUnaryStreamClient{stream} 130 if err := x.ClientStream.SendMsg(in); err != nil { 131 return nil, err 132 } 133 if err := x.ClientStream.CloseSend(); err != nil { 134 return nil, err 135 } 136 return x, nil 137 } 138 139 type SampleApplication_DoUnaryStreamClient interface { 140 Recv() (*Message, error) 141 grpc.ClientStream 142 } 143 144 type sampleApplicationDoUnaryStreamClient struct { 145 grpc.ClientStream 146 } 147 148 func (x *sampleApplicationDoUnaryStreamClient) Recv() (*Message, error) { 149 m := new(Message) 150 if err := x.ClientStream.RecvMsg(m); err != nil { 151 return nil, err 152 } 153 return m, nil 154 } 155 156 func (c *sampleApplicationClient) DoStreamUnary(ctx context.Context, opts ...grpc.CallOption) (SampleApplication_DoStreamUnaryClient, error) { 157 stream, err := c.cc.NewStream(ctx, &_SampleApplication_serviceDesc.Streams[1], "/SampleApplication/DoStreamUnary", opts...) 158 if err != nil { 159 return nil, err 160 } 161 x := &sampleApplicationDoStreamUnaryClient{stream} 162 return x, nil 163 } 164 165 type SampleApplication_DoStreamUnaryClient interface { 166 Send(*Message) error 167 CloseAndRecv() (*Message, error) 168 grpc.ClientStream 169 } 170 171 type sampleApplicationDoStreamUnaryClient struct { 172 grpc.ClientStream 173 } 174 175 func (x *sampleApplicationDoStreamUnaryClient) Send(m *Message) error { 176 return x.ClientStream.SendMsg(m) 177 } 178 179 func (x *sampleApplicationDoStreamUnaryClient) CloseAndRecv() (*Message, error) { 180 if err := x.ClientStream.CloseSend(); err != nil { 181 return nil, err 182 } 183 m := new(Message) 184 if err := x.ClientStream.RecvMsg(m); err != nil { 185 return nil, err 186 } 187 return m, nil 188 } 189 190 func (c *sampleApplicationClient) DoStreamStream(ctx context.Context, opts ...grpc.CallOption) (SampleApplication_DoStreamStreamClient, error) { 191 stream, err := c.cc.NewStream(ctx, &_SampleApplication_serviceDesc.Streams[2], "/SampleApplication/DoStreamStream", opts...) 192 if err != nil { 193 return nil, err 194 } 195 x := &sampleApplicationDoStreamStreamClient{stream} 196 return x, nil 197 } 198 199 type SampleApplication_DoStreamStreamClient interface { 200 Send(*Message) error 201 Recv() (*Message, error) 202 grpc.ClientStream 203 } 204 205 type sampleApplicationDoStreamStreamClient struct { 206 grpc.ClientStream 207 } 208 209 func (x *sampleApplicationDoStreamStreamClient) Send(m *Message) error { 210 return x.ClientStream.SendMsg(m) 211 } 212 213 func (x *sampleApplicationDoStreamStreamClient) Recv() (*Message, error) { 214 m := new(Message) 215 if err := x.ClientStream.RecvMsg(m); err != nil { 216 return nil, err 217 } 218 return m, nil 219 } 220 221 // SampleApplicationServer is the server API for SampleApplication service. 222 type SampleApplicationServer interface { 223 DoUnaryUnary(context.Context, *Message) (*Message, error) 224 DoUnaryStream(*Message, SampleApplication_DoUnaryStreamServer) error 225 DoStreamUnary(SampleApplication_DoStreamUnaryServer) error 226 DoStreamStream(SampleApplication_DoStreamStreamServer) error 227 } 228 229 // UnimplementedSampleApplicationServer can be embedded to have forward compatible implementations. 230 type UnimplementedSampleApplicationServer struct { 231 } 232 233 func (*UnimplementedSampleApplicationServer) DoUnaryUnary(ctx context.Context, req *Message) (*Message, error) { 234 return nil, status.Errorf(codes.Unimplemented, "method DoUnaryUnary not implemented") 235 } 236 func (*UnimplementedSampleApplicationServer) DoUnaryStream(req *Message, srv SampleApplication_DoUnaryStreamServer) error { 237 return status.Errorf(codes.Unimplemented, "method DoUnaryStream not implemented") 238 } 239 func (*UnimplementedSampleApplicationServer) DoStreamUnary(srv SampleApplication_DoStreamUnaryServer) error { 240 return status.Errorf(codes.Unimplemented, "method DoStreamUnary not implemented") 241 } 242 func (*UnimplementedSampleApplicationServer) DoStreamStream(srv SampleApplication_DoStreamStreamServer) error { 243 return status.Errorf(codes.Unimplemented, "method DoStreamStream not implemented") 244 } 245 246 func RegisterSampleApplicationServer(s *grpc.Server, srv SampleApplicationServer) { 247 s.RegisterService(&_SampleApplication_serviceDesc, srv) 248 } 249 250 func _SampleApplication_DoUnaryUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 251 in := new(Message) 252 if err := dec(in); err != nil { 253 return nil, err 254 } 255 if interceptor == nil { 256 return srv.(SampleApplicationServer).DoUnaryUnary(ctx, in) 257 } 258 info := &grpc.UnaryServerInfo{ 259 Server: srv, 260 FullMethod: "/SampleApplication/DoUnaryUnary", 261 } 262 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 263 return srv.(SampleApplicationServer).DoUnaryUnary(ctx, req.(*Message)) 264 } 265 return interceptor(ctx, in, info, handler) 266 } 267 268 func _SampleApplication_DoUnaryStream_Handler(srv interface{}, stream grpc.ServerStream) error { 269 m := new(Message) 270 if err := stream.RecvMsg(m); err != nil { 271 return err 272 } 273 return srv.(SampleApplicationServer).DoUnaryStream(m, &sampleApplicationDoUnaryStreamServer{stream}) 274 } 275 276 type SampleApplication_DoUnaryStreamServer interface { 277 Send(*Message) error 278 grpc.ServerStream 279 } 280 281 type sampleApplicationDoUnaryStreamServer struct { 282 grpc.ServerStream 283 } 284 285 func (x *sampleApplicationDoUnaryStreamServer) Send(m *Message) error { 286 return x.ServerStream.SendMsg(m) 287 } 288 289 func _SampleApplication_DoStreamUnary_Handler(srv interface{}, stream grpc.ServerStream) error { 290 return srv.(SampleApplicationServer).DoStreamUnary(&sampleApplicationDoStreamUnaryServer{stream}) 291 } 292 293 type SampleApplication_DoStreamUnaryServer interface { 294 SendAndClose(*Message) error 295 Recv() (*Message, error) 296 grpc.ServerStream 297 } 298 299 type sampleApplicationDoStreamUnaryServer struct { 300 grpc.ServerStream 301 } 302 303 func (x *sampleApplicationDoStreamUnaryServer) SendAndClose(m *Message) error { 304 return x.ServerStream.SendMsg(m) 305 } 306 307 func (x *sampleApplicationDoStreamUnaryServer) Recv() (*Message, error) { 308 m := new(Message) 309 if err := x.ServerStream.RecvMsg(m); err != nil { 310 return nil, err 311 } 312 return m, nil 313 } 314 315 func _SampleApplication_DoStreamStream_Handler(srv interface{}, stream grpc.ServerStream) error { 316 return srv.(SampleApplicationServer).DoStreamStream(&sampleApplicationDoStreamStreamServer{stream}) 317 } 318 319 type SampleApplication_DoStreamStreamServer interface { 320 Send(*Message) error 321 Recv() (*Message, error) 322 grpc.ServerStream 323 } 324 325 type sampleApplicationDoStreamStreamServer struct { 326 grpc.ServerStream 327 } 328 329 func (x *sampleApplicationDoStreamStreamServer) Send(m *Message) error { 330 return x.ServerStream.SendMsg(m) 331 } 332 333 func (x *sampleApplicationDoStreamStreamServer) Recv() (*Message, error) { 334 m := new(Message) 335 if err := x.ServerStream.RecvMsg(m); err != nil { 336 return nil, err 337 } 338 return m, nil 339 } 340 341 var _SampleApplication_serviceDesc = grpc.ServiceDesc{ 342 ServiceName: "SampleApplication", 343 HandlerType: (*SampleApplicationServer)(nil), 344 Methods: []grpc.MethodDesc{ 345 { 346 MethodName: "DoUnaryUnary", 347 Handler: _SampleApplication_DoUnaryUnary_Handler, 348 }, 349 }, 350 Streams: []grpc.StreamDesc{ 351 { 352 StreamName: "DoUnaryStream", 353 Handler: _SampleApplication_DoUnaryStream_Handler, 354 ServerStreams: true, 355 }, 356 { 357 StreamName: "DoStreamUnary", 358 Handler: _SampleApplication_DoStreamUnary_Handler, 359 ClientStreams: true, 360 }, 361 { 362 StreamName: "DoStreamStream", 363 Handler: _SampleApplication_DoStreamStream_Handler, 364 ServerStreams: true, 365 ClientStreams: true, 366 }, 367 }, 368 Metadata: "sampleapp.proto", 369 }