Documentation ¶
Index ¶
- func GRPCClientStreamErrorInterceptor(ctx context.Context, desc *grpc.StreamDesc, cc *grpc.ClientConn, method string, ...) (grpc.ClientStream, error)
- func GRPCClientUnaryErrorInterceptor(ctx context.Context, method string, req, reply interface{}, ...) error
- func GRPCServerStreamErrorInterceptor(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func GRPCServerUnaryErrorInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func WithMFAUnaryInterceptor(mfaCeremony mfa.CeremonyFn) grpc.UnaryClientInterceptor
- type RemoteError
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