upadted to 1.24.0; fixed stb and spiddped doubles in precene
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package handler
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
|
||||
"github.com/iancoleman/strcase"
|
||||
"github.com/spf13/viper"
|
||||
|
||||
"git.amok.space/yevhen/resource-scraper/pkg/service"
|
||||
@@ -16,14 +19,13 @@ func New(services *service.Service) *Handler {
|
||||
}
|
||||
|
||||
func (h *Handler) InitConsole() string {
|
||||
switch viper.GetString(constant.CfgKeyScopeEnable) {
|
||||
case constant.ScopeRuTracker:
|
||||
return h.rutracker()
|
||||
case constant.ScopePrescene:
|
||||
return h.prescene()
|
||||
}
|
||||
methodName := strcase.ToCamel(viper.GetString(constant.FlagScopeEnable))
|
||||
|
||||
return "no scope chosen"
|
||||
immutable := reflect.ValueOf(h)
|
||||
method := immutable.MethodByName(methodName)
|
||||
v := method.Call(nil)
|
||||
|
||||
return methodName + " launched, " + v[0].String() + "\n"
|
||||
}
|
||||
|
||||
func (h *Handler) InitRoutes() string {
|
||||
|
||||
Reference in New Issue
Block a user