Documentation
¶
Index ¶
- Constants
- func DecisionError(ctx context.Context, typ, value, duration string, statusCode int) error
- func EnsureIP(ctx context.Context) (context.Context, netip.Addr)
- func FromContext(ctx context.Context) (netip.Addr, bool)
- func WriteResponse(w http.ResponseWriter, logger *zap.Logger, typ, value, duration string, ...) error
Constants ¶
View Source
const ( CrowdSecActionVar = "crowdsec.action" CrowdSecValueVar = "crowdsec.value" CrowdSecDurationVar = "crowdsec.duration" CrowdSecStatusVar = "crowdsec.status_code" CrowdSecRetryAfterVar = "crowdsec.retry_after" )
Variables ¶
This section is empty.
Functions ¶
func DecisionError ¶
DecisionError converts a CrowdSec decision to a Caddy HTTP error so request handling can be delegated to handle_errors routes.
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, logger *zap.Logger, typ, value, duration string, statusCode int) error
WriteResponse writes a response to the http.ResponseWriter based on the typ, value, duration and status code provide.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.