middleware

package
v0.0.0-...-53ac766 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientTraceInterceptor

func ClientTraceInterceptor() grpc.UnaryClientInterceptor

ClientTraceInterceptor implements client tracing interceptor

func InterceptorLogger

func InterceptorLogger(s *slog.Logger) logging.Logger

InterceptorLogger adapts slog logger to interceptor logger

func LogInterceptor

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

LogInterceptor logs grpc request records

func LoggingInterceptor

func LoggingInterceptor() grpc.UnaryServerInterceptor

LoggingInterceptor implements logging UnaryServerInterceptor

func NopInterceptor

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

NopInterceptor logs grpc request records

func ServerTraceInterceptor

func ServerTraceInterceptor() grpc.UnaryServerInterceptor

ServerTraceInterceptor implements server tracing

Types

type Profiler

type Profiler struct {
	Endpoint string
}

Profiler is a middleware for pprof

func NewProfiler

func NewProfiler(prefixs ...string) *Profiler

NewProfiler creates a new profiler instance

func (*Profiler) Register

func (p *Profiler) Register(mux *http.ServeMux)

Register injects routers on server mux

Jump to

Keyboard shortcuts

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