Documentation ¶
Index ¶
- func ClientVersionFromContext(ctx context.Context) (string, bool)
- func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- type DisableInterceptors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClientVersionFromContext ¶
ClientVersionFromContext can be called from a GRPC server method to return the client version that was added to the GRPC metadata by StreamClientInterceptor or UnaryClientInterceptor on the client.
func StreamClientInterceptor ¶
func StreamClientInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)
StreamClientInterceptor intercepts a GRPC client stream call and adds default metadata to the context.
func StreamServerInterceptor ¶
func StreamServerInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamServerInterceptor intercepts a GRPC client stream call and adds default metadata to the context.
func UnaryClientInterceptor ¶
func UnaryClientInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientInterceptor intercepts a GRPC client unary call and adds default metadata to the context.
Types ¶
type DisableInterceptors ¶
type DisableInterceptors struct{}
DisableInterceptors can be set on the client context with context.WithValue(ctx, DisableInterceptors{}, struct{}{}) to stop the client interceptors from adding any metadata to the context (useful for testing).