testapp

package
v3.12.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 3, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

README

Testing gRPC Application

This directory contains a testing application for validating the New Relic gRPC integration. The code in testapp.pb.go is generated using the following command (to be run from the _integrations/nrgrpc directory). This command should be rerun every time the testapp.proto file has changed for any reason.

$ protoc -I testapp/ testapp/testapp.proto --go_out=plugins=grpc:testapp

To install required dependencies:

go get -u google.golang.org/grpc
go get -u github.com/golang/protobuf/protoc-gen-go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterTestApplicationServer

func RegisterTestApplicationServer(s *grpc.Server, srv TestApplicationServer)

Types

type Message

type Message struct {
	Text                 string   `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetText

func (m *Message) GetText() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

func (*Message) XXX_DiscardUnknown

func (m *Message) XXX_DiscardUnknown()

func (*Message) XXX_Marshal

func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Message) XXX_Merge

func (m *Message) XXX_Merge(src proto.Message)

func (*Message) XXX_Size

func (m *Message) XXX_Size() int

func (*Message) XXX_Unmarshal

func (m *Message) XXX_Unmarshal(b []byte) error

type Server

type Server struct{}

Server is a gRPC server.

func (*Server) DoStreamStream

func (s *Server) DoStreamStream(stream TestApplication_DoStreamStreamServer) error

DoStreamStream is a stream request, stream response method.

func (*Server) DoStreamUnary

func (s *Server) DoStreamUnary(stream TestApplication_DoStreamUnaryServer) error

DoStreamUnary is a stream request, unary response method.

func (*Server) DoUnaryStream

func (s *Server) DoUnaryStream(msg *Message, stream TestApplication_DoUnaryStreamServer) error

DoUnaryStream is a unary request, stream response method.

func (*Server) DoUnaryStreamError

func (s *Server) DoUnaryStreamError(msg *Message, stream TestApplication_DoUnaryStreamErrorServer) error

DoUnaryStreamError is a unary request, unary response method that returns an error.

func (*Server) DoUnaryUnary

func (s *Server) DoUnaryUnary(ctx context.Context, msg *Message) (*Message, error)

DoUnaryUnary is a unary request, unary response method.

func (*Server) DoUnaryUnaryError

func (s *Server) DoUnaryUnaryError(ctx context.Context, msg *Message) (*Message, error)

DoUnaryUnaryError is a unary request, unary response method that returns an error.

type TestApplicationClient

type TestApplicationClient interface {
	DoUnaryUnary(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
	DoUnaryStream(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamClient, error)
	DoStreamUnary(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamUnaryClient, error)
	DoStreamStream(ctx context.Context, opts ...grpc.CallOption) (TestApplication_DoStreamStreamClient, error)
	DoUnaryUnaryError(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error)
	DoUnaryStreamError(ctx context.Context, in *Message, opts ...grpc.CallOption) (TestApplication_DoUnaryStreamErrorClient, error)
}

TestApplicationClient is the client API for TestApplication service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewTestApplicationClient

func NewTestApplicationClient(cc *grpc.ClientConn) TestApplicationClient

type TestApplicationServer

type TestApplicationServer interface {
	DoUnaryUnary(context.Context, *Message) (*Message, error)
	DoUnaryStream(*Message, TestApplication_DoUnaryStreamServer) error
	DoStreamUnary(TestApplication_DoStreamUnaryServer) error
	DoStreamStream(TestApplication_DoStreamStreamServer) error
	DoUnaryUnaryError(context.Context, *Message) (*Message, error)
	DoUnaryStreamError(*Message, TestApplication_DoUnaryStreamErrorServer) error
}

TestApplicationServer is the server API for TestApplication service.

type TestApplication_DoStreamStreamClient

type TestApplication_DoStreamStreamClient interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ClientStream
}

type TestApplication_DoStreamStreamServer

type TestApplication_DoStreamStreamServer interface {
	Send(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type TestApplication_DoStreamUnaryClient

type TestApplication_DoStreamUnaryClient interface {
	Send(*Message) error
	CloseAndRecv() (*Message, error)
	grpc.ClientStream
}

type TestApplication_DoStreamUnaryServer

type TestApplication_DoStreamUnaryServer interface {
	SendAndClose(*Message) error
	Recv() (*Message, error)
	grpc.ServerStream
}

type TestApplication_DoUnaryStreamClient

type TestApplication_DoUnaryStreamClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type TestApplication_DoUnaryStreamErrorClient

type TestApplication_DoUnaryStreamErrorClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type TestApplication_DoUnaryStreamErrorServer

type TestApplication_DoUnaryStreamErrorServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type TestApplication_DoUnaryStreamServer

type TestApplication_DoUnaryStreamServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type UnimplementedTestApplicationServer

type UnimplementedTestApplicationServer struct {
}

UnimplementedTestApplicationServer can be embedded to have forward compatible implementations.

func (*UnimplementedTestApplicationServer) DoStreamStream

func (*UnimplementedTestApplicationServer) DoStreamUnary

func (*UnimplementedTestApplicationServer) DoUnaryStream

func (*UnimplementedTestApplicationServer) DoUnaryStreamError

func (*UnimplementedTestApplicationServer) DoUnaryUnary

func (*UnimplementedTestApplicationServer) DoUnaryUnaryError

func (*UnimplementedTestApplicationServer) DoUnaryUnaryError(ctx context.Context, req *Message) (*Message, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL