mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-16 06:51:27 +00:00
32 lines
511 B
Go
32 lines
511 B
Go
package routes
|
|
|
|
import "go.uber.org/fx"
|
|
|
|
var Module = fx.Options(
|
|
fx.Provide(NewItemControllerRoutes),
|
|
fx.Provide(NewSwaggerRoutes),
|
|
fx.Provide(NewRoutes),
|
|
)
|
|
|
|
type Routes []Route
|
|
|
|
type Route interface {
|
|
Setup()
|
|
}
|
|
|
|
func NewRoutes(
|
|
itemControllerRoutes ItemControllerRoutes,
|
|
swaggerRoutes SwaggerRoutes,
|
|
) Routes {
|
|
return Routes{
|
|
itemControllerRoutes,
|
|
swaggerRoutes,
|
|
}
|
|
}
|
|
|
|
func (r Routes) Setup() {
|
|
for _, route := range r {
|
|
route.Setup()
|
|
}
|
|
}
|