-
Notifications
You must be signed in to change notification settings - Fork 14
/
social.go
38 lines (32 loc) · 973 Bytes
/
social.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
package registry
import (
"github.com/sarulabs/di"
"github.com/coretrix/hitrix/service"
"github.com/coretrix/hitrix/service/component/config"
"github.com/coretrix/hitrix/service/component/social"
)
func ServiceProviderGoogleSocial() *service.DefinitionGlobal {
return &service.DefinitionGlobal{
Name: service.GoogleService,
Build: func(ctn di.Container) (interface{}, error) {
return &social.Google{}, nil
},
}
}
func ServiceProviderFacebookSocial() *service.DefinitionGlobal {
return &service.DefinitionGlobal{
Name: service.FacebookService,
Build: func(ctn di.Container) (interface{}, error) {
return &social.Facebook{}, nil
},
}
}
func ServiceProviderAppleSocial() *service.DefinitionGlobal {
return &service.DefinitionGlobal{
Name: service.AppleService,
Build: func(ctn di.Container) (interface{}, error) {
configService := ctn.Get(service.ConfigService).(config.IConfig)
return social.NewAppleSocial(configService)
},
}
}