-
Notifications
You must be signed in to change notification settings - Fork 27
/
wire_gen.go
87 lines (80 loc) · 2.95 KB
/
wire_gen.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
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
// Code generated by Wire. DO NOT EDIT.
//go:generate go run github.com/google/wire/cmd/wire
//go:build !wireinject
// +build !wireinject
package elasticsearch
import (
"context"
"github.com/authgear/authgear-server/pkg/lib/authn/identity/loginid"
"github.com/authgear/authgear-server/pkg/lib/authn/identity/oauth"
"github.com/authgear/authgear-server/pkg/lib/authn/user"
"github.com/authgear/authgear-server/pkg/lib/config"
"github.com/authgear/authgear-server/pkg/lib/config/configsource"
"github.com/authgear/authgear-server/pkg/lib/infra/db"
"github.com/authgear/authgear-server/pkg/lib/infra/db/appdb"
"github.com/authgear/authgear-server/pkg/lib/infra/db/globaldb"
"github.com/authgear/authgear-server/pkg/lib/rolesgroups"
"github.com/authgear/authgear-server/pkg/util/clock"
)
// Injectors from wire.go:
func NewAppLister(ctx context.Context, pool *db.Pool, databaseCredentials *config.DatabaseCredentials) *AppLister {
globalDatabaseCredentialsEnvironmentConfig := NewGlobalDatabaseCredentials(databaseCredentials)
databaseEnvironmentConfig := config.NewDefaultDatabaseEnvironmentConfig()
factory := NewLoggerFactory()
handle := globaldb.NewHandle(ctx, pool, globalDatabaseCredentialsEnvironmentConfig, databaseEnvironmentConfig, factory)
sqlBuilder := globaldb.NewSQLBuilder(globalDatabaseCredentialsEnvironmentConfig)
sqlExecutor := globaldb.NewSQLExecutor(ctx, handle)
store := &configsource.Store{
SQLBuilder: sqlBuilder,
SQLExecutor: sqlExecutor,
}
appLister := &AppLister{
Handle: handle,
Store: store,
}
return appLister
}
func NewReindexer(ctx context.Context, pool *db.Pool, databaseCredentials *config.DatabaseCredentials, appID config.AppID) *Reindexer {
clock := _wireSystemClockValue
databaseEnvironmentConfig := config.NewDefaultDatabaseEnvironmentConfig()
factory := NewLoggerFactory()
handle := appdb.NewHandle(ctx, pool, databaseEnvironmentConfig, databaseCredentials, factory)
sqlBuilderApp := appdb.NewSQLBuilderApp(databaseCredentials, appID)
sqlExecutor := appdb.NewSQLExecutor(ctx, handle)
store := &user.Store{
SQLBuilder: sqlBuilderApp,
SQLExecutor: sqlExecutor,
Clock: clock,
AppID: appID,
}
identityConfig := NewEmptyIdentityConfig()
oauthStore := &oauth.Store{
SQLBuilder: sqlBuilderApp,
SQLExecutor: sqlExecutor,
IdentityConfig: identityConfig,
}
loginidStore := &loginid.Store{
SQLBuilder: sqlBuilderApp,
SQLExecutor: sqlExecutor,
}
rolesgroupsStore := &rolesgroups.Store{
SQLBuilder: sqlBuilderApp,
SQLExecutor: sqlExecutor,
Clock: clock,
}
reindexedTimestamps := NewReindexedTimestamps()
reindexer := &Reindexer{
Clock: clock,
Handle: handle,
AppID: appID,
Users: store,
OAuth: oauthStore,
LoginID: loginidStore,
RolesGroups: rolesgroupsStore,
ReindexedTimestamps: reindexedTimestamps,
}
return reindexer
}
var (
_wireSystemClockValue = clock.NewSystemClock()
)