Upstream sync

This commit is contained in:
Senad Uka
2018-05-19 10:15:27 +02:00
parent cf5b94edcc
commit 157b23da3c
14 changed files with 276 additions and 35 deletions

View File

@@ -28,6 +28,7 @@ type Conn struct {
notification *notificationRepo
profile *profileRepo
organization *organizationRepo
zipcodes *zipcodeRepo
}
// Begin starts a transaction
@@ -80,6 +81,10 @@ func (c *Conn) Organization() contract.OrganizationRepo {
return c.organization
}
func (c *Conn) Zipcodes() contract.ZipcodeRepo{
return c.zipcodes
}
// Instance returns an instance of a DataManager
func Instance(cfg *config.Config) (contract.DataManager, error) {
once.Do(func() {
@@ -111,6 +116,7 @@ func Instance(cfg *config.Config) (contract.DataManager, error) {
instance.notification = newNotificationRepo(db)
instance.profile = newProfileRepo(db)
instance.organization = newOrganizationRepo(db)
instance.zipcodes = newZipcodeRepo(db)
})
return instance, connErr