MCPcopy Create free account
hub / github.com/ceramicnetwork/rust-ceramic / parse_operation_id

Method parse_operation_id

api-server/src/server/mod.rs:2265–2362  ·  view source on GitHub ↗
(request: &Request<T>)

Source from the content-addressed store, hash-verified

2263pub struct ApiRequestParser;
2264impl<T> RequestParser<T> for ApiRequestParser {
2265 fn parse_operation_id(request: &Request<T>) -> Option<&'static str> {
2266 let path = paths::GLOBAL_REGEX_SET.matches(request.uri().path());
2267 match *request.method() {
2268 // ConfigNetworkGet - GET /config/network
2269 hyper::Method::GET if path.matched(paths::ID_CONFIG_NETWORK) => {
2270 Some("ConfigNetworkGet")
2271 }
2272 // ConfigNetworkOptions - OPTIONS /config/network
2273 hyper::Method::OPTIONS if path.matched(paths::ID_CONFIG_NETWORK) => {
2274 Some("ConfigNetworkOptions")
2275 }
2276 // DebugHeapGet - GET /debug/heap
2277 hyper::Method::GET if path.matched(paths::ID_DEBUG_HEAP) => Some("DebugHeapGet"),
2278 // DebugHeapOptions - OPTIONS /debug/heap
2279 hyper::Method::OPTIONS if path.matched(paths::ID_DEBUG_HEAP) => {
2280 Some("DebugHeapOptions")
2281 }
2282 // EventsEventIdGet - GET /events/{event_id}
2283 hyper::Method::GET if path.matched(paths::ID_EVENTS_EVENT_ID) => {
2284 Some("EventsEventIdGet")
2285 }
2286 // EventsEventIdOptions - OPTIONS /events/{event_id}
2287 hyper::Method::OPTIONS if path.matched(paths::ID_EVENTS_EVENT_ID) => {
2288 Some("EventsEventIdOptions")
2289 }
2290 // EventsOptions - OPTIONS /events
2291 hyper::Method::OPTIONS if path.matched(paths::ID_EVENTS) => Some("EventsOptions"),
2292 // EventsPost - POST /events
2293 hyper::Method::POST if path.matched(paths::ID_EVENTS) => Some("EventsPost"),
2294 // ExperimentalEventsSepSepValueGet - GET /experimental/events/{sep}/{sepValue}
2295 hyper::Method::GET if path.matched(paths::ID_EXPERIMENTAL_EVENTS_SEP_SEPVALUE) => {
2296 Some("ExperimentalEventsSepSepValueGet")
2297 }
2298 // ExperimentalEventsSepSepValueOptions - OPTIONS /experimental/events/{sep}/{sepValue}
2299 hyper::Method::OPTIONS if path.matched(paths::ID_EXPERIMENTAL_EVENTS_SEP_SEPVALUE) => {
2300 Some("ExperimentalEventsSepSepValueOptions")
2301 }
2302 // ExperimentalInterestsGet - GET /experimental/interests
2303 hyper::Method::GET if path.matched(paths::ID_EXPERIMENTAL_INTERESTS) => {
2304 Some("ExperimentalInterestsGet")
2305 }
2306 // ExperimentalInterestsOptions - OPTIONS /experimental/interests
2307 hyper::Method::OPTIONS if path.matched(paths::ID_EXPERIMENTAL_INTERESTS) => {
2308 Some("ExperimentalInterestsOptions")
2309 }
2310 // FeedEventsGet - GET /feed/events
2311 hyper::Method::GET if path.matched(paths::ID_FEED_EVENTS) => Some("FeedEventsGet"),
2312 // FeedEventsOptions - OPTIONS /feed/events
2313 hyper::Method::OPTIONS if path.matched(paths::ID_FEED_EVENTS) => {
2314 Some("FeedEventsOptions")
2315 }
2316 // FeedResumeTokenGet - GET /feed/resumeToken
2317 hyper::Method::GET if path.matched(paths::ID_FEED_RESUMETOKEN) => {
2318 Some("FeedResumeTokenGet")
2319 }
2320 // FeedResumeTokenOptions - OPTIONS /feed/resumeToken
2321 hyper::Method::OPTIONS if path.matched(paths::ID_FEED_RESUMETOKEN) => {
2322 Some("FeedResumeTokenOptions")

Callers

nothing calls this directly

Calls 1

pathMethod · 0.80

Tested by

no test coverage detected