24 lines
359 B
Go
24 lines
359 B
Go
package repository
|
|
|
|
import (
|
|
"github.com/jmoiron/sqlx"
|
|
"github.com/spf13/viper"
|
|
|
|
"git.amok.space/yevhen/resource-scraper/types"
|
|
)
|
|
|
|
type Repository struct {
|
|
types.Rutracker
|
|
}
|
|
|
|
func New(db *sqlx.DB) *Repository {
|
|
switch viper.GetString("scope") {
|
|
case types.RuTracker:
|
|
return &Repository{
|
|
Rutracker: NewRutracker(db),
|
|
}
|
|
}
|
|
|
|
return &Repository{}
|
|
}
|