Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StreamInterceptor ¶
func StreamInterceptor(srv interface{}, stream grpc.ServerStream, serverInfo *grpc.StreamServerInfo, handler grpc.StreamHandler) error
StreamInterceptor returns a Stream Interceptor
func UnaryInterceptor ¶
func UnaryInterceptor(ctx context.Context, req interface{}, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
UnaryInterceptor returns a Unary Interceptor
Types ¶
type RequestInfo ¶
type RequestInfo struct { FullMethod string Repository *gitalypb.Repository // contains filtered or unexported fields }
RequestInfo contains information about the current RPC call. Its main purpose is to be used in generic code such that we can obtain RPC-call specific information.
func Extract ¶
func Extract(ctx context.Context) *RequestInfo
Extract extracts the RequestInfo from the context. Returns `nil` if there is on RequestInfo injected into the context.
func (*RequestInfo) ExtractServiceAndMethodName ¶
func (i *RequestInfo) ExtractServiceAndMethodName() (string, string)
ExtractServiceAndMethodName converts the full method name of the request into a server and method part. Returns "unknown" in case they cannot be extracted.
func (*RequestInfo) Tags ¶
func (i *RequestInfo) Tags() map[string]string
Tags returns all tags recorded by this request info.
Click to show internal directories.
Click to hide internal directories.