interceptors

package
v0.0.0-...-547f59d Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 9 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GRPCClientStreamErrorInterceptor

func GRPCClientStreamErrorInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, streamer grpc.Streamer, opts ...grpc.CallOption) (grpc.ClientStream, error)

GRPCClientStreamErrorInterceptor is gRPC client stream interceptor that handles converting errors to the appropriate gRPC status error.

func GRPCClientUnaryErrorInterceptor

func GRPCClientUnaryErrorInterceptor(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error

GRPCClientUnaryErrorInterceptor is a gRPC unary client interceptor that handles converting errors to the appropriate grpc status error.

func GRPCServerStreamErrorInterceptor

func GRPCServerStreamErrorInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error

GRPCServerStreamErrorInterceptor is a gRPC server stream interceptor that handles converting errors to the appropriate gRPC status error.

func GRPCServerUnaryErrorInterceptor

func GRPCServerUnaryErrorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)

GRPCServerUnaryErrorInterceptor is a gRPC unary server interceptor that handles converting errors to the appropriate gRPC status error.

func WithMFAUnaryInterceptor

func WithMFAUnaryInterceptor(mfaCeremony mfa.CeremonyFn) grpc.UnaryClientInterceptor

WithMFAUnaryInterceptor intercepts a GRPC client unary call to add MFA credentials to the rpc call when an MFA response is provided through the context. Additionally, when the call returns an error that indicates that MFA is required, this interceptor will prompt for MFA using the given mfaCeremony and retry.

Types

type RemoteError

type RemoteError struct {
	// Err is the underlying error.
	Err error
}

RemoteError annotates server-side errors translated into trace by GRPCClientUnaryErrorInterceptor or GRPCClientStreamErrorInterceptor.

func (*RemoteError) Error

func (e *RemoteError) Error() string

func (*RemoteError) Unwrap

func (e *RemoteError) Unwrap() error

Jump to

Keyboard shortcuts

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