initial commit 2
This commit is contained in:
33
application/tncservice/tncservice.go
Normal file
33
application/tncservice/tncservice.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package tncservice
|
||||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"bitbucket.org/nemt/nemt-portal-api/application/entitymapping"
|
||||
"bitbucket.org/nemt/nemt-portal-api/application/notificationservice"
|
||||
"bitbucket.org/nemt/nemt-portal-api/domain/service"
|
||||
"bitbucket.org/nemt/nemt-portal-api/infra/config"
|
||||
)
|
||||
|
||||
var (
|
||||
instance *Service
|
||||
once sync.Once
|
||||
)
|
||||
|
||||
// Service holds the domain service repositories
|
||||
type Service struct {
|
||||
Lyft *lyftService
|
||||
LyftProd *lyftService
|
||||
}
|
||||
|
||||
// New returns a new domain Service instance
|
||||
func New(svc *service.Service, mapper *entitymapping.Mapper, cfg *config.Config, notificationService *notificationservice.Service) *Service {
|
||||
once.Do(func() {
|
||||
instance = &Service{
|
||||
Lyft: newLyftService(svc, mapper, cfg, notificationService),
|
||||
LyftProd: newLyftProdService(svc, mapper, cfg, notificationService),
|
||||
}
|
||||
})
|
||||
|
||||
return instance
|
||||
}
|
||||
Reference in New Issue
Block a user