// Unary intercepts unary RPC requests

Unary intercepts unary RPC requests
// Unary intercepts unary RPC requests
func (interceptor *AuthInterceptor) Unary() grpc.UnaryServerInterceptor {
	return func(
		ctx context.Context,
		req interface{},
		info *grpc.UnaryServerInfo,
		handler grpc.UnaryHandler,
	) (interface{}, error) {
		newCtx, err := interceptor.authorize(ctx, info.FullMethod)
		if err != nil {
			return nil, err
		}
		return handler(newCtx, req)
	}
}
func ( interceptor * AuthInterceptor ) Unary ( ) grpc . UnaryServerInterceptor { return func ( ctx context . Context , req interface { } , info * grpc . UnaryServerInfo , handler grpc . UnaryHandler , ) ( interface { } , error ) { newCtx , err := interceptor . authorize ( ctx , info . FullMethod ) if err != nil { return nil , err } return handler ( newCtx , req ) } }
Unary intercepts unary RPC requests
Unary intercepts unary RPC requests