Documentation ¶
Index ¶
- type CloudMock
- func (mock *CloudMock) ClientConn() *grpc.ClientConn
- func (mock *CloudMock) GetNumSpans() int
- func (mock *CloudMock) GetSpan(index int) *cloudtrace.Span
- func (mock *CloudMock) SetDelay(delay time.Duration)
- func (mock *CloudMock) SetOnUpload(onUpload func(ctx context.Context, spans []*cloudtrace.Span))
- func (mock *CloudMock) Shutdown()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudMock ¶
type CloudMock struct { TraceServiceClient cloudtrace.TraceServiceClient MetricServiceClient monitoring.MetricServiceClient // contains filtered or unexported fields }
CloudMock is the struct we will expose to users to use in their tests. It contains the gRPC clients for users to call, as well as the connection info to allow a graceful shutdown after the tests run.
func NewCloudMock ¶
func NewCloudMock() *CloudMock
NewCloudMock is the constructor for the CloudMock struct, it will return a pointer to a new CloudMock.
func (*CloudMock) ClientConn ¶
func (mock *CloudMock) ClientConn() *grpc.ClientConn
ClientConn is a getter to retrieve the client connection. This is used to provide the exporters with the address of our mock server.
func (*CloudMock) GetNumSpans ¶
GetNumSpans returns the number of spans currently stored on the server.
func (*CloudMock) SetDelay ¶
SetDelay allows users to set the amount of time to delay before writing spans to memory.
func (*CloudMock) SetOnUpload ¶
SetOnUpload allows users to set the onUpload function on the mock server, which is called before BatchWriteSpans runs.