rpcutil

package
v0.0.0-test-multiarch Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertFromServerContext

func CertFromServerContext(ctx context.Context) (cert *x509.Certificate, valid bool)

CertFromServerContext returns the peer provided certificate any whether it id valid or not.

func HTTPLogger

func HTTPLogger(request *http.Request, base *zap.Logger) *zap.Logger

func HTTPLoggerFields

func HTTPLoggerFields(request *http.Request) []zap.Field

func MaskContains

func MaskContains(mask *fieldmaskpb.FieldMask, field string) bool

func ServerLogger

func ServerLogger(ctx context.Context, base *zap.Logger) *zap.Logger

ServerLogger creates a sub-logger with fields derived from a gRPC server context.

func ServerLoggerFields

func ServerLoggerFields(ctx context.Context) []zap.Field

func ServiceMethod

func ServiceMethod(ctx context.Context) (service, method string, ok bool)

ServiceMethod retrieves the service name and method name from a gRPC server context. Works like grpc.Method, but splits the path into service and method parts.

func SplitMethodPath

func SplitMethodPath(methodPath string) (service, method string, ok bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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