forked from concrnt/concrnt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwire_gen.go
More file actions
238 lines (197 loc) · 11.3 KB
/
Copy pathwire_gen.go
File metadata and controls
238 lines (197 loc) · 11.3 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
// Code generated by Wire. DO NOT EDIT.
//go:generate go run -mod=mod github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package concurrent
import (
"github.com/bradfitz/gomemcache/memcache"
"github.com/google/wire"
"github.com/redis/go-redis/v9"
"github.com/totegamma/concurrent/client"
"github.com/totegamma/concurrent/core"
"github.com/totegamma/concurrent/x/ack"
"github.com/totegamma/concurrent/x/association"
"github.com/totegamma/concurrent/x/auth"
"github.com/totegamma/concurrent/x/domain"
"github.com/totegamma/concurrent/x/entity"
"github.com/totegamma/concurrent/x/job"
"github.com/totegamma/concurrent/x/jwt"
"github.com/totegamma/concurrent/x/key"
"github.com/totegamma/concurrent/x/message"
"github.com/totegamma/concurrent/x/notification"
"github.com/totegamma/concurrent/x/policy"
"github.com/totegamma/concurrent/x/profile"
"github.com/totegamma/concurrent/x/schema"
"github.com/totegamma/concurrent/x/semanticid"
"github.com/totegamma/concurrent/x/store"
"github.com/totegamma/concurrent/x/subscription"
"github.com/totegamma/concurrent/x/timeline"
"github.com/totegamma/concurrent/x/userkv"
"gorm.io/gorm"
)
// Injectors from wire.go:
func SetupPolicyService(rdb *redis.Client, globalPolicy core.Policy, config core.Config) core.PolicyService {
repository := policy.NewRepository(rdb)
policyService := policy.NewService(repository, globalPolicy, config)
return policyService
}
func SetupJwtService(rdb *redis.Client) jwt.Service {
repository := jwt.NewRepository(rdb)
service := jwt.NewService(repository)
return service
}
func SetupJobService(db *gorm.DB) core.JobService {
repository := job.NewRepository(db)
jobService := job.NewService(repository)
return jobService
}
func SetupAckService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, policy2 core.PolicyService, config core.Config) core.AckService {
repository := ack.NewRepository(db)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
keyService := SetupKeyService(db, rdb, mc, client2, config)
ackService := ack.NewService(repository, client2, entityService, keyService, config)
return ackService
}
func SetupKeyService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, config core.Config) core.KeyService {
repository := key.NewRepository(db, mc, client2)
keyService := key.NewService(repository, config)
return keyService
}
func SetupMessageService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, keeper timeline.Keeper, client2 client.Client, policy2 core.PolicyService, config core.Config) core.MessageService {
schemaService := SetupSchemaService(db)
repository := message.NewRepository(db, mc, schemaService)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
domainService := SetupDomainService(db, client2, config)
timelineService := SetupTimelineService(db, rdb, mc, keeper, client2, policy2, config)
keyService := SetupKeyService(db, rdb, mc, client2, config)
messageService := message.NewService(repository, client2, entityService, domainService, timelineService, keyService, policy2, config)
return messageService
}
func SetupProfileService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, policy2 core.PolicyService, config core.Config) core.ProfileService {
schemaService := SetupSchemaService(db)
repository := profile.NewRepository(db, mc, schemaService)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
semanticIDService := SetupSemanticidService(db)
profileService := profile.NewService(repository, entityService, policy2, semanticIDService)
return profileService
}
func SetupAssociationService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, keeper timeline.Keeper, client2 client.Client, policy2 core.PolicyService, config core.Config) core.AssociationService {
schemaService := SetupSchemaService(db)
repository := association.NewRepository(db, mc, schemaService)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
domainService := SetupDomainService(db, client2, config)
profileService := SetupProfileService(db, rdb, mc, client2, policy2, config)
timelineService := SetupTimelineService(db, rdb, mc, keeper, client2, policy2, config)
subscriptionService := SetupSubscriptionService(db, rdb, mc, client2, policy2, config)
messageService := SetupMessageService(db, rdb, mc, keeper, client2, policy2, config)
keyService := SetupKeyService(db, rdb, mc, client2, config)
associationService := association.NewService(repository, client2, entityService, domainService, profileService, timelineService, subscriptionService, messageService, keyService, policy2, config)
return associationService
}
func SetupTimelineService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, keeper timeline.Keeper, client2 client.Client, policy2 core.PolicyService, config core.Config) core.TimelineService {
schemaService := SetupSchemaService(db)
repository := timeline.NewRepository(db, rdb, mc, keeper, client2, schemaService, config)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
domainService := SetupDomainService(db, client2, config)
semanticIDService := SetupSemanticidService(db)
subscriptionService := SetupSubscriptionService(db, rdb, mc, client2, policy2, config)
timelineService := timeline.NewService(repository, entityService, domainService, semanticIDService, subscriptionService, policy2, config)
return timelineService
}
func SetupDomainService(db *gorm.DB, client2 client.Client, config core.Config) core.DomainService {
repository := domain.NewRepository(db)
domainService := domain.NewService(repository, client2, config)
return domainService
}
func SetupEntityService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, policy2 core.PolicyService, config core.Config) core.EntityService {
schemaService := SetupSchemaService(db)
repository := entity.NewRepository(db, mc, schemaService)
keyService := SetupKeyService(db, rdb, mc, client2, config)
service := SetupJwtService(rdb)
entityService := entity.NewService(repository, client2, config, keyService, policy2, service)
return entityService
}
func SetupAuthService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, policy2 core.PolicyService, config core.Config) core.AuthService {
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
domainService := SetupDomainService(db, client2, config)
keyService := SetupKeyService(db, rdb, mc, client2, config)
authService := auth.NewService(rdb, config, entityService, domainService, keyService, policy2)
return authService
}
func SetupUserkvService(db *gorm.DB) userkv.Service {
repository := userkv.NewRepository(db)
service := userkv.NewService(repository)
return service
}
func SetupSchemaService(db *gorm.DB) core.SchemaService {
repository := schema.NewRepository(db)
schemaService := schema.NewService(repository)
return schemaService
}
func SetupStoreService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, keeper timeline.Keeper, client2 client.Client, policy2 core.PolicyService, config core.Config, repositoryPath string) core.StoreService {
repository := store.NewRepository(db, rdb)
keyService := SetupKeyService(db, rdb, mc, client2, config)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
messageService := SetupMessageService(db, rdb, mc, keeper, client2, policy2, config)
associationService := SetupAssociationService(db, rdb, mc, keeper, client2, policy2, config)
profileService := SetupProfileService(db, rdb, mc, client2, policy2, config)
timelineService := SetupTimelineService(db, rdb, mc, keeper, client2, policy2, config)
ackService := SetupAckService(db, rdb, mc, client2, policy2, config)
subscriptionService := SetupSubscriptionService(db, rdb, mc, client2, policy2, config)
semanticIDService := SetupSemanticidService(db)
storeService := store.NewService(repository, keyService, entityService, messageService, associationService, profileService, timelineService, ackService, subscriptionService, semanticIDService, config, repositoryPath)
return storeService
}
func SetupSubscriptionService(db *gorm.DB, rdb *redis.Client, mc *memcache.Client, client2 client.Client, policy2 core.PolicyService, config core.Config) core.SubscriptionService {
schemaService := SetupSchemaService(db)
repository := subscription.NewRepository(db, schemaService)
entityService := SetupEntityService(db, rdb, mc, client2, policy2, config)
subscriptionService := subscription.NewService(repository, entityService, policy2)
return subscriptionService
}
func SetupSemanticidService(db *gorm.DB) core.SemanticIDService {
repository := semanticid.NewRepository(db)
semanticIDService := semanticid.NewService(repository)
return semanticIDService
}
func SetupNotificationService(db *gorm.DB) core.NotificationService {
repo := notification.NewRepository(db)
notificationService := notification.NewService(repo)
return notificationService
}
// wire.go:
// Lv0
var jwtServiceProvider = wire.NewSet(jwt.NewService, jwt.NewRepository)
var schemaServiceProvider = wire.NewSet(schema.NewService, schema.NewRepository)
var domainServiceProvider = wire.NewSet(domain.NewService, domain.NewRepository)
var semanticidServiceProvider = wire.NewSet(semanticid.NewService, semanticid.NewRepository)
var userKvServiceProvider = wire.NewSet(userkv.NewService, userkv.NewRepository)
var policyServiceProvider = wire.NewSet(policy.NewService, policy.NewRepository)
var keyServiceProvider = wire.NewSet(key.NewService, key.NewRepository)
var jobServiceProvider = wire.NewSet(job.NewService, job.NewRepository)
// Lv1
var entityServiceProvider = wire.NewSet(entity.NewService, entity.NewRepository, SetupJwtService, SetupSchemaService, SetupKeyService)
// Lv2
var timelineServiceProvider = wire.NewSet(timeline.NewService, timeline.NewRepository, SetupEntityService, SetupDomainService, SetupSchemaService, SetupSemanticidService, SetupSubscriptionService)
var subscriptionServiceProvider = wire.NewSet(subscription.NewService, subscription.NewRepository, SetupSchemaService, SetupEntityService)
// Lv3
var profileServiceProvider = wire.NewSet(profile.NewService, profile.NewRepository, SetupEntityService, SetupKeyService, SetupSchemaService, SetupSemanticidService)
var authServiceProvider = wire.NewSet(auth.NewService, SetupEntityService, SetupDomainService, SetupKeyService)
var ackServiceProvider = wire.NewSet(ack.NewService, ack.NewRepository, SetupEntityService, SetupKeyService)
// Lv4
var messageServiceProvider = wire.NewSet(message.NewService, message.NewRepository, SetupEntityService, SetupDomainService, SetupTimelineService, SetupKeyService, SetupSchemaService)
// Lv5
var associationServiceProvider = wire.NewSet(association.NewService, association.NewRepository, SetupEntityService, SetupDomainService, SetupTimelineService, SetupMessageService, SetupKeyService, SetupSchemaService, SetupProfileService, SetupSubscriptionService)
// Lv6
var storeServiceProvider = wire.NewSet(store.NewService, store.NewRepository, SetupKeyService,
SetupMessageService,
SetupAssociationService,
SetupProfileService,
SetupEntityService,
SetupTimelineService,
SetupAckService,
SetupSubscriptionService,
SetupSemanticidService,
)
// other
var notificationServiceProvider = wire.NewSet(notification.NewService, notification.NewRepository)