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

@@ -1,7 +1,10 @@
package handler
import (
"github.com/spf13/viper"
"git.amok.space/yevhen/resource-scraper/pkg/service"
"git.amok.space/yevhen/resource-scraper/types/constant"
)
type Handler struct {
@@ -13,16 +16,17 @@ func New(services *service.Service) *Handler {
}
func (h *Handler) InitConsole() string {
return h.rutracker()
switch viper.GetString(constant.CfgKeyScopeEnable) {
case constant.ScopeRuTracker:
return h.rutracker()
case constant.ScopePrescene:
return h.prescene()
}
return "no scope chosen"
}
//func (h *Handler) Base(services *service.Service) *Handler {
// return &Handler{services: services}
//}
//func (h *Handler) InitApi() *chi.Mux {
// api := chi.NewRouter()
// api.Get("/", web.ApiFallbackHandler)
//
// return api
//}
func (h *Handler) InitRoutes() string {
//TODO:
return "i am the web initiator"
}