MCPcopy Create free account
hub / github.com/pace/bricks / RouterWithFallback

Function RouterWithFallback

http/jsonapi/generator/internal/fueling/open-api_test.go:686–701  ·  view source on GitHub ↗

* Router implements: PACE Fueling API Fueling API */

(service interface{}, fallback http.Handler)

Source from the content-addressed store, hash-verified

684Fueling API
685*/
686func RouterWithFallback(service interface{}, fallback http.Handler) *mux.Router {
687 router := mux.NewRouter()
688 // Subrouter s1 - Path: /fueling/beta/
689 s1 := router.PathPrefix("/fueling/beta/").Subrouter()
690 s1.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}/wait-for-status-change").Name("WaitOnPumpStatusChange").Handler(WaitOnPumpStatusChangeHandlerWithFallbackHelper(service, fallback))
691 s1.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}").Name("GetPump").Handler(GetPumpHandlerWithFallbackHelper(service, fallback))
692 s1.Methods("POST").Path("/gas-station/{gasStationId}/payment").Name("ProcessPayment").Handler(ProcessPaymentHandlerWithFallbackHelper(service, fallback))
693 s1.Methods("POST").Path("/gas-stations/{gasStationId}/approaching").Name("ApproachingAtTheForecourt").Handler(ApproachingAtTheForecourtHandlerWithFallbackHelper(service, fallback))
694 // Subrouter s2 - Path: /fueling/v1/
695 s2 := router.PathPrefix("/fueling/v1/").Subrouter()
696 s2.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}/wait-for-status-change").Name("WaitOnPumpStatusChange").Handler(WaitOnPumpStatusChangeHandlerWithFallbackHelper(service, fallback))
697 s2.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}").Name("GetPump").Handler(GetPumpHandlerWithFallbackHelper(service, fallback))
698 s2.Methods("POST").Path("/gas-station/{gasStationId}/payment").Name("ProcessPayment").Handler(ProcessPaymentHandlerWithFallbackHelper(service, fallback))
699 s2.Methods("POST").Path("/gas-stations/{gasStationId}/approaching").Name("ApproachingAtTheForecourt").Handler(ApproachingAtTheForecourtHandlerWithFallbackHelper(service, fallback))
700 return router
701}

Callers

nothing calls this directly

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…