github.com/newrelic/go-agent@v3.26.0+incompatible/_integrations/nrgrpc/testapp/testapp.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: testapp.proto
     6  
     7  package testapp
     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_98d4e818d9f182b1, []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("testapp.proto", fileDescriptor_98d4e818d9f182b1) }
    74  
    75  var fileDescriptor_98d4e818d9f182b1 = []byte{
    76  	// 175 bytes of a gzipped FileDescriptorProto
    77  	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2d, 0x49, 0x2d, 0x2e,
    78  	0x49, 0x2c, 0x28, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x57, 0x92, 0xe5, 0x62, 0xf7, 0x4d, 0x2d,
    79  	0x2e, 0x4e, 0x4c, 0x4f, 0x15, 0x12, 0xe2, 0x62, 0x29, 0x49, 0xad, 0x28, 0x91, 0x60, 0x54, 0x60,
    80  	0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x8d, 0xfa, 0x98, 0xb8, 0xf8, 0x43, 0x52, 0x8b, 0x4b, 0x1c, 0x0b,
    81  	0x0a, 0x72, 0x32, 0x93, 0x13, 0x4b, 0x32, 0xf3, 0xf3, 0x84, 0x54, 0xb8, 0x78, 0x5c, 0xf2, 0x43,
    82  	0xf3, 0x12, 0x8b, 0x2a, 0xc1, 0x84, 0x10, 0x87, 0x1e, 0xd4, 0x04, 0x29, 0x38, 0x4b, 0x89, 0x41,
    83  	0x48, 0x9d, 0x8b, 0x17, 0xaa, 0x2a, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0x17, 0xbb, 0x32, 0x03, 0x46,
    84  	0x88, 0x42, 0x88, 0x1a, 0x3c, 0xe6, 0x69, 0x30, 0x0a, 0x69, 0x71, 0xf1, 0xc1, 0x14, 0xe2, 0x33,
    85  	0x52, 0x83, 0xd1, 0x80, 0x51, 0x48, 0x93, 0x4b, 0x10, 0xd9, 0x8d, 0xae, 0x45, 0x45, 0xf9, 0x45,
    86  	0x38, 0x1c, 0xaa, 0xc3, 0x25, 0x84, 0xe2, 0x50, 0x3c, 0x6a, 0x0d, 0x18, 0x93, 0xd8, 0xc0, 0xc1,
    87  	0x66, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb8, 0xca, 0x5d, 0x32, 0x47, 0x01, 0x00, 0x00,
    88  }
    89  
    90  // Reference imports to suppress errors if they are not otherwise used.
    91  var _ context.Context
    92  var _ grpc.ClientConn
    93  
    94  // This is a compile-time assertion to ensure that this generated file
    95  // is compatible with the grpc package it is being compiled against.
    96  const _ = grpc.SupportPackageIsVersion4
    97  
    98  // TestApplicationClient is the client API for TestApplication service.
    99  //
   100  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
   101  type TestApplicationClient interface {
   102  	DoUnaryUnary(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
   103  	DoUnaryStream(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamClient, error)
   104  	DoStreamUnary(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamUnaryClient, error)
   105  	DoStreamStream(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamStreamClient, error)
   106  	DoUnaryUnaryError(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
   107  	DoUnaryStreamError(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamErrorClient, error)
   108  }
   109  
   110  type testApplicationClient struct {
   111  	cc *grpc.ClientConn
   112  }
   113  
   114  func NewTestApplicationClient(cc *grpc.ClientConn) TestApplicationClient {
   115  	return &testApplicationClient{cc}
   116  }
   117  
   118  func (c *testApplicationClient) DoUnaryUnary(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
   119  	out := new(Message)
   120  	err := c.cc.Invoke(ctx, "/TestApplication/DoUnaryUnary", in, out, opts...)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return out, nil
   125  }
   126  
   127  func (c *testApplicationClient) DoUnaryStream(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamClient, error) {
   128  	stream, err := c.cc.NewStream(ctx, &_TestApplication_serviceDesc.Streams[0], "/TestApplication/DoUnaryStream", opts...)
   129  	if err != nil {
   130  		return nil, err
   131  	}
   132  	x := &testApplicationDoUnaryStreamClient{stream}
   133  	if err := x.ClientStream.SendMsg(in); err != nil {
   134  		return nil, err
   135  	}
   136  	if err := x.ClientStream.CloseSend(); err != nil {
   137  		return nil, err
   138  	}
   139  	return x, nil
   140  }
   141  
   142  type TestApplication_DoUnaryStreamClient interface {
   143  	Recv() (*Message, error)
   144  	grpc.ClientStream
   145  }
   146  
   147  type testApplicationDoUnaryStreamClient struct {
   148  	grpc.ClientStream
   149  }
   150  
   151  func (x *testApplicationDoUnaryStreamClient) Recv() (*Message, error) {
   152  	m := new(Message)
   153  	if err := x.ClientStream.RecvMsg(m); err != nil {
   154  		return nil, err
   155  	}
   156  	return m, nil
   157  }
   158  
   159  func (c *testApplicationClient) DoStreamUnary(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamUnaryClient, error) {
   160  	stream, err := c.cc.NewStream(ctx, &_TestApplication_serviceDesc.Streams[1], "/TestApplication/DoStreamUnary", opts...)
   161  	if err != nil {
   162  		return nil, err
   163  	}
   164  	x := &testApplicationDoStreamUnaryClient{stream}
   165  	return x, nil
   166  }
   167  
   168  type TestApplication_DoStreamUnaryClient interface {
   169  	Send(*Message) error
   170  	CloseAndRecv() (*Message, error)
   171  	grpc.ClientStream
   172  }
   173  
   174  type testApplicationDoStreamUnaryClient struct {
   175  	grpc.ClientStream
   176  }
   177  
   178  func (x *testApplicationDoStreamUnaryClient) Send(m *Message) error {
   179  	return x.ClientStream.SendMsg(m)
   180  }
   181  
   182  func (x *testApplicationDoStreamUnaryClient) CloseAndRecv() (*Message, error) {
   183  	if err := x.ClientStream.CloseSend(); err != nil {
   184  		return nil, err
   185  	}
   186  	m := new(Message)
   187  	if err := x.ClientStream.RecvMsg(m); err != nil {
   188  		return nil, err
   189  	}
   190  	return m, nil
   191  }
   192  
   193  func (c *testApplicationClient) DoStreamStream(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamStreamClient, error) {
   194  	stream, err := c.cc.NewStream(ctx, &_TestApplication_serviceDesc.Streams[2], "/TestApplication/DoStreamStream", opts...)
   195  	if err != nil {
   196  		return nil, err
   197  	}
   198  	x := &testApplicationDoStreamStreamClient{stream}
   199  	return x, nil
   200  }
   201  
   202  type TestApplication_DoStreamStreamClient interface {
   203  	Send(*Message) error
   204  	Recv() (*Message, error)
   205  	grpc.ClientStream
   206  }
   207  
   208  type testApplicationDoStreamStreamClient struct {
   209  	grpc.ClientStream
   210  }
   211  
   212  func (x *testApplicationDoStreamStreamClient) Send(m *Message) error {
   213  	return x.ClientStream.SendMsg(m)
   214  }
   215  
   216  func (x *testApplicationDoStreamStreamClient) Recv() (*Message, error) {
   217  	m := new(Message)
   218  	if err := x.ClientStream.RecvMsg(m); err != nil {
   219  		return nil, err
   220  	}
   221  	return m, nil
   222  }
   223  
   224  func (c *testApplicationClient) DoUnaryUnaryError(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) {
   225  	out := new(Message)
   226  	err := c.cc.Invoke(ctx, "/TestApplication/DoUnaryUnaryError", in, out, opts...)
   227  	if err != nil {
   228  		return nil, err
   229  	}
   230  	return out, nil
   231  }
   232  
   233  func (c *testApplicationClient) DoUnaryStreamError(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamErrorClient, error) {
   234  	stream, err := c.cc.NewStream(ctx, &_TestApplication_serviceDesc.Streams[3], "/TestApplication/DoUnaryStreamError", opts...)
   235  	if err != nil {
   236  		return nil, err
   237  	}
   238  	x := &testApplicationDoUnaryStreamErrorClient{stream}
   239  	if err := x.ClientStream.SendMsg(in); err != nil {
   240  		return nil, err
   241  	}
   242  	if err := x.ClientStream.CloseSend(); err != nil {
   243  		return nil, err
   244  	}
   245  	return x, nil
   246  }
   247  
   248  type TestApplication_DoUnaryStreamErrorClient interface {
   249  	Recv() (*Message, error)
   250  	grpc.ClientStream
   251  }
   252  
   253  type testApplicationDoUnaryStreamErrorClient struct {
   254  	grpc.ClientStream
   255  }
   256  
   257  func (x *testApplicationDoUnaryStreamErrorClient) Recv() (*Message, error) {
   258  	m := new(Message)
   259  	if err := x.ClientStream.RecvMsg(m); err != nil {
   260  		return nil, err
   261  	}
   262  	return m, nil
   263  }
   264  
   265  // TestApplicationServer is the server API for TestApplication service.
   266  type TestApplicationServer interface {
   267  	DoUnaryUnary(context.Context, *Message) (*Message, error)
   268  	DoUnaryStream(*Message, TestApplication_DoUnaryStreamServer) error
   269  	DoStreamUnary(TestApplication_DoStreamUnaryServer) error
   270  	DoStreamStream(TestApplication_DoStreamStreamServer) error
   271  	DoUnaryUnaryError(context.Context, *Message) (*Message, error)
   272  	DoUnaryStreamError(*Message, TestApplication_DoUnaryStreamErrorServer) error
   273  }
   274  
   275  // UnimplementedTestApplicationServer can be embedded to have forward compatible implementations.
   276  type UnimplementedTestApplicationServer struct {
   277  }
   278  
   279  func (*UnimplementedTestApplicationServer) DoUnaryUnary(ctx context.Context, req *Message) (*Message, error) {
   280  	return nil, status.Errorf(codes.Unimplemented, "method DoUnaryUnary not implemented")
   281  }
   282  func (*UnimplementedTestApplicationServer) DoUnaryStream(req *Message, srv TestApplication_DoUnaryStreamServer) error {
   283  	return status.Errorf(codes.Unimplemented, "method DoUnaryStream not implemented")
   284  }
   285  func (*UnimplementedTestApplicationServer) DoStreamUnary(srv TestApplication_DoStreamUnaryServer) error {
   286  	return status.Errorf(codes.Unimplemented, "method DoStreamUnary not implemented")
   287  }
   288  func (*UnimplementedTestApplicationServer) DoStreamStream(srv TestApplication_DoStreamStreamServer) error {
   289  	return status.Errorf(codes.Unimplemented, "method DoStreamStream not implemented")
   290  }
   291  func (*UnimplementedTestApplicationServer) DoUnaryUnaryError(ctx context.Context, req *Message) (*Message, error) {
   292  	return nil, status.Errorf(codes.Unimplemented, "method DoUnaryUnaryError not implemented")
   293  }
   294  func (*UnimplementedTestApplicationServer) DoUnaryStreamError(req *Message, srv TestApplication_DoUnaryStreamErrorServer) error {
   295  	return status.Errorf(codes.Unimplemented, "method DoUnaryStreamError not implemented")
   296  }
   297  
   298  func RegisterTestApplicationServer(s *grpc.Server, srv TestApplicationServer) {
   299  	s.RegisterService(&_TestApplication_serviceDesc, srv)
   300  }
   301  
   302  func _TestApplication_DoUnaryUnary_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   303  	in := new(Message)
   304  	if err := dec(in); err != nil {
   305  		return nil, err
   306  	}
   307  	if interceptor == nil {
   308  		return srv.(TestApplicationServer).DoUnaryUnary(ctx, in)
   309  	}
   310  	info := &grpc.UnaryServerInfo{
   311  		Server:     srv,
   312  		FullMethod: "/TestApplication/DoUnaryUnary",
   313  	}
   314  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   315  		return srv.(TestApplicationServer).DoUnaryUnary(ctx, req.(*Message))
   316  	}
   317  	return interceptor(ctx, in, info, handler)
   318  }
   319  
   320  func _TestApplication_DoUnaryStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   321  	m := new(Message)
   322  	if err := stream.RecvMsg(m); err != nil {
   323  		return err
   324  	}
   325  	return srv.(TestApplicationServer).DoUnaryStream(m, &testApplicationDoUnaryStreamServer{stream})
   326  }
   327  
   328  type TestApplication_DoUnaryStreamServer interface {
   329  	Send(*Message) error
   330  	grpc.ServerStream
   331  }
   332  
   333  type testApplicationDoUnaryStreamServer struct {
   334  	grpc.ServerStream
   335  }
   336  
   337  func (x *testApplicationDoUnaryStreamServer) Send(m *Message) error {
   338  	return x.ServerStream.SendMsg(m)
   339  }
   340  
   341  func _TestApplication_DoStreamUnary_Handler(srv interface{}, stream grpc.ServerStream) error {
   342  	return srv.(TestApplicationServer).DoStreamUnary(&testApplicationDoStreamUnaryServer{stream})
   343  }
   344  
   345  type TestApplication_DoStreamUnaryServer interface {
   346  	SendAndClose(*Message) error
   347  	Recv() (*Message, error)
   348  	grpc.ServerStream
   349  }
   350  
   351  type testApplicationDoStreamUnaryServer struct {
   352  	grpc.ServerStream
   353  }
   354  
   355  func (x *testApplicationDoStreamUnaryServer) SendAndClose(m *Message) error {
   356  	return x.ServerStream.SendMsg(m)
   357  }
   358  
   359  func (x *testApplicationDoStreamUnaryServer) Recv() (*Message, error) {
   360  	m := new(Message)
   361  	if err := x.ServerStream.RecvMsg(m); err != nil {
   362  		return nil, err
   363  	}
   364  	return m, nil
   365  }
   366  
   367  func _TestApplication_DoStreamStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   368  	return srv.(TestApplicationServer).DoStreamStream(&testApplicationDoStreamStreamServer{stream})
   369  }
   370  
   371  type TestApplication_DoStreamStreamServer interface {
   372  	Send(*Message) error
   373  	Recv() (*Message, error)
   374  	grpc.ServerStream
   375  }
   376  
   377  type testApplicationDoStreamStreamServer struct {
   378  	grpc.ServerStream
   379  }
   380  
   381  func (x *testApplicationDoStreamStreamServer) Send(m *Message) error {
   382  	return x.ServerStream.SendMsg(m)
   383  }
   384  
   385  func (x *testApplicationDoStreamStreamServer) Recv() (*Message, error) {
   386  	m := new(Message)
   387  	if err := x.ServerStream.RecvMsg(m); err != nil {
   388  		return nil, err
   389  	}
   390  	return m, nil
   391  }
   392  
   393  func _TestApplication_DoUnaryUnaryError_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   394  	in := new(Message)
   395  	if err := dec(in); err != nil {
   396  		return nil, err
   397  	}
   398  	if interceptor == nil {
   399  		return srv.(TestApplicationServer).DoUnaryUnaryError(ctx, in)
   400  	}
   401  	info := &grpc.UnaryServerInfo{
   402  		Server:     srv,
   403  		FullMethod: "/TestApplication/DoUnaryUnaryError",
   404  	}
   405  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   406  		return srv.(TestApplicationServer).DoUnaryUnaryError(ctx, req.(*Message))
   407  	}
   408  	return interceptor(ctx, in, info, handler)
   409  }
   410  
   411  func _TestApplication_DoUnaryStreamError_Handler(srv interface{}, stream grpc.ServerStream) error {
   412  	m := new(Message)
   413  	if err := stream.RecvMsg(m); err != nil {
   414  		return err
   415  	}
   416  	return srv.(TestApplicationServer).DoUnaryStreamError(m, &testApplicationDoUnaryStreamErrorServer{stream})
   417  }
   418  
   419  type TestApplication_DoUnaryStreamErrorServer interface {
   420  	Send(*Message) error
   421  	grpc.ServerStream
   422  }
   423  
   424  type testApplicationDoUnaryStreamErrorServer struct {
   425  	grpc.ServerStream
   426  }
   427  
   428  func (x *testApplicationDoUnaryStreamErrorServer) Send(m *Message) error {
   429  	return x.ServerStream.SendMsg(m)
   430  }
   431  
   432  var _TestApplication_serviceDesc = grpc.ServiceDesc{
   433  	ServiceName: "TestApplication",
   434  	HandlerType: (*TestApplicationServer)(nil),
   435  	Methods: []grpc.MethodDesc{
   436  		{
   437  			MethodName: "DoUnaryUnary",
   438  			Handler:    _TestApplication_DoUnaryUnary_Handler,
   439  		},
   440  		{
   441  			MethodName: "DoUnaryUnaryError",
   442  			Handler:    _TestApplication_DoUnaryUnaryError_Handler,
   443  		},
   444  	},
   445  	Streams: []grpc.StreamDesc{
   446  		{
   447  			StreamName:    "DoUnaryStream",
   448  			Handler:       _TestApplication_DoUnaryStream_Handler,
   449  			ServerStreams: true,
   450  		},
   451  		{
   452  			StreamName:    "DoStreamUnary",
   453  			Handler:       _TestApplication_DoStreamUnary_Handler,
   454  			ClientStreams: true,
   455  		},
   456  		{
   457  			StreamName:    "DoStreamStream",
   458  			Handler:       _TestApplication_DoStreamStream_Handler,
   459  			ServerStreams: true,
   460  			ClientStreams: true,
   461  		},
   462  		{
   463  			StreamName:    "DoUnaryStreamError",
   464  			Handler:       _TestApplication_DoUnaryStreamError_Handler,
   465  			ServerStreams: true,
   466  		},
   467  	},
   468  	Metadata: "testapp.proto",
   469  }