Last active
July 22, 2019 12:16
-
-
Save jfeng45/377bf028dad94ec0e839a57ba424e1bb to your computer and use it in GitHub Desktop.
get cache factory from registry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sqlUserDataServiceFactory is a empty receiver for Build method | |
type sqlUserDataServiceFactory struct{} | |
func (sudsf *sqlUserDataServiceFactory) Build(c container.Container, dataConfig *config.DataConfig) | |
(dataservice.UserDataInterface, error) { | |
dsc := dataConfig.DataStoreConfig | |
dsi, err := datastorefactory.GetDataStoreFb(dsc.Code).Build(c, &dsc) | |
if err != nil { | |
return nil, errors.Wrap(err, "") | |
} | |
ds := dsi.(gdbc.SqlGdbc) | |
uds := sqldb.UserDataSql{DB: ds} | |
logger.Log.Debug("uds:", uds.DB) | |
return &uds, nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment