Documentation ¶
Overview ¶
Package testing is a generated protocol buffer package.
It is generated from these files:
test.proto
It has these top-level messages:
EchoRequest EchoResponse
Index ¶
- func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
- type EchoRequest
- type EchoResponse
- type FakeNRApp
- type FakeNRTxn
- func (t *FakeNRTxn) AddAttribute(k string, v interface{}) error
- func (t *FakeNRTxn) CheckEnded()
- func (t *FakeNRTxn) CheckErrorCount(c int)
- func (t *FakeNRTxn) CheckIgnored(ignored bool)
- func (t *FakeNRTxn) CheckStatusCode(c codes.Code)
- func (t *FakeNRTxn) End() error
- func (t *FakeNRTxn) Ignore() error
- func (t *FakeNRTxn) NoticeError(err error) error
- func (t *FakeNRTxn) SetName(name string) error
- func (t *FakeNRTxn) SetWebRequest(req newrelic.WebRequest) error
- func (t *FakeNRTxn) StartSegmentNow() newrelic.SegmentStartTime
- type TestContext
- type TestServiceClient
- type TestServiceServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterTestServiceServer ¶
func RegisterTestServiceServer(s *grpc.Server, srv TestServiceServer)
Types ¶
type EchoRequest ¶
type EchoRequest struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoRequest) Descriptor ¶
func (*EchoRequest) Descriptor() ([]byte, []int)
func (*EchoRequest) GetMessage ¶
func (m *EchoRequest) GetMessage() string
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) Reset ¶
func (m *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (m *EchoRequest) String() string
type EchoResponse ¶
type EchoResponse struct {
Message string `protobuf:"bytes,1,opt,name=message" json:"message,omitempty"`
}
func (*EchoResponse) Descriptor ¶
func (*EchoResponse) Descriptor() ([]byte, []int)
func (*EchoResponse) GetMessage ¶
func (m *EchoResponse) GetMessage() string
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
type FakeNRApp ¶
type FakeNRApp struct { newrelic.Application Txns []*FakeNRTxn // contains filtered or unexported fields }
FakeNRApp is an impplementation of newrelic.Application for tests.
func NewFakeNRApp ¶
NewFakeNRApp returns a new fake newrelic.Application instnace.
func (*FakeNRApp) CheckTxnCount ¶
CheckTxnCount fails the test if created transaction count is invalid.
func (*FakeNRApp) StartTransaction ¶
func (a *FakeNRApp) StartTransaction(name string, _ http.ResponseWriter, _ *http.Request) newrelic.Transaction
StartTransaction implements the newrelic.Application interface.
type FakeNRTxn ¶
type FakeNRTxn struct { newrelic.Transaction Name string Errs []error Ended bool Ignored bool Attrs map[string]interface{} // contains filtered or unexported fields }
FakeNRTxn is an implementation of newrelic.Transaction for tests.
func NewFakeNRTxn ¶
NewFakeNRTxn returns a new fake newrelic.Transaction instnace.
func (*FakeNRTxn) AddAttribute ¶
AddAttribute implements the newrelic.Transaction interface.
func (*FakeNRTxn) CheckEnded ¶
func (t *FakeNRTxn) CheckEnded()
CheckEnded fails the test if the transaction has been ended.
func (*FakeNRTxn) CheckErrorCount ¶
CheckErrorCount fails the test if the transaction's error count is invalid.
func (*FakeNRTxn) CheckIgnored ¶
CheckIgnored fails the test if the transaction's ignored status is invaild.
func (*FakeNRTxn) CheckStatusCode ¶
CheckStatusCode fails the test if the transaction does not has a valid status code.
func (*FakeNRTxn) NoticeError ¶
NoticeError implements the newrelic.Transaction interface.
func (*FakeNRTxn) SetWebRequest ¶
func (t *FakeNRTxn) SetWebRequest(req newrelic.WebRequest) error
SetWebRequest implements the newrelic.Transaction interface.
func (*FakeNRTxn) StartSegmentNow ¶
func (t *FakeNRTxn) StartSegmentNow() newrelic.SegmentStartTime
StartSegmentNow implements the newrelic.Transaction interface.
type TestContext ¶
type TestContext struct { ServerOpts []grpc.ServerOption ClientOpts []grpc.DialOption Service TestServiceServer Client TestServiceClient // contains filtered or unexported fields }
TestContext is a testing helper for generating a gRPC server and a gRPC client.
func CreateTestContext ¶
func CreateTestContext(t *testing.T) *TestContext
CreateTestContext returns a new TestContext object.
func (*TestContext) SetClientStatsHandler ¶
func (c *TestContext) SetClientStatsHandler(h stats.Handler)
SetClientStatsHandler sets stats.Handler to a test client.
func (*TestContext) SetServerStatsHandler ¶
func (c *TestContext) SetServerStatsHandler(h stats.Handler)
SetServerStatsHandler sets stats.Handler to a test server.
func (*TestContext) Setup ¶
func (c *TestContext) Setup()
Setup starts a server and creates a client connection.
func (*TestContext) Teardown ¶
func (c *TestContext) Teardown()
Teardown disconnects a client connection and stops a server
type TestServiceClient ¶
type TestServiceClient interface { Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) Empty(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*google_protobuf.Empty, error) Error(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*google_protobuf.Empty, error) }
func NewTestServiceClient ¶
func NewTestServiceClient(cc *grpc.ClientConn) TestServiceClient
type TestServiceServer ¶
type TestServiceServer interface { Echo(context.Context, *EchoRequest) (*EchoResponse, error) Empty(context.Context, *google_protobuf.Empty) (*google_protobuf.Empty, error) Error(context.Context, *google_protobuf.Empty) (*google_protobuf.Empty, error) }