MCPcopy
hub / github.com/grpc/grpc-go / UnaryInterceptor

Function UnaryInterceptor

server.go:485–492  ·  view source on GitHub ↗

UnaryInterceptor returns a ServerOption that sets the UnaryServerInterceptor for the server. Only one unary interceptor can be installed. The construction of multiple interceptors (e.g., chaining) can be implemented at the caller.

(i UnaryServerInterceptor)

Source from the content-addressed store, hash-verified

483// server. Only one unary interceptor can be installed. The construction of multiple
484// interceptors (e.g., chaining) can be implemented at the caller.
485func UnaryInterceptor(i UnaryServerInterceptor) ServerOption {
486 return newFuncServerOption(func(o *serverOptions) {
487 if o.unaryInt != nil {
488 panic("The unary server interceptor was already set and may not be reset.")
489 }
490 o.unaryInt = i
491 })
492}
493
494// ChainUnaryInterceptor returns a ServerOption that specifies the chained interceptor
495// for unary RPCs. The first interceptor will be the outer most,

Calls 1

newFuncServerOptionFunction · 0.85