Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Middleware ¶
func Middleware(driver Driver, opts ...Option) gin.HandlerFunc
Middleware returns a new HTTP middleware that records audit log entries.
Types ¶
type ErrorHandler ¶
type ErrorHandler = common.ErrorHandler
ErrorHandler is the fundamental interface for error handling.
type HTTPEntry ¶
type HTTPEntry struct { ClientIP string UserAgent string Method string Path string RequestBody string StatusCode int ResponseTime int ResponseSize int Errors []string }
HTTPEntry contains details related to an HTTP call for an audit log entry.
type NoopErrorHandler ¶
type NoopErrorHandler = common.NoopErrorHandler
NoopErrorHandler is an error handler that discards every error.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option configures an audit log middleware.
func WithErrorHandler ¶
func WithErrorHandler(errorHandler ErrorHandler) Option
WithErrorHandler sets the clock in an audit log middleware.
func WithSensitivePaths ¶
WithSensitivePaths marks API call paths as sensitive, causing the log entry to omit the request body.
Click to show internal directories.
Click to hide internal directories.