middleware

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMaskerMethod

func DefaultMaskerMethod(_ context.Context, _ string, _ bool, data interface{}) interface{}

func InjectLogServerInHandler

func InjectLogServerInHandler(l *log.Log) tap.ServerInHandle

Inject logger into gRPC context.

func TraceToLogInjector

func TraceToLogInjector(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo,
	handler grpc.UnaryHandler) (interface{}, error)

Inject tracing headers from gRPC metadata to logger field.

func UnaryClientCallInterceptor

func UnaryClientCallInterceptor(opts ...Option) grpc.UnaryClientInterceptor

func UnaryServerCallInterceptor

func UnaryServerCallInterceptor(opts ...Option) grpc.UnaryServerInterceptor

Types

type Decider

type Decider func(ctx context.Context, fullMethodName string, request bool, err error) LogDetails

type LogDetails

type LogDetails int
const (
	LogDetailsOff   LogDetails = 0
	LogDetailsShort LogDetails = 1
	LogDetailsFull  LogDetails = 2
)

func DefaultDeciderMethod

func DefaultDeciderMethod(ctx context.Context, _ string, _ bool, _ error) LogDetails

type Masker

type Masker func(ctx context.Context, fullMethodName string, request bool, data interface{}) interface{}

type Option

type Option func(*options)

func WithDecider

func WithDecider(f Decider) Option

func WithMasker

func WithMasker(f Masker) Option

Jump to

Keyboard shortcuts

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