Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrepareAccessLogMiddleware ¶
PrepareAccessLogMiddleware builds a logging middleware instance using the provided logger
Types ¶
type LogMetadata ¶
type LogMetadata struct {
Action string
// User is the authenticated principal (username or access key) or "anonymous".
// Written by the auth middleware; empty for unauthenticated internal endpoints.
User string
// AuthzDecision is "allow" or "deny", written by the authorization middleware.
// Empty for routes that bypass authorization (health, metrics, etc.).
AuthzDecision string
Custom map[string]string
}
LogMetadata is a mutable metadata container shared between the access log middleware and the inner middleware/handlers via a pointer in context. Inner layers write to it; the access log reads it after the request finishes.
func GetLogData ¶
func GetLogData(ctx context.Context) (*LogMetadata, bool)