Documentation ¶
Index ¶
- func CopyDeadline(ctx context.Context) (context.Context, context.CancelFunc)
- func ExtractMetadata(ctx context.Context) context.Context
- func UnaryClientIntercept(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func UnaryServerInterceptor(ctx context.Context, r any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDeadline ¶
CopyDeadline searches for the deadline in the metadata and returns an updated context with a cancellation function. If the headers do not include the deadline value, the context is returned unchanged and the cancellation function will be nil.
func ExtractMetadata ¶
ExtractMetadata extracts configured values from the metadata and stores them in the returned context.
func UnaryClientIntercept ¶
func UnaryClientIntercept(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
UnaryClientIntercept intercepts an outgoing request, adding metadata keys for the configured context values and deadline.
func UnaryServerInterceptor ¶
func UnaryServerInterceptor(ctx context.Context, r any, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error)
UnaryServerInterceptor extracts configured values from the incoming metadata and stores them in the context. Sets a deadline (and handles its cancellation) when one is found. Does not process outgoing metadata.
Types ¶
This section is empty.