Documentation ¶
Overview ¶
Package fakegrpc provides a fake gRPC client/server for testing purpose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamLoggerInterceptor ¶ added in v0.8.8
func StreamLoggerInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamLoggerInterceptor intercepts streams to the server and logs the messages.
func UnaryLoggerInterceptor ¶ added in v0.8.8
func UnaryLoggerInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryLoggerInterceptor intercepts calls to the server and logs the request and response.
Types ¶
type Fake ¶
Fake contains the server and client for a GRPC connection.
type LoggerStream ¶ added in v0.8.8
type LoggerStream struct {
grpc.ServerStream
}
LoggerStream wraps around the embedded grpc.ServerStream, and intercepts the RecvMsg and SendMsg method call and logs them.
func (*LoggerStream) RecvMsg ¶ added in v0.8.8
func (w *LoggerStream) RecvMsg(m interface{}) error
RecvMsg recieves a message.
func (*LoggerStream) SendMsg ¶ added in v0.8.8
func (w *LoggerStream) SendMsg(m interface{}) error
SendMsg sends a message.
Click to show internal directories.
Click to hide internal directories.