middleware

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 16, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCustomerToctx

func AddCustomerToctx(ctx context.Context)

AddCustomerToctx ...

func AddFields

func AddFields(ctx context.Context, fields map[string]interface{})

AddFields adds fields to the logger.

func AddLogging

func AddLogging(logger *zap.Logger, options []grpc.ServerOption) []grpc.ServerOption

AddLogging returns grpc.Server config option that turn on logging.

func Extract

func Extract(ctx context.Context) map[string]interface{}

Extract takes the call-scoped logrus.Entry from ctx_logrus middleware.

If the ctx_logrus middleware wasn't used, a no-op `logrus.Entry` is returned. This makes it safe to use regardless.

func ToContext

func ToContext(ctx context.Context, callLog map[string]interface{}) context.Context

ToContext adds the logrus.Entry to the context for extraction later. Returning the new context that has been created.

Types

This section is empty.

Jump to

Keyboard shortcuts

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