grpcx

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package grpcx provides helper types and functions to work with gRPC.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogInterceptor

func LogInterceptor(
	ctx context.Context,
	req any,
	info *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler,
) (resp any, err error)

LogInterceptor logs gRPC calls.

Types

type Logger

type Logger struct {
	Logger *log.Logger
}

Logger implements grpclog.LoggerV2 to log to slog.

func (Logger) Error

func (l Logger) Error(args ...any)

func (Logger) Errorf

func (l Logger) Errorf(format string, args ...any)

func (Logger) Errorln

func (l Logger) Errorln(args ...any)

func (Logger) Fatal

func (l Logger) Fatal(args ...any)

func (Logger) Fatalf

func (l Logger) Fatalf(format string, args ...any)

func (Logger) Fatalln

func (l Logger) Fatalln(args ...any)

func (Logger) Info

func (l Logger) Info(args ...any)

func (Logger) Infof

func (l Logger) Infof(format string, args ...any)

func (Logger) Infoln

func (l Logger) Infoln(args ...any)

func (Logger) V

func (Logger) V(l int) bool

func (Logger) Warning

func (l Logger) Warning(args ...any)

func (Logger) Warningf

func (l Logger) Warningf(format string, args ...any)

func (Logger) Warningln

func (l Logger) Warningln(args ...any)

Jump to

Keyboard shortcuts

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