Procházet zdrojové kódy

SVI Переделка на новую архитектуру

SVI před 1 rokem
rodič
revize
680ffe9df4
80 změnil soubory, kde provedl 375 přidání a 2958 odebrání
  1. 3 5
      cmd/server/main.go
  2. 0 3
      go.mod
  3. 0 6
      go.sum
  4. 6 7
      pkg/arena/arena.go
  5. 3 3
      pkg/arena/arena_context/arena_context.go
  6. 3 3
      pkg/arena/arena_string/arena_string.go
  7. 2 2
      pkg/components/arena_net/arena_net.go
  8. 2 2
      pkg/components/arena_net/http_worker/http_worker.go
  9. 2 3
      pkg/components/arena_net/http_worker/net_stat/net_stat.go
  10. 1 1
      pkg/components/arena_net/scene_web_worker/scene_web_worker.go
  11. 1 1
      pkg/components/wrag/wrag.go
  12. 2 2
      pkg/helpers/helpers.go
  13. 3 3
      pkg/helpers/helpers_test.go
  14. 4 4
      pkg/kernel/kernel_ctx/kernel_keeper/kernel_keeper.go
  15. 3 3
      pkg/kernel/kernel_ctx/kernel_wg/kernel_wg.go
  16. 37 0
      pkg/kernel/kernel_dict/kernel_dict.go
  17. 2 4
      pkg/kernel/kernel_log/logger.go
  18. 6 6
      pkg/kernel/kernel_serv_http/kernel_serv_http.go
  19. 6 6
      pkg/kernel/kernel_store/kernel_store.go
  20. 1 4
      pkg/kernel/kernel_types/ikernel_ctx.go
  21. 2 2
      pkg/kernel/kernel_types/ikernel_server_http.go
  22. 13 13
      pkg/mock/mock_env/mock_env.go
  23. 2 0
      run_dev.sh
  24. 2 8
      server/lev0/types/iweb_server.go
  25. 4 2
      server/lev2/serv_bots/dict_warbot/dict_warbot.go
  26. 2 3
      server/lev2/serv_bots/serv_bots.go
  27. 15 15
      server/lev2/serv_bots/warbot/angar/angar.go
  28. 9 9
      server/lev2/serv_bots/warbot/angar/base/arsenal/arsenal.go
  29. 5 6
      server/lev2/serv_bots/warbot/angar/base/bank/bank.go
  30. 3 3
      server/lev2/serv_bots/warbot/angar/base/bank/bank_mode/bank_mode.go
  31. 1 2
      server/lev2/serv_bots/warbot/angar/base/base.go
  32. 4 5
      server/lev2/serv_bots/warbot/angar/base/fuel/fuel.go
  33. 3 4
      server/lev2/serv_bots/warbot/angar/base/market/market.go
  34. 8 9
      server/lev2/serv_bots/warbot/angar/base/mine/mine.go
  35. 5 5
      server/lev2/serv_bots/warbot/angar/base/polygon/polygon.go
  36. 1 2
      server/lev2/serv_bots/warbot/angar/battle/battle.go
  37. 1 2
      server/lev2/serv_bots/warbot/angar/battle/battle_register/battle_register.go
  38. 1 2
      server/lev2/serv_bots/warbot/angar/battle/battle_wait/battle_wait.go
  39. 4 5
      server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker.go
  40. 1 2
      server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker/battle_worker.go
  41. 20 19
      server/lev2/serv_bots/warbot/angar/bot_net_stat/net_stat.go
  42. 3 4
      server/lev2/serv_bots/warbot/angar/convoy/convoy.go
  43. 3 3
      server/lev2/serv_bots/warbot/angar/death_match/death_worker/death_worker.go
  44. 2 2
      server/lev2/serv_bots/warbot/angar/division/div_war/div_war.go
  45. 2 2
      server/lev2/serv_bots/warbot/angar/division/divwar/divwar.go
  46. 3 3
      server/lev2/serv_bots/warbot/angar/fuel/fuel.go
  47. 1 2
      server/lev2/serv_bots/warbot/angar/fuel_attack/fuel_attack.go
  48. 3 3
      server/lev2/serv_bots/warbot/angar/masters/bat_masters.go
  49. 1 2
      server/lev2/serv_bots/warbot/angar/missions/missions.go
  50. 1 1
      server/lev2/serv_bots/warbot/angar/tank_params/tank_params.go
  51. 4 9
      server/lev2/serv_bots/warbot/bot_stat/stat_param/stat_param.go
  52. 5 5
      server/lev2/serv_bots/warbot/bot_stat/stat_resurs/stat_resurs.go
  53. 68 0
      server/lev2/serv_bots/warbot/bot_stat/tank_stat/tank_stat.go
  54. 0 70
      server/lev2/serv_bots/warbot/stat_tank/tank_stat.go
  55. 14 5
      server/lev2/serv_bots/warbot/warbot.go
  56. 2 2
      server/lev2/serv_bots/warbot/warbot_net/warbot_net.go
  57. 13 113
      server/lev2/serv_web/serv_web.go
  58. 35 36
      server/lev2/serv_web/web_api/web_api.go
  59. 13 13
      server/lev2/serv_web/web_gui/web_gui.go
  60. 9 3
      server/server.go
  61. 0 33
      vendor/github.com/gofiber/template/.gitignore
  62. 0 232
      vendor/github.com/gofiber/template/.golangci.yml
  63. 0 21
      vendor/github.com/gofiber/template/LICENSE
  64. 0 243
      vendor/github.com/gofiber/template/README.md
  65. 0 21
      vendor/github.com/gofiber/template/html/v2/LICENSE
  66. 0 210
      vendor/github.com/gofiber/template/html/v2/README.md
  67. 0 582
      vendor/github.com/gofiber/template/html/v2/TEMPLATES_CHEATSHEET.md
  68. 0 174
      vendor/github.com/gofiber/template/html/v2/html.go
  69. 0 129
      vendor/github.com/gofiber/template/template.go
  70. 0 21
      vendor/github.com/gofiber/utils/LICENSE
  71. 0 87
      vendor/github.com/gofiber/utils/README.md
  72. 0 62
      vendor/github.com/gofiber/utils/assertions.go
  73. 0 78
      vendor/github.com/gofiber/utils/bytes.go
  74. 0 83
      vendor/github.com/gofiber/utils/common.go
  75. 0 104
      vendor/github.com/gofiber/utils/convert.go
  76. 0 110
      vendor/github.com/gofiber/utils/file.go
  77. 0 212
      vendor/github.com/gofiber/utils/http.go
  78. 0 13
      vendor/github.com/gofiber/utils/integer.go
  79. 0 70
      vendor/github.com/gofiber/utils/strings.go
  80. 0 9
      vendor/modules.txt

+ 3 - 5
cmd/server/main.go

@@ -13,14 +13,13 @@ import (
 	_ "net/http/pprof"
 	"os"
 	"time"
-	"wartank/pkg/kernel/kernel_ctx"
+
 	"wartank/pkg/kernel/kernel_log"
 	"wartank/server"
 )
 
 func profile() {
-	конт := kernel_ctx.ПолучЯдроКонтекст()
-	лог := kernel_log.НовЛоггер(конт, "Профиль")
+	лог := kernel_log.НовЛоггер("ПРОФИЛЬ")
 	port := "29081"
 	stage := os.Getenv("STAGE")
 	if stage == "prod" {
@@ -45,8 +44,7 @@ var (
 )
 
 func main() {
-	конт := kernel_ctx.ПолучЯдроКонтекст()
-	лог := kernel_log.НовЛоггер(конт, "main")
+	лог := kernel_log.НовЛоггер("main")
 	лог.Инфо("main():\n\tgo = %v\n\tvers = %v\n\tdate = %v\n", GoVersion, Version, Date)
 	go profile()
 	сервер := server.НовСервер()

+ 0 - 3
go.mod

@@ -6,7 +6,6 @@ require (
 	github.com/charmbracelet/bubbletea v1.3.3
 	github.com/dgraph-io/badger/v4 v4.5.1
 	github.com/gofiber/fiber/v2 v2.52.6
-	github.com/gofiber/template/html/v2 v2.1.3
 	github.com/sirupsen/logrus v1.9.3
 )
 
@@ -21,8 +20,6 @@ require (
 	github.com/dgraph-io/ristretto/v2 v2.1.0 // indirect
 	github.com/dustin/go-humanize v1.0.1 // indirect
 	github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
-	github.com/gofiber/template v1.8.3 // indirect
-	github.com/gofiber/utils v1.1.0 // indirect
 	github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
 	github.com/google/flatbuffers v25.2.10+incompatible // indirect
 	github.com/google/uuid v1.6.0 // indirect

+ 0 - 6
go.sum

@@ -37,12 +37,6 @@ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6
 github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
 github.com/gofiber/fiber/v2 v2.52.6 h1:Rfp+ILPiYSvvVuIPvxrBns+HJp8qGLDnLJawAu27XVI=
 github.com/gofiber/fiber/v2 v2.52.6/go.mod h1:YEcBbO/FB+5M1IZNBP9FO3J9281zgPAreiI1oqg8nDw=
-github.com/gofiber/template v1.8.3 h1:hzHdvMwMo/T2kouz2pPCA0zGiLCeMnoGsQZBTSYgZxc=
-github.com/gofiber/template v1.8.3/go.mod h1:bs/2n0pSNPOkRa5VJ8zTIvedcI/lEYxzV3+YPXdBvq8=
-github.com/gofiber/template/html/v2 v2.1.3 h1:n1LYBtmr9C0V/k/3qBblXyMxV5B0o/gpb6dFLp8ea+o=
-github.com/gofiber/template/html/v2 v2.1.3/go.mod h1:U5Fxgc5KpyujU9OqKzy6Kn6Qup6Tm7zdsISR+VpnHRE=
-github.com/gofiber/utils v1.1.0 h1:vdEBpn7AzIUJRhe+CiTOJdUcTg4Q9RK+pEa0KPbLdrM=
-github.com/gofiber/utils v1.1.0/go.mod h1:poZpsnhBykfnY1Mc0KeEa6mSHrS3dV0+oBWyeQmb2e0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 h1:f+oWsMOmNPc8JmEHVZIycC7hBoQxHH9pNKQORJNozsQ=

+ 6 - 7
pkg/arena/arena.go

@@ -10,7 +10,6 @@ import (
 	"wartank/pkg/arena/arena_string"
 	"wartank/pkg/arena/down_time"
 	. "wartank/pkg/helpers"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -25,11 +24,11 @@ type АренаКонфиг struct {
 
 // Контролирует правильность параметров
 func (конф *АренаКонфиг) контроль() {
-	ПроверТверд(конф.СтрКонтроль_ == "", "АренаКонфиг.СтрКонтроль_ == \"\"")
-	ПроверТверд(конф.ФнПуск_ == nil, "АренаКонфиг.ФнПуск_ == nil")
-	ПроверТверд(конф.Бот_ == nil, "АренаКонфиг.Бот_ == nil")
-	ПроверТверд(конф.АренаИмя_ == "", "АренаКонфиг.СценаИмя_ == \"\"")
-	ПроверТверд(конф.СтрУрл_ == "", "АренаКонфиг.СтрУрл_ == \"\"")
+	Паника(конф.СтрКонтроль_ == "", "АренаКонфиг.СтрКонтроль_ == \"\"")
+	Паника(конф.ФнПуск_ == nil, "АренаКонфиг.ФнПуск_ == nil")
+	Паника(конф.Бот_ == nil, "АренаКонфиг.Бот_ == nil")
+	Паника(конф.АренаИмя_ == "", "АренаКонфиг.СценаИмя_ == \"\"")
+	Паника(конф.СтрУрл_ == "", "АренаКонфиг.СтрУрл_ == \"\"")
 }
 
 // Арена -- арена игры
@@ -42,7 +41,7 @@ type Арена struct {
 }
 
 // НовАрена -- возвращает новую арену игры
-func НовАрена(конт ИЯдроКонтекст, конф АренаКонфиг) *Арена {
+func НовАрена(конт ИБотКонтекст, конф АренаКонфиг) *Арена {
 	log.Printf("НовАрена(): стрКонтроль=%q\n", конф.СтрКонтроль_)
 	конф.контроль()
 	аренаКонтекст := arena_context.НовАренаКонтекст(конт, конф.Бот_, конф.АренаИмя_)

+ 3 - 3
pkg/arena/arena_context/arena_context.go

@@ -25,9 +25,9 @@ type АренаКонтекст struct {
 }
 
 // НовАренаКонтекст -- возвращает новый контекст арены
-func НовАренаКонтекст(конт ИЯдроКонтекст, бот ИБот, сценаИмя alias.АренаИмя) *АренаКонтекст {
-	ПроверТверд(конт != nil, "НовАренаКонтекст(): ИЯдроКонтекст==пусто")
-	лог := kernel_log.НовЛоггер(конт, "АренаКонтекст "+string(сценаИмя))
+func НовАренаКонтекст(конт ИБотКонтекст, бот ИБот, сценаИмя alias.АренаИмя) *АренаКонтекст {
+	Паника(конт != nil, "НовАренаКонтекст(): ИЯдроКонтекст==пусто")
+	лог := kernel_log.НовЛоггер("АренаКонтекст " + string(сценаИмя))
 	лог.Инфо("НовАренаКонтекст() " + string(сценаИмя) + "\n")
 	лог.Паника(бот == nil, "НовАренаКонтекст(): ИБот==nil")
 	лог.Паника(сценаИмя == "", "НовАренаКонтекст(): сценаИмя не задано")

+ 3 - 3
pkg/arena/arena_string/arena_string.go

@@ -6,7 +6,7 @@ import (
 	"strings"
 	"sync"
 	"wartank/pkg/kernel/kernel_log"
-	. "wartank/pkg/kernel/kernel_types"
+	. "wartank/server/lev0/types"
 )
 
 // АренаСтроки -- потокобезопасный список строк арены
@@ -17,8 +17,8 @@ type АренаСтроки struct {
 }
 
 // НовАренаСтроки -- возвращает новый потокобезопасный список строк арены
-func НовАренаСтроки(конт ИЯдроКонтекст, strControl string) *АренаСтроки {
-	лог := kernel_log.НовЛоггер(конт, "АренаСтроки")
+func НовАренаСтроки(конт ИБотКонтекст, strControl string) *АренаСтроки {
+	лог := kernel_log.НовЛоггер("АренаСтроки")
 	лог.Отладка("НовАренаСтроки(): strControl=%q", strControl)
 	лог.Паника(strControl == "", "НовАренаСтроки(): strControl is empty")
 	сам := &АренаСтроки{

+ 2 - 2
pkg/components/arena_net/arena_net.go

@@ -22,8 +22,8 @@ type АренаСеть struct {
 }
 
 // НовАренаСеть -- возвращает новый *АренаСеть
-func НовАренаСеть(конт ИЯдроКонтекст, сцена ИСценаСтр, стрУрл string) *АренаСеть {
-	лог := kernel_log.НовЛоггер(конт, "АренаСеть")
+func НовАренаСеть(конт ИБотКонтекст, сцена ИСценаСтр, стрУрл string) *АренаСеть {
+	лог := kernel_log.НовЛоггер("АренаСеть")
 	лог.Инфо("НовАренаСеть(): strUrl=%q\n", стрУрл)
 	лог.Паника(сцена == nil, "НовАренаСеть(): ИСценаСтр == nil")
 	лог.Паника(стрУрл == "", "НовАренаСеть(): стрУрл пустой\n")

+ 2 - 2
pkg/components/arena_net/http_worker/http_worker.go

@@ -28,8 +28,8 @@ type ХттпВоркер struct {
 }
 
 // НовХттпВоркер -- возвращает веб-воркера бота
-func НовХттпВоркер(конт ИЯдроКонтекст, botNet ИБотСеть, conn *http.Client) *ХттпВоркер {
-	лог := kernel_log.НовЛоггер(конт, "ХттпВоркер")
+func НовХттпВоркер(конт ИБотКонтекст, botNet ИБотСеть, conn *http.Client) *ХттпВоркер {
+	лог := kernel_log.НовЛоггер("ХттпВоркер")
 	лог.Инфо("НовХттпВоркер()\n")
 	сам := &ХттпВоркер{
 		botNet:     botNet,

+ 2 - 3
pkg/components/arena_net/http_worker/net_stat/net_stat.go

@@ -6,7 +6,6 @@ import (
 	"time"
 
 	"wartank/pkg/kernel/kernel_log"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -28,8 +27,8 @@ type СетьСтата struct {
 }
 
 // НовСетьСтата -- возвращает новый *NetStat
-func НовСетьСтата(конт ИЯдроКонтекст, botNet ИБотСеть) *СетьСтата {
-	лог := kernel_log.НовЛоггер(конт, "СетьСтата")
+func НовСетьСтата(конт ИБотКонтекст, botNet ИБотСеть) *СетьСтата {
+	лог := kernel_log.НовЛоггер("СетьСтата")
 	лог.Инфо("НовСетьСтата()\n")
 	сам := &СетьСтата{
 		botNet: botNet,

+ 1 - 1
pkg/components/arena_net/scene_web_worker/scene_web_worker.go

@@ -23,7 +23,7 @@ type СценаВебВоркер struct {
 
 // НовСценаВебВоркер -- возвращает сетевого клиента
 func НовСценаВебВоркер(конт ИЯдроКонтекст, ботСеть ИБотСеть) *СценаВебВоркер {
-	лог := kernel_log.НовЛоггер(конт, "СценаВебВоркер")
+	лог := kernel_log.НовЛоггер("СценаВебВоркер")
 	лог.Инфо("НовСценаВебВоркер()\n")
 	сам := &СценаВебВоркер{
 		ботСеть:   ботСеть,

+ 1 - 1
pkg/components/wrag/wrag.go

@@ -21,7 +21,7 @@ type Враг struct {
 
 // НовВраг -- возвращает новый объект врага
 func НовВраг(конт ИЯдроКонтекст, app ИСервер, lstBattle []string) *Враг {
-	лог := kernel_log.НовЛоггер(конт, "Враг")
+	лог := kernel_log.НовЛоггер("Враг")
 	лог.Отладка("НовВраг()\n")
 	сам := &Враг{
 		сервер: app,

+ 2 - 2
pkg/helpers/helpers.go

@@ -25,8 +25,8 @@ func Провер(isCond bool, msgFormat string, args ...interface{}) {
 	fmt.Print(msg)
 }
 
-// ПроверТверд -- проверка на правильность утверждения с безусловным падением в панику (hard assert)
-func ПроверТверд(isCond bool, msgFormat string, args ...interface{}) {
+// Паника -- проверка на правильность утверждения с безусловным падением в панику (hard assert)
+func Паника(isCond bool, msgFormat string, args ...interface{}) {
 	if isCond {
 		return
 	}

+ 3 - 3
pkg/helpers/helpers_test.go

@@ -50,7 +50,7 @@ func (sf *tester) hassert() {
 // Мягкая ТВЁРДАЯ проверка на ок
 func (sf *tester) hassertProdGood1() {
 	sf.t.Log("hassertProdGood1")
-	ПроверТверд(true, "tra-la-la")
+	Паника(true, "tra-la-la")
 }
 
 // Твёрдая проверка
@@ -66,7 +66,7 @@ func (sf *tester) hassertProd() {
 			sf.t.Fatalf("assertLocal(): panic==nil")
 		}
 	}()
-	ПроверТверд(false, "tra-la-la")
+	Паника(false, "tra-la-la")
 }
 
 // ТВЁРДАЯ проверка
@@ -77,7 +77,7 @@ func (sf *tester) hassertLocal() {
 			sf.t.Fatalf("assertLocal(): panic==nil")
 		}
 	}()
-	ПроверТверд(false, "tra-la-la")
+	Паника(false, "tra-la-la")
 }
 
 //========================================================================

+ 4 - 4
pkg/kernel/kernel_ctx/kernel_keeper/kernel_keeper.go

@@ -29,9 +29,9 @@ func GetKernelKeeper(ctx context.Context, fnCancel func(), wg IKernelWg) *kernel
 	if kernKeep != nil {
 		return kernKeep
 	}
-	ПроверТверд(ctx != nil, "NewKernelCtx(): ctx==nil")
-	ПроверТверд(wg != nil, "NewKernelCtx(): IKernelWg==nil")
-	ПроверТверд(fnCancel != nil, "NewKernelCtx(): fnCancel==nil")
+	Паника(ctx != nil, "NewKernelCtx(): ctx==nil")
+	Паника(wg != nil, "NewKernelCtx(): IKernelWg==nil")
+	Паника(fnCancel != nil, "NewKernelCtx(): fnCancel==nil")
 	sf := &kernelKeeper{
 		ctx:      ctx,
 		fnCancel: fnCancel,
@@ -39,7 +39,7 @@ func GetKernelKeeper(ctx context.Context, fnCancel func(), wg IKernelWg) *kernel
 		chSys_:   make(chan os.Signal, 2),
 	}
 	err := sf.wg.Add("kernel_keeper")
-	ПроверТверд(err == nil, "NewKernelCtx(): in add stream kernel keeper in IKernelWg, err=\n\t%v,err")
+	Паника(err == nil, "NewKernelCtx(): in add stream kernel keeper in IKernelWg, err=\n\t%v,err")
 
 	go sf.run(sf.chSys_)
 	kernKeep = sf

+ 3 - 3
pkg/kernel/kernel_ctx/kernel_wg/kernel_wg.go

@@ -34,7 +34,7 @@ func GetKernelWg(ctx context.Context) IKernelWg {
 	if kernWg != nil {
 		return kernWg
 	}
-	ПроверТверд(ctx != nil, "GetKernelWg(): ctx==nil")
+	Паника(ctx != nil, "GetKernelWg(): ctx==nil")
 	сам := &ядроОп{
 		ctx:          ctx,
 		dictStream:   map[AStreamName]bool{},
@@ -95,9 +95,9 @@ func (сам *ядроОп) Add(name AStreamName) error {
 	if !сам.еслиРаботает.Получ() {
 		return fmt.Errorf("ядроОп.Add(): stream=%v, work end", name)
 	}
-	ПроверТверд(name != "", "ядроОп.Add(): name stream is empty")
+	Паника(name != "", "ядроОп.Add(): name stream is empty")
 	_, isOk := сам.dictStream[name]
-	ПроверТверд(!isOk, "ядроОп.Add(): stream '%v' already exists", name)
+	Паника(!isOk, "ядроОп.Add(): stream '%v' already exists", name)
 	сам.dictStream[name] = true
 	return nil
 }

+ 37 - 0
pkg/kernel/kernel_dict/kernel_dict.go

@@ -0,0 +1,37 @@
+// package kernel_dict -- потокобезопасный автономный словарь
+package kernel_dict
+
+import (
+	"sync"
+
+	. "wartank/pkg/kernel/kernel_types"
+)
+
+// ЯдроСловаря -- потокобезопасный автономный словарь
+type ЯдроСловарь struct {
+	dictVal map[string]interface{} // Словарь различных значений
+	block   sync.RWMutex
+}
+
+// НовЯдроСловарь -- возвращает новый потокобезопасный автономный словарь
+func НовЯдроСловарь() *ЯдроСловарь {
+	sf := &ЯдроСловарь{
+		dictVal: map[string]interface{}{},
+	}
+	_ = ИЯдроСловарь(sf)
+	return sf
+}
+
+// Получ -- возвращает хранимое значение
+func (sf *ЯдроСловарь) Получ(key string) interface{} {
+	sf.block.RLock()
+	defer sf.block.RUnlock()
+	return sf.dictVal[key]
+}
+
+// Уст -- устанавливает значение в контекст
+func (sf *ЯдроСловарь) Уст(key string, val interface{}) {
+	sf.block.Lock()
+	defer sf.block.Unlock()
+	sf.dictVal[key] = val
+}

+ 2 - 4
pkg/kernel/kernel_log/logger.go

@@ -5,7 +5,6 @@ import (
 	"fmt"
 	"sync"
 
-	. "wartank/pkg/helpers"
 	. "wartank/pkg/kernel/kernel_types"
 )
 
@@ -15,10 +14,9 @@ type Логгер struct {
 	префикс string
 }
 
-func НовЛоггер(конт ИЯдроСловарь) *Логгер {
-	ПроверТверд(конт != nil, "НовЯдроЛог(): ИЯдроСловарь==пусто")
+func НовЛоггер(префикс string) *Логгер {
 	сам := &Логгер{
-		префикс: конт.Получ("префикс").(string),
+		префикс: префикс,
 	}
 	_ = ИЯдроЛог(сам)
 	return сам

+ 6 - 6
pkg/kernel/kernel_serv_http/kernel_serv_http.go

@@ -41,7 +41,7 @@ var (
 )
 
 // GetKernelServHttp -- возвращает  встроенный HTTP-сервер
-func GetKernelServHttp(ctx ИЯдроКонтекст) IKernelServerHttp {
+func GetKernelServHttp(ctx ИЯдроКонтекст) ИЯдроСерверВеб {
 	log.Println("NewKernelServHttp()")
 	block.Lock()
 	defer block.Unlock()
@@ -49,13 +49,13 @@ func GetKernelServHttp(ctx ИЯдроКонтекст) IKernelServerHttp {
 		return kernServHttp
 	}
 	strPort := os.Getenv("SERVER_HTTP_PORT")
-	ПроверТверд(strPort != "", "NewKernelServHttp(): env SERVER_HTTP_PORT not set")
+	Паника(strPort != "", "NewKernelServHttp(): env SERVER_HTTP_PORT not set")
 	confFiber := fiber.Config{
-		ServerHeader:      "Server log audit",
+		ServerHeader:      "KernelServerWeb",
 		UnescapePath:      true,
 		ReadTimeout:       time.Second * 15,
 		WriteTimeout:      time.Second * 15,
-		AppName:           "AppServerLogAudit",
+		AppName:           "KernelServerWeb",
 		Network:           "tcp4",
 		EnablePrintRoutes: true,
 	}
@@ -74,9 +74,9 @@ func GetKernelServHttp(ctx ИЯдроКонтекст) IKernelServerHttp {
 		Browse:     true,
 		MaxAge:     3600 * 24,
 	}))
-	sf.fiberApp.Get("/monitor", monitor.New(monitor.Config{Title: "ServerLogAudit"}))
+	sf.fiberApp.Get("/monitor", monitor.New(monitor.Config{Title: "KernelServerWeb"}))
 	err := sf.ctx.Оп().Add(streamName)
-	ПроверТверд(err == nil, "NewKernelServHttp(): in add stream %v, err=\n\t%v", streamName, err)
+	Паника(err == nil, "NewKernelServHttp(): in add stream %v, err=\n\t%v", streamName, err)
 	ctx.Уст("fiberApp", sf.fiberApp)
 	kernServHttp = sf
 	ctx.Уст("kernServHttp", kernServHttp)

+ 6 - 6
pkg/kernel/kernel_store/kernel_store.go

@@ -43,7 +43,7 @@ func GetKernelStore(ctx ИЯдроКонтекст) IKernelStore {
 	if kernStore != nil {
 		return kernStore
 	}
-	ПроверТверд(ctx != nil, "GetKernelStore(): IKernelCtx==nil")
+	Паника(ctx != nil, "GetKernelStore(): IKernelCtx==nil")
 	sf := &kernelStore{
 		ctx:    ctx,
 		wg:     ctx.Оп(),
@@ -114,16 +114,16 @@ func (sf *kernelStore) open() {
 	sf.block.Lock()
 	defer sf.block.Unlock()
 	strPath := os.Getenv("LOCAL_STORE_PATH")
-	ПроверТверд(strPath != "", "kernelStore.open(): env LOCAL_STORE_PATH not set")
+	Паника(strPath != "", "kernelStore.open(): env LOCAL_STORE_PATH not set")
 	pwd, err := os.Getwd()
-	ПроверТверд(err == nil, "kernelStore.open(): in get PWD, err=\n\t%v", err)
+	Паника(err == nil, "kernelStore.open(): in get PWD, err=\n\t%v", err)
 	sf.storePath = pwd + strPath + "/db_local"
 	err = os.MkdirAll(sf.storePath, 0750)
-	ПроверТверд(err == nil, "kernelStore.open(): in make dir %v, err=\n\t%v", sf.storePath, err)
+	Паника(err == nil, "kernelStore.open(): in make dir %v, err=\n\t%v", sf.storePath, err)
 	sf.db, err = badger.Open(badger.DefaultOptions(sf.storePath))
-	ПроверТверд(err == nil, "kernelStore.open(): in open DB %v, err=\n\t%v", sf.storePath, err)
+	Паника(err == nil, "kernelStore.open(): in open DB %v, err=\n\t%v", sf.storePath, err)
 	err = sf.wg.Add(storeStreamName)
-	ПроверТверд(err == nil, "kernelStore.open(): in add name stream to IKernelWg, err=\n\t%v", err)
+	Паника(err == nil, "kernelStore.open(): in add name stream to IKernelWg, err=\n\t%v", err)
 	sf.isWork.Уст()
 	go sf.close()
 	go sf.clean()

+ 1 - 4
pkg/kernel/kernel_types/ikernel_ctx.go

@@ -5,6 +5,7 @@ import "context"
 
 // ИЯдроКонтекст -- интерфейс к контексту ядра
 type ИЯдроКонтекст interface {
+	ИЯдроСловарь
 	// КонтФон -- возвращает неотменяемый контекст ядра
 	КонтФон() context.Context
 	// Конт -- возвращает отменяемы контекст ядра
@@ -13,10 +14,6 @@ type ИЯдроКонтекст interface {
 	Отменить()
 	// Ждать -- ожидает отмены контекста ядра
 	Ждать()
-	// Уст -- добавляет значение в контекст
-	Уст(key string, val interface{})
-	// Получ -- извлекает значение из контекста
-	Получ(key string) interface{}
 	// Оп -- возвращает ожидатель потоков
 	Оп() IKernelWg
 }

+ 2 - 2
pkg/kernel/kernel_types/ikernel_server_http.go

@@ -2,8 +2,8 @@ package kernel_types
 
 import "github.com/gofiber/fiber/v2"
 
-// IKernelServerHttp -- интерфейс к серверу HTTP в ядре
-type IKernelServerHttp interface {
+// ИЯдроСерверВеб -- интерфейс к серверу HTTP в ядре
+type ИЯдроСерверВеб interface {
 	// Run -- запускает сервер в работу (блокирующий вызов; надо для добавления роутов)
 	Run()
 	// Fiber -- возвращает объект веб-приложения fiber

+ 13 - 13
pkg/mock/mock_env/mock_env.go

@@ -24,9 +24,9 @@ func СделатьОкружение() *МокОкружение {
 	sf.путьУст()
 	sf.прочитатьЕнв()
 	err := sf.parseEnv()
-	ПроверТверд(err == nil, "СделатьОкружение(): parseEnv, err=\n\t%v", err)
+	Паника(err == nil, "СделатьОкружение(): parseEnv, err=\n\t%v", err)
 	err = sf.SetAll()
-	ПроверТверд(err == nil, "СделатьОкружение(): SetAll, err=\n\t%v", err)
+	Паника(err == nil, "СделатьОкружение(): SetAll, err=\n\t%v", err)
 	return sf
 }
 
@@ -42,7 +42,7 @@ func (сам *МокОкружение) parseEnv() error {
 			continue
 		}
 		err := сам.парситьЕнвСтр(pair)
-		ПроверТверд(err == nil, "МокОкружение.parseEnv(): in parse str(%v), err=\n\t%w", pair, err)
+		Паника(err == nil, "МокОкружение.parseEnv(): in parse str(%v), err=\n\t%w", pair, err)
 	}
 	return nil
 }
@@ -50,9 +50,9 @@ func (сам *МокОкружение) parseEnv() error {
 // Парсит строку окружения
 func (сам *МокОкружение) парситьЕнвСтр(pair string) error {
 	lstPair := strings.Split(pair, "=")
-	ПроверТверд(len(lstPair) >= 2, "МокОкружение.парситьЕнвСтр(): pair(%v) not have =", pair)
+	Паника(len(lstPair) >= 2, "МокОкружение.парситьЕнвСтр(): pair(%v) not have =", pair)
 	key := lstPair[0]
-	ПроверТверд(key != "", "МокОкружение.парситьЕнвСтр(): in pair(%v) key is empty", pair)
+	Паника(key != "", "МокОкружение.парситьЕнвСтр(): in pair(%v) key is empty", pair)
 	lstVal := lstPair[1:]
 
 	val := ""
@@ -61,7 +61,7 @@ func (сам *МокОкружение) парситьЕнвСтр(pair string)
 	}
 	val = strings.TrimSuffix(val, "=")
 
-	ПроверТверд(val != "", "МокОкружение.parseEnvStr(): in pair(%v) val is empty", pair)
+	Паника(val != "", "МокОкружение.parseEnvStr(): in pair(%v) val is empty", pair)
 	сам.dictEnv[key] = val
 	return nil
 }
@@ -69,14 +69,14 @@ func (сам *МокОкружение) парситьЕнвСтр(pair string)
 // Читает файл переменных окружения
 func (сам *МокОкружение) прочитатьЕнв() {
 	binEnv, err := os.ReadFile(сам.fileName)
-	ПроверТверд(err == nil, "МокОкружение.прочитатьЕнв(): in read %v, err=\n\t%v", сам.fileName, err)
+	Паника(err == nil, "МокОкружение.прочитатьЕнв(): in read %v, err=\n\t%v", сам.fileName, err)
 	сам.strEnv = string(binEnv)
 }
 
 // Устанавливает текущий путь относительно проекта в dev
 func (сам *МокОкружение) путьУст() {
 	dir, err := os.Getwd()
-	ПроверТверд(err == nil, "МокОкружение.путьУст(): in get PWD, err=\n\t%v", err)
+	Паника(err == nil, "МокОкружение.путьУст(): in get PWD, err=\n\t%v", err)
 	lstDir := strings.Split(dir, "/")
 	pwd := ""
 	fileName := ""
@@ -90,11 +90,11 @@ func (сам *МокОкружение) путьУст() {
 			break
 		}
 	}
-	ПроверТверд(isFind, "МокОкружение.путьУст(): not find file .env")
+	Паника(isFind, "МокОкружение.путьУст(): not find file .env")
 	сам.pwd = pwd + "/bin_dev"
 	_ = os.MkdirAll(сам.pwd, 0755)
 	err = os.Chdir(сам.pwd)
-	ПроверТверд(err == nil, "МокОкружение.путьУст(): in set cwd(%v), err=\n\t%v", сам.pwd, err)
+	Паника(err == nil, "МокОкружение.путьУст(): in set cwd(%v), err=\n\t%v", сам.pwd, err)
 	сам.fileName = fileName
 }
 
@@ -109,7 +109,7 @@ func (сам *МокОкружение) SetAll() error {
 	for key, val := range сам.dictEnv {
 		сам.Reset("key")
 		err := os.Setenv(key, val)
-		ПроверТверд(err == nil, "МокОкружение.SetAll(): in set env %v on key %v, err=\n\t%v", key, val, err)
+		Паника(err == nil, "МокОкружение.SetAll(): in set env %v on key %v, err=\n\t%v", key, val, err)
 	}
 	return nil
 }
@@ -123,7 +123,7 @@ func (сам *МокОкружение) СброситьВсё() {
 
 // Reset -- сбрасывает конкретный ключ
 func (сам *МокОкружение) Reset(key string) {
-	ПроверТверд(key != "", "МокОкружение.Reset(): key is empty")
+	Паника(key != "", "МокОкружение.Reset(): key is empty")
 	err := os.Unsetenv(key)
-	ПроверТверд(err == nil, "МокОкружение.Reset(): in reset env %v, err=\n\t%v", key, err)
+	Паника(err == nil, "МокОкружение.Reset(): in reset env %v, err=\n\t%v", key, err)
 }

+ 2 - 0
run_dev.sh

@@ -1,5 +1,7 @@
 export STAGE="local"
 
+export LOCAL_STORE_PATH="/store"
+export SERVER_HTTP_PORT="18100"
 
 cd ./bin_dev
 while true; do

+ 2 - 8
server/lev0/types/iweb_server.go

@@ -1,13 +1,7 @@
 package types
 
-import (
-	"github.com/gofiber/fiber/v2"
-)
-
 // ИВебСервер -- интерфейс к веб-серверу
 type ИВебСервер interface {
-	// Файбер -- возвращает файбер-приложение
-	Файбер() *fiber.App
-	// Сервер -- вохвращает сервер
-	Сервер() ИСервер
+	// КонтБот -- возвращает контекст бота
+	КонтБот() ИБотКонтекст
 }

+ 4 - 2
server/lev2/serv_bots/dict_warbot/dict_warbot.go

@@ -20,6 +20,7 @@ const (
 
 // СловарьБотов -- потокобезопасный словарь ботов
 type СловарьБотов struct {
+	конт    ИЯдроКонтекст
 	сервер  ИСервер
 	хран    IKernelStore
 	словарь map[alias.БотНомер]ИБот
@@ -29,10 +30,11 @@ type СловарьБотов struct {
 
 // НовСловарьБотов -- возвращает новый потокобезопасный словарь ботов
 func НовСловарьБотов(конт ИЯдроКонтекст, сервер ИСервер) *СловарьБотов {
-	лог := kernel_log.НовЛоггер(конт, "СловарьБотов")
+	лог := kernel_log.НовЛоггер("СловарьБотов")
 	лог.Инфо("НовСловарьБотов()\n")
 	лог.Паника(сервер == nil, "НовСловарьБотов(): ИСервер==nil")
 	сам := &СловарьБотов{
+		конт:    конт,
 		сервер:  сервер,
 		хран:    сервер.Получ("kernStore").(IKernelStore),
 		словарь: map[alias.БотНомер]ИБот{},
@@ -109,7 +111,7 @@ func (сам *СловарьБотов) load() {
 		if isOk {
 			continue
 		}
-		bot := warbot.ЗагрузитьВарБот(сам.сервер, number)
+		bot := warbot.ЗагрузитьВарБот(сам.конт, сам.сервер, number)
 		if bot.АвтоИграЕсли() {
 			go bot.Пуск()
 		}

+ 2 - 3
server/lev2/serv_bots/serv_bots.go

@@ -6,7 +6,6 @@ import (
 	"log"
 
 	"wartank/pkg/alias"
-	. "wartank/pkg/helpers"
 	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/dict_warbot"
@@ -21,9 +20,9 @@ type БотоФерма struct {
 }
 
 // НовБотоФерма -- возвращает новый словарь серверных ботов
-func НовБотоФерма(конт ИЯдроКонтекст, серв ИСервер) *БотоФерма {
+func НовБотоФерма(конт ИЯдроКонтекст) *БотоФерма {
 	log.Println("НовБотоФерма()")
-	ПроверТверд(серв != nil, "НовБотоФерма(): ИСервер == nil")
+	серв := конт.Получ("сервер").(ИСервер)
 	сам := &БотоФерма{
 		серв: серв,
 		хран: серв.Получ("kernStore").(IKernelStore),

+ 15 - 15
server/lev2/serv_bots/warbot/angar/angar.go

@@ -10,18 +10,17 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/base"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle"
+	"wartank/server/lev2/serv_bots/warbot/angar/bot_net_stat"
 	"wartank/server/lev2/serv_bots/warbot/angar/convoy"
 	"wartank/server/lev2/serv_bots/warbot/angar/fuel_attack"
 	"wartank/server/lev2/serv_bots/warbot/angar/masters"
 	"wartank/server/lev2/serv_bots/warbot/angar/missions"
-	"wartank/server/lev2/serv_bots/warbot/angar/net_stat"
 	"wartank/server/lev2/serv_bots/warbot/angar/tank_params"
-	"wartank/server/lev2/serv_bots/warbot/stat_resurs"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_resurs"
 )
 
 /*
@@ -41,21 +40,21 @@ type Ангар struct {
 
 	silverOnline ИСтатПарам
 
-	сетьТанкСтат *net_stat.NetStat
+	сетьТанкСтат *bot_net_stat.БотСетьСтат
 	танкПарам    *tank_params.ТанкПараметры
 	словАрена    map[alias.АренаИмя]ИАрена
 	ресурсы      *stat_resurs.СтатРесурсы
 }
 
 // НовАнгар -- возвращает новый *Angar
-func НовАнгар(конт ИЯдроКонтекст, бот ИБот) (*Ангар, error) {
+func НовАнгар(конт ИБотКонтекст, бот ИБот) (*Ангар, error) {
 	танкПарам := tank_params.НовТанкПараметры(бот)
 	сам := &Ангар{
 		бот:           бот,
-		уровень:       static_param.НовСтатПарам("level"),
-		progress:      static_param.НовСтатПарам("progress"),
-		игроковОнлайн: static_param.НовСтатПарам("online"),
-		silverOnline:  static_param.НовСтатПарам("silver_online"),
+		уровень:       stat_param.НовСтатПарам("уровень"),
+		progress:      stat_param.НовСтатПарам("прогресс"),
+		игроковОнлайн: stat_param.НовСтатПарам("онлайн"),
+		silverOnline:  stat_param.НовСтатПарам("серебро онлайн"),
 		танкПарам:     танкПарам,
 		словАрена:     make(map[alias.АренаИмя]ИАрена),
 	}
@@ -66,34 +65,35 @@ func НовАнгар(конт ИЯдроКонтекст, бот ИБот) (*А
 		ФнПуск_:      сам.пуск,
 		СтрУрл_:      "https://wartank.ru/angar",
 	}
+	конт.Уст("ангар", сам)
 	сам.ИАрена = arena.НовАрена(конт, аренаКонф)
 	сам.сеть = arena_net.НовАренаСеть(конт, сам, "https://wartank.ru/angar")
 	var err error
-	топливоБой, err := fuel_attack.НовТопливоБой(сам)
+	топливоБой, err := fuel_attack.НовТопливоБой(конт, сам)
 	if err != nil {
 		return nil, fmt.Errorf("НовАнгар(): in create <AngarAttackNet>, err=\n\t%w", err)
 	}
 	сам.словАрена["топливоБой"] = топливоБой
 	// Статистика
-	сам.сетьТанкСтат = net_stat.NewNetStat(сам.бот)
+	сам.сетьТанкСтат = bot_net_stat.НовБотСетьСтат(конт)
 
 	конвой := convoy.НовКонвой(конт, сам.бот)
 	сам.словАрена["конвой"] = конвой
 	сражение := battle.НовСражение(конт, сам.бот)
 	сам.словАрена["сражение"] = сражение
-	битваМастеров := masters.НовБитваМастеров(сам.бот)
+	битваМастеров := masters.НовБитваМастеров(конт, сам.бот)
 	сам.словАрена["битваМастеров"] = битваМастеров
 	база, err := base.НовБаза(конт, сам)
 	if err != nil {
 		return nil, fmt.Errorf("НовАнгар(): in make IBase, err=\n\t%w", err)
 	}
 	сам.словАрена["база"] = база
-	миссии, err := missions.НовМиссии(сам.бот)
+	миссии, err := missions.НовМиссии(конт, сам.бот)
 	if err != nil {
 		return nil, fmt.Errorf("НовАнгар(): in make *Missions, err=\n\t%w", err)
 	}
 	сам.словАрена["миссии"] = миссии
-	сам.ресурсы = stat_resurs.НовСтатРесурсы(сам)
+	сам.ресурсы = stat_resurs.НовСтатРесурсы(конт, сам)
 	_ = ИАнгар(сам)
 	return сам, nil
 }

+ 9 - 9
server/lev2/serv_bots/warbot/angar/base/arsenal/arsenal.go

@@ -15,7 +15,7 @@ import (
 	"wartank/pkg/kernel/kernel_log"
 	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 const (
@@ -46,20 +46,20 @@ type Арсенал struct {
 }
 
 // НовАрсенал -- возвращает новый *Arsenal
-func НовАрсенал(конт ИЯдроКонтекст, база ИБаза) (ИАрсенал, error) {
-	лог := kernel_log.НовЛоггер(конт, "Арсенал")
+func НовАрсенал(конт ИБотКонтекст, база ИБаза) (ИАрсенал, error) {
+	лог := kernel_log.НовЛоггер("Арсенал")
 	лог.Инфо("НовАрсенал()\n")
 
 	кнт, фнОтмена := context.WithCancel(база.Контекст())
 	сам := &Арсенал{
 		бот:        база.Бот(),
 		база:       база,
-		фугас:      static_param.НовСтатПарам(стрФугасы),
-		бронебойка: static_param.НовСтатПарам(стрБронебойки),
-		кумулятив:  static_param.НовСтатПарам(стрКумулятивы),
-		ремка:      static_param.НовСтатПарам(стрРемки),
-		уровень:    static_param.НовСтатПарам("уровень"),
-		продуктКол: static_param.НовСтатПарам("свинец"),
+		фугас:      stat_param.НовСтатПарам(стрФугасы),
+		бронебойка: stat_param.НовСтатПарам(стрБронебойки),
+		кумулятив:  stat_param.НовСтатПарам(стрКумулятивы),
+		ремка:      stat_param.НовСтатПарам(стрРемки),
+		уровень:    stat_param.НовСтатПарам("уровень"), // FIXME: это должно быть на уровне арены
+		продуктКол: stat_param.НовСтатПарам("свинец"),
 		кнт:        кнт,
 		фнОтмена:   фнОтмена,
 

+ 5 - 6
server/lev2/serv_bots/warbot/angar/base/bank/bank.go

@@ -10,10 +10,9 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/base/bank/bank_mode"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -30,12 +29,12 @@ type Банк struct {
 }
 
 // НовБанк -- возвращает новый *Bank
-func НовБанк(конт ИЯдроКонтекст, база ИБаза) (*Банк, error) {
+func НовБанк(конт ИБотКонтекст, база ИБаза) (*Банк, error) {
 
 	сам := &Банк{
-		сереброБот: static_param.НовСтатПарам("silver_bot"),
-		режим1:     bank_mode.NewBankMode(),
-		режим2:     bank_mode.NewBankMode(),
+		сереброБот: stat_param.НовСтатПарам("серебро бота"),
+		режим1:     bank_mode.NewBankMode(конт),
+		режим2:     bank_mode.NewBankMode(конт),
 	}
 	аренаКонфиг := arena.АренаКонфиг{
 		Бот_:         база.Бот(),

+ 3 - 3
server/lev2/serv_bots/warbot/angar/base/bank/bank_mode/bank_mode.go

@@ -2,7 +2,7 @@ package bank_mode
 
 import (
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -16,9 +16,9 @@ type BankMode struct {
 }
 
 // NewBankMode -- возвращает новый *BankMode
-func NewBankMode() *BankMode {
+func NewBankMode(конт ИБотКонтекст) *BankMode {
 	return &BankMode{
-		серебро: static_param.НовСтатПарам("silver"),
+		серебро: stat_param.НовСтатПарам("серебро"),
 	}
 }
 

+ 1 - 2
server/lev2/serv_bots/warbot/angar/base/base.go

@@ -13,7 +13,6 @@ import (
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
 	"wartank/pkg/cons"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/base/arsenal"
 	"wartank/server/lev2/serv_bots/warbot/angar/base/bank"
@@ -50,7 +49,7 @@ type База struct {
 }
 
 // НовБаза -- возвращает новую базу бота
-func НовБаза(конт ИЯдроКонтекст, ангар ИАнгар) (*База, error) {
+func НовБаза(конт ИБотКонтекст, ангар ИАнгар) (*База, error) {
 	log.Printf("НовБаза(): %q\n", ангар.Бот().Имя())
 	сам := &База{
 		бот: ангар.Бот(),

+ 4 - 5
server/lev2/serv_bots/warbot/angar/base/fuel/fuel.go

@@ -10,9 +10,8 @@ import (
 
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // СкладТоплива -- склад топлива
@@ -29,15 +28,15 @@ type СкладТоплива struct {
 }
 
 // НовТопливо -- возвращает новой склад топлива
-func НовСкладТоплива(конт ИЯдроКонтекст, база ИБаза) (*СкладТоплива, error) {
+func НовСкладТоплива(конт ИБотКонтекст, база ИБаза) (*СкладТоплива, error) {
 	кнт, фнОтмена := context.WithCancel(база.Контекст())
 	сам := &СкладТоплива{
 		бот:      база.Бот(),
 		база:     база,
-		топливо:  static_param.НовСтатПарам("топливо"),
+		топливо:  stat_param.НовСтатПарам("топливо"),
 		кнт:      кнт,
 		фнОтмена: фнОтмена,
-		уровень:  static_param.НовСтатПарам("уровень"),
+		уровень:  stat_param.НовСтатПарам("уровень"), // FIXME: вынести на уровень арены
 	}
 	аренаКонфиг := arena.АренаКонфиг{
 		Бот_:         база.Бот(),

+ 3 - 4
server/lev2/serv_bots/warbot/angar/base/market/market.go

@@ -10,9 +10,8 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // Рынок -- объект рынка
@@ -24,10 +23,10 @@ type Рынок struct {
 }
 
 // НовРынок -- возвращает новый рынок
-func НовРынок(конт ИЯдроКонтекст, база ИБаза) *Рынок {
+func НовРынок(конт ИБотКонтекст, база ИБаза) *Рынок {
 	сам := &Рынок{
 		бот:     база.Бот(),
-		уровень: static_param.НовСтатПарам("уровень"),
+		уровень: stat_param.НовСтатПарам("уровень"), // FIXME: вынести на уровень арены
 	}
 	аренаКонфиг := arena.АренаКонфиг{
 		Бот_:         база.Бот(),

+ 8 - 9
server/lev2/serv_bots/warbot/angar/base/mine/mine.go

@@ -11,9 +11,8 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // Шахта -- объект шахты на базе
@@ -36,17 +35,17 @@ type Шахта struct {
 }
 
 // НовШахта -- возвращает новый *Mine
-func НовШахта(конт ИЯдроКонтекст, база ИБаза) (ИБазаШахта, error) {
+func НовШахта(конт ИБотКонтекст, база ИБаза) (ИБазаШахта, error) {
 	кнт, фнОтмена := context.WithCancel(база.Контекст())
 	сам := &Шахта{
 		бот:        база.Бот(),
 		база:       база,
-		руда:       static_param.НовСтатПарам("руда"),
-		железо:     static_param.НовСтатПарам("железо"),
-		сталь:      static_param.НовСтатПарам("сталь"),
-		свинец:     static_param.НовСтатПарам("свинец"),
-		продуктКол: static_param.НовСтатПарам("свинец"),
-		уровень:    static_param.НовСтатПарам("уровень"),
+		руда:       stat_param.НовСтатПарам("руда"),
+		железо:     stat_param.НовСтатПарам("железо"),
+		сталь:      stat_param.НовСтатПарам("сталь"),
+		свинец:     stat_param.НовСтатПарам("свинец"),
+		продуктКол: stat_param.НовСтатПарам("кол-во"),
+		уровень:    stat_param.НовСтатПарам("уровень"),
 		кнт:        кнт,
 		фнОтмена:   фнОтмена,
 	}

+ 5 - 5
server/lev2/serv_bots/warbot/angar/base/polygon/polygon.go

@@ -15,7 +15,7 @@ import (
 	"wartank/pkg/kernel/safe_int"
 	"wartank/pkg/kernel/safe_string"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -39,20 +39,20 @@ type Полигон struct {
 	сеть          ИАренаСеть
 	продуктСейчас *safe_string.БезопСтрока
 	продуктКол    *safe_int.БезопЦелое
-	уровень       *static_param.СтатПарам
+	уровень       *stat_param.СтатПарам
 	лог           ИЯдроЛог
 }
 
 // НовПолигон -- возвращает новый *Polygon
-func НовПолигон(конт ИЯдроКонтекст, база ИБаза) *Полигон {
-	лог := kernel_log.НовЛоггер(конт, "Полигон "+база.Бот().Имя())
+func НовПолигон(конт ИБотКонтекст, база ИБаза) *Полигон {
+	лог := kernel_log.НовЛоггер("Полигон " + база.Бот().Имя())
 	лог.Инфо("НовПолигон(): бот=%s\n", база.Бот().Имя())
 	сам := &Полигон{
 		бот:           база.Бот(),
 		танкСтат:      база.Бот().Стата(),
 		продуктСейчас: safe_string.НовБезопСтрока(),
 		продуктКол:    safe_int.НовБезопЦелое(),
-		уровень:       static_param.НовСтатПарам("уровень полигона"),
+		уровень:       stat_param.НовСтатПарам("уровень"), // FIXME: вынести на уровень арены
 		лог:           лог,
 	}
 	аренаКонфиг := arena.АренаКонфиг{

+ 1 - 2
server/lev2/serv_bots/warbot/angar/battle/battle.go

@@ -5,7 +5,6 @@ import (
 	"time"
 
 	"wartank/pkg/arena"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_register"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_wait"
@@ -25,7 +24,7 @@ type Сражение struct {
 }
 
 // НовСражение -- возвращает новый *Battle
-func НовСражение(конт ИЯдроКонтекст, бот ИБот) *Сражение {
+func НовСражение(конт ИБотКонтекст, бот ИБот) *Сражение {
 	сам := &Сражение{
 		бот:    бот,
 		клиент: бот.Сеть().ВебВоркер(),

+ 1 - 2
server/lev2/serv_bots/warbot/angar/battle/battle_register/battle_register.go

@@ -8,7 +8,6 @@ import (
 
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -21,7 +20,7 @@ type СхваткаРегистрация struct {
 }
 
 // НовСражениеРегистрация -- возвращает новый ожидатель битвы
-func НовСражениеРегистрация(конт ИЯдроКонтекст, бот ИБот) *СхваткаРегистрация {
+func НовСражениеРегистрация(конт ИБотКонтекст, бот ИБот) *СхваткаРегистрация {
 	сам := &СхваткаРегистрация{
 		бот:          бот,
 		счётРегистер: 10_000,

+ 1 - 2
server/lev2/serv_bots/warbot/angar/battle/battle_wait/battle_wait.go

@@ -8,7 +8,6 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -20,7 +19,7 @@ type СхваткаОжидание struct {
 }
 
 // НовСражениеОжидание -- возвращает новый ожидатель битвы
-func НовСражениеОжидание(конт ИЯдроКонтекст, бот ИБот) *СхваткаОжидание {
+func НовСражениеОжидание(конт ИБотКонтекст, бот ИБот) *СхваткаОжидание {
 	сам := &СхваткаОжидание{
 		бот: бот,
 	}

+ 4 - 5
server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker.go

@@ -6,17 +6,16 @@ import (
 
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker/battle_sound"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // СражениеДействие -- исполнение битвы
 type СхваткаИсполнитель struct {
 	ИАрена
-	конт ИЯдроКонтекст
+	конт ИБотКонтекст
 	бот  ИБот
 	сеть ИАренаСеть
 
@@ -29,11 +28,11 @@ type СхваткаИсполнитель struct {
 }
 
 // НовСражениеДействие -- возвращает новый исполнитель битвы
-func НовСражениеИсполнитель(конт ИЯдроКонтекст, bot ИБот) *СхваткаИсполнитель {
+func НовСражениеИсполнитель(конт ИБотКонтекст, bot ИБот) *СхваткаИсполнитель {
 	сам := &СхваткаИсполнитель{
 		конт:       конт,
 		бот:        bot,
-		еслиНачало: static_param.НовСтатПарам("alarm"),
+		еслиНачало: stat_param.НовСтатПарам("тревога"),
 		sound:      battle_sound.NewBattleSound(),
 	}
 	аренаКонфиг := arena.АренаКонфиг{

+ 1 - 2
server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker/battle_worker.go

@@ -6,7 +6,6 @@ import (
 
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker/health"
 	"wartank/server/lev2/serv_bots/warbot/angar/battle/battle_worker/battle_worker/manevr"
@@ -34,7 +33,7 @@ type СражениеДействие struct {
 }
 
 // НовСражениеДействие -- возвращает новый *BattleOn
-func НовСражениеДействие(конт ИЯдроКонтекст, бот ИБот) *СражениеДействие {
+func НовСражениеДействие(конт ИБотКонтекст, бот ИБот) *СражениеДействие {
 	// Ограничить время сражения бота
 	кнтСражение, фнОтменить := context.WithTimeout(бот.Контекст(), time.Second*305)
 	сам := &СражениеДействие{

+ 20 - 19
server/lev2/serv_bots/warbot/angar/net_stat/net_stat.go → server/lev2/serv_bots/warbot/angar/bot_net_stat/net_stat.go

@@ -1,4 +1,5 @@
-package net_stat
+// package bot_net_stat -- сетевая статистика бота
+package bot_net_stat
 
 import (
 	"strconv"
@@ -10,22 +11,22 @@ import (
 )
 
 /*
-	Исходник предоставляет тип для парсинга статистики уровня танка и сервера.
+	Исходник предоставляет тип для парсинга статистики уровня бота.
 */
 
-// NetStat -- статистика уровня танка и сервера
-type NetStat struct {
+// БотНетСтат -- статистика уровня бота
+type БотСетьСтат struct {
 	server ИСервер
 	бот    ИБот
 	лог    ИЯдроЛог
 }
 
-// NewNetStat -- возвращает новый *NetStat
-func NewNetStat(конт ИЯдроКонтекст, bot ИБот) *NetStat {
-	лог := kernel_log.НовЛоггер(конт, "NetStat")
-	лог.Инфо("NewNetStat()\n")
-	лог.Паника(bot == nil, "NewNetStat(): ИБот == nil")
-	сам := &NetStat{
+// НовБотСетьСтат -- возвращает новый *NetStat
+func НовБотСетьСтат(конт ИБотКонтекст) *БотСетьСтат {
+	лог := kernel_log.НовЛоггер("БотСетьСтат")
+	лог.Инфо("НовБотСетьСтат()\n")
+	bot := конт.Получ("бот").(ИБот)
+	сам := &БотСетьСтат{
 		server: bot.Сервер(),
 		бот:    bot,
 		лог:    лог,
@@ -33,7 +34,7 @@ func NewNetStat(конт ИЯдроКонтекст, bot ИБот) *NetStat {
 	return сам
 }
 
-func (сам *NetStat) Update() {
+func (сам *БотСетьСтат) Update() {
 	// _mt.Println("\n===NetStat.Update()===")
 	сам.findLevelTank()
 	сам.findLevelProgress()
@@ -46,7 +47,7 @@ func (сам *NetStat) Update() {
 }
 
 // Ищет в теле текста ангара мощность танка
-func (сам *NetStat) мощностьНайти() {
+func (сам *БотСетьСтат) мощностьНайти() {
 	lstAngar := сам.бот.Ангар().СписПолучить()
 	if len(lstAngar) == 0 {
 		// log._rintf("WARN NetStat.findPower(): lstAngar is empty\n")
@@ -70,7 +71,7 @@ func (сам *NetStat) мощностьНайти() {
 }
 
 // Ищет в теле текста ангара прочность танка
-func (сам *NetStat) прочностьНайти() {
+func (сам *БотСетьСтат) прочностьНайти() {
 	var (
 		strOut      string
 		lstAngar    = сам.бот.Ангар().СписПолучить()
@@ -100,7 +101,7 @@ func (сам *NetStat) прочностьНайти() {
 }
 
 // Ищет в теле текста ангара точность танка
-func (сам *NetStat) точностьНайти() {
+func (сам *БотСетьСтат) точностьНайти() {
 	var (
 		strOut      string
 		lstAngar    = сам.бот.Ангар().СписПолучить()
@@ -130,7 +131,7 @@ func (сам *NetStat) точностьНайти() {
 }
 
 // Ищет в теле текста ангара броню танка
-func (сам *NetStat) броняНайти() {
+func (сам *БотСетьСтат) броняНайти() {
 	var (
 		strOut      string
 		lstAngar    = сам.бот.Ангар().СписПолучить()
@@ -159,7 +160,7 @@ func (сам *NetStat) броняНайти() {
 }
 
 // Ищет в теле текста ангара уровень танка
-func (сам *NetStat) findLevelTank() {
+func (сам *БотСетьСтат) findLevelTank() {
 	lstAngar := сам.бот.Ангар().СписПолучить()
 	if len(lstAngar) == 0 {
 		// log._rintf("ERRO NetStat.findLevelTank(): пустой lstAngar")
@@ -183,7 +184,7 @@ func (сам *NetStat) findLevelTank() {
 }
 
 // Ищет в теле текста ангара прогресс уровня танка танка
-func (сам *NetStat) findLevelProgress() {
+func (сам *БотСетьСтат) findLevelProgress() {
 	lstAngar := сам.бот.Ангар().СписПолучить()
 	сам.лог.Паника(len(lstAngar) == 0, "lstAngar пустой")
 	var strOut string
@@ -204,7 +205,7 @@ func (сам *NetStat) findLevelProgress() {
 }
 
 // Ищет в теле текста ангара силу атаки танка
-func (сам *NetStat) атакаНайти() {
+func (сам *БотСетьСтат) атакаНайти() {
 	var (
 		strOut      string
 		lstAngar    = сам.бот.Ангар().СписПолучить()
@@ -230,7 +231,7 @@ func (сам *NetStat) атакаНайти() {
 }
 
 // Ищет в теле текста ангара силу атаки танка
-func (сам *NetStat) игроковОнлайнНайти() {
+func (сам *БотСетьСтат) игроковОнлайнНайти() {
 	lstAngar := сам.бот.Ангар().СписПолучить()
 	var strOut string
 	for _, стрАтака := range lstAngar {

+ 3 - 4
server/lev2/serv_bots/warbot/angar/convoy/convoy.go

@@ -10,9 +10,8 @@ import (
 	"wartank/pkg/alias"
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -28,10 +27,10 @@ type Конвой struct {
 }
 
 // НовКонвой -- возвращает новый *Convoy
-func НовКонвой(конт ИЯдроКонтекст, бот ИБот) *Конвой {
+func НовКонвой(конт ИБотКонтекст, бот ИБот) *Конвой {
 	сам := &Конвой{
 		бот:   бот,
-		слава: static_param.НовСтатПарам("glory"),
+		слава: stat_param.НовСтатПарам("слава"),
 	}
 	аренаКонфиг := arena.АренаКонфиг{
 		Бот_:         сам.бот,

+ 3 - 3
server/lev2/serv_bots/warbot/angar/death_match/death_worker/death_worker.go

@@ -10,7 +10,7 @@ import (
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/death_match/death_worker/death_on"
 	"wartank/server/lev2/serv_bots/warbot/angar/death_match/death_worker/death_on/battle_sound"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // СражениеДействие -- исполнение схватки
@@ -33,7 +33,7 @@ func НовСхваткаИсполнитель(конт ИЯдроКонтек
 	сам := &СхваткаИсполнитель{
 		конт:       конт,
 		бот:        bot,
-		еслиНачало: static_param.НовСтатПарам("alarm"),
+		еслиНачало: stat_param.НовСтатПарам("тревога"),
 		sound:      battle_sound.NewBattleSound(),
 	}
 	аренаКонфиг := arena.АренаКонфиг{
@@ -49,7 +49,7 @@ func НовСхваткаИсполнитель(конт ИЯдроКонтек
 
 // пуск исполнителя схватки
 func (сам *СхваткаИсполнитель) пуск() {
-	сам.еслиНачало = static_param.НовСтатПарам("alarm")
+	сам.еслиНачало = stat_param.НовСтатПарам("тревога")
 }
 
 // Танковать -- выполняет битву

+ 2 - 2
server/lev2/serv_bots/warbot/angar/division/div_war/div_war.go

@@ -14,7 +14,7 @@ import (
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_net"
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_on"
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_on/div_war_sound"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -47,7 +47,7 @@ func NewDivWar(конт ИЯдроКонтекст, bot ИБот) (*DivWar, erro
 	}
 	сам := &DivWar{
 		bot:      bot,
-		alarm:    static_param.НовСтатПарам("alarm"),
+		alarm:    stat_param.НовСтатПарам("тревога"),
 		chDivWar: make(chan int, 1),
 		sound:    div_war_sound.NewDivWarSound(),
 		conn:     bot.Сеть().ВебВоркер(),

+ 2 - 2
server/lev2/serv_bots/warbot/angar/division/divwar/divwar.go

@@ -14,7 +14,7 @@ import (
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_net"
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_on"
 	"wartank/server/lev2/serv_bots/warbot/angar/division/div_war/div_war_on/div_war_sound"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 /*
@@ -48,7 +48,7 @@ func NewDivWar(конт ИЯдроКонтекст, bot ИБот) (*DivWar, erro
 	сам := &DivWar{
 		конт:     конт,
 		bot:      bot,
-		alarm:    static_param.НовСтатПарам("alarm"),
+		alarm:    stat_param.НовСтатПарам("тревога"),
 		chDivWar: make(chan int, 1),
 		sound:    div_war_sound.NewDivWarSound(),
 		conn:     bot.Сеть().ВебВоркер(),

+ 3 - 3
server/lev2/serv_bots/warbot/angar/fuel/fuel.go

@@ -9,7 +9,7 @@ import (
 	"time"
 
 	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // Топливо -- топливо в баке, +1 каждые 15 сек
@@ -19,13 +19,13 @@ type Топливо struct {
 }
 
 // НовТопливо -- возвращает новый топливный бак
-func НовТопливо(ангар ИАнгар) (*Топливо, error) {
+func НовТопливо(конт ИБотКонтекст, ангар ИАнгар) (*Топливо, error) {
 	if ангар == nil {
 		return nil, fmt.Errorf("NewFuel(): IAngar == nil")
 	}
 	сам := &Топливо{
 		ангар:   ангар,
-		топливо: static_param.НовСтатПарам("fuel"),
+		топливо: stat_param.НовСтатПарам("топливо"),
 	}
 	return сам, nil
 }

+ 1 - 2
server/lev2/serv_bots/warbot/angar/fuel_attack/fuel_attack.go

@@ -11,7 +11,6 @@ import (
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
 	"wartank/pkg/cons"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -23,7 +22,7 @@ type ТопливоБой struct {
 }
 
 // НовТопливоБой -- возвращает новый *ТопливоБойNet
-func НовТопливоБой(конт ИЯдроКонтекст, ангар ИАнгар) (*ТопливоБой, error) {
+func НовТопливоБой(конт ИБотКонтекст, ангар ИАнгар) (*ТопливоБой, error) {
 	аренаСеть := arena_net.НовАренаСеть(конт, ангар, "https://wartank.ru/battle")
 	сам := &ТопливоБой{
 		ангар:     ангар,

+ 3 - 3
server/lev2/serv_bots/warbot/angar/masters/bat_masters.go

@@ -28,8 +28,8 @@ type БитваМастеров struct {
 }
 
 // НовБитваМастеров -- возвращает новый *BatMas
-func НовБитваМастеров(конт ИЯдроКонтекст, бот ИБот) *БитваМастеров {
-	лог := kernel_log.НовЛоггер(конт, "БитваМастеров")
+func НовБитваМастеров(конт ИБотКонтекст, бот ИБот) *БитваМастеров {
+	лог := kernel_log.НовЛоггер("БитваМастеров")
 	лог.Инфо("НовБитваМастеров()\n")
 	лог.Паника(бот == nil, "НовБитваМастеров(): ИБот == nil\n")
 	сам := &БитваМастеров{
@@ -44,7 +44,7 @@ func НовБитваМастеров(конт ИЯдроКонтекст, бо
 		СтрУрл_:      "https://wartank.ru/pvp",
 	}
 	сам.ИАрена = arena.НовАрена(конт, аренаКонфиг)
-	сам.сеть = arena_net.НовАренаСеть(сам, "https://wartank.ru/pvp")
+	сам.сеть = arena_net.НовАренаСеть(конт, сам, "https://wartank.ru/pvp")
 	return сам
 }
 

+ 1 - 2
server/lev2/serv_bots/warbot/angar/missions/missions.go

@@ -6,7 +6,6 @@ import (
 
 	"wartank/pkg/arena"
 	"wartank/pkg/components/arena_net"
-	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
@@ -22,7 +21,7 @@ type Миссии struct {
 }
 
 // НовМиссии -- возвращает новый *Миссии
-func НовМиссии(конт ИЯдроКонтекст, бот ИБот) (*Миссии, error) {
+func НовМиссии(конт ИБотКонтекст, бот ИБот) (*Миссии, error) {
 	сам := &Миссии{
 		бот: бот,
 	}

+ 1 - 1
server/lev2/serv_bots/warbot/angar/tank_params/tank_params.go

@@ -22,7 +22,7 @@ type ТанкПараметры struct {
 
 // НовТанкПараметры -- возвращает новые параметры танка
 func НовТанкПараметры(бот ИБот) *ТанкПараметры {
-	лог := kernel_log.НовЛоггер(бот.КонтБот(), "ТанкПараметры")
+	лог := kernel_log.НовЛоггер("ТанкПараметры")
 	лог.Инфо("НовТанкПараметры()\n")
 	лог.Паника(бот == nil, "НовТанкПараметры(): ИБот == nil")
 	сам := &ТанкПараметры{

+ 4 - 9
server/lev2/serv_bots/warbot/stat_tank/static_param/static_param.go → server/lev2/serv_bots/warbot/bot_stat/stat_param/stat_param.go

@@ -1,4 +1,5 @@
-package static_param
+// package stat_param -- отдельный параметр статистики бота
+package stat_param
 
 import (
 	"sync"
@@ -7,20 +8,14 @@ import (
 	. "wartank/server/lev0/types"
 )
 
-/*
-	Исходник предоставляет единичный статичный параметр статистики
-	танка. Проверяет присваиваемые значения.
-	Потокобезопасно.
-*/
-
-// СтатПарам -- потокобезопасный параметр танка
+// СтатПарам -- потокобезопасная статистика бота
 type СтатПарам struct {
 	имя  string // Имя параметра
 	знач int    // Значение параметра
 	блок sync.RWMutex
 }
 
-// НовСтатПарам -- возвращает новый *СтатПарам
+// НовБотСтатистика -- возвращает новую статистику бота
 func НовСтатПарам(имя string) *СтатПарам {
 	лог := kernel_log.НовЛоггер("СтатПарам")
 	лог.Инфо("НовСтатПарам(%s)\n", имя)

+ 5 - 5
server/lev2/serv_bots/warbot/stat_resurs/stat_resurs.go → server/lev2/serv_bots/warbot/bot_stat/stat_resurs/stat_resurs.go

@@ -6,7 +6,7 @@ import (
 
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar/fuel"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
 )
 
 // СтатРесурсы -- статистика ресурсов
@@ -17,13 +17,13 @@ type СтатРесурсы struct {
 }
 
 // НовСтатРесурсы -- новая статистика ресурсов
-func НовСтатРесурсы(ангар ИАнгар) *СтатРесурсы {
+func НовСтатРесурсы(конт ИБотКонтекст, ангар ИАнгар) *СтатРесурсы {
 	сам := &СтатРесурсы{
-		золото:       static_param.НовСтатПарам("gold"),
-		сереброВсего: static_param.НовСтатПарам("silver_all"),
+		золото:       stat_param.НовСтатПарам("золото"),
+		сереброВсего: stat_param.НовСтатПарам("серебро всего"),
 	}
 	var ош error
-	сам.топливо, ош = fuel.НовТопливо(ангар)
+	сам.топливо, ош = fuel.НовТопливо(конт, ангар)
 	if ош != nil {
 		panic(fmt.Errorf("НовСтатРесурсы(): in make *Missions, err=\n\t%w", ош))
 	}

+ 68 - 0
server/lev2/serv_bots/warbot/bot_stat/tank_stat/tank_stat.go

@@ -0,0 +1,68 @@
+// package tank_stat -- статистика бота
+package tank_stat
+
+import (
+	. "wartank/server/lev0/types"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/stat_param"
+)
+
+// ТанкСтат -- статические параметры танка
+type ТанкСтат struct {
+	конт      ИБотКонтекст
+	атака     ИСтатПарам
+	точность  ИСтатПарам
+	прочность ИСтатПарам
+	броня     ИСтатПарам
+	power     ИСтатПарам // Танковая мощь (может не совпадать по сумме, если есть усиление)
+	усиление  ИСтатПарам
+}
+
+// НовТанкСтат -- возвращает новый *TankStat
+func НовТанкСтат(конт ИБотКонтекст) *ТанкСтат {
+	сам := &ТанкСтат{
+		конт:      конт,
+		атака:     stat_param.НовСтатПарам("атака"),
+		точность:  stat_param.НовСтатПарам("точность"),
+		прочность: stat_param.НовСтатПарам("прочность"),
+		броня:     stat_param.НовСтатПарам("броня"),
+		power:     stat_param.НовСтатПарам("мощь"),
+		усиление:  stat_param.НовСтатПарам("усиление"),
+	}
+	return сам
+}
+
+// Атака -- возвращает объект силы атаки
+func (сам *ТанкСтат) Атака() ИСтатПарам {
+	return сам.атака
+}
+
+// Прочность -- возвращает объект прочности танка
+func (сам *ТанкСтат) Прочность() ИСтатПарам {
+	return сам.броня
+}
+
+// Точность -- возвращает объект точности танка
+func (сам *ТанкСтат) Точность() ИСтатПарам {
+	return сам.точность
+}
+
+// Броня -- возвращает объект брони танка
+func (сам *ТанкСтат) Броня() ИСтатПарам {
+	return сам.прочность
+}
+
+// Мощь -- возвращает объект мощи танка
+func (сам *ТанкСтат) Мощь() ИСтатПарам {
+	return сам.power
+}
+
+// Форсаж -- возвращает объект форсированного параметра
+func (сам *ТанкСтат) Форсаж() ИСтатПарам {
+	return сам.усиление
+}
+
+// Форсаж -- возвращает объект форсированного параметра
+func (сам *ТанкСтат) ФорсажОбнов(парам string, знач int) {
+	сам.усиление = stat_param.НовСтатПарам("усиление")
+	сам.усиление.Уст(знач)
+}

+ 0 - 70
server/lev2/serv_bots/warbot/stat_tank/tank_stat.go

@@ -1,70 +0,0 @@
-package stat_tank
-
-import (
-	. "wartank/server/lev0/types"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank/static_param"
-)
-
-/*
-	Исходник предоставляет статические параметры танка.
-	Броня, атака, прочность и т.п.
-*/
-
-// СтатТанк -- статические параметры танка
-type СтатТанк struct {
-	атака     ИСтатПарам // Сила атаки танка
-	точность  ИСтатПарам // Точность танка
-	прочность ИСтатПарам // Броня танка
-	броня     ИСтатПарам // Броня танка
-	power     ИСтатПарам // Танковая мощь (может не совпадать по сумме, если есть усиление)
-	усиление  ИСтатПарам
-}
-
-// НовТанкСтат -- возвращает новый *TankStat
-func НовТанкСтат() *СтатТанк {
-	сам := &СтатТанк{
-		атака:     static_param.НовСтатПарам("атака"),
-		точность:  static_param.НовСтатПарам("точность"),
-		прочность: static_param.НовСтатПарам("прочность"),
-		броня:     static_param.НовСтатПарам("броня"),
-		power:     static_param.НовСтатПарам("мощь"),
-		усиление:  static_param.НовСтатПарам("усиление"),
-	}
-	return сам
-}
-
-// Атака -- возвращает объект силы атаки
-func (сам *СтатТанк) Атака() ИСтатПарам {
-	return сам.атака
-}
-
-// Прочность -- возвращает объект прочности танка
-func (сам *СтатТанк) Прочность() ИСтатПарам {
-	return сам.броня
-}
-
-// Точность -- возвращает объект точности танка
-func (сам *СтатТанк) Точность() ИСтатПарам {
-	return сам.точность
-}
-
-// Броня -- возвращает объект брони танка
-func (сам *СтатТанк) Броня() ИСтатПарам {
-	return сам.прочность
-}
-
-// Мощь -- возвращает объект мощи танка
-func (сам *СтатТанк) Мощь() ИСтатПарам {
-	return сам.power
-}
-
-// Форсаж -- возвращает объект форсированного параметра
-func (сам *СтатТанк) Форсаж() ИСтатПарам {
-	return сам.усиление
-}
-
-// Форсаж -- возвращает объект форсированного параметра
-func (сам *СтатТанк) ФорсажОбнов(парам string, знач int) {
-	сам.усиление = static_param.НовСтатПарам("force")
-	сам.усиление.Уст(знач)
-}

+ 14 - 5
server/lev2/serv_bots/warbot/warbot.go

@@ -9,12 +9,13 @@ import (
 	"time"
 
 	"wartank/pkg/alias"
+	"wartank/pkg/kernel/kernel_dict"
 	"wartank/pkg/kernel/kernel_log"
 	. "wartank/pkg/kernel/kernel_types"
 	"wartank/pkg/kernel/safe_bool"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots/warbot/angar"
-	"wartank/server/lev2/serv_bots/warbot/stat_tank"
+	"wartank/server/lev2/serv_bots/warbot/bot_stat/tank_stat"
 	"wartank/server/lev2/serv_bots/warbot/warbot_config"
 	"wartank/server/lev2/serv_bots/warbot/warbot_net"
 )
@@ -33,10 +34,11 @@ type ВарБот struct {
 	кнт            context.Context             // Контекст бота
 	фтОтмена       func()                      // Функция отменя контекста бота
 	лог            ИЯдроЛог
+	конт           ИБотКонтекст
 }
 
 // ЗагрузитьВарБот -- загружает бота из базы
-func ЗагрузитьВарБот(сервер ИСервер, номер alias.БотНомер) *ВарБот {
+func ЗагрузитьВарБот(конт ИЯдроКонтекст, сервер ИСервер, номер alias.БотНомер) *ВарБот {
 	лог := kernel_log.НовЛоггер("ВарБот")
 	лог.Инфо("ЗагрузитьВарБот()\n")
 	лог.Паника(сервер == nil, "ЗагрузитьВарБот(): ИСервер ==nil")
@@ -93,10 +95,12 @@ func создатьЯдроВарБот(серв ИСервер, конфиг *w
 	лог.Паника(серв == nil, "создатьЯдроВарБот(): ИСервер == nil")
 	лог.Паника(конфиг == nil, "создатьЯдроВарБот(): ВарБотКонфиг==nil")
 	ctx, fnCancel := context.WithCancel(серв.Конт())
+	конт := kernel_dict.НовЯдроСловарь()
 	сам := &ВарБот{
+		конт:           конт,
 		сервер:         серв,
 		store:          серв.Получ("kernStore").(IKernelStore),
-		стата:          stat_tank.НовТанкСтат(),
+		стата:          tank_stat.НовТанкСтат(конт),
 		еслиРаботает:   safe_bool.НовБезопБул(),
 		еслиАвтозапуск: safe_bool.НовБезопБул(),
 		конфиг:         конфиг,
@@ -106,8 +110,8 @@ func создатьЯдроВарБот(серв ИСервер, конфиг *w
 	}
 	var err error
 	// WarBotNet
-	сам.сеть = warbot_net.НовВарБотСеть(сам)
-	сам.ангар, err = angar.НовАнгар(сам)
+	сам.сеть = warbot_net.НовВарБотСеть(конт, сам)
+	сам.ангар, err = angar.НовАнгар(конт, сам)
 	сам.лог.Паника(err != nil, "НовВарБот(): in make IAngar, err=\n\t%w", err)
 	if сам.конфиг.ЕслиАвтозапуск_ {
 		сам.еслиАвтозапуск.Уст()
@@ -217,3 +221,8 @@ func (сам *ВарБот) сохр() {
 	err := сам.store.Set("/bots/"+стрНомер, сам.конфиг.Marshall())
 	сам.лог.Паника(err != nil, "ВарБот.сохр(): err=\n\t%v\n", err)
 }
+
+// КонтБот -- возвращает контекст бота
+func (сам *ВарБот) КонтБот() ИБотКонтекст {
+	return сам.конт
+}

+ 2 - 2
server/lev2/serv_bots/warbot/warbot_net/warbot_net.go

@@ -29,7 +29,7 @@ type ВарБотСеть struct {
 }
 
 // НовВарБотСеть -- возвращает новый коннект к сети бота
-func НовВарБотСеть(бот ИБот) *ВарБотСеть {
+func НовВарБотСеть(конт ИБотКонтекст, бот ИБот) *ВарБотСеть {
 	лог := kernel_log.НовЛоггер("ВарБотСеть")
 	лог.Инфо("НовВарБотСеть()\n")
 	лог.Паника(бот == nil, "НовВарБотСеть(): ИБот == nil")
@@ -44,7 +44,7 @@ func НовВарБотСеть(бот ИБот) *ВарБотСеть {
 		фнОтмена:   фнОтмена,
 		лог:        лог,
 	}
-	сам.вебВоркер = http_worker.НовХттпВоркер(сам, сам.вебСокет.ВебСокет())
+	сам.вебВоркер = http_worker.НовХттпВоркер(конт, сам, сам.вебСокет.ВебСокет())
 	// Подключаем сетевой логин
 	сам.логин = bot_net_login.НовБотСетьЛогин(сам, сам.вебСокет.ВебСокет())
 

+ 13 - 113
server/lev2/serv_web/serv_web.go

@@ -3,25 +3,21 @@ package serv_web
 
 import (
 	"fmt"
-	"os"
-	"time"
 
 	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/fiber/v2/middleware/compress"
-	"github.com/gofiber/template/html/v2"
 
 	"wartank/pkg/alias"
 	"wartank/pkg/kernel/kernel_log"
+	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_web/web_api"
 	"wartank/server/lev2/serv_web/web_gui"
 )
 
 type СервВеб struct {
-	серв   ИСервер
-	файбер fiber.App
-	порт   string
-	лог    *kernel_log.Логгер
+	конт ИЯдроКонтекст
+	серв ИСервер
+	лог  *kernel_log.Логгер
 }
 
 // НовСервВеб -- возвращает новый веб-сервер
@@ -29,118 +25,22 @@ func НовСервВеб(серв ИСервер) *СервВеб {
 	лог := kernel_log.НовЛоггер("СервВеб")
 	лог.Инфо("НовСервВеб()\n")
 	лог.Паника(серв == nil, "НовСервВеб(): ИСервер==nil")
-	рендер := html.New("./web/tmpl", ".tmpl.html")
 
-	конф := fiber.Config{
-		// Prefork:                      false,
-		ServerHeader: "WarTank",
-		//StrictRouting:                false,
-		//CaseSensitive:                false,
-		//Immutable:                    false,
-		//UnescapePath:                 false,
-		//ETag:                         false,
-		BodyLimit: 100_000_000,
-		// Concurrency: 100,
-		Views: рендер,
-		//ViewsLayout:                  "",
-		//PassLocalsToViews:            false,
-		// ReadTimeout:     15 * time.Second,
-		// WriteTimeout:    15 * time.Second,
-		// IdleTimeout:     15 * time.Second,
-		ReadBufferSize:  4_000_000,
-		WriteBufferSize: 4_000_000,
-		//CompressedFileSuffix:         "",
-		//ProxyHeader:                  "",
-		//GETOnly:                      false,
-		//ErrorHandler:                 func(*fiber.Ctx, error) error { panic("not implemented") },
-		//DisableKeepalive:             false,
-		//DisableDefaultDate:           false,
-		//DisableDefaultContentType:    false,
-		//DisableHeaderNormalizing:     false,
-		//DisableStartupMessage:        false,
-		AppName: "WarTank.App",
-		// StreamRequestBody:            false,
-		// DisablePreParseMultipartForm: false,
-		// ReduceMemoryUsage:            false,
-		// JSONEncoder:                  func(interface{}) ([]byte, error) { panic("not implemented") },
-		// JSONDecoder:                  func([]byte, interface{}) error { panic("not implemented") },
-		// XMLEncoder:                   func(interface{}) ([]byte, error) { panic("not implemented") },
-		Network: "tcp4",
-		// EnableTrustedProxyCheck:      false,
-		// TrustedProxies:               []string{},
-		// EnableIPValidation:           false,
-		// EnablePrintRoutes:            false,
-		// ColorScheme: fiber.Colors{
-		// 	Black:   "",
-		// 	Red:     "",
-		// 	Green:   "",
-		// 	Yellow:  "",
-		// 	Blue:    "",
-		// 	Magenta: "",
-		// 	Cyan:    "",
-		// 	White:   "",
-		// 	Reset:   "",
-		// },
-		// RequestMethods:           []string{},
-		// EnableSplittingOnParsers: false,
-	}
 	сам := &СервВеб{
-		серв:   серв,
-		файбер: *fiber.New(конф),
-		лог:    лог,
-	}
-	компресКонфиг := compress.Config{
-		Level: compress.LevelBestCompression,
+		конт: серв,
+		серв: серв,
+		лог:  лог,
 	}
-	сам.файбер.Use(compress.New(компресКонфиг))
-	сам.файбер.Static("/static", "./web/static", fiber.Static{
-		Compress:      true,
-		ByteRange:     true,
-		Browse:        true,
-		Index:         "index.html",
-		CacheDuration: 30 * time.Second,
-		MaxAge:        3600,
-	})
 
-	сам.файбер.Get("/list_bot/get", сам.гетСписБот)
-	сам.файбер.Post("/list_bot/add", сам.постБотНов)
-	сам.файбер.Post("/bot/stat", сам.постБотСтат)
-	_ = web_api.НовВебАпи(сам)
-	_ = web_gui.НовВебГуи(сам)
+	файбер := серв.Получ("fiberApp").(*fiber.App)
+	файбер.Get("/list_bot/get", сам.гетСписБот)
+	файбер.Post("/list_bot/add", сам.постБотНов)
+	файбер.Post("/bot/stat", сам.постБотСтат)
+	_ = web_api.НовВебАпи(сам.конт)
+	_ = web_gui.НовВебГуи(сам.конт)
 	return сам
 }
 
-// Файбер -- возвращает файбер
-func (сам *СервВеб) Файбер() *fiber.App {
-	return &сам.файбер
-}
-
-// Сервер -- возвращает сервер
-func (сам *СервВеб) Сервер() ИСервер {
-	return сам.серв
-}
-
-// Пуск -- запускает веб-сервер в работу
-func (сам *СервВеб) Пуск() {
-	фнПуск := func() {
-		сам.лог.Инфо("СервВеб.Пуск().фнПуск(): порт=%q\n", сам.порт)
-		ош := сам.файбер.Listen(":" + сам.порт)
-		сам.лог.Паника(ош != nil, "СервВеб.Пуск(): при работе веб-сервера, ош=\n\t%v\n", ош)
-	}
-	stage := os.Getenv("STAGE")
-	switch stage {
-	case "local":
-		сам.порт = "18061"
-	case "prod":
-		сам.порт = "18060"
-	case "prod2":
-		сам.порт = "18062"
-	default:
-		сам.лог.Паника(true, "СервВеб.Пуск(): не установлена переменная STAGE")
-	}
-	go фнПуск()
-}
-
 type ПостБотСтат struct {
 	Номер alias.БотНомер `form:"bot_number"`
 }

+ 35 - 36
server/lev2/serv_web/web_api/web_api.go

@@ -17,47 +17,46 @@ import (
 
 // ВебАпи -- веб-сервер для API
 type ВебАпи struct {
-	серв   ИСервер
-	файбер fiber.App
-	лог    ИЯдроЛог
+	серв ИСервер
+	лог  ИЯдроЛог
 }
 
 // НовВебАпи -- возвращает новый веб-сервер для API
-func НовВебАпи(вебСервер ИВебСервер) *ВебАпи {
+func НовВебАпи(конт ИБотКонтекст) *ВебАпи {
 	лог := kernel_log.НовЛоггер("ВебАпи")
-	лог.Паника(вебСервер == nil, "НовВебАпи(): ИВебСервер==nil")
+	лог.Паника(конт == nil, "НовВебАпи(): ИВебСервер==nil")
 	сам := &ВебАпи{
-		серв:   вебСервер.Сервер(),
-		файбер: *вебСервер.Файбер(),
-		лог:    лог,
-	}
-	сам.файбер.Post("/api/login", сам.логин)
-	сам.файбер.Post("/api/add_bot", сам.добавитьБота)
-	сам.файбер.Get("/api/uptime", сам.аптаймСервер)
-	сам.файбер.Get("/api/count_start", сам.стартНомер)
-
-	сам.файбер.Get("/api/bot/:number/mine/level", сам.шахтаУровень)
-	сам.файбер.Get("/api/bot/:number/mine/mode", сам.шахтаРежим)
-	сам.файбер.Get("/api/bot/:number/mine/count_product", сам.шахтаРаботаКоличество)
-	сам.файбер.Get("/api/bot/:number/mine/name_product", сам.шахтаРаботаИмя)
-	сам.файбер.Get("/api/bot/:number/mine/back_time", сам.шахтаВремяОсталось)
-	сам.файбер.Get("/api/bot/:number/mine/log", сам.шахтаЛог)
-
-	сам.файбер.Get("/api/bot/:number/tank/fuel", сам.танкТопливо)
-	сам.файбер.Get("/api/bot/:number/angar/silver", сам.ангарСеребро)
-
-	сам.файбер.Get("/api/bot/:number/polygon/level", сам.полигонУровень)
-	сам.файбер.Get("/api/bot/:number/polygon/mode", сам.полигонРежим)
-	сам.файбер.Get("/api/bot/:number/polygon/count_product", сам.полигонРаботаКоличество)
-	сам.файбер.Get("/api/bot/:number/polygon/name_product", сам.полигонРаботаИмя)
-	сам.файбер.Get("/api/bot/:number/polygon/back_time", сам.полигонВремяОсталось)
-
-	сам.файбер.Get("/api/bot/:number/arsenal/level", сам.арсеналУровень)
-	сам.файбер.Get("/api/bot/:number/arsenal/mode", сам.арсеналРежим)
-	сам.файбер.Get("/api/bot/:number/arsenal/count_product", сам.полигонРаботаКоличество)
-	сам.файбер.Get("/api/bot/:number/arsenal/name_product", сам.арсеналРаботаИмя)
-	сам.файбер.Get("/api/bot/:number/arsenal/back_time", сам.арсеналВремяОсталось)
-	сам.файбер.Get("/api/bot/:number/arsenal/log", сам.арсеналЛог)
+		серв: конт.Получ("сервер").(ИСервер),
+		лог:  лог,
+	}
+	файбер := конт.Получ("fiberApp").(*fiber.App)
+	файбер.Post("/api/login", сам.логин)
+	файбер.Post("/api/add_bot", сам.добавитьБота)
+	файбер.Get("/api/uptime", сам.аптаймСервер)
+	файбер.Get("/api/count_start", сам.стартНомер)
+
+	файбер.Get("/api/bot/:number/mine/level", сам.шахтаУровень)
+	файбер.Get("/api/bot/:number/mine/mode", сам.шахтаРежим)
+	файбер.Get("/api/bot/:number/mine/count_product", сам.шахтаРаботаКоличество)
+	файбер.Get("/api/bot/:number/mine/name_product", сам.шахтаРаботаИмя)
+	файбер.Get("/api/bot/:number/mine/back_time", сам.шахтаВремяОсталось)
+	файбер.Get("/api/bot/:number/mine/log", сам.шахтаЛог)
+
+	файбер.Get("/api/bot/:number/tank/fuel", сам.танкТопливо)
+	файбер.Get("/api/bot/:number/angar/silver", сам.ангарСеребро)
+
+	файбер.Get("/api/bot/:number/polygon/level", сам.полигонУровень)
+	файбер.Get("/api/bot/:number/polygon/mode", сам.полигонРежим)
+	файбер.Get("/api/bot/:number/polygon/count_product", сам.полигонРаботаКоличество)
+	файбер.Get("/api/bot/:number/polygon/name_product", сам.полигонРаботаИмя)
+	файбер.Get("/api/bot/:number/polygon/back_time", сам.полигонВремяОсталось)
+
+	файбер.Get("/api/bot/:number/arsenal/level", сам.арсеналУровень)
+	файбер.Get("/api/bot/:number/arsenal/mode", сам.арсеналРежим)
+	файбер.Get("/api/bot/:number/arsenal/count_product", сам.полигонРаботаКоличество)
+	файбер.Get("/api/bot/:number/arsenal/name_product", сам.арсеналРаботаИмя)
+	файбер.Get("/api/bot/:number/arsenal/back_time", сам.арсеналВремяОсталось)
+	файбер.Get("/api/bot/:number/arsenal/log", сам.арсеналЛог)
 	return сам
 }
 

+ 13 - 13
server/lev2/serv_web/web_gui/web_gui.go

@@ -10,30 +10,30 @@ import (
 
 	"wartank/pkg/alias"
 	"wartank/pkg/kernel/kernel_log"
+	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 )
 
 // ВебГип -- веб-сервер для графики
 type ВебГуи struct {
-	серв   ИСервер
-	файбер *fiber.App
-	лог    *kernel_log.Логгер
+	серв ИСервер
+	лог  *kernel_log.Логгер
 }
 
 // НовВебГуи -- возвращает новый веб-сервер для графики
-func НовВебГуи(вебСервер ИВебСервер) *ВебГуи {
+func НовВебГуи(конт ИЯдроКонтекст) *ВебГуи {
 	лог := kernel_log.НовЛоггер("ВебГуи")
-	лог.Паника(вебСервер == nil, "НовВебГуи(): ИВебСервер==nil")
+	лог.Паника(конт == nil, "НовВебГуи(): ИВебСервер==nil")
 	сам := &ВебГуи{
-		серв:   вебСервер.Сервер(),
-		файбер: вебСервер.Файбер(),
-		лог:    лог,
+		серв: конт.Получ("сервер").(ИСервер),
+		лог:  лог,
 	}
-	сам.файбер.Get("/", сам.индекс)
-	сам.файбер.Get("/gui/login", сам.логин)
-	сам.файбер.Get("/gui/list_bot", сам.кукиПроверить, сам.списокБотов)
-	сам.файбер.Get("/gui/add_bot", сам.кукиПроверить, сам.гетБотНов)
-	сам.файбер.Get("/gui/bot/:number/state", сам.кукиПроверить, сам.состояниеБота)
+	файбер := конт.Получ("fiberApp").(*fiber.App)
+	файбер.Get("/", сам.индекс)
+	файбер.Get("/gui/login", сам.логин)
+	файбер.Get("/gui/list_bot", сам.кукиПроверить, сам.списокБотов)
+	файбер.Get("/gui/add_bot", сам.кукиПроверить, сам.гетБотНов)
+	файбер.Get("/gui/bot/:number/state", сам.кукиПроверить, сам.состояниеБота)
 	return сам
 }
 

+ 9 - 3
server/server.go

@@ -4,6 +4,8 @@ package server
 import (
 	"wartank/pkg/kernel/kernel_ctx"
 	"wartank/pkg/kernel/kernel_log"
+	"wartank/pkg/kernel/kernel_serv_http"
+	"wartank/pkg/kernel/kernel_store"
 	. "wartank/pkg/kernel/kernel_types"
 	. "wartank/server/lev0/types"
 	"wartank/server/lev2/serv_bots"
@@ -15,9 +17,9 @@ import (
 type Сервер struct {
 	ИЯдроКонтекст
 	ботоФерма *serv_bots.БотоФерма
-	сервВеб   *serv_web.СервВеб
 	сервСтат  ИСерверСтат
 	лог       ИЯдроЛог
+	ядроВеб   ИЯдроСерверВеб
 }
 
 // НовСервер -- возвращает новый объект приложения
@@ -28,16 +30,20 @@ func НовСервер() *Сервер {
 		ИЯдроКонтекст: kernel_ctx.ПолучЯдроКонтекст(),
 		лог:           лог,
 	}
+	_ = kernel_store.GetKernelStore(сам)
+	сам.ядроВеб = kernel_serv_http.GetKernelServHttp(сам)
+	сам.Уст("сервер", сам)
 	сам.ботоФерма = serv_bots.НовБотоФерма(сам)
-	сам.сервВеб = serv_web.НовСервВеб(сам)
+	_ = serv_web.НовСервВеб(сам)
 	сам.сервСтат = server_stat.НовСерверСтат(сам)
+	_ = ИСервер(сам)
 	return сам
 }
 
 // Пуск -- запускает сервер бота в работу
 func (сам *Сервер) Пуск() error {
 	сам.лог.Инфо("Сервер.Пуск()\n")
-	сам.сервВеб.Пуск()
+	сам.ядроВеб.Run()
 	<-сам.Конт().Done()
 	return nil
 }

+ 0 - 33
vendor/github.com/gofiber/template/.gitignore

@@ -1,33 +0,0 @@
-# Binaries for programs and plugins
-*.exe
-*.exe~
-*.dll
-*.so
-*.dylib
-
-# Test binary, built with `go test -c`
-*.test
-*.tmp
-
-# Output of the go coverage tool, specifically when used with LiteIDE
-*.out
-
-# IDE files
-.vscode
-.DS_Store
-.idea
-
-# Misc
-*.fiber.gz
-*.fasthttp.gz
-*.pprof
-*.workspace
-
-# Dependencies
-/vendor/
-vendor/
-vendor
-/Godeps/
-
-# test files
-*/views/ShouldReload.*

+ 0 - 232
vendor/github.com/gofiber/template/.golangci.yml

@@ -1,232 +0,0 @@
-# Created based on v1.56.1
-# NOTE: Keep this in sync with the version in .github/workflows/linter.yml
-
-run:
-  modules-download-mode: readonly
-  skip-dirs-use-default: false
-  skip-dirs:
-    - internal
-
-output:
-  sort-results: true
-
-linters-settings:
-  errcheck:
-     check-type-assertions: true
-     check-blank: true
-     disable-default-exclusions: true
-     exclude-functions:
-       - '(*bytes.Buffer).Write' # always returns nil error
-       - '(*github.com/valyala/bytebufferpool.ByteBuffer).Write' # always returns nil error
-       - '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteByte' # always returns nil error
-       - '(*github.com/valyala/bytebufferpool.ByteBuffer).WriteString' # always returns nil error
-
-  errchkjson:
-    report-no-exported: true
-
-  exhaustive:
-    default-signifies-exhaustive: true
-
-  forbidigo:
-    forbid:
-      - ^(fmt\.Print(|f|ln)|print|println)$
-      - 'http\.Default(Client|Transport)'
-      # TODO: Eventually enable these patterns
-      # - 'time\.Sleep'
-      # - 'panic'
-
-  gocritic:
-    disabled-checks:
-      - ifElseChain
-
-  gofumpt:
-    module-path: github.com/gofiber/template
-    extra-rules: true
-
-  gosec:
-    excludes:
-      - G104 # Provided by errcheck
-    config:
-      global:
-        audit: true
-  
-  depguard:
-    rules:
-      main:
-        deny:
-          - pkg: flag
-            desc: '`flag` package is only allowed in main.go'
-          - pkg: io/ioutil
-            desc: '`io/ioutil` package is deprecated, use the `io` and `os` package instead'
-
-  govet:
-    check-shadowing: true
-    enable-all: true
-    disable:
-      - shadow
-      - fieldalignment
-      - loopclosure
-
-  grouper:
-    import-require-single-import: true
-    import-require-grouping: true
-
-  misspell:
-    locale: US
-
-  nolintlint:
-    require-explanation: true
-    require-specific: true
-
-  nonamedreturns:
-    report-error-in-defer: true
-
-  predeclared:
-    q: true
-
-  promlinter:
-    strict: true
-
-  revive:
-    enable-all-rules: true
-    rules:
-      # Provided by gomnd linter
-      - name: add-constant
-        disabled: true
-      - name: argument-limit
-        disabled: true
-      # Provided by bidichk
-      - name: banned-characters
-        disabled: true
-      - name: cognitive-complexity
-        disabled: true
-      - name: comment-spacings
-        disabled: true # TODO https://github.com/gofiber/fiber/issues/2816
-      - name: cyclomatic
-        disabled: true
-      - name: early-return
-        severity: warning
-        disabled: true
-      - name: exported
-        disabled: true
-      - name: file-header
-        disabled: true
-      - name: function-result-limit
-        disabled: true
-      - name: function-length
-        disabled: true
-      - name: line-length-limit
-        disabled: true
-      - name: max-public-structs
-        disabled: true
-      - name: modifies-parameter
-        disabled: true
-      - name: nested-structs
-        disabled: true
-      - name: package-comments
-        disabled: true
-      - name: unchecked-type-assertion
-        disabled: true # TODO https://github.com/gofiber/fiber/issues/2816
-      # Provided by errcheck
-      - name: unhandled-error
-        disabled: true
-      - name: use-any # TODO Enable for v3 release
-        disabled: true
-
-  stylecheck:
-    checks:
-      - all
-      - -ST1000
-      - -ST1020
-      - -ST1021
-      - -ST1022
-
-  tagliatelle:
-    case:
-      rules:
-        json: snake
-
-  tenv:
-    all: true
-
-  #unparam:
-  #  check-exported: true
-
-  wrapcheck:
-    ignorePackageGlobs:
-      - github.com/gofiber/fiber/*
-      - github.com/valyala/fasthttp
-
-issues:
-   exclude-use-default: false
-
-linters:
-  disable:
-    - spancheck
-  enable:
-    - asasalint
-    - asciicheck
-    - bidichk
-    - bodyclose
-    - containedctx
-    - contextcheck
-    - depguard
-    - dogsled
-    - durationcheck
-    - errcheck
-    - errchkjson
-    - errname
-    - errorlint
-    - execinquery
-    - exhaustive
-    - exportloopref
-    - forbidigo
-    - forcetypeassert
-    - gochecksumtype
-    - goconst
-    - gocritic
-    - gofmt
-    - gofumpt
-    - goimports
-    - gomoddirectives
-    - goprintffuncname
-    - gosec
-    - gosimple
-    - gosmopolitan
-    - govet
-    - grouper
-    - inamedparam
-    - loggercheck
-    - mirror
-    - misspell
-    - nakedret
-    - nilerr
-    - nilnil
-    - noctx
-    - nolintlint
-    - nonamedreturns
-    - nosprintfhostport
-    - perfsprint
-    - predeclared
-    - promlinter
-    - reassign
-    - revive
-    - rowserrcheck
-    - sqlclosecheck
-    - staticcheck
-    - stylecheck
-    - tagalign
-    - tagliatelle
-    - testifylint
-    - testpackage
-    - thelper
-    - tparallel
-    - typecheck
-    - unconvert
-    - unparam
-    - unused
-    - usestdlibvars
-    - wastedassign
-    - whitespace
-    - wrapcheck
-    - tenv

+ 0 - 21
vendor/github.com/gofiber/template/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 Fiber
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 243
vendor/github.com/gofiber/template/README.md

@@ -1,243 +0,0 @@
----
-title: 👋 Welcome
-description: 🧬 Template engine middlewares for Fiber.
-sidebar_position: 1
----
-
-
-<p align="center">
-  <img height="125" alt="Fiber" src="https://raw.githubusercontent.com/gofiber/template/master/.github/logo-dark.svg#gh-dark-mode-only"/>
-  <img height="125" alt="Fiber" src="https://raw.githubusercontent.com/gofiber/template/master/.github/logo.svg#gh-light-mode-only" />
-  <br/>
-
-  <a href="https://pkg.go.dev/github.com/gofiber/template?tab=doc">
-    <img src="https://img.shields.io/badge/%F0%9F%93%9A%20godoc-pkg-00ACD7.svg?color=00ACD7&style=flat"/>
-  </a>
-  <a href="https://goreportcard.com/report/github.com/gofiber/template">
-    <img src="https://img.shields.io/badge/%F0%9F%93%9D%20goreport-A%2B-75C46B"/>
-  </a>
-  <a href="https://gofiber.io/discord">
-    <img src="https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7"/>
-  </a>
-</p>
-
-This package provides universal methods to use multiple template engines with the [Fiber web framework](https://github.com/gofiber/fiber) using the new [Views](https://godoc.org/github.com/gofiber/fiber#Views) interface that is available from `> v1.11.1`. Special thanks to @bdtomlin & @arsmn for helping!
-
-9 template engines are supported:
-- [ace](./ace/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Ace%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-ace.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a> 
-- [amber](./amber/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Amber%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-amber.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-- [django](./django/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Django%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-django.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a> 
-- [handlebars](./handlebars/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Handlebars%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-handlebars.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-- [html](./html/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Html%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-html.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/> </a>
-- [jet](./jet/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Jet%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-jet.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-- [mustache](./mustache/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Mustache%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-mustache.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-- [pug](./pug/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Pug%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-pug.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-- [slim](./slim/README.md) <a href="https://github.com/gofiber/template/actions?query=workflow%3A%22Tests+Slim%22"> <img src="https://img.shields.io/github/actions/workflow/status/gofiber/template/test-slim.yml?branch=master&label=%F0%9F%A7%AA%20&style=flat&color=75C46B"/></a>
-
-### Installation
-> Go version `1.17` or higher is required.
-
-```
-go get -u github.com/gofiber/fiber/v2
-go get -u github.com/gofiber/template/any_template_engine/vX
-```
-
-### Example
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-
-	// To use a specific template engine, import as shown below:
-	// "github.com/gofiber/template/pug"
-	// "github.com/gofiber/template/mustache"
-	// etc..
-
-	// In this example we use the html template engine
-	"github.com/gofiber/template/html/v2"
-)
-
-func main() {
-	// Create a new engine by passing the template folder
-	// and template extension using <engine>.New(dir, ext string)
-	engine := html.New("./views", ".html")
-
-  	// We also support the http.FileSystem interface
-	// See examples below to load templates from embedded files
-	engine := html.NewFileSystem(http.Dir("./views"), ".html")
-
-	// Reload the templates on each render, good for development
-	engine.Reload(true) // Optional. Default: false
-
-	// Debug will print each template that is parsed, good for debugging
-	engine.Debug(true) // Optional. Default: false
-
-	// Layout defines the variable name that is used to yield templates within layouts
-	engine.Layout("embed") // Optional. Default: "embed"
-
-	// Delims sets the action delimiters to the specified strings
-	engine.Delims("{{", "}}") // Optional. Default: engine delimiters
-
-	// AddFunc adds a function to the template's global function map.
-	engine.AddFunc("greet", func(name string) string {
-		return "Hello, " + name + "!"
-	})
-
-	// After you created your engine, you can pass it to Fiber's Views Engine
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	// To render a template, you can call the ctx.Render function
-	// Render(tmpl string, values interface{}, layout ...string)
-	app.Get("/", func(c *fiber.Ctx) error {
-		return c.Render("index", fiber.Map{
-			"Title": "Hello, World!",
-		})
-	})
-
-	// Render with layout example
-	app.Get("/layout", func(c *fiber.Ctx) error {
-		return c.Render("index", fiber.Map{
-			"Title": "Hello, World!",
-		}, "layouts/main")
-	})
-
-	log.Fatal(app.Listen(":3000"))
-}
-
-```
-
-### More Examples
-
-To view more specific examples, you could visit each engine folder to learn more
-- [ace](./ace/README.md)
-- [amber](./amber/README.md)
-- [django](./django/README.md)
-- [handlebars](./handlebars/README.md)
-- [html](./html/README.md)
-- [jet](./jet/README.md)
-- [mustache](./mustache/README.md)
-- [pug](./pug/README.md)
-- [slim](./slim/README.md)
-
-
-### embedded Systems
-
-We support the `http.FileSystem` interface, so you can use different libraries to load the templates from embedded binaries.
-
-#### pkger
-Read documentation: https://github.com/markbates/pkger
-
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/template/html"
-
-	"github.com/markbates/pkger"
-)
-
-func main() {
-	engine := html.NewFileSystem(pkger.Dir("/views"), ".html")
-
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	// run pkger && go build
-}
-```
-#### packr
-Read documentation: https://github.com/gobuffalo/packr
-
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/template/html"
-
-	"github.com/gobuffalo/packr/v2"
-)
-
-func main() {
-	engine := html.NewFileSystem(packr.New("Templates", "/views"), ".html")
-
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	// run packr && go build
-}
-```
-#### go.rice
-Read documentation: https://github.com/GeertJohan/go.rice
-
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/template/html"
-
-	"github.com/GeertJohan/go.rice"
-)
-
-func main() {
-	engine := html.NewFileSystem(rice.MustFindBox("views").HTTPBox(), ".html")
-
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	// run rice embed-go && go build
-}
-
-```
-#### fileb0x
-Read documentation: https://github.com/UnnoTed/fileb0x
-
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/template/html"
-	// your generated package
-	"github.com/<user>/<repo>/static"
-)
-
-func main() {
-	engine := html.NewFileSystem(static.HTTP, ".html")
-
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	// Read the documentation on how to use fileb0x
-}
-```
-
-
-### Benchmarks
-
-#### Simple
-![](https://raw.githubusercontent.com/gofiber/template/master/.github/data/Simple-TimeperOperation.png)
-
-#### Extended
-![](https://raw.githubusercontent.com/gofiber/template/master/.github/data/Extended-TimeperOperation.png)
-
-Benchmarks were ran on Apple Macbook M1. Each engine was benchmarked 20 times and the results averaged into a single xlsx file. Mustache was excluded from the extended benchmark

+ 0 - 21
vendor/github.com/gofiber/template/html/v2/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 Fiber
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 210
vendor/github.com/gofiber/template/html/v2/README.md

@@ -1,210 +0,0 @@
----
-id: html
-title: HTML
----
-
-![Release](https://img.shields.io/github/v/tag/gofiber/template?filter=html*)
-[![Discord](https://img.shields.io/discord/704680098577514527?style=flat&label=%F0%9F%92%AC%20discord&color=00ACD7)](https://gofiber.io/discord)
-![Test](https://github.com/gofiber/template/workflows/Tests/badge.svg)
-![Security](https://github.com/gofiber/template/workflows/Security/badge.svg)
-![Linter](https://github.com/gofiber/template/workflows/Linter/badge.svg)
-
-HTML is the official Go template engine [html/template](https://golang.org/pkg/html/template/), to see the original syntax documentation please [click here](TEMPLATES_CHEATSHEET.md)
-
-**Info:**
-
-All templates within the specified view directory are analyzed and compiled at the beginning to increase the performance when using them.
-Thus it should be noted that no `definition` with the same name should exist, otherwise they will overwrite each other.
-For templating the `{{embed}}` tag should be used
-
-### Basic Example
-
-_**./views/index.html**_
-
-```html
-{{template "partials/header" .}}
-
-<h1>{{.Title}}</h1>
-
-{{template "partials/footer" .}}
-```
-
-_**./views/partials/header.html**_
-
-```html
-<h2>Header</h2>
-```
-
-_**./views/partials/footer.html**_
-
-```html
-<h2>Footer</h2>
-```
-
-_**./views/layouts/main.html**_
-
-```html
-<!DOCTYPE html>
-<html>
-  <head>
-    <title>Main</title>
-  </head>
-
-  <body>
-    {{embed}}
-  </body>
-</html>
-```
-
-```go
-package main
-
-import (
-	"log"
-
-	"github.com/gofiber/fiber/v2"
-	"github.com/gofiber/template/html/v2"
-)
-
-func main() {
-	// Create a new engine
-	engine := html.New("./views", ".html")
-
-	// Or from an embedded system
-	// See github.com/gofiber/embed for examples
-	// engine := html.NewFileSystem(http.Dir("./views"), ".html")
-
-	// Pass the engine to the Views
-	app := fiber.New(fiber.Config{
-		Views: engine,
-	})
-
-	app.Get("/", func(c *fiber.Ctx) error {
-		// Render index
-		return c.Render("index", fiber.Map{
-			"Title": "Hello, World!",
-		})
-	})
-
-	app.Get("/layout", func(c *fiber.Ctx) error {
-		// Render index within layouts/main
-		return c.Render("index", fiber.Map{
-			"Title": "Hello, World!",
-		}, "layouts/main")
-	})
-
-	app.Get("/layouts-nested", func(c *fiber.Ctx) error {
-		// Render index within layouts/nested/main within layouts/nested/base
-		return c.Render("index", fiber.Map{
-			"Title": "Hello, World!",
-		}, "layouts/nested/main", "layouts/nested/base")
-	})
-
-	log.Fatal(app.Listen(":3000"))
-}
-
-```
-
-### Example with embed.FS
-
-```go
-package main
-
-import (
-    "log"
-    "net/http"
-    "embed"
-
-    "github.com/gofiber/fiber/v2"
-    "github.com/gofiber/template/html"
-)
-
-//go:embed views/*
-var viewsfs embed.FS
-
-func main() {
-    engine := html.NewFileSystem(http.FS(viewsfs), ".html")
-
-    // Pass the engine to the Views
-    app := fiber.New(fiber.Config{
-        Views: engine,
-    })
-
-
-    app.Get("/", func(c *fiber.Ctx) error {
-        // Render index - start with views directory
-        return c.Render("views/index", fiber.Map{
-            "Title": "Hello, World!",
-        })
-    })
-
-    log.Fatal(app.Listen(":3000"))
-}
-```
-
-and change the starting point to the views directory
-
-_**./views/index.html**_
-
-```html
-{{template "views/partials/header" .}}
-
-<h1>{{.Title}}</h1>
-
-{{template "views/partials/footer" .}}
-```
-
-### Example with innerHTML
-
-```go
-package main
-
-import (
-    "embed"
-    "html/template"
-    "log"
-    "net/http"
-
-    "github.com/gofiber/fiber/v2"
-    "github.com/gofiber/template/html"
-)
-
-//go:embed views/*
-var viewsfs embed.FS
-
-func main() {
-    engine := html.NewFileSystem(http.FS(viewsfs), ".html")
-    engine.AddFunc(
-        // add unescape function
-        "unescape", func(s string) template.HTML {
-            return template.HTML(s)
-        },
-    )
-
-    // Pass the engine to the Views
-    app := fiber.New(fiber.Config{Views: engine})
-
-    app.Get("/", func(c *fiber.Ctx) error {
-        // Render index
-        return c.Render("views/index", fiber.Map{
-            "Title": "Hello, <b>World</b>!",
-        })
-    })
-
-    log.Fatal(app.Listen(":3000"))
-}
-```
-
-and change the starting point to the views directory
-
-_**./views/index.html**_
-
-```html
-<p>{{ unescape .Title}}</p>
-```
-
-**html output**
-
-```html
-<p>Hello, <b>World</b>!</p>
-```

+ 0 - 582
vendor/github.com/gofiber/template/html/v2/TEMPLATES_CHEATSHEET.md

@@ -1,582 +0,0 @@
-# Golang Templates Cheatsheet
-
-The Go standard library provides a set of packages to generate output. The [text/template](https://archive.is/o/2HksZ/https://golang.org/pkg/text/template/) package implements templates for generating text output, while the [html/template](https://archive.is/o/2HksZ/https://golang.org/pkg/html/template/) package implements templates for generating HTML output that is safe against certain attacks. Both packages use the same interface but the following examples of the core features are directed towards HTML applications.
-
----
-
-## Table of Contents
-
-- [Parsing and Creating Templates](#parsing-and-creating-templates)
-- [Executing Templates](#executing-templates)
-- [Template Encoding and HTML](#template-encoding-and-html)
-- [Template Variables](#template-variables)
-- [Template Actions](#template-actions)
-- [Template Functions](#template-functions)
-- [Template Comparison Functions](#template-comparison-functions)
-- [Nested Templates and Layouts](#nested-templates-and-layouts)
-- [Templates Calling Functions](#templates-calling-functions)
-
----
-
-## Parsing and Creating Templates
-
-#### Naming Templates
-
-There is no defined file extension for Go templates. One of the most popular is `.tmpl` supported by vim-go and [referenced in the text/template godocs](https://archive.is/o/2HksZ/golang.org/pkg/text/template/%23example_Template_helpers). The extension `.gohtml` supports syntax highlighting in both Atom and GoSublime editors. Finally analysis of large Go codebases finds that `.tpl` is often used by developers. While the extension is not important it is still good to be consistent within a project for clarity.
-
----
-
-#### Creating a Template
-
-`tpl, err := template.Parse(filename)` will get the template at filename and store it in tpl. tpl can then be executed to show the template.
-
----
-
-#### Parsing Multiple Templates
-
-`template.ParseFiles(filenames)` takes a list of filenames and stores all templates. `template.ParseGlob(pattern)` will find all templates matching the pattern and store the templates.
-
----
-
-## Executing Templates
-
-#### Execute a Single Template
-
-Once a template has been parsed there are two options to execute them. A single template `tpl` can be executed using `tpl.Execute(io.Writer, data)`. The content of tpl will be written to the io.Writer. Data is an interface passed to the template that will be useable in the template.
-
----
-
-#### Executing a Named Template
-
-`tpl.ExecuteTemplate(io.Writer, name, data)` works the same as execute but allows for a string name of the template the user wants to execute.
-
----
-
-## Template Encoding and HTML
-
-#### Contextual Encoding
-
-Go’s html/template package does encoding based on the context of the code. As a result, html/template encodes any characters that need encoding to be rendered correctly.
-
-For example the < and > in `"<h1>A header!</h1>"` will be encoded as `&lt;h1&gt;A header!&lt;/h1&gt;` .
-
-Type `template.HTML` can be used to skip encoding by telling Go the string is safe. `template.HTML("<h1>A Safe header</h1>")` will then be `<h1>A Safe header</h1>` . Using this type with user input is dangerous and leaves the application vulnerable.
-
-The go `html/template` package is aware of attributes within the template and will encode values differently based on the attribute.
-
-Go templates can also be used with javascript. Structs and maps will be expanded into JSON objects and quotes will be added to strings for use in function parameters and as variable values.
-
-```go
-    // Go
-    type Cat struct {
-    	Name string
-    	Age int
-    }
-
-    kitten := Cat{"Sam", 12}
-```
-
-```html
-// Template
-<script>
-  var cat = {{.kitten}}
-</script>
-```
-
-```js
-    // Javascript
-    var cat = {"Name":"Sam", "Age":12}
-```
-
----
-
-#### Safe Strings and HTML Comments
-
-The `html/template` package will remove any comments from a template by default. This can cause issues when comments are necessary such as detecting internet explorer.
-
-```html
-<!--[if IE]>
-  Place content here to target all Internet Explorer users.
-<![endif]-->
-```
-
-We can use the Custom Functions method (Globally) to create a function that returns html preserving comments. Define a function `htmlSafe` in the FuncMap of the template.
-
-```go
-    testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
-    	"htmlSafe": func(html string) template.HTML {
-    		return template.HTML(html)
-        },
-    }).ParseFiles("hello.gohtml")
-```
-
-This function takes a string and produces the unaltered HTML code. This function can be used in a template like so to preserve the comments `<!--[if IE 6]>` and `<![endif]-->` :
-
-```go
-    {{htmlSafe "<!--[if IE 6]>" }}
-    <meta http-equiv="Content-Type" content="text/html; charset=Unicode">
-    {{ htmlSafe "<![endif]-->" }}
-```
-
----
-
-## Template Variables
-
-#### The dot character (.)
-
-A template variable can be a boolean, string, character, integer, floating-point, imaginary, or complex constant in Go syntax. Data passed to the template can be accessed using dot `{{ . }}`.
-
-If the data is a complex type then it’s fields can be accessed using the dot with the field name `{{ .FieldName }}`.
-
-Dots can be chained together if the data contains multiple complex structures. `{{ .Struct.StructTwo.Field }}`
-
----
-
-#### Variables in Templates
-
-Data passed to the template can be saved in a variable and used throughout the template. `{{$number := .}}` We use the `$number` to create a variable then initialize it with the value passed to the template. To use the variable we call it in the template with `{{$number}}`.
-
-```go
-    {{$number := .}}
-    <h1> It is day number {{$number}} of the month </h1>
-```
-
-```go
-    var tpl *template.Template
-
-    tpl = template.Must(template.ParseFiles("templateName"))
-
-    err := tpl.ExecuteTemplate(os.Stdout, "templateName", 23)
-```
-
-In this example we pass 23 to the template and stored in the `$number` variable which can be used anywhere in the template
-
----
-
-## Template Actions
-
-#### If/Else Statements
-
-Go templates support if/else statements like many programming languages. We can use the if statement to check for values, if it doesn’t exist we can use an else value. The empty values are false, 0, any nil pointer or interface value, and any array, slice, map, or string of length zero.
-
-```html
-<h1>Hello, {{if .Name}} {{.Name}} {{else}} Anonymous {{end}}!</h1>
-```
-
-If .Name exists then `Hello, Name` will be printed (replaced with the name value) otherwise it will print `Hello, Anonymous`.
-
-Templates also provide the else if statment `{{else if .Name2 }}` which can be used to evaluate other options after an if.
-
----
-
-#### Removing Whitespace
-
-Adding different values to a template can add various amounts of whitespace. We can either change our template to better handle it, by ignoring or minimizing effects, or we can use the minus sign `-` within out template.
-
-`<h1>Hello, {{if .Name}} {{.Name}} {{- else}} Anonymous {{- end}}!</h1>`
-
-Here we are telling the template to remove all spaces between the `Name` variable and whatever comes after it. We are doing the same with the end keyword. This allows us to have whitespace within the template for easier reading but remove it in production.
-
----
-
-#### Range Blocks
-
-Go templates have a `range` keyword to iterate over all objects in a structure. Suppose we had the Go structures:
-
-```go
-    type Item struct {
-    	Name  string
-    	Price int
-    }
-
-    type ViewData struct {
-    	Name  string
-    	Items []Item
-    }
-```
-
-We have an Item, with a name and price, then a ViewData which is the structure sent to the template. Consider the template containing the following:
-
-```html
-{{range .Items}}
-<div class="item">
-  <h3 class="name">{{.Name}}</h3>
-  <span class="price">${{.Price}}</span>
-</div>
-{{end}}
-```
-
-For each Item in the range of Items (in the ViewData structure) get the Name and Price of that item and create html for each Item automatically. Within a range each Item becomes the `{{.}}` and the item properties therefore become `{{.Name}}` or `{{.Price}}` in this example.
-
----
-
-## Template Functions
-
-The template package provides a list of predefined global functions. Below are some of the most used.
-
----
-
-#### Indexing structures in Templates
-
-If the data passed to the template is a map, slice, or array it can be indexed from the template. We use `{{index x number}}` where index is the keyword, x is the data and number is a integer for the index value. If we had `{{index names 2}}` it is equivalent to `names[2]`. We can add more integers to index deeper into data. `{{index names 2 3 4}}` is equivalent to `names[2][3][4]`.
-
-```html
-<body>
-  <h1>{{index .FavNums 2 }}</h1>
-</body>
-```
-
-```go
-    type person struct {
-    	Name    string
-    	FavNums []int
-    }
-
-    func main() {
-
-    	tpl := template.Must(template.ParseGlob("*.gohtml"))
-    	tpl.Execute(os.Stdout, &person{"Curtis", []int{7, 11, 94}})
-    }
-```
-
-This code example passes a person structure and gets the 3rd favourite number from the FavNums slice.
-
----
-
-#### The `and` Function
-
-The and function returns the boolean AND of its arguments by returning the first empty argument or the last argument. `and x y` behaves logically as `if x then y else x` . Consider the following go code
-
-```go
-    type User struct {
-      Admin bool
-    }
-
-    type ViewData struct {
-      *User
-    }
-```
-
-Pass a ViewData with a User that has Admin set true to the following template
-
-```go
-
-    {{if and .User .User.Admin}}
-      You are an admin user!
-    {{else}}
-      Access denied!
-    {{end}}
-```
-
-The result will be `You are an admin user!`. However if the ViewData did not include a \*User object or Admin was set as false then the result will be `Access denied!`.
-
----
-
-#### The `or` Function
-
-The or function operates similarly to the and function however will stop at the first true. `or x y` is equivalent to `if x then x else y` so y will never be evaluated if x is not empty.
-
----
-
-#### The `not` Function
-
-The not function returns the boolean negation of the argument.
-
-```go
-    {{ if not .Authenticated}}
-      Access Denied!
-    {{ end }}
-```
-
----
-
-## Template Comparison Functions
-
-#### Comparisons
-
-The `html/template` package provides a variety of functions to do comparisons between operators. The operators may only be basic types or named basic types such as `type Temp float32` Remember that template functions take the form `{{ function arg1 arg2 }}`.
-
-- `eq` Returns the result of `arg1 == arg2`
-- `ne` Returns the result of `arg1 != arg2`
-- `lt` Returns the result of `arg1 < arg2`
-- `le` Returns the result of `arg1 <= arg2`
-- `gt` Returns the result of `arg1 > arg2`
-- `ge` Returns the result of `arg1 >= arg2`
-
-Of special note `eq` can be used with two or more arguments by comparing all arguments to the first. `{{ eq arg1 arg2 arg3 arg4}}` will result in the following logical expression:
-
-`arg1==arg2 || arg1==arg3 || arg1==arg4`
-
----
-
-## Nested Templates and Layouts
-
-#### Nesting Templates
-
-Nested templates can be used for parts of code frequently used across templates, a footer or header for example. Rather than updating each template separately we can use a nested template that all other templates can use. You can define a template as follows:
-
-```go
-    {{define "footer"}}
-    <footer>
-    	<p>Here is the footer</p>
-    </footer>
-    {{end}}
-```
-
-A template named “footer” is defined which can be used in other templates like so to add the footer template content into the other template:
-
-```go
-    {{template "footer"}}
-```
-
----
-
-#### Passing Variables between Templates
-
-The `template` action used to include nested templates also allows a second parameter to pass data to the nested template.
-
-```html
-// Define a nested template called header 
-{{define "header"}}
-<h1>{{.}}</h1>
-{{end}}
-
-// Call template and pass a name parameter 
-{{range .Items}}
-<div class="item">
-  {{template "header" .Name}}
-  <span class="price">${{.Price}}</span>
-</div>
-{{end}}
-```
-
-We use the same range to loop through Items as before but we pass the name to the header template each time in this simple example.
-
----
-
-#### Creating Layouts
-
-Glob patterns specify sets of filenames with wildcard characters. The `template.ParseGlob(pattern string)` function will parse all templates that match the string pattern. `template.ParseFiles(files...)` can also be used with a list of file names.
-
-The templates are named by default based on the base names of the argument files. This mean `views/layouts/hello.gohtml` will have the name `hello.gohtml` . If the template has a `{{define “templateName”}}` within it then that name will be usable.
-
-A specific template can be executed using `t.ExecuteTemplate(w, "templateName", nil)` . `t` is an object of type Template, `w` is type io.Writer such as an `http.ResponseWriter`, Then there is the name of the template to execute, and finally passing any data to the template, in this case a nil value.
-
-Example main.go file
-
-```go
-    // Omitted imports & package
-
-    var LayoutDir string = "views/layouts"
-    var bootstrap *template.Template
-
-    func main() {
-    	var err error
-    	bootstrap, err = template.ParseGlob(LayoutDir + "/*.gohtml")
-    	if err != nil {
-    		panic(err)
-    	}
-
-    	http.HandleFunc("/", handler)
-    	http.ListenAndServe(":8080", nil)
-    }
-
-    func handler(w http.ResponseWriter, r *http.Request) {
-    	bootstrap.ExecuteTemplate(w, "bootstrap", nil)
-    }
-```
-
-All `.gohtml` files are parsed in main. When route `/` is reached the template defined as `bootstrap` is executed using the handler function.
-
-Example views/layouts/bootstrap.gohtml file
-
-```html
-    {{define "bootstrap"}}
-    <!DOCTYPE html>
-    <html lang="en">
-      <head>
-        <title>Go Templates</title>
-        <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
-    	rel="stylesheet">
-      </head>
-      <body>
-        <div class="container-fluid">
-          <h1>Filler header</h1>
-    	  <p>Filler paragraph</p>
-        </div>
-        <!-- jquery & Bootstrap JS -->
-        <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
-        </script>
-        <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js">
-        </script>
-      </body>
-    </html>
-    {{end}}
-```
-
-## Templates Calling Functions
-
-#### Function Variables (calling struct methods)
-
-We can use templates to call the methods of objects in the template to return data. Consider the User struct with the following method.
-
-```go
-    type User struct {
-      ID    int
-      Email string
-    }
-
-    func (u User) HasPermission(feature string) bool {
-      if feature == "feature-a" {
-        return true
-      } else {
-        return false
-      }
-    }
-```
-
-When a type User has been passed to the template we can then call this method from the template.
-
-```html
-{{if .User.HasPermission "feature-a"}}
-<div class="feature">
-  <h3>Feature A</h3>
-  <p>Some other stuff here...</p>
-</div>
-{{else}}
-<div class="feature disabled">
-  <h3>Feature A</h3>
-  <p>To enable Feature A please upgrade your plan</p>
-</div>
-{{end}}
-```
-
-The template checks if the User HasPermission for the feature and renders depending on the result.
-
----
-
-#### Function Variables (call)
-
-If the Method HasPermission has to change at times then the Function Variables (Methods) implementation may not fit the design. Instead a `HasPermission func(string) bool` attribute can be added on the `User` type. This can then have a function assigned to it at creation.
-
-```go
-    // Structs
-    type ViewData struct {
-      User User
-    }
-
-    type User struct {
-      ID            int
-      Email         string
-      HasPermission func(string) bool
-    }
-
-    // Example of creating a ViewData
-    vd := ViewData{
-    		User: User{
-    			ID:    1,
-    			Email: "curtis.vermeeren@gmail.com",
-    			// Create the HasPermission function
-    			HasPermission: func(feature string) bool {
-    				if feature == "feature-b" {
-    					return true
-    				}
-    				return false
-    			},
-    		},
-    	}
-
-    // Executing the ViewData with the template
-    err := testTemplate.Execute(w, vd)
-```
-
-We need to tell the Go template that we want to call this function so we must change the template from the Function Variables (Methods) implementation to do this. We use the `call` keyword supplied by the go `html/template` package. Changing the previous template to use `call` results in:
-
-```html
-{{if (call .User.HasPermission "feature-b")}}
-<div class="feature">
-  <h3>Feature B</h3>
-  <p>Some other stuff here...</p>
-</div>
-{{else}}
-<div class="feature disabled">
-  <h3>Feature B</h3>
-  <p>To enable Feature B please upgrade your plan</p>
-</div>
-{{end}}
-```
-
----
-
-#### Custom Functions
-
-Another way to call functions is to create custom functions with `template.FuncMap` . This method creates global methods that can be used throughout the entire application. FuncMap has type `map[string]interface{}` mapping a string, the function name, to a function. The mapped functions must have either a single return value, or two return values where the second has type error.
-
-```go
-    // Creating a template with function hasPermission
-    testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
-        "hasPermission": func(user User, feature string) bool {
-          if user.ID == 1 && feature == "feature-a" {
-            return true
-          }
-          return false
-        },
-      }).ParseFiles("hello.gohtml")
-```
-
-Here the function to check if a user has permission for a feature is mapped to the string `"hasPermission"` and stored in the FuncMap. Note that the custom functions must be created before calling `ParseFiles()`
-
-The function could be executed in the template as follows:
-
-```go
-    {{ if hasPermission .User "feature-a" }}
-```
-
-The `.User` and string `"feature-a"` are both passed to `hasPermission` as arguments.
-
----
-
-#### Custom Functions (Globally)
-
-The previous two methods of custom functions rely on `.User` being passed to the template. This works in many cases but in a large application passing too many objects to a template can become difficult to maintain across many templates. We can change the implementation of the custom function to work without the .User being passed.
-
-Using a similar feature example as the other 2 sections first you would have to create a default `hasPermission` function and define it in the template’s function map.
-
-```go
-      testTemplate, err = template.New("hello.gohtml").Funcs(template.FuncMap{
-        "hasPermission": func(feature string) bool {
-          return false
-        },
-      }).ParseFiles("hello.gohtml")
-```
-
-This function could be placed in `main()` or somewhere that ensures the default `hasPermission` is created in the `hello.gohtml` function map. The default function just returns false but it defines the function and implementation that doesn’t require `User` .
-
-Next a closure could be used to redefine the `hasPermission` function. It would use the `User` data available when it is created in a handler rather than having `User` data passed to it. Within the handler for the template you can redefine any functions to use the information available.
-
-```go
-    func handler(w http.ResponseWriter, r *http.Request) {
-    	w.Header().Set("Content-Type", "text/html")
-
-    	user := User{
-    		ID:    1,
-    		Email: "Curtis.vermeeren@gmail.com",
-    	}
-    	vd := ViewData{}
-    	err := testTemplate.Funcs(template.FuncMap{
-    		"hasPermission": func(feature string) bool {
-    			if user.ID == 1 && feature == "feature-a" {
-    				return true
-    			}
-    			return false
-    		},
-    	}).Execute(w, vd)
-    	if err != nil {
-    		http.Error(w, err.Error(), http.StatusInternalServerError)
-    	}
-    }
-```
-
-In this handler a `User` is created with ID and Email, Then a `ViewData` is created without passing the user to it. The `hasPermission` function is redefined using `user.ID` which is available when the function is created. `{{if hasPermission "feature-a"}}` can be used in a template without having to pass a `User` to the template as the User object in the handler is used instead.
-
----

+ 0 - 174
vendor/github.com/gofiber/template/html/v2/html.go

@@ -1,174 +0,0 @@
-package html
-
-import (
-	"fmt"
-	"html/template"
-	"io"
-	"log"
-	"net/http"
-	"os"
-	"path/filepath"
-	"strings"
-
-	core "github.com/gofiber/template"
-	"github.com/gofiber/utils"
-)
-
-// Engine struct
-type Engine struct {
-	core.Engine
-	// templates
-	Templates *template.Template
-}
-
-// New returns a HTML render engine for Fiber
-func New(directory, extension string) *Engine {
-	return newEngine(directory, extension, nil)
-}
-
-// NewFileSystem returns a HTML render engine for Fiber with file system
-func NewFileSystem(fs http.FileSystem, extension string) *Engine {
-	return newEngine("/", extension, fs)
-}
-
-// newEngine creates a new Engine instance with common initialization logic.
-func newEngine(directory, extension string, fs http.FileSystem) *Engine {
-	engine := &Engine{
-		Engine: core.Engine{
-			Left:       "{{",
-			Right:      "}}",
-			Directory:  directory,
-			FileSystem: fs,
-			Extension:  extension,
-			LayoutName: "embed",
-			Funcmap:    make(map[string]interface{}),
-		},
-	}
-	// Add a default function that throws an error if called unexpectedly.
-	// This can be useful for debugging or ensuring certain functions are used correctly.
-	engine.AddFunc(engine.LayoutName, func() error {
-		return fmt.Errorf("layoutName called unexpectedly")
-	})
-	return engine
-}
-
-// Load parses the templates to the engine.
-func (e *Engine) Load() error {
-	if e.Loaded {
-		return nil
-	}
-
-	// race safe
-	e.Mutex.Lock()
-	defer e.Mutex.Unlock()
-	e.Templates = template.New(e.Directory)
-
-	// Set template settings
-	e.Templates.Delims(e.Left, e.Right)
-	e.Templates.Funcs(e.Funcmap)
-
-	walkFn := func(path string, info os.FileInfo, err error) error {
-		// Return error if exist
-		if err != nil {
-			return err
-		}
-
-		// Skip file if it's a directory or has no file info
-		if info == nil || info.IsDir() {
-			return nil
-		}
-
-		// Skip file if it does not equal the given template Extension
-		if len(e.Extension) >= len(path) || path[len(path)-len(e.Extension):] != e.Extension {
-			return nil
-		}
-
-		// Get the relative file path
-		// ./views/html/index.tmpl -> index.tmpl
-		rel, err := filepath.Rel(e.Directory, path)
-		if err != nil {
-			return err
-		}
-
-		// Reverse slashes '\' -> '/' and
-		// partials\footer.tmpl -> partials/footer.tmpl
-		name := filepath.ToSlash(rel)
-		// Remove ext from name 'index.tmpl' -> 'index'
-		name = strings.TrimSuffix(name, e.Extension)
-		// name = strings.Replace(name, e.Extension, "", -1)
-		// Read the file
-		// #gosec G304
-		buf, err := utils.ReadFile(path, e.FileSystem)
-		if err != nil {
-			return err
-		}
-
-		// Create new template associated with the current one
-		// This enable use to invoke other templates {{ template .. }}
-		_, err = e.Templates.New(name).Parse(string(buf))
-		if err != nil {
-			return err
-		}
-
-		// Debugging
-		if e.Verbose {
-			log.Printf("views: parsed template: %s\n", name)
-		}
-		return err
-	}
-
-	// notify Engine that we parsed all templates
-	e.Loaded = true
-
-	if e.FileSystem != nil {
-		return utils.Walk(e.FileSystem, e.Directory, walkFn)
-	}
-	return filepath.Walk(e.Directory, walkFn)
-}
-
-// Render will execute the template name along with the given values.
-func (e *Engine) Render(out io.Writer, name string, binding interface{}, layout ...string) error {
-	// Check if templates need to be loaded/reloaded
-	if e.PreRenderCheck() {
-		if err := e.Load(); err != nil {
-			return err
-		}
-	}
-
-	// Acquire read lock for accessing the template
-	e.Mutex.RLock()
-	tmpl := e.Templates.Lookup(name)
-	e.Mutex.RUnlock()
-
-	if tmpl == nil {
-		return fmt.Errorf("render: template %s does not exist", name)
-	}
-
-	render := renderFuncCreate(e, out, binding, *tmpl, nil)
-	if len(layout) > 0 && layout[0] != "" {
-		e.Mutex.Lock()
-		defer e.Mutex.Unlock()
-	}
-
-	// construct a nested render function to embed templates in layouts
-	for _, layName := range layout {
-		if layName == "" {
-			break
-		}
-		lay := e.Templates.Lookup(layName)
-		if lay == nil {
-			return fmt.Errorf("render: LayoutName %s does not exist", layName)
-		}
-		render = renderFuncCreate(e, out, binding, *lay, render)
-	}
-	return render()
-}
-
-func renderFuncCreate(e *Engine, out io.Writer, binding interface{}, tmpl template.Template, childRenderFunc func() error) func() error {
-	return func() error {
-		tmpl.Funcs(map[string]interface{}{
-			e.LayoutName: childRenderFunc,
-		})
-		return tmpl.Execute(out, binding)
-	}
-}

+ 0 - 129
vendor/github.com/gofiber/template/template.go

@@ -1,129 +0,0 @@
-package template
-
-import (
-	"io"
-	"net/http"
-	"sync"
-)
-
-// IEngine interface, to be implemented for any templating engine added to the repository
-type IEngine interface {
-	IEngineCore
-	Load() error
-	Render(out io.Writer, template string, binding interface{}, layout ...string) error
-}
-
-// IEngineCore interface
-type IEngineCore interface {
-	AddFunc(name string, fn interface{}) IEngineCore
-	AddFuncMap(m map[string]interface{}) IEngineCore
-	Debug(enabled bool) IEngineCore
-	Delims(left, right string) IEngineCore
-	FuncMap() map[string]interface{}
-	Layout(key string) IEngineCore
-	Reload(enabled bool) IEngineCore
-	PreRenderCheck() bool
-}
-
-// Engine engine struct
-type Engine struct {
-	IEngineCore
-	// delimiters
-	Left  string
-	Right string
-	// views folder
-	Directory string
-	// http.FileSystem supports embedded files
-	FileSystem http.FileSystem
-	// views extension
-	Extension string
-	// layout variable name that incapsulates the template
-	LayoutName string
-	// determines if the engine parsed all templates
-	Loaded bool
-	// reload on each render
-	ShouldReload bool
-	// debug prints the parsed templates
-	Verbose bool
-	// lock for funcmap and templates
-	Mutex sync.RWMutex
-	// template funcmap
-	Funcmap map[string]interface{}
-}
-
-// AddFunc adds the function to the template's function map.
-// It is legal to overwrite elements of the default actions
-func (e *Engine) AddFunc(name string, fn interface{}) IEngineCore {
-	e.Mutex.Lock()
-	e.Funcmap[name] = fn
-	e.Mutex.Unlock()
-	return e
-}
-
-// AddFuncMap adds the functions from a map to the template's function map.
-// It is legal to overwrite elements of the default actions
-func (e *Engine) AddFuncMap(m map[string]interface{}) IEngineCore {
-	e.Mutex.Lock()
-	for name, fn := range m {
-		e.Funcmap[name] = fn
-	}
-	e.Mutex.Unlock()
-	return e
-}
-
-// Debug will print the parsed templates when Load is triggered.
-func (e *Engine) Debug(enabled bool) IEngineCore {
-	e.Mutex.Lock()
-	e.Verbose = enabled
-	e.Mutex.Unlock()
-	return e
-}
-
-// Delims sets the action delimiters to the specified strings, to be used in
-// templates. An empty delimiter stands for the
-// corresponding default: "{{" and "}}".
-func (e *Engine) Delims(left, right string) IEngineCore {
-	e.Mutex.Lock()
-	e.Left, e.Right = left, right
-	e.Mutex.Unlock()
-	return e
-}
-
-// FuncMap returns the template's function map.
-func (e *Engine) FuncMap() map[string]interface{} {
-	return e.Funcmap
-}
-
-// Layout defines the variable name that will incapsulate the template
-func (e *Engine) Layout(key string) IEngineCore {
-	e.Mutex.Lock()
-	e.LayoutName = key
-	e.Mutex.Unlock()
-	return e
-}
-
-// Reload if set to true the templates are reloading on each render,
-// use it when you're in development and you don't want to restart
-// the application when you edit a template file.
-func (e *Engine) Reload(enabled bool) IEngineCore {
-	e.Mutex.Lock()
-	e.ShouldReload = enabled
-	e.Mutex.Unlock()
-	return e
-}
-
-// Check if the engine should reload the templates before rendering
-// Explicit Mute Unlock vs defer offers better performance
-func (e *Engine) PreRenderCheck() bool {
-	e.Mutex.Lock()
-
-	if !e.Loaded || e.ShouldReload {
-		if e.ShouldReload {
-			e.Loaded = false
-		}
-		e.Mutex.Unlock()
-		return true
-	}
-	e.Mutex.Unlock()
-	return false
-}

+ 0 - 21
vendor/github.com/gofiber/utils/LICENSE

@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 Fiber
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.

+ 0 - 87
vendor/github.com/gofiber/utils/README.md

@@ -1,87 +0,0 @@
-A collection of common functions but with better performance, less allocations and no dependencies created for [Fiber](https://github.com/gofiber/fiber).
-
-```go
-// go test -benchmem -run=^$ -bench=Benchmark_ -count=2
-
-Benchmark_ToLowerBytes/fiber-16                 42847654                25.7 ns/op             0 B/op          0 allocs/op
-Benchmark_ToLowerBytes/fiber-16                 46143196                25.7 ns/op             0 B/op          0 allocs/op
-Benchmark_ToLowerBytes/default-16               17387322                67.4 ns/op            48 B/op          1 allocs/op
-Benchmark_ToLowerBytes/default-16               17906491                67.4 ns/op            48 B/op          1 allocs/op
-
-Benchmark_ToUpperBytes/fiber-16                 46143729                25.7 ns/op             0 B/op          0 allocs/op
-Benchmark_ToUpperBytes/fiber-16                 47989250                25.6 ns/op             0 B/op          0 allocs/op
-Benchmark_ToUpperBytes/default-16               15580854                76.7 ns/op            48 B/op          1 allocs/op
-Benchmark_ToUpperBytes/default-16               15381202                76.9 ns/op            48 B/op          1 allocs/op
-
-Benchmark_TrimRightBytes/fiber-16               70572459                16.3 ns/op             8 B/op          1 allocs/op
-Benchmark_TrimRightBytes/fiber-16               74983597                16.3 ns/op             8 B/op          1 allocs/op
-Benchmark_TrimRightBytes/default-16             16212578                74.1 ns/op            40 B/op          2 allocs/op
-Benchmark_TrimRightBytes/default-16             16434686                74.1 ns/op            40 B/op          2 allocs/op
-
-Benchmark_TrimLeftBytes/fiber-16                74983128                16.3 ns/op             8 B/op          1 allocs/op
-Benchmark_TrimLeftBytes/fiber-16                74985002                16.3 ns/op             8 B/op          1 allocs/op
-Benchmark_TrimLeftBytes/default-16              21047868                56.5 ns/op            40 B/op          2 allocs/op
-Benchmark_TrimLeftBytes/default-16              21048015                56.5 ns/op            40 B/op          2 allocs/op
-
-Benchmark_TrimBytes/fiber-16                    54533307                21.9 ns/op            16 B/op          1 allocs/op
-Benchmark_TrimBytes/fiber-16                    54532812                21.9 ns/op            16 B/op          1 allocs/op
-Benchmark_TrimBytes/default-16                  14282517                84.6 ns/op            48 B/op          2 allocs/op
-Benchmark_TrimBytes/default-16                  14114508                84.7 ns/op            48 B/op          2 allocs/op
-
-Benchmark_EqualFolds/fiber-16                   36355153                32.6 ns/op             0 B/op          0 allocs/op
-Benchmark_EqualFolds/fiber-16                   36355593                32.6 ns/op             0 B/op          0 allocs/op
-Benchmark_EqualFolds/default-16                 15186220                78.1 ns/op             0 B/op          0 allocs/op
-Benchmark_EqualFolds/default-16                 15186412                78.3 ns/op             0 B/op          0 allocs/op
-
-Benchmark_UUID/fiber-16                         23994625                49.8 ns/op            48 B/op          1 allocs/op
-Benchmark_UUID/fiber-16                         23994768                50.1 ns/op            48 B/op          1 allocs/op
-Benchmark_UUID/default-16                        3233772                 371 ns/op           208 B/op          6 allocs/op
-Benchmark_UUID/default-16                        3251295                 370 ns/op           208 B/op          6 allocs/op
-
-Benchmark_GetString/unsafe-16                 1000000000               0.709 ns/op             0 B/op          0 allocs/op
-Benchmark_GetString/unsafe-16                 1000000000               0.713 ns/op             0 B/op          0 allocs/op
-Benchmark_GetString/default-16                  59986202                19.0 ns/op            16 B/op          1 allocs/op
-Benchmark_GetString/default-16                  63142939                19.0 ns/op            16 B/op          1 allocs/op
-
-Benchmark_GetBytes/unsafe-16                   508360195                2.36 ns/op             0 B/op          0 allocs/op
-Benchmark_GetBytes/unsafe-16                   508359979                2.35 ns/op             0 B/op          0 allocs/op
-Benchmark_GetBytes/default-16                   46143019                25.7 ns/op            16 B/op          1 allocs/op
-Benchmark_GetBytes/default-16                   44434734                25.6 ns/op            16 B/op          1 allocs/op
-
-Benchmark_GetMIME/fiber-16                      21423750                56.3 ns/op             0 B/op          0 allocs/op
-Benchmark_GetMIME/fiber-16                      21423559                55.4 ns/op             0 B/op          0 allocs/op
-Benchmark_GetMIME/default-16                     6735282                 173 ns/op             0 B/op          0 allocs/op
-Benchmark_GetMIME/default-16                     6895002                 172 ns/op             0 B/op          0 allocs/op
-
-Benchmark_StatusMessage/fiber-16              1000000000               0.766 ns/op             0 B/op          0 allocs/op
-Benchmark_StatusMessage/fiber-16              1000000000               0.767 ns/op             0 B/op          0 allocs/op
-Benchmark_StatusMessage/default-16             159538528                7.50 ns/op             0 B/op          0 allocs/op
-Benchmark_StatusMessage/default-16             159750830                7.51 ns/op             0 B/op          0 allocs/op
-
-Benchmark_ToUpper/fiber-16                      22217408                53.3 ns/op            48 B/op          1 allocs/op
-Benchmark_ToUpper/fiber-16                      22636554                53.2 ns/op            48 B/op          1 allocs/op
-Benchmark_ToUpper/default-16                    11108600                 108 ns/op            48 B/op          1 allocs/op
-Benchmark_ToUpper/default-16                    11108580                 108 ns/op            48 B/op          1 allocs/op
-
-Benchmark_ToLower/fiber-16                      23994720                49.8 ns/op            48 B/op          1 allocs/op
-Benchmark_ToLower/fiber-16                      23994768                50.1 ns/op            48 B/op          1 allocs/op
-Benchmark_ToLower/default-16                    10808376                 110 ns/op            48 B/op          1 allocs/op
-Benchmark_ToLower/default-16                    10617034                 110 ns/op            48 B/op          1 allocs/op
-
-Benchmark_TrimRight/fiber-16                   413699521                2.94 ns/op             0 B/op          0 allocs/op
-Benchmark_TrimRight/fiber-16                   415131687                2.91 ns/op             0 B/op          0 allocs/op
-Benchmark_TrimRight/default-16                  23994577                49.1 ns/op            32 B/op          1 allocs/op
-Benchmark_TrimRight/default-16                  24484249                49.4 ns/op            32 B/op          1 allocs/op
-
-Benchmark_TrimLeft/fiber-16                    379661170                3.13 ns/op             0 B/op          0 allocs/op
-Benchmark_TrimLeft/fiber-16                    382079941                3.16 ns/op             0 B/op          0 allocs/op
-Benchmark_TrimLeft/default-16                   27900877                41.9 ns/op            32 B/op          1 allocs/op
-Benchmark_TrimLeft/default-16                   28564898                42.0 ns/op            32 B/op          1 allocs/op
-
-Benchmark_Trim/fiber-16                        236632856                 4.96 ns/op            0 B/op          0 allocs/op
-Benchmark_Trim/fiber-16                        237570085                 4.93 ns/op            0 B/op          0 allocs/op
-Benchmark_Trim/default-16                       18457221                 66.0 ns/op           32 B/op          1 allocs/op
-Benchmark_Trim/default-16                       18177328                 65.9 ns/op           32 B/op          1 allocs/op
-Benchmark_Trim/default.trimspace-16            188933770                 6.33 ns/op            0 B/op          0 allocs/op
-Benchmark_Trim/default.trimspace-16            184007649                 6.42 ns/op            0 B/op          0 allocs/op
-```

+ 0 - 62
vendor/github.com/gofiber/utils/assertions.go

@@ -1,62 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-import (
-	"bytes"
-	"fmt"
-	"log"
-	"path/filepath"
-	"reflect"
-	"runtime"
-	"testing"
-	"text/tabwriter"
-)
-
-// AssertEqual checks if values are equal
-func AssertEqual(t testing.TB, expected interface{}, actual interface{}, description ...string) {
-	if reflect.DeepEqual(expected, actual) {
-		return
-	}
-	var aType = "<nil>"
-	var bType = "<nil>"
-	if reflect.ValueOf(expected).IsValid() {
-		aType = reflect.TypeOf(expected).Name()
-	}
-	if reflect.ValueOf(actual).IsValid() {
-		bType = reflect.TypeOf(actual).Name()
-	}
-
-	testName := "AssertEqual"
-	if t != nil {
-		testName = t.Name()
-	}
-
-	_, file, line, _ := runtime.Caller(1)
-
-	var buf bytes.Buffer
-	w := tabwriter.NewWriter(&buf, 0, 0, 5, ' ', 0)
-	fmt.Fprintf(w, "\nTest:\t%s", testName)
-	fmt.Fprintf(w, "\nTrace:\t%s:%d", filepath.Base(file), line)
-	fmt.Fprintf(w, "\nError:\tNot equal")
-	fmt.Fprintf(w, "\nExpect:\t%v\t[%s]", expected, aType)
-	fmt.Fprintf(w, "\nResult:\t%v\t[%s]", actual, bType)
-
-	if len(description) > 0 {
-		fmt.Fprintf(w, "\nDescription:\t%s", description[0])
-	}
-
-	result := ""
-	if err := w.Flush(); err != nil {
-		result = err.Error()
-	} else {
-		result = buf.String()
-	}
-	if t != nil {
-		t.Fatal(result)
-	} else {
-		log.Fatal(result)
-	}
-}

+ 0 - 78
vendor/github.com/gofiber/utils/bytes.go

@@ -1,78 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-// ToLowerBytes is the equivalent of bytes.ToLower
-func ToLowerBytes(b []byte) []byte {
-	for i := 0; i < len(b); i++ {
-		b[i] = toLowerTable[b[i]]
-	}
-	return b
-}
-
-// ToUpperBytes is the equivalent of bytes.ToUpper
-func ToUpperBytes(b []byte) []byte {
-	for i := 0; i < len(b); i++ {
-		b[i] = toUpperTable[b[i]]
-	}
-	return b
-}
-
-// TrimRightBytes is the equivalent of bytes.TrimRight
-func TrimRightBytes(b []byte, cutset byte) []byte {
-	lenStr := len(b)
-	for lenStr > 0 && b[lenStr-1] == cutset {
-		lenStr--
-	}
-	return b[:lenStr]
-}
-
-// TrimLeftBytes is the equivalent of bytes.TrimLeft
-func TrimLeftBytes(b []byte, cutset byte) []byte {
-	lenStr, start := len(b), 0
-	for start < lenStr && b[start] == cutset {
-		start++
-	}
-	return b[start:]
-}
-
-// TrimBytes is the equivalent of bytes.Trim
-func TrimBytes(b []byte, cutset byte) []byte {
-	i, j := 0, len(b)-1
-	for ; i < j; i++ {
-		if b[i] != cutset {
-			break
-		}
-	}
-	for ; i < j; j-- {
-		if b[j] != cutset {
-			break
-		}
-	}
-
-	return b[i : j+1]
-}
-
-// EqualFold the equivalent of bytes.EqualFold
-func EqualsFold(b, s []byte) (equals bool) {
-	n := len(b)
-	equals = n == len(s)
-	if equals {
-		for i := 0; i < n; i++ {
-			if equals = b[i]|0x20 == s[i]|0x20; !equals {
-				break
-			}
-		}
-	}
-	return
-}
-
-// DefaultBytes returns the provided fallback value if []byte is empty
-func DefaultBytes(value []byte, defaultValue []byte) []byte {
-	if len(value) <= 0 {
-		return defaultValue
-	}
-	return value
-}

+ 0 - 83
vendor/github.com/gofiber/utils/common.go

@@ -1,83 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-import (
-	"crypto/rand"
-	"encoding/binary"
-	"encoding/hex"
-	"os"
-	"reflect"
-	"runtime"
-	"sync"
-	"sync/atomic"
-)
-
-const toLowerTable = "\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
-const toUpperTable = "\x00\x01\x02\x03\x04\x05\x06\a\b\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~\u007f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
-
-// Copyright © 2014, Roger Peppe
-// github.com/rogpeppe/fastuuid
-// All rights reserved.
-
-var uuidSeed [24]byte
-var uuidCounter uint64
-var uuidSetup sync.Once
-
-// UUID generates an universally unique identifier (UUID)
-func UUID() string {
-	// Setup seed & counter once
-	uuidSetup.Do(func() {
-		if _, err := rand.Read(uuidSeed[:]); err != nil {
-			return
-		}
-		uuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8])
-	})
-	if atomic.LoadUint64(&uuidCounter) <= 0 {
-		return "00000000-0000-0000-0000-000000000000"
-	}
-	// first 8 bytes differ, taking a slice of the first 16 bytes
-	x := atomic.AddUint64(&uuidCounter, 1)
-	uuid := uuidSeed
-	binary.LittleEndian.PutUint64(uuid[:8], x)
-	uuid[6], uuid[9] = uuid[9], uuid[6]
-
-	// RFC4122 v4
-	uuid[6] = (uuid[6] & 0x0f) | 0x40
-	uuid[8] = uuid[8]&0x3f | 0x80
-
-	// create UUID representation of the first 128 bits
-	b := make([]byte, 36)
-	hex.Encode(b[0:8], uuid[0:4])
-	b[8] = '-'
-	hex.Encode(b[9:13], uuid[4:6])
-	b[13] = '-'
-	hex.Encode(b[14:18], uuid[6:8])
-	b[18] = '-'
-	hex.Encode(b[19:23], uuid[8:10])
-	b[23] = '-'
-	hex.Encode(b[24:], uuid[10:16])
-
-	return GetString(b)
-}
-
-// FunctionName returns function name
-func FunctionName(fn interface{}) string {
-	t := reflect.ValueOf(fn).Type()
-	if t.Kind() == reflect.Func {
-		return runtime.FuncForPC(reflect.ValueOf(fn).Pointer()).Name()
-	}
-	return t.String()
-}
-
-// GetArgument check if key is in arguments
-func GetArgument(arg string) bool {
-	for i := range os.Args[1:] {
-		if os.Args[1:][i] == arg {
-			return true
-		}
-	}
-	return false
-}

+ 0 - 104
vendor/github.com/gofiber/utils/convert.go

@@ -1,104 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-import (
-	"reflect"
-	"strconv"
-	"strings"
-	"unsafe"
-)
-
-// #nosec G103
-// GetString returns a string pointer without allocation
-func UnsafeString(b []byte) string {
-	return *(*string)(unsafe.Pointer(&b))
-}
-
-// #nosec G103
-// GetBytes returns a byte pointer without allocation
-func UnsafeBytes(s string) (bs []byte) {
-	sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
-	bh := (*reflect.SliceHeader)(unsafe.Pointer(&bs))
-	bh.Data = sh.Data
-	bh.Len = sh.Len
-	bh.Cap = sh.Len
-	return
-}
-
-// SafeString copies a string to make it immutable
-func SafeString(s string) string {
-	return string(UnsafeBytes(s))
-}
-
-// SafeBytes copies a slice to make it immutable
-func SafeBytes(b []byte) []byte {
-	tmp := make([]byte, len(b))
-	copy(tmp, b)
-	return tmp
-}
-
-const (
-	uByte = 1 << (10 * iota)
-	uKilobyte
-	uMegabyte
-	uGigabyte
-	uTerabyte
-	uPetabyte
-	uExabyte
-)
-
-// ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth.
-// The unit that results in the smallest number greater than or equal to 1 is always chosen.
-func ByteSize(bytes uint64) string {
-	unit := ""
-	value := float64(bytes)
-	switch {
-	case bytes >= uExabyte:
-		unit = "EB"
-		value = value / uExabyte
-	case bytes >= uPetabyte:
-		unit = "PB"
-		value = value / uPetabyte
-	case bytes >= uTerabyte:
-		unit = "TB"
-		value = value / uTerabyte
-	case bytes >= uGigabyte:
-		unit = "GB"
-		value = value / uGigabyte
-	case bytes >= uMegabyte:
-		unit = "MB"
-		value = value / uMegabyte
-	case bytes >= uKilobyte:
-		unit = "KB"
-		value = value / uKilobyte
-	case bytes >= uByte:
-		unit = "B"
-	default:
-		return "0B"
-	}
-	result := strconv.FormatFloat(value, 'f', 1, 64)
-	result = strings.TrimSuffix(result, ".0")
-	return result + unit
-}
-
-// Deprecated fn's
-
-// #nosec G103
-// GetString returns a string pointer without allocation
-func GetString(b []byte) string {
-	return UnsafeString(b)
-}
-
-// #nosec G103
-// GetBytes returns a byte pointer without allocation
-func GetBytes(s string) []byte {
-	return UnsafeBytes(s)
-}
-
-// ImmutableString copies a string to make it immutable
-func ImmutableString(s string) string {
-	return SafeString(s)
-}

+ 0 - 110
vendor/github.com/gofiber/utils/file.go

@@ -1,110 +0,0 @@
-package utils
-
-import (
-	"io"
-	"net/http"
-	"os"
-	pathpkg "path"
-	"path/filepath"
-	"sort"
-)
-
-// Walk walks the filesystem rooted at root, calling walkFn for each file or
-// directory in the filesystem, including root. All errors that arise visiting files
-// and directories are filtered by walkFn. The files are walked in lexical
-// order.
-func Walk(fs http.FileSystem, root string, walkFn filepath.WalkFunc) error {
-	info, err := stat(fs, root)
-	if err != nil {
-		return walkFn(root, nil, err)
-	}
-	return walk(fs, root, info, walkFn)
-}
-
-// #nosec G304
-// ReadFile returns the raw content of a file
-func ReadFile(path string, fs http.FileSystem) ([]byte, error) {
-	if fs != nil {
-		file, err := fs.Open(path)
-		if err != nil {
-			return nil, err
-		}
-		defer file.Close()
-		return io.ReadAll(file)
-	}
-	return os.ReadFile(path)
-}
-
-// readDirNames reads the directory named by dirname and returns
-// a sorted list of directory entries.
-func readDirNames(fs http.FileSystem, dirname string) ([]string, error) {
-	fis, err := readDir(fs, dirname)
-	if err != nil {
-		return nil, err
-	}
-	names := make([]string, len(fis))
-	for i := range fis {
-		names[i] = fis[i].Name()
-	}
-	sort.Strings(names)
-	return names, nil
-}
-
-// walk recursively descends path, calling walkFn.
-func walk(fs http.FileSystem, path string, info os.FileInfo, walkFn filepath.WalkFunc) error {
-	err := walkFn(path, info, nil)
-	if err != nil {
-		if info.IsDir() && err == filepath.SkipDir {
-			return nil
-		}
-		return err
-	}
-
-	if !info.IsDir() {
-		return nil
-	}
-
-	names, err := readDirNames(fs, path)
-	if err != nil {
-		return walkFn(path, info, err)
-	}
-
-	for _, name := range names {
-		filename := pathpkg.Join(path, name)
-		fileInfo, err := stat(fs, filename)
-		if err != nil {
-			if err := walkFn(filename, fileInfo, err); err != nil && err != filepath.SkipDir {
-				return err
-			}
-		} else {
-			err = walk(fs, filename, fileInfo, walkFn)
-			if err != nil {
-				if !fileInfo.IsDir() || err != filepath.SkipDir {
-					return err
-				}
-			}
-		}
-	}
-	return nil
-}
-
-// readDir reads the contents of the directory associated with file and
-// returns a slice of FileInfo values in directory order.
-func readDir(fs http.FileSystem, name string) ([]os.FileInfo, error) {
-	f, err := fs.Open(name)
-	if err != nil {
-		return nil, err
-	}
-	defer f.Close()
-	return f.Readdir(0)
-}
-
-// stat returns the FileInfo structure describing file.
-func stat(fs http.FileSystem, name string) (os.FileInfo, error) {
-	f, err := fs.Open(name)
-	if err != nil {
-		return nil, err
-	}
-	defer f.Close()
-	return f.Stat()
-}

+ 0 - 212
vendor/github.com/gofiber/utils/http.go

@@ -1,212 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-const MIMEOctetStream = "application/octet-stream"
-
-// GetMIME returns the content-type of a file extension
-func GetMIME(extension string) (mime string) {
-	if len(extension) == 0 {
-		return mime
-	}
-	if extension[0] == '.' {
-		mime = mimeExtensions[extension[1:]]
-	} else {
-		mime = mimeExtensions[extension]
-	}
-	if len(mime) == 0 {
-		return MIMEOctetStream
-	}
-	return mime
-}
-
-// limits for HTTP statuscodes
-const (
-	statusMessageMin = 100
-	statusMessageMax = 511
-)
-
-// StatusMessage returns the correct message for the provided HTTP statuscode
-func StatusMessage(status int) string {
-	if status < statusMessageMin || status > statusMessageMax {
-		return ""
-	}
-	return statusMessage[status]
-}
-
-// HTTP status codes were copied from net/http.
-var statusMessage = []string{
-	100: "Continue",
-	101: "Switching Protocols",
-	102: "Processing",
-	103: "Early Hints",
-	200: "OK",
-	201: "Created",
-	202: "Accepted",
-	203: "Non-Authoritative Information",
-	204: "No Content",
-	205: "Reset Content",
-	206: "Partial Content",
-	207: "Multi-Status",
-	208: "Already Reported",
-	226: "IM Used",
-	300: "Multiple Choices",
-	301: "Moved Permanently",
-	302: "Found",
-	303: "See Other",
-	304: "Not Modified",
-	305: "Use Proxy",
-	306: "Switch Proxy",
-	307: "Temporary Redirect",
-	308: "Permanent Redirect",
-	400: "Bad Request",
-	401: "Unauthorized",
-	402: "Payment Required",
-	403: "Forbidden",
-	404: "Not Found",
-	405: "Method Not Allowed",
-	406: "Not Acceptable",
-	407: "Proxy Authentication Required",
-	408: "Request Timeout",
-	409: "Conflict",
-	410: "Gone",
-	411: "Length Required",
-	412: "Precondition Failed",
-	413: "Request Entity Too Large",
-	414: "Request URI Too Long",
-	415: "Unsupported Media Type",
-	416: "Requested Range Not Satisfiable",
-	417: "Expectation Failed",
-	418: "I'm a teapot",
-	421: "Misdirected Request",
-	422: "Unprocessable Entity",
-	423: "Locked",
-	424: "Failed Dependency",
-	426: "Upgrade Required",
-	428: "Precondition Required",
-	429: "Too Many Requests",
-	431: "Request Header Fields Too Large",
-	451: "Unavailable For Legal Reasons",
-	500: "Internal Server Error",
-	501: "Not Implemented",
-	502: "Bad Gateway",
-	503: "Service Unavailable",
-	504: "Gateway Timeout",
-	505: "HTTP Version Not Supported",
-	506: "Variant Also Negotiates",
-	507: "Insufficient Storage",
-	508: "Loop Detected",
-	510: "Not Extended",
-	511: "Network Authentication Required",
-}
-
-// MIME types were copied from https://github.com/nginx/nginx/blob/master/conf/mime.types
-var mimeExtensions = map[string]string{
-	"html":    "text/html",
-	"htm":     "text/html",
-	"shtml":   "text/html",
-	"css":     "text/css",
-	"gif":     "image/gif",
-	"jpeg":    "image/jpeg",
-	"jpg":     "image/jpeg",
-	"xml":     "application/xml",
-	"js":      "application/javascript",
-	"atom":    "application/atom+xml",
-	"rss":     "application/rss+xml",
-	"mml":     "text/mathml",
-	"txt":     "text/plain",
-	"jad":     "text/vnd.sun.j2me.app-descriptor",
-	"wml":     "text/vnd.wap.wml",
-	"htc":     "text/x-component",
-	"png":     "image/png",
-	"svg":     "image/svg+xml",
-	"svgz":    "image/svg+xml",
-	"tif":     "image/tiff",
-	"tiff":    "image/tiff",
-	"wbmp":    "image/vnd.wap.wbmp",
-	"webp":    "image/webp",
-	"ico":     "image/x-icon",
-	"jng":     "image/x-jng",
-	"bmp":     "image/x-ms-bmp",
-	"woff":    "font/woff",
-	"woff2":   "font/woff2",
-	"jar":     "application/java-archive",
-	"war":     "application/java-archive",
-	"ear":     "application/java-archive",
-	"json":    "application/json",
-	"hqx":     "application/mac-binhex40",
-	"doc":     "application/msword",
-	"pdf":     "application/pdf",
-	"ps":      "application/postscript",
-	"eps":     "application/postscript",
-	"ai":      "application/postscript",
-	"rtf":     "application/rtf",
-	"m3u8":    "application/vnd.apple.mpegurl",
-	"kml":     "application/vnd.google-earth.kml+xml",
-	"kmz":     "application/vnd.google-earth.kmz",
-	"xls":     "application/vnd.ms-excel",
-	"eot":     "application/vnd.ms-fontobject",
-	"ppt":     "application/vnd.ms-powerpoint",
-	"odg":     "application/vnd.oasis.opendocument.graphics",
-	"odp":     "application/vnd.oasis.opendocument.presentation",
-	"ods":     "application/vnd.oasis.opendocument.spreadsheet",
-	"odt":     "application/vnd.oasis.opendocument.text",
-	"wmlc":    "application/vnd.wap.wmlc",
-	"7z":      "application/x-7z-compressed",
-	"cco":     "application/x-cocoa",
-	"jardiff": "application/x-java-archive-diff",
-	"jnlp":    "application/x-java-jnlp-file",
-	"run":     "application/x-makeself",
-	"pl":      "application/x-perl",
-	"pm":      "application/x-perl",
-	"prc":     "application/x-pilot",
-	"pdb":     "application/x-pilot",
-	"rar":     "application/x-rar-compressed",
-	"rpm":     "application/x-redhat-package-manager",
-	"sea":     "application/x-sea",
-	"swf":     "application/x-shockwave-flash",
-	"sit":     "application/x-stuffit",
-	"tcl":     "application/x-tcl",
-	"tk":      "application/x-tcl",
-	"der":     "application/x-x509-ca-cert",
-	"pem":     "application/x-x509-ca-cert",
-	"crt":     "application/x-x509-ca-cert",
-	"xpi":     "application/x-xpinstall",
-	"xhtml":   "application/xhtml+xml",
-	"xspf":    "application/xspf+xml",
-	"zip":     "application/zip",
-	"bin":     "application/octet-stream",
-	"exe":     "application/octet-stream",
-	"dll":     "application/octet-stream",
-	"deb":     "application/octet-stream",
-	"dmg":     "application/octet-stream",
-	"iso":     "application/octet-stream",
-	"img":     "application/octet-stream",
-	"msi":     "application/octet-stream",
-	"msp":     "application/octet-stream",
-	"msm":     "application/octet-stream",
-	"mid":     "audio/midi",
-	"midi":    "audio/midi",
-	"kar":     "audio/midi",
-	"mp3":     "audio/mpeg",
-	"ogg":     "audio/ogg",
-	"m4a":     "audio/x-m4a",
-	"ra":      "audio/x-realaudio",
-	"3gpp":    "video/3gpp",
-	"3gp":     "video/3gpp",
-	"ts":      "video/mp2t",
-	"mp4":     "video/mp4",
-	"mpeg":    "video/mpeg",
-	"mpg":     "video/mpeg",
-	"mov":     "video/quicktime",
-	"webm":    "video/webm",
-	"flv":     "video/x-flv",
-	"m4v":     "video/x-m4v",
-	"mng":     "video/x-mng",
-	"asx":     "video/x-ms-asf",
-	"asf":     "video/x-ms-asf",
-	"wmv":     "video/x-ms-wmv",
-	"avi":     "video/x-msvideo",
-}

+ 0 - 13
vendor/github.com/gofiber/utils/integer.go

@@ -1,13 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-// DefaultINT returns the provided fallback value if int is 0 or lower
-func DefaultINT(value int, defaultValue int) int {
-	if value <= 0 {
-		return defaultValue
-	}
-	return value
-}

+ 0 - 70
vendor/github.com/gofiber/utils/strings.go

@@ -1,70 +0,0 @@
-// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
-// 🤖 Github Repository: https://github.com/gofiber/fiber
-// 📌 API Documentation: https://docs.gofiber.io
-
-package utils
-
-// ToLower is the equivalent of strings.ToLower
-func ToLower(b string) string {
-	var res = make([]byte, len(b))
-	copy(res, b)
-	for i := 0; i < len(res); i++ {
-		res[i] = toLowerTable[res[i]]
-	}
-
-	return GetString(res)
-}
-
-// ToUpper is the equivalent of strings.ToUpper
-func ToUpper(b string) string {
-	var res = make([]byte, len(b))
-	copy(res, b)
-	for i := 0; i < len(res); i++ {
-		res[i] = toUpperTable[res[i]]
-	}
-
-	return GetString(res)
-}
-
-// TrimLeft is the equivalent of strings.TrimLeft
-func TrimLeft(s string, cutset byte) string {
-	lenStr, start := len(s), 0
-	for start < lenStr && s[start] == cutset {
-		start++
-	}
-	return s[start:]
-}
-
-// Trim is the equivalent of strings.Trim
-func Trim(s string, cutset byte) string {
-	i, j := 0, len(s)-1
-	for ; i < j; i++ {
-		if s[i] != cutset {
-			break
-		}
-	}
-	for ; i < j; j-- {
-		if s[j] != cutset {
-			break
-		}
-	}
-
-	return s[i : j+1]
-}
-
-// TrimRight is the equivalent of strings.TrimRight
-func TrimRight(s string, cutset byte) string {
-	lenStr := len(s)
-	for lenStr > 0 && s[lenStr-1] == cutset {
-		lenStr--
-	}
-	return s[:lenStr]
-}
-
-// DefaultString returns the provided fallback value if string is empty
-func DefaultString(value string, defaultValue string) string {
-	if len(value) <= 0 {
-		return defaultValue
-	}
-	return value
-}

+ 0 - 9
vendor/modules.txt

@@ -63,15 +63,6 @@ github.com/gofiber/fiber/v2/middleware/compress
 github.com/gofiber/fiber/v2/middleware/filesystem
 github.com/gofiber/fiber/v2/middleware/monitor
 github.com/gofiber/fiber/v2/utils
-# github.com/gofiber/template v1.8.3
-## explicit; go 1.20
-github.com/gofiber/template
-# github.com/gofiber/template/html/v2 v2.1.3
-## explicit; go 1.20
-github.com/gofiber/template/html/v2
-# github.com/gofiber/utils v1.1.0
-## explicit; go 1.17
-github.com/gofiber/utils
 # github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8
 ## explicit; go 1.20
 github.com/golang/groupcache/lru