Documentation ¶
Index ¶
- func AppendTraceKeys(keys []string)
- func GRPCUnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, ...) error
- func GRPCUnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, ...) (resp any, err error)
- func GinMiddleware() gin.HandlerFunc
- func NewGORMLogger(config gormlogger.Config) gormlogger.Interface
- func NewLogrusHook() logrus.Hook
- func Parse(ctx context.Context) (labels map[string]string)
- func SetTraceIDGenerator(generator TraceIDGenerator)
- func SetTraceIDKey(key string)
- func Trace(ctx context.Context) context.Context
- type LogrusHook
- type TraceIDGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendTraceKeys ¶
func AppendTraceKeys(keys []string)
func GRPCUnaryClientInterceptor ¶
func GRPCUnaryClientInterceptor(ctx context.Context, method string, req, reply any, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error
func GRPCUnaryServerInterceptor ¶
func GRPCUnaryServerInterceptor(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp any, err error)
func GinMiddleware ¶
func GinMiddleware() gin.HandlerFunc
func NewGORMLogger ¶
func NewGORMLogger(config gormlogger.Config) gormlogger.Interface
func NewLogrusHook ¶
func SetTraceIDGenerator ¶
func SetTraceIDGenerator(generator TraceIDGenerator)
func SetTraceIDKey ¶
func SetTraceIDKey(key string)
Types ¶
type LogrusHook ¶
type LogrusHook struct{}
func (*LogrusHook) Levels ¶
func (hook *LogrusHook) Levels() []logrus.Level
type TraceIDGenerator ¶
type TraceIDGenerator func() string
Click to show internal directories.
Click to hide internal directories.