interceptor

package
v0.0.0-...-749ffa6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RecoveryStreamServerInterceptor

func RecoveryStreamServerInterceptor() grpc.StreamServerInterceptor

func RecoveryUnaryServerInterceptor

func RecoveryUnaryServerInterceptor() grpc.UnaryServerInterceptor

func StreamLoggerInterceptor

func StreamLoggerInterceptor(record func(entity *LogEntity)) grpc.StreamServerInterceptor

func UnaryLoggerInterceptor

func UnaryLoggerInterceptor(record func(entity *LogEntity)) grpc.UnaryServerInterceptor

Types

type LogEntity

type LogEntity struct {
	Request    string
	Response   string
	ClientAddr string
	Metadata   map[string][]string
	Time       time.Time
	Duration   time.Duration
	Error      error
	Context    context.Context
	FullMethod string
	Stream     bool
}

func (*LogEntity) Fields

func (e *LogEntity) Fields() map[string]any

Jump to

Keyboard shortcuts

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