preset scraper added

This commit is contained in:
2024-09-10 15:57:48 +03:00
parent bfdfc634e4
commit 0ecf0ddec1
38 changed files with 790 additions and 167 deletions

View File

@@ -5,16 +5,15 @@ import (
"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"
"git.amok.space/yevhen/resource-scraper/types/constant"
)
func Bootstrap() {
config.New()
//https://ahmadrosid.com/blog/how-to-query-html-dom-in-golang
dbase := db.New()
repos := repository.New(dbase)
@@ -22,10 +21,12 @@ func Bootstrap() {
handlers := handler.New(services)
switch viper.GetString("role") {
case types.RoleConsole:
case constant.RoleConsole:
fmt.Printf("init console console: %s\n", handlers.InitConsole())
break
case constant.RoleWeb:
fmt.Printf("who: %s\n", handlers.InitRoutes())
///http.Run()
break
}
///http.Run()
}