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

Function Router

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

* Router implements: PACE Fueling API Fueling API */

(service interface{})

Source from the content-addressed store, hash-verified

662Fueling API
663*/
664func Router(service interface{}) *mux.Router {
665 router := mux.NewRouter()
666 // Subrouter s1 - Path: /fueling/beta/
667 s1 := router.PathPrefix("/fueling/beta/").Subrouter()
668 s1.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}/wait-for-status-change").Name("WaitOnPumpStatusChange").Handler(WaitOnPumpStatusChangeHandlerWithFallbackHelper(service, router.NotFoundHandler))
669 s1.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}").Name("GetPump").Handler(GetPumpHandlerWithFallbackHelper(service, router.NotFoundHandler))
670 s1.Methods("POST").Path("/gas-station/{gasStationId}/payment").Name("ProcessPayment").Handler(ProcessPaymentHandlerWithFallbackHelper(service, router.NotFoundHandler))
671 s1.Methods("POST").Path("/gas-stations/{gasStationId}/approaching").Name("ApproachingAtTheForecourt").Handler(ApproachingAtTheForecourtHandlerWithFallbackHelper(service, router.NotFoundHandler))
672 // Subrouter s2 - Path: /fueling/v1/
673 s2 := router.PathPrefix("/fueling/v1/").Subrouter()
674 s2.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}/wait-for-status-change").Name("WaitOnPumpStatusChange").Handler(WaitOnPumpStatusChangeHandlerWithFallbackHelper(service, router.NotFoundHandler))
675 s2.Methods("GET").Path("/gas-stations/{gasStationId}/pumps/{pumpId}").Name("GetPump").Handler(GetPumpHandlerWithFallbackHelper(service, router.NotFoundHandler))
676 s2.Methods("POST").Path("/gas-station/{gasStationId}/payment").Name("ProcessPayment").Handler(ProcessPaymentHandlerWithFallbackHelper(service, router.NotFoundHandler))
677 s2.Methods("POST").Path("/gas-stations/{gasStationId}/approaching").Name("ApproachingAtTheForecourt").Handler(ApproachingAtTheForecourtHandlerWithFallbackHelper(service, router.NotFoundHandler))
678 return router
679}
680
681/*
682Router implements: PACE Fueling API

Callers 1

TestErrorReportingFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…