Documentation
¶
Index ¶
Constants ¶
View Source
const ( Unknown = "Unknown" MetricAuditLogRecordsTotal = "otel_audit_log_records_total" MetricAuditLogSendErrorsTotal = "otel_audit_log_send_errors_total" MetricAuditLogConnectionDegraded = "otel_audit_log_connection_degraded" )
Variables ¶
This section is empty.
Functions ¶
func CreateConn ¶
func CreateConn(connectSocket bool) (createConn audit.CreateConn)
func CreateOtelAuditMsg ¶
func GetOperationType ¶
func GetOperationType(method string) msgs.OperationType
Types ¶
type AuditClient ¶
type AuditClient struct {
// contains filtered or unexported fields
}
func NewOtelAuditClient ¶
func NewOtelAuditClient(ctx context.Context, createConn audit.CreateConn, registerer prometheus.Registerer, options ...base.Option) (*AuditClient, error)
NewOtelAuditClient creates an audit client that wraps the given connection factory with best-effort fallback. If the connection fails, it falls back to a no-op connection and sets the degraded gauge. Non-connection errors from the underlying audit library are returned to the caller.
func (*AuditClient) Send ¶
func (c *AuditClient) Send(ctx context.Context, msg msgs.Msg, options ...base.SendOption) error
type ResponseWriter ¶
type ResponseWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
ResponseWriter wraps http.ResponseWriter to capture the status code for audit logging.
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) *ResponseWriter
func (*ResponseWriter) StatusCode ¶
func (w *ResponseWriter) StatusCode() int
StatusCode returns the HTTP status code that was written. Returns http.StatusOK if WriteHeader was never called.
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.