requestinfohandler

package
v16.11.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 14 Imported by: 0

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.

Jump to

Keyboard shortcuts

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