-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_games.go
More file actions
27 lines (23 loc) · 783 Bytes
/
Copy pathprocess_games.go
File metadata and controls
27 lines (23 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package GCPSteamAnalytics
import (
"net/http"
"github.com/Tomas-vilte/GCPSteamAnalytics/api"
"github.com/Tomas-vilte/GCPSteamAnalytics/controller"
"github.com/Tomas-vilte/GCPSteamAnalytics/steamapi/persistence"
"github.com/Tomas-vilte/GCPSteamAnalytics/steamapi/service"
"github.com/gin-gonic/gin"
)
func createApp() controller.ProcessController {
storage := persistence.NewStorage()
steamClient := service.NewSteamClient(&http.Client{})
sv := service.NewGameProcessor(storage, steamClient)
return controller.NewProcessController(sv)
}
func ProcessGames(w http.ResponseWriter, r *http.Request) {
rGin := gin.Default()
gin.SetMode(gin.ReleaseMode)
app := createApp()
api.SetupRoutesGetGamesGCP(rGin, app)
rGin.Use(api.RateLimitMiddleware())
rGin.ServeHTTP(w, r)
}