Beispiel #1
0
// NewSavedItemsRepo will attempt to connect to to MySQL and
// return a SavedItemsRepo implementation.
func NewSavedItemsRepo(cfg *mysql.Config) (SavedItemsRepo, error) {
	db, err := cfg.DB()
	if err != nil {
		return nil, err
	}
	return &MySQLSavedItemsRepo{db}, nil
}
Beispiel #2
0
func NewMySQLDataRepo(cfg *mysql.Config) (DataRepo, error) {
	db, err := cfg.DB()
	return &MySQLDataRepo{db}, err
}