-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
56 lines (53 loc) · 1.5 KB
/
main.go
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package main
import (
"net/http"
"github.com/int128/amefuriso/gateways"
"github.com/int128/amefuriso/handlers"
"github.com/int128/amefuriso/infrastructure"
"github.com/int128/amefuriso/usecases"
"google.golang.org/appengine"
)
func main() {
h := handlers.Handlers{
GetWeather: handlers.GetWeather{
Usecase: &usecases.GetWeather{
UserRepository: &gateways.UserRepository{},
SubscriptionRepository: &gateways.SubscriptionRepository{},
WeatherService: &gateways.WeatherService{
Client: &infrastructure.WeatherClient{},
},
},
},
GetImage: handlers.GetImage{
Usecase: &usecases.GetImage{
PNGRepository: &gateways.PNGRepository{},
},
},
PollWeathers: handlers.PollWeathers{
Usecase: &usecases.PollWeathers{
UserRepository: &gateways.UserRepository{},
SubscriptionRepository: &gateways.SubscriptionRepository{},
PNGRepository: &gateways.PNGRepository{},
WeatherService: &gateways.WeatherService{
Client: &infrastructure.WeatherClient{},
},
NotificationService: &gateways.NotificationService{
Client: &infrastructure.SlackClient{},
},
},
},
CleanupImages: handlers.CleanupImages{
Usecase: &usecases.CleanupImages{
PNGRepository: &gateways.PNGRepository{},
},
},
Setup: handlers.Setup{
Usecase: &usecases.Setup{
SubscriptionRepository: &gateways.SubscriptionRepository{},
UserRepository: &gateways.UserRepository{},
},
},
}
http.Handle("/", h.NewRouter())
appengine.Main()
}