Documentation
¶
Index ¶
- func AddToContext(ctx context.Context, d Details) context.Context
- func Decorator(inner auditrail.Logger) auditrail.Logger
- func EchoMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func GRPCStreamInterceptor(srv interface{}, ss grpc.ServerStream, ssi *grpc.StreamServerInfo, ...) error
- func GRPCUnaryInterceptor(ctx context.Context, req interface{}, usi *grpc.UnaryServerInfo, ...) (resp interface{}, err error)
- func GinMiddleware(c *gin.Context)
- type Details
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToContext ¶
AddToContext adds the HTTP details to a context.
func Decorator ¶
Decorator returns a new audit.Logger that appends http details to the log entry before logging it.
This decorator assumes that http data was previously added to the context using the AddToContext function, either directly or through some of the provided middlewares (Gin, Echo, etc).
func EchoMiddleware ¶
func EchoMiddleware(next echo.HandlerFunc) echo.HandlerFunc
EchoMiddleware is an Echo middleware that injects into request's context a httpd.Details object holding request details.
func GRPCStreamInterceptor ¶
func GRPCStreamInterceptor(srv interface{}, ss grpc.ServerStream, ssi *grpc.StreamServerInfo, handler grpc.StreamHandler) error
GRPCStreamInterceptor is a gRPC stream server interceptor that injects httpd.Details into the context.
func GRPCUnaryInterceptor ¶
func GRPCUnaryInterceptor(ctx context.Context, req interface{}, usi *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error)
GRPCUnaryInterceptor is a gRPC unary call interceptor that injects httpd.Details into the context.
func GinMiddleware ¶
GinMiddleware is a Gin middleware that injects into request's context a httpd.Details object holding request details.