Documentation ¶
Overview ¶
Package grpctest is a utility for testing gRPC and Gateway services.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct { // RegisterServicesFunc will be called when the server is created to register services. Every new session calls this // function. RegisterServicesFunc RegisterFunc // contains filtered or unexported fields }
Manager is a manager that controls a test gRPC server and the gateway that runs services.
NOTE: This manager works with a *testing.T object to log failurs and mark tests as failed. This field is optional and when it is not available, panics are used instead. This is not a very idiomatic behavior however it simplifies the tests and these panics are indeed unexpected behavior that require author's attention as soon as possible.
func NewManager ¶
func NewManager(t *testing.T, name string, registerFunc RegisterFunc) *Manager
NewManager creates a new manager instance without starting it.
func (*Manager) ClientConnection ¶
func (m *Manager) ClientConnection() *grpc.ClientConn
ClientConnection creates a gRPC client connection for the current server.