Crate pingap_core

Source

Structs§

CommonServiceTask
CompressionStat
Statistics about response compression operations
Ctx
Represents the state of a request/response cycle, tracking various metrics and properties including connection details, caching information, and upstream server interactions.
Guard
A Guard is returned when an Inflight key is incremented via Inflight::incr.
HttpChunkResponse
Chunked response handler for streaming large responses
HttpResponse
Main HTTP response struct for handling complete responses
Inflight
An Inflight type tracks the frequency of actions that are actively occurring. When the value is dropped from scope, the count will automatically decrease.
NotificationData
Rate
A stable rate estimator that reports the rate of events in the past interval time. It returns the average rate between interval * 2 and interval while collecting the events happening between interval and now.
RateComponents
Input struct to custom functions for calculating rate. Includes the counts from the current interval, previous interval, the configured duration of an interval, and the fraction into the current interval that the sample was taken.
SimpleServiceTask
TinyUfo
TinyUfo cache
TtlLruLimit

Enums§

Error
NotificationLevel
PluginStep

Constants§

HOST_NAME_TAG

Statics§

HTTP_HEADER_CONTENT_HTML
HTTP_HEADER_CONTENT_JSON
HTTP_HEADER_CONTENT_TEXT
HTTP_HEADER_NAME_X_REQUEST_ID
HTTP_HEADER_NO_CACHE
HTTP_HEADER_NO_STORE
HTTP_HEADER_TRANSFER_CHUNKED
HTTP_HEADER_X_FORWARDED_FOR
HTTP_HEADER_X_REAL_IP
LOG_CATEGORY

Traits§

ModifyResponseBody
Trait for modifying the response body
Notification
Trait for sending notifications
Plugin
Core trait that defines the interface all plugins must implement.
ServiceTask

Functions§

convert_header
Converts a string in “name: value” format into an HTTP header tuple. Returns None if the input string doesn’t contain a colon separator.
convert_header_value
Processes special header values that contain dynamic variables. Supports variables like $host, $scheme, $remote_addr etc.
convert_headers
Converts a slice of strings into HTTP headers. Each string should be in “name: value” format.
convert_query_map
Converts query string to key-value map.
get_cache_key
Generates a cache key from the request method, URI and state context. The key includes an optional namespace and prefix if configured in the state.
get_client_ip
Gets client ip from X-Forwarded-For, If none, get from X-Real-Ip, If none, get remote addr.
get_cookie_value
Gets cookie value from req header.
get_host
Get request host in this order of precedence: host name from the request line, or host name from the “Host” request header field
get_hostname
Returns the system hostname.
get_query_value
Gets query parameter value from request header.
get_remote_addr
Get remote addr from session
get_req_header_value
Gets string value from req header.
get_super_ts
Returns the number of seconds elapsed since SUPER_TIMESTAMP Returns 0 if the current time is before SUPER_TIMESTAMP
new_internal_error
Creates a new internal error
new_simple_service_task
Creates a new SimpleServiceTask with the specified name, interval, and collection of tasks. This service manages multiple background tasks that run concurrently at fixed intervals.
remove_query_from_header
Remove query parameter from request header URI

Type Aliases§

HttpHeader
NotificationSender
Type alias for a boxed Notification trait object that can be shared between threads
SimpleServiceTaskFuture