uvhttp_router.c
Functions
uvhttp_method_from_string(const char *method)
uvhttp_method_to_string(uvhttp_method_t method)
Return Type: const char *
create_route_node(uvhttp_router_t *router)
Return Type: uint32_t
find_or_create_child(uvhttp_router_t *router, uint32_t parent_index, const char *segment, int is_param)
Return Type: uint32_t
parse_path_params(const char *path, uvhttp_param_t *params, size_t *param_count)
Return Type: int
uvhttp_router_new(uvhttp_router_t **router)
Create new Router.
Parameters:
router: Output parameter, used to receive Router pointer
Returns: UVHTTP_OK on success, other values indicate failure
Note: On success, *router is set to a valid Router object, must be freed using uvhttp_router_free Note: On failure, *router is set to NULL
uvhttp_router_free(uvhttp_router_t *router)
Return Type: void
add_array_route(uvhttp_router_t *router, const char *path, uvhttp_method_t method, uvhttp_request_handler_t handler)
find_array_route(const uvhttp_router_t *router, const char *path, uvhttp_method_t method)
migrate_to_trie(uvhttp_router_t *router)
uvhttp_router_add_route(uvhttp_router_t *router, const char *path, uvhttp_request_handler_t handler)
uvhttp_router_add_route_method(uvhttp_router_t *router, const char *path, uvhttp_method_t method, uvhttp_request_handler_t handler)
match_route_node(const uvhttp_router_t *router, uint32_t node_index, const char **segments, size_t segment_count, size_t segment_index, uvhttp_method_t method, uvhttp_route_match_t *match)
Return Type: int
static_file_handler_wrapper(uvhttp_request_t *request, uvhttp_response_t *response)
Return Type: int
uvhttp_router_find_handler(const uvhttp_router_t *router, const char *path, const char *method)
uvhttp_router_match(const uvhttp_router_t *router, const char *path, const char *method, uvhttp_route_match_t *match)
uvhttp_parse_path_params(const char *path, uvhttp_param_t *params, size_t *param_count)
uvhttp_router_add_static_route(uvhttp_router_t *router, const char *prefix_path, void *static_context)
uvhttp_router_add_fallback_route(uvhttp_router_t *router, void *static_context)
binary_route_handler(uvhttp_request_t *request, uvhttp_response_t *response)
Return Type: int