2
0

router.go 522 B

12345678910111213141516171819202122232425262728
  1. package router
  2. import (
  3. "net/http"
  4. "github.com/go-chi/chi"
  5. "github.com/porter-dev/porter/api/server/shared"
  6. "github.com/porter-dev/porter/api/server/shared/config"
  7. "github.com/porter-dev/porter/api/types"
  8. )
  9. type Route struct {
  10. Endpoint *shared.APIEndpoint
  11. Handler http.Handler
  12. Router chi.Router
  13. }
  14. type Registerer struct {
  15. GetRoutes func(
  16. r chi.Router,
  17. config *config.Config,
  18. basePath *types.Path,
  19. factory shared.APIEndpointFactory,
  20. children ...*Registerer,
  21. ) []*Route
  22. Children []*Registerer
  23. }