package polymarket

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Polymarket_rate_limiter.MatcherSource

Route matching for rate limiting.

This module provides pattern matching for HTTP requests against route configurations. Pattern matching uses segment boundaries for paths, not simple prefix matching.

Sourceval matches_pattern : method_:string -> uri:Uri.t -> Types.route_pattern -> bool

Check if a request matches a route pattern.

  • parameter method_

    HTTP method (e.g., "GET", "POST")

  • parameter uri

    Request URI

Sourceval find_matching_routes : method_:string -> uri:Uri.t -> Types.route_config list -> Types.route_config list

Find all route configs that match the request. Routes are returned in the order they appear in the config list. All matching routes apply (not just first match).

Sourceval make_route_key : method_:string -> uri:Uri.t -> Types.route_pattern -> State.route_key

Generate a unique key for state lookup. The key format is: "host:method:path_prefix"

Sourceval path_matches_prefix : path:string -> prefix:string -> bool

Check if a path matches a prefix using segment boundaries. Examples:

  • "/orders" matches "/orders", "/orders/", "/orders/123"
  • "/orders" does NOT match "/orders-test", "/ordersX"
  • "/api/v1" matches "/api/v1/users"
  • "/api/v1" does NOT match "/api/v10"