interceptors

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseMethod

func ParseMethod(method string) (string, string)

func StreamLogging

func StreamLogging() grpc.StreamServerInterceptor

StreamLogging handles generic logging of RPC methods to zerolog.

func StreamMTLS

func StreamMTLS() grpc.StreamServerInterceptor

StreamMTLS adds authenticated peer info to the context and returns an unauthenticated error if that peer information is not available.

func StreamMaintenance

func StreamMaintenance(statusEndpoint string) grpc.StreamServerInterceptor

The stream maintenance interceptor simply returns an unavailable error.

func StreamRecovery

func StreamRecovery() grpc.StreamServerInterceptor

Recovers a stream handler from a panic and converts the error into an internal error.

func StreamType

func StreamType(info *grpc.StreamServerInfo) string

func UnaryLogging

func UnaryLogging() grpc.UnaryServerInterceptor

UnaryLogging handles generic logging of RPC methods to zerolog.

func UnaryMTLS

func UnaryMTLS() grpc.UnaryServerInterceptor

UnaryMTLS adds authenticated peer info to the context and returns an unauthenticated error if that peer information is not available.

func UnaryMaintenance

func UnaryMaintenance(statusEndpoint string) grpc.UnaryServerInterceptor

The maintenance interceptor only allows Status endpoint to be queried and returns a service unavailable error otherwise.

func UnaryRecovery

func UnaryRecovery() grpc.UnaryServerInterceptor

Recovers a unary handler from a panic and converts the error into an internal error.

Types

type ContextKey

type ContextKey string

type PeerInfo

type PeerInfo struct {
	Name        *pkix.Name
	DNSNames    []string
	IPAddresses []net.IP
}

PeerInfo stores information about the identity of a remote peer.

func PeerFromTLS

func PeerFromTLS(ctx context.Context) (info *PeerInfo, err error)

PeerFromTLS looks up the TLSInfo from the incoming gRPC connection to retrieve information about the remote peer from the certificate.

Jump to

Keyboard shortcuts

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