forwardtest

package
v6.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SendMetricHandler

type SendMetricHandler func([]*metricpb.Metric)

SendMetricHandler is a handler that is called when a Server gets a SendMetrics RPC

type Server

type Server struct {
	*grpc.Server
	// contains filtered or unexported fields
}

Server is a gRPC server similar to httptest.Server

func NewServer

func NewServer(handler SendMetricHandler) *Server

NewServer creates an unstarted Server with the specified handler

func (*Server) Addr

func (s *Server) Addr() net.Addr

Addr returns the address the server is listening on.

func (*Server) SendMetrics

func (s *Server) SendMetrics(ctx context.Context, mlist *forwardrpc.MetricList) (*empty.Empty, error)

SendMetrics calls the input SendMetricsHandler whenever it receives an RPC

func (*Server) Start

func (s *Server) Start(t testing.TB)

Start starts the gRPC server listening on the loopback interface on a random port. The address it is listening on can be retrieved from (*Server).Addr()

Jump to

Keyboard shortcuts

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