resource-scraper/internal/bootstrap.go

32 lines
697 B
Go

package scraper
import (
"fmt"
"github.com/spf13/viper"
"git.amok.space/yevhen/resource-scraper/internal/config"
"git.amok.space/yevhen/resource-scraper/internal/db"
"git.amok.space/yevhen/resource-scraper/pkg/handler"
"git.amok.space/yevhen/resource-scraper/pkg/repository"
"git.amok.space/yevhen/resource-scraper/pkg/service"
"git.amok.space/yevhen/resource-scraper/types"
)
func Bootstrap() {
config.New()
dbase := db.New()
repos := repository.New(dbase)
services := service.New(repos)
handlers := handler.New(services)
switch viper.GetString("role") {
case types.RoleConsole:
fmt.Printf("init console console: %s\n", handlers.InitConsole())
break
}
///http.Run()
}