瀏覽代碼

SVI Рабочее сохранение

SVI 4 月之前
父節點
當前提交
8c145ae06a
共有 42 個文件被更改,包括 128 次插入 和 128 次删除
  1. 1 2
      v4/lev0/core_spec/itime.go
  2. 1 3
      v4/lev0/defs/def_err/def_err.go
  3. 10 1
      v4/lev0/defs/def_spec/def_spec.go
  4. 9 10
      v4/lev0/defs/def_txt/def_txt.go
  5. 2 13
      v4/lev0/defs/stream_name/stream_name.go
  6. 2 2
      v4/lev0/helpers/helpers.go
  7. 8 8
      v4/lev0/result/result.go
  8. 2 2
      v4/lev0/result/result_test.go
  9. 8 11
      v4/lev0/voc/etime/etime.go
  10. 1 2
      v4/lev1/log_buf/log_msg/log_msg.go
  11. 2 2
      v4/lev1/mock_env/mock_env.go
  12. 1 1
      v4/lev2/kwg/kwg.go
  13. 2 1
      v4/lev2/lsi/kstore_kv/kstore_kv_test.go
  14. 4 3
      v4/lev2/lsi/store_ent/rec_key/store_key.go
  15. 3 3
      v4/lev2/lti/bus_ent/handler_name/handler_name.go
  16. 1 2
      v4/lev2/lti/bus_ent/topic/topic.go
  17. 3 2
      v4/lev2/lti/bus_mock/mock_hand_sub_http/mock_hand_sub_http.go
  18. 2 1
      v4/lev2/lti/bus_mock/mock_hand_sub_local/mock_hand_sub.go
  19. 2 1
      v4/lev2/lti/kbus_http/client_bus_http/client_bus_http_test.go
  20. 3 2
      v4/lev2/lti/kbus_http/kbus_http_test.go
  21. 5 4
      v4/lev2/wui/hx_swap_oob/hx_swap_oob.go
  22. 5 4
      v4/lev2/wui/hx_target/hx_target.go
  23. 7 6
      v4/lev2/wui/hx_vals/hx_vals.go
  24. 1 1
      v4/lev2/wui/wui.go
  25. 3 3
      v4/lev2/wui/wui_button/wui_button.go
  26. 4 4
      v4/lev2/wui/wui_button/wui_button_test.go
  27. 1 1
      v4/lev2/wui/wui_test.go
  28. 1 2
      v4/lev2/wui/wui_types/ihx_swap.go
  29. 5 4
      v4/lev2/wui/wui_types/ihx_swap_oob.go
  30. 5 4
      v4/lev2/wui/wui_types/ihx_target.go
  31. 1 2
      v4/lev2/wui/wui_types/ihx_trigger.go
  32. 3 2
      v4/lev2/wui/wui_types/ihx_url.go
  33. 6 5
      v4/lev2/wui/wui_types/ihx_vals.go
  34. 1 1
      v4/lev2/wui/wui_types/iwui_button.go
  35. 3 2
      v4/lev2/wui/wui_types/iwui_hx.go
  36. 2 3
      v4/lev3/mod_ent/module_name/module_name.go
  37. 1 1
      v4/lev3/mod_serv_http/btn_modules/btn_modules.go
  38. 1 1
      v4/lev3/mod_serv_http/btn_modules/btn_modules_test.go
  39. 1 1
      v4/lev3/mod_serv_http/btn_monolit/btn_monolit.go
  40. 1 1
      v4/lev3/mod_serv_http/btn_monolit/btn_monolit_test.go
  41. 3 3
      v4/lev3/mod_wui/mod_wui.go
  42. 1 1
      v4/lev3/mod_wui/mod_wui_test.go

+ 1 - 2
v4/lev0/core_spec/itime.go

@@ -7,10 +7,9 @@ import (
 // ITime -- интерфейс времени.
 // Вывод: "2006-01-02 15:04:05.000 -07 MST".
 type ITime interface {
+	defs.IString
 	// Time -- получить время.
 	Time() defs.ITimeFix
-	// String -- получить строковое представление времени.
-	String() string
 	// MarshalJSON -- сериализация в JSON себя
 	MarshalJSON() ([]byte, error)
 	// UnmarshalJSON -- десериализация из JSON себя

+ 1 - 3
v4/lev0/defs/def_err/def_err.go

@@ -2,8 +2,6 @@
 package def_err
 
 import (
-	"fmt"
-
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_txt"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
@@ -17,7 +15,7 @@ type KErr struct {
 // Err -- создать новую обёрнутую ошибку.
 func Err(msg def_spec.ATxt, arg ...any) *KErr {
 	helpers.Hassert(msg == "", "Err(): msg is empty")
-	_msg := fmt.Sprintf(string(msg), arg...)
+	_msg := def_spec.Sprintf(msg, arg...)
 	sf := &KErr{
 		ITxtFix: def_txt.Txt(_msg),
 	}

+ 10 - 1
v4/lev0/defs/def_spec/def_spec.go

@@ -1,6 +1,10 @@
 // package def_spec -- внутренние спецификации типы
 package def_spec
 
+import(
+	"fmt"
+)
+
 // Int -- алиас для int.
 type Int int
 
@@ -13,7 +17,12 @@ type IString interface {
 	String() string
 }
 
-// TxtConstraint -- разрешает string и любые типы на его основе (например, ATxt).
+// Sprintf -- форматирует строку с помощью fmt.Sprintf.
+func Sprintf[T TxtConstraint](msgFmt T, args ...interface{}) ATxt {
+	return ATxt(fmt.Sprintf(string(msgFmt), args...))
+}
+
+// TxtConstraint -- разрешает строки и любые типы на его основе (например, ATxt).
 type TxtConstraint interface {
 	~string
 }

+ 9 - 10
v4/lev0/defs/def_txt/def_txt.go

@@ -18,9 +18,9 @@ type KTxt struct {
 
 // Txt -- создать новую строку.
 func Txt[T def_spec.TxtConstraint](msg T, arg ...any) *KTxt {
-	_msg := fmt.Sprintf(string(msg), arg...)
+	_msg := def_spec.Sprintf(msg, arg...)
 	sf := &KTxt{
-		val: def_spec.ATxt(_msg),
+		val: _msg,
 	}
 	return sf
 }
@@ -33,9 +33,9 @@ func TxtFix[T def_spec.TxtConstraint](msg T, arg ...any) def_spec.ITxtFix {
 
 // TxtMut -- создать новую мутабельную строку.
 func TxtMut[T def_spec.TxtConstraint](msg T, arg ...any) def_spec.ITxtMut {
-	_msg := fmt.Sprintf(string(msg), arg...)
+	_msg := def_spec.Sprintf(msg, arg...)
 	sf := &KTxt{
-		val: def_spec.ATxt(_msg),
+		val: _msg,
 	}
 	return sf
 }
@@ -47,10 +47,9 @@ func (sf KTxt) Get() def_spec.ATxt {
 
 // Concat -- создать новую строку.
 func (sf *KTxt) Concat(msg any, arg ...any) def_spec.ITxtFix {
-	val := fmt.Sprintf("%v", msg)
-	val = fmt.Sprintf(val, arg...)
-	_msg := string(sf.val) + val
-	sf.val = def_spec.ATxt(_msg)
+	val := def_spec.Sprintf("%v", msg)
+	val = def_spec.Sprintf(val, arg...)
+	sf.val += val
 	return sf
 }
 
@@ -86,11 +85,11 @@ func (sf KTxt) String() string {
 	return string(sf.val)
 }
 
-// Atoi -- возвращает возможное число
+// Atoi -- возвращает возможное число.
 func (sf KTxt) Atoi() def_spec.IResult[def_spec.Int] {
 	iRes,err:=strconv.Atoi(sf.String())
 	if err!=nil{
-		err:=fmt.Errorf("KTxt.Atot(): val(%q) not int, err=\n\t%w", err)
+		err:=fmt.Errorf("KTxt.Atot(): val(%q) not int, err=\n\t%w", sf.val, err)
 		return result.NewErr[def_spec.Int](err)
 	}
 	return result.NewOk(def_spec.Int(iRes))

+ 2 - 13
v4/lev0/defs/stream_name/stream_name.go

@@ -7,26 +7,15 @@ import (
 
 // AStreamName -- имя потока для ожидания.
 type AStreamName struct {
-	val defs.ITxtFix
+	defs.ITxtFix
 }
 
 // NewAStreamName -- создать новое имя потока.
 func NewAStreamName(val defs.ITxtFix) *AStreamName {
 	helpers.Hassert(val.Get() != "", "NewAStreamName(): val is empty")
 	sf := &AStreamName{
-		val: val,
+		ITxtFix: val,
 	}
 	return sf
 }
 
-// String -- строковое представление.
-//
-
-func (sf *AStreamName) String() string {
-	return sf.val.String()
-}
-
-// Get -- получить значение.
-func (sf *AStreamName) Name() defs.ITxtFix {
-	return sf.val
-}

+ 2 - 2
v4/lev0/helpers/helpers.go

@@ -27,7 +27,7 @@ func Assert(isCond bool, msgFormat def_spec.ATxt, args ...any) {
 	if isCond {
 		return
 	}
-	msg := fmt.Sprintf("SOFT ASSERT "+string(msgFormat)+"\n", args...)
+	msg := def_spec.Sprintf("SOFT ASSERT "+msgFormat+"\n", args...)
 	if IsStageLocal {
 		panic(msg)
 	}
@@ -44,7 +44,7 @@ func Hassert(isCond bool, msgFormat def_spec.ATxt, args ...any) {
 	if isCond {
 		return
 	}
-	msg := fmt.Sprintf("HARD ASSERT "+string(msgFormat)+"\n", args...)
+	msg := def_spec.Sprintf("HARD ASSERT "+msgFormat+"\n", args...)
 	panic(msg)
 }
 

+ 8 - 8
v4/lev0/result/result.go

@@ -142,26 +142,26 @@ func (sf *Result[T]) Error() string {
 
 // Hassert -- проверяет, что нет ошибки (с паникой).
 func (sf *Result[T]) Hassert(msgFormat def_spec.ATxt, args ...any) T {
-	strErr := ""
+	txtErr := def_spec.ATxt("")
 	if !sf.isCheck {
-		strErr = fmt.Sprintf("Result[T].Hassert(): not check error, err=\n\t%v", sf.err)
+		txtErr = def_spec.Sprintf("Result[T].Hassert(): not check error, err=\n\t%v", sf.err)
 	} else {
-		strErr = fmt.Sprintf(string(msgFormat)+strErr, args...)
+		txtErr = def_spec.Sprintf(msgFormat+txtErr, args...)
 	}
-	mKh.Hassert(sf.err == nil, def_spec.ATxt(strErr))
+	mKh.Hassert(sf.err == nil, txtErr)
 	sf.isCheck = true
 	return sf.val
 }
 
 // Assert -- проверяет, что нет ошибки (с паникой только на локальном стенде).
 func (sf *Result[T]) Assert(msgFormat def_spec.ATxt, args ...any) T {
-	strErr := ""
+	txtErr := def_spec.ATxt("")
 	if !sf.isCheck {
-		strErr = fmt.Sprintf("Result[T].Assert(): not check error, , err=\n\t%v", sf.err)
+		txtErr = def_spec.Sprintf("Result[T].Assert(): not check error, , err=\n\t%v", sf.err)
 	} else {
-		strErr = fmt.Sprintf(string(msgFormat)+strErr, args...)
+		txtErr = def_spec.Sprintf(msgFormat+txtErr, args...)
 	}
-	mKh.Assert(sf.err == nil, def_spec.ATxt(strErr), args...)
+	mKh.Assert(sf.err == nil, txtErr, args...)
 	sf.isCheck = true
 	return sf.val
 }

+ 2 - 2
v4/lev0/result/result_test.go

@@ -115,7 +115,7 @@ func (sf *tester) assert2() {
 			sf.t.Fatalf("assert2(): panic==nil")
 		}
 	}()
-	res.Assert(str2)
+	_ = res.Assert(str2)
 }
 
 var (
@@ -209,7 +209,7 @@ func (sf *tester) createOkGood2() {
 }
 
 // Функция высшего порядка для замещения ошибки.
-func (sf *tester) fnWrap2()  error {
+func (sf *tester) fnWrap2() error {
 	return fmt.Errorf("test5")
 }
 

+ 8 - 11
v4/lev0/voc/etime/etime.go

@@ -13,8 +13,7 @@ import (
 // ETime -- метка времени.
 // Вывод: "2006-01-02 15:04:05.000 -07 MST".
 type ETime struct {
-	val    defs.ITimeFix
-	isMut  bool // Мутабельность
+	defs.ITimeFix
 	isFill bool // Признак заполнения
 }
 
@@ -22,8 +21,8 @@ type ETime struct {
 func NewETime(val defs.ITimeFix) mKs.ITime {
 	helpers.Hassert(val.Get() != "", "NewETime(): val is empty")
 	sf := &ETime{
-		val:    val,
-		isFill: true,
+		ITimeFix: val,
+		isFill:   true,
 	}
 	return sf
 }
@@ -42,7 +41,6 @@ func NewETimeAuto() mKs.ITime {
 func NewETimeAutoMut() mKs.ITimeMut {
 	sf := &ETime{
 		isFill: true,
-		isMut:  true,
 	}
 	val := defs.TxtFix(time.Now().Local().Format("2006-01-02 15:04:05.000 -07 MST"))
 	sf.Set(val)
@@ -51,21 +49,20 @@ func NewETimeAutoMut() mKs.ITimeMut {
 
 // String -- возвращает строку.
 func (sf *ETime) String() string {
-	helpers.Hassert(sf.val.Get() != "", "ETime.String(): значение не инициализировано")
-	return sf.val.String()
+	helpers.Hassert(sf.Get() != "", "ETime.String(): значение не инициализировано")
+	return sf.ITimeFix.String()
 }
 
 // Time -- возвращает типизированную строку.
 func (sf *ETime) Time() defs.ITimeFix {
-	helpers.Hassert(sf.val.Get() != "", "ETime.Time(): значение не инициализировано")
-	return sf.val
+	helpers.Hassert(sf.Get() != "", "ETime.Time(): значение не инициализировано")
+	return sf.ITimeFix
 }
 
 // Set -- устанавливает типизированное значение.
 func (sf *ETime) Set(val defs.ITimeFix) {
-	helpers.Hassert(sf.isMut, "ETime.Set(): значение фиксировано")
 	helpers.Hassert(val.Get() != "", "ETime.Set(): val is empty")
-	sf.val = val
+	sf.ITimeFix = val
 }
 
 // MarshalJSON -- сериализует себя в строку.

+ 1 - 2
v4/lev1/log_buf/log_msg/log_msg.go

@@ -12,14 +12,13 @@ import (
 
 // ILogMsg -- сообщение лога.
 type ILogMsg interface {
+	defs.IString
 	// CreateAt -- когда создано
 	CreateAt() core_spec.ITime
 	// Level -- уровень сообщения
 	Level() defs.ITxtMut
 	// Msg -- текст сообщения
 	Msg() defs.ITxtFix
-	// String -- форматированная строка
-	String() string
 }
 
 const (

+ 2 - 2
v4/lev1/mock_env/mock_env.go

@@ -72,7 +72,7 @@ func (sf *MockEnv) parseEnvStr(pair defs.ITxtFix) {
 func (sf *MockEnv) readEnv() {
 	binEnv, err := os.ReadFile(sf.fileName.String())
 	helpers.Hassert(err == nil, "MockEnv.readEnv(): in read %v, err=\n\t%v", []any{sf.fileName, err})
-	sf.strEnv = defs.TxtFix(string(binEnv))
+	sf.strEnv = defs.TxtFix(defs.ATxt(binEnv))
 }
 
 // Устанавливает текущий путь относительно проекта в dev.
@@ -84,7 +84,7 @@ func (sf *MockEnv) setPath() {
 	fileName := ""
 	isFind := false
 	for _, point := range lstDir {
-		pwd.WriteString(point + "/")
+		_, _ = pwd.WriteString(point + "/")
 		fileName = pwd.String() + ".env"
 		_, err := os.ReadFile(fileName)
 		if err == nil {

+ 1 - 1
v4/lev2/kwg/kwg.go

@@ -116,7 +116,7 @@ func (sf *kernelWg) Add(name *stream_name.AStreamName) {
 	msg := defs.TxtFix("Add(): stream('%v') done", name)
 	sf.log.Debug(msg)
 	mKh.Hassert(sf.isWork.Get(), "Add(): stream=%v, work end", []any{name})
-	mKh.Hassert(name.Name().Get() != "", "Add(): name stream is empty")
+	mKh.Hassert(name.Get() != "", "Add(): name stream is empty")
 	_, isOk := sf.dictStream[name]
 	mKh.Hassert(!isOk, "Add(): stream '%v' already exists", name)
 	sf.dictStream[name] = true

+ 2 - 1
v4/lev2/lsi/kstore_kv/kstore_kv_test.go

@@ -6,6 +6,7 @@ import (
 	"time"
 
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/stream_name"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev1/mock_env"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/kctx"
@@ -106,7 +107,7 @@ func (sf *tester) get() {
 	key := rec_key.NewRecKey("test_key")
 	res := kernStore.Get(key)
 	res.Hassert("get(): val==nil")
-	strVal := string(res.Ok())
+	strVal := def_spec.ATxt(res.Ok())
 	if strVal != "test_val" {
 		sf.t.Fatalf("get(): strVal(%v)!='test_val'", strVal)
 	}

+ 4 - 3
v4/lev2/lsi/store_ent/rec_key/store_key.go

@@ -2,16 +2,17 @@
 package rec_key
 
 import (
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
 )
 
 // ARecKey -- ключ хранилища.
-type ARecKey string
+type ARecKey def_spec.ATxt
 
 // IRecKeyFix -- фиксированный ключ хранилища.
 type IRecKeyFix interface {
-	// String -- строковое представление ключа хранилища.
-	String() string
+	defs.IString
 	// Get -- получить значение ключа хранилища.
 	Get() ARecKey
 	// Byte -- получить значение ключа хранилища в виде байтов.

+ 3 - 3
v4/lev2/lti/bus_ent/handler_name/handler_name.go

@@ -3,16 +3,16 @@ package handler_name
 
 import (
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
 )
 
 // AHandlerName -- имя функции обработчика.
-type AHandlerName string
+type AHandlerName def_spec.ATxt
 
 // IHandlerNameFix -- неизменяемое имя функции обработчика.
 type IHandlerNameFix interface {
-	// String -- строковое представление имени функции обработчика.
-	String() string
+	defs.IString
 	// Get -- возвращает имя функции обработчика.
 	Get() AHandlerName
 	// Txt -- внутренне представление имени функции обработчика.

+ 1 - 2
v4/lev2/lti/bus_ent/topic/topic.go

@@ -10,10 +10,9 @@ type ATopic defs.ATxt
 
 // ITopicFix -- неизменяемое имя топика в шине.
 type ITopicFix interface {
+	defs.IString
 	// Get -- возвращает имя топика
 	Get() ATopic
-	// String -- строковое представление топика
-	String() string
 }
 
 // ITopicMut -- изменяемое имя топика в шине.

+ 3 - 2
v4/lev2/lti/bus_mock/mock_hand_sub_http/mock_hand_sub_http.go

@@ -7,6 +7,7 @@ import (
 	"sync"
 
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	mKh "gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/lti/bus_ent"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/lti/bus_ent/handler_name"
@@ -61,7 +62,7 @@ func (sf *MockHandSubHttp) Name() bus_ent.IHandlerNameFix {
 func (sf *MockHandSubHttp) FnBack(binMsg []byte) {
 	sf.block.Lock()
 	defer sf.block.Unlock()
-	log.Printf("HandlerHttpSub.FnBack(): msg=%v\n", string(binMsg))
+	log.Printf("HandlerHttpSub.FnBack(): msg=%v\n", def_spec.ATxt(binMsg))
 	sf.BinMsg_ = binMsg
 }
 
@@ -69,5 +70,5 @@ func (sf *MockHandSubHttp) FnBack(binMsg []byte) {
 func (sf *MockHandSubHttp) Msg() defs.ITxtFix {
 	sf.block.Lock()
 	defer sf.block.Unlock()
-	return defs.TxtFix(string(sf.BinMsg_))
+	return defs.TxtFix(def_spec.ATxt(sf.BinMsg_))
 }

+ 2 - 1
v4/lev2/lti/bus_mock/mock_hand_sub_local/mock_hand_sub.go

@@ -6,6 +6,7 @@ import (
 	"sync"
 
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	mKh "gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/lti/bus_ent"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/lti/bus_spec"
@@ -35,7 +36,7 @@ func NewMockHandlerSub(topic bus_ent.ITopicFix, localHook defs.ITxtFix) *MockHan
 func (sf *MockHandlerSub) Msg() defs.ITxtFix {
 	sf.block.RLock()
 	defer sf.block.RUnlock()
-	return defs.TxtFix(string(sf.Msg_))
+	return defs.TxtFix(def_spec.ATxt(sf.Msg_))
 }
 
 // Функция обратного вызова подписки.

+ 2 - 1
v4/lev2/lti/kbus_http/client_bus_http/client_bus_http_test.go

@@ -8,6 +8,7 @@ import (
 	"time"
 
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	mL1 "gitp78su.ipnodns.ru/svi/kern/v4/lev1"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/kctx"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/kserv_http"
@@ -90,7 +91,7 @@ func (sf *tester) sendGood1() {
 	if res.Ok() == nil {
 		sf.t.Fatalf("sendGood1(): binResp==nil")
 	}
-	strResp := string(res.Ok())
+	strResp := def_spec.ATxt(res.Ok())
 	if strResp != "test msg 456" {
 		sf.t.Fatalf("sendGood1(): strResp(%v)!='test msg 456'", strResp)
 	}

+ 3 - 2
v4/lev2/lti/kbus_http/kbus_http_test.go

@@ -10,6 +10,7 @@ import (
 	"time"
 
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs/def_spec"
 	. "gitp78su.ipnodns.ru/svi/kern/v4/lev1"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/kctx"
 	"gitp78su.ipnodns.ru/svi/kern/v4/lev2/kserv_http"
@@ -517,8 +518,8 @@ func (sf *tester) reqGood1() {
 	if err != nil {
 		sf.t.Fatalf("reqGood1(): err=%v", err)
 	}
-	if string(resp.BinResp_) != "test_msg" {
-		sf.t.Fatalf("reqGood1(): resp(%v)!='test_msg'", string(resp.BinResp_))
+	if def_spec.ATxt(resp.BinResp_) != "test_msg" {
+		sf.t.Fatalf("reqGood1(): resp(%v)!='test_msg'", def_spec.ATxt(resp.BinResp_))
 	}
 }
 

+ 5 - 4
v4/lev2/wui/hx_swap_oob/hx_swap_oob.go

@@ -4,13 +4,14 @@ package hx_swap_oob
 import (
 	"sync"
 
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
 	mWt "gitp78su.ipnodns.ru/svi/kern/v4/lev2/wui/wui_types"
 )
 
 // HxSwapOob -- объект внеполосной подкачки.
 type HxSwapOob struct {
 	sync.RWMutex
-	val string
+	val defs.ATxt
 }
 
 // NewHxSwapOob -- возвращает новую внеполосную подкачку.
@@ -24,18 +25,18 @@ func NewHxSwapOob() *HxSwapOob {
 func (sf *HxSwapOob) String() string {
 	sf.RLock()
 	defer sf.RUnlock()
-	return `hx-swap-oob="` + sf.val + `"`
+	return `hx-swap-oob="` + string(sf.val) + `"`
 }
 
 // Get -- возвращает хранимое значение внеполосной подкачки.
-func (sf *HxSwapOob) Get() string {
+func (sf *HxSwapOob) Get() defs.ATxt {
 	sf.RLock()
 	defer sf.RUnlock()
 	return sf.val
 }
 
 // Set -- устанавливает значение внеполосной подкачки.
-func (sf *HxSwapOob) Set(val string) {
+func (sf *HxSwapOob) Set(val defs.ATxt) {
 	sf.Lock()
 	defer sf.Unlock()
 	sf.val = val

+ 5 - 4
v4/lev2/wui/hx_target/hx_target.go

@@ -4,13 +4,14 @@ package hx_target
 import (
 	"sync"
 
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
 	mWt "gitp78su.ipnodns.ru/svi/kern/v4/lev2/wui/wui_types"
 )
 
 // HxSwap -- атрибут HTMX (цель замены).
 type HxSwap struct {
 	sync.RWMutex
-	val string
+	val defs.ATxt
 }
 
 // NewHxTarget -- возвращает новую цель замены.
@@ -26,11 +27,11 @@ func (sf *HxSwap) String() string {
 	sf.RLock()
 	defer sf.RUnlock()
 
-	return `hx-target="` + sf.val + `"`
+	return `hx-target="` + string(sf.val) + `"`
 }
 
 // Get -- возвращает хранимое значение цели замена.
-func (sf *HxSwap) Get() string {
+func (sf *HxSwap) Get() defs.ATxt {
 	sf.RLock()
 	defer sf.RUnlock()
 
@@ -38,7 +39,7 @@ func (sf *HxSwap) Get() string {
 }
 
 // Set -- устанавливает значение цели обмена.
-func (sf *HxSwap) Set(val string) {
+func (sf *HxSwap) Set(val defs.ATxt) {
 	sf.Lock()
 	defer sf.Unlock()
 	sf.val = val

+ 7 - 6
v4/lev2/wui/hx_vals/hx_vals.go

@@ -5,6 +5,7 @@ import (
 	"encoding/json"
 	"sync"
 
+	"gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
 	mKh "gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
 	mWt "gitp78su.ipnodns.ru/svi/kern/v4/lev2/wui/wui_types"
 )
@@ -12,13 +13,13 @@ import (
 // HxVals -- атрибут HTMX (словарь значений).
 type HxVals struct {
 	sync.RWMutex
-	dict map[string]any
+	dict map[defs.ATxt]any
 }
 
 // NewHxVals -- возвращает новый словарь значений.
 func NewHxVals() *HxVals {
 	sf := &HxVals{
-		dict: map[string]any{},
+		dict: map[defs.ATxt]any{},
 	}
 	_ = mWt.IHxVals(sf)
 	return sf
@@ -32,7 +33,7 @@ func (sf *HxVals) Len() int {
 }
 
 // Del -- удаляет ключ словаря.
-func (sf *HxVals) Del(key string) {
+func (sf *HxVals) Del(key defs.ATxt) {
 	sf.Lock()
 	defer sf.Unlock()
 	delete(sf.dict, key)
@@ -42,7 +43,7 @@ func (sf *HxVals) Del(key string) {
 func (sf *HxVals) Clear() {
 	sf.Lock()
 	defer sf.Unlock()
-	sf.dict = map[string]any{}
+	sf.dict = map[defs.ATxt]any{}
 }
 
 // String -- возвращает строковое представление тэга.
@@ -54,14 +55,14 @@ func (sf *HxVals) String() string {
 }
 
 // Get -- возвращает хранимое значение словарь значений.
-func (sf *HxVals) Get(key string) any {
+func (sf *HxVals) Get(key defs.ATxt) any {
 	sf.RLock()
 	defer sf.RUnlock()
 	return sf.dict[key]
 }
 
 // Set -- устанавливает значение словарь значений.
-func (sf *HxVals) Set(key string, val any) {
+func (sf *HxVals) Set(key defs.ATxt, val any) {
 	sf.Lock()
 	defer sf.Unlock()
 	mKh.Hassert(key != "", "HxVals.Set(): key is empty")

+ 1 - 1
v4/lev2/wui/wui.go

@@ -10,7 +10,7 @@ import (
 )
 
 // NewWuiButton -- возвращает новую WUI-кнопку.
-func NewWuiButton(text defs.ITxtFix, fnClick func(map[string]string) mL0.IResult[defs.ITxtFix]) mWt.IWuiButton {
+func NewWuiButton(text defs.ITxtFix, fnClick func(map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix]) mWt.IWuiButton {
 	wBtn := wui_button.NewWuiButton(text, fnClick)
 	return wBtn
 }

+ 3 - 3
v4/lev2/wui/wui_button/wui_button.go

@@ -18,12 +18,12 @@ import (
 type WuiButton struct {
 	mWt.IWuiWidget
 	text   mWt.IWuiText
-	fnBack func(map[string]string) mL0.IResult[defs.ITxtFix]
+	fnBack func(map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix]
 	hx     mWt.IWuiHx
 }
 
 // FnBtnBack -- функция обратного вызова для кнопки.
-type FnBtnBack func(map[string]string) mL0.IResult[defs.ITxtFix]
+type FnBtnBack func(map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix]
 
 // NewWuiButton -- возвращает новую WUI-кнопку.
 func NewWuiButton(text defs.ITxtFix, fnBack FnBtnBack) *WuiButton {
@@ -51,7 +51,7 @@ func (sf *WuiButton) Text() mWt.IWuiText {
 }
 
 // Click -- событие нажатия.
-func (sf *WuiButton) Click(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *WuiButton) Click(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	return sf.fnBack(dict)
 }
 

+ 4 - 4
v4/lev2/wui/wui_button/wui_button_test.go

@@ -9,13 +9,13 @@ import (
 
 type tester struct {
 	t      *testing.T
-	chCall chan string
+	chCall chan defs.ATxt
 }
 
 func TestWuiButton(t *testing.T) {
 	sf := &tester{
 		t:      t,
-		chCall: make(chan string, 2),
+		chCall: make(chan defs.ATxt, 2),
 	}
 	sf.new()
 }
@@ -36,14 +36,14 @@ func (sf *tester) new() {
 	if hx := btn.Hx(); hx == nil {
 		sf.t.Fatalf("new(): IWuiHx==nil")
 	}
-	btn.Click(map[string]string{}).Hassert("new()")
+	btn.Click(map[defs.ATxt]defs.ATxt{}).Hassert("new()")
 	if str := <-sf.chCall; str != "test" {
 		sf.t.Fatalf("new(): bad called")
 	}
 }
 
 // Функция обратного вызова.
-func (sf *tester) fnBack(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *tester) fnBack(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	sf.chCall <- "test"
 	return mL0.NewOk(defs.TxtFix("test_click"))
 }

+ 1 - 1
v4/lev2/wui/wui_test.go

@@ -32,7 +32,7 @@ func (sf *tester) get() {
 }
 
 // Функция обратного вызова.
-func (sf *tester) fnClick(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *tester) fnClick(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	sf.t.Log("fnClick")
 	return mL0.NewOk(defs.TxtFix("test_click"))
 }

+ 1 - 2
v4/lev2/wui/wui_types/ihx_swap.go

@@ -50,8 +50,7 @@ import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
 //
 // hx-swap="innerHTML show:top".
 type IHxSwap interface {
+	defs.IString
 	// Swap -- возвращает политику замены элемента
 	Swap() defs.ITxtMut
-	// String -- возвращает строковое представление тэга
-	String() string
 }

+ 5 - 4
v4/lev2/wui/wui_types/ihx_swap_oob.go

@@ -1,5 +1,7 @@
 package wui_types
 
+import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+
 // IHxSwapOob -- внеполосная подкачка (hx-swap-oob)
 //
 // Атрибут 'hx-swap-oob' позволяет указать, что некоторый контент в ответе должен
@@ -20,10 +22,9 @@ package wui_types
 //
 // hx-swap-oob="true".
 type IHxSwapOob interface {
+	defs.IString
 	// Get -- получает атрибут HTMX
-	Get() string
+	Get() defs.ATxt
 	// Set -- устанавливает атрибут HTMX
-	Set(string)
-	// String -- возвращает строковое представление тэга
-	String() string
+	Set(defs.ATxt)
 }

+ 5 - 4
v4/lev2/wui/wui_types/ihx_target.go

@@ -1,5 +1,7 @@
 package wui_types
 
+import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+
 // IHxTarget -- атрибут цели HTMX (hx-target)
 //
 // Атрибут hx-target позволяет выбрать для замены другой элемент, отличный от того,
@@ -38,10 +40,9 @@ package wui_types
 //
 // <a hx-post="/new-link" hx-target="this" hx-swap="outerHTML">New link</a>.
 type IHxTarget interface {
+	defs.IString
 	// Set -- устанавливает цель атрибута
-	Set(string)
+	Set(defs.ATxt)
 	// Get -- возвращает цель атрибута
-	Get() string
-	// String -- возвращает строковое значение тэга
-	String() string
+	Get() defs.ATxt
 }

+ 1 - 2
v4/lev2/wui/wui_types/ihx_trigger.go

@@ -150,8 +150,7 @@ import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
 //
 // hx-vals='js:{x: event.offsetX, y: event.offsetY}'.
 type IHxTrigger interface {
+	defs.IString
 	// Trigger -- устанавливает триггер срабатывания атрибута
 	Trigger() defs.ITxtMut
-	// String -- возвращает строковое значение тэга
-	String() string
 }

+ 3 - 2
v4/lev2/wui/wui_types/ihx_url.go

@@ -1,11 +1,12 @@
 package wui_types
 
+import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+
 // IHxUrl -- атрибут метода HTMX.
 type IHxUrl interface {
+	defs.IString
 	// Method -- возвращает метод атрибута
 	Method() IHxUrlMethod
 	// Patch -- возвращает путь атрибута
 	Patch() IHxUrlPatch
-	// String -- возвращает полное значение
-	String() string
 }

+ 6 - 5
v4/lev2/wui/wui_types/ihx_vals.go

@@ -1,5 +1,7 @@
 package wui_types
 
+import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+
 // IHxVals -- словарь значений в элементе HTMX (hx-vals).
 //
 // Атрибут hx-vals позволяет добавлять параметры, которые будут отправляться с запросом AJAX.
@@ -15,16 +17,15 @@ package wui_types
 //
 // hx-vals='js:{x: event.clientX, y: event.clientY}'.
 type IHxVals interface {
+	defs.IString
 	// Get --  возвращает элемент словаря
-	Get(key string) any
+	Get(key defs.ATxt) any
 	// Set -- устанавливает элемент словаря
-	Set(key string, val any)
+	Set(key defs.ATxt, val any)
 	// Del -- удаляет элемент из словаря
-	Del(key string)
+	Del(key defs.ATxt)
 	// Clear -- очищает весь словарь
 	Clear()
 	// Len -- возвращает размер словаря
 	Len() int
-	// String -- возвращает строковое представление тэга
-	String() string
 }

+ 1 - 1
v4/lev2/wui/wui_types/iwui_button.go

@@ -11,7 +11,7 @@ type IWuiButton interface {
 	// Text -- возвращает текст кнопки
 	Text() IWuiText
 	// Click -- нажатие кнопки
-	Click(map[string]string) mL0.IResult[defs.ITxtFix]
+	Click(map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix]
 	// Hx -- атрибуты HTMX
 	Hx() IWuiHx
 }

+ 3 - 2
v4/lev2/wui/wui_types/iwui_hx.go

@@ -1,7 +1,10 @@
 package wui_types
 
+import "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
+
 // IWuiHx -- атрибуты HTMX.
 type IWuiHx interface {
+	defs.IString
 	// Url -- возвращает URL HTMX
 	Url() IHxUrl
 	// Trigger -- возвращает триггер HTMX
@@ -14,6 +17,4 @@ type IWuiHx interface {
 	Oob() IHxSwapOob
 	// Vals -- словарь дополнительных значений
 	Vals() IHxVals
-	// String -- возвращает строку тэгов
-	String() string
 }

+ 2 - 3
v4/lev3/mod_ent/module_name/module_name.go

@@ -7,14 +7,13 @@ import (
 )
 
 // AModuleName -- уникальное имя модуля.
-type AModuleName string
+type AModuleName defs.ATxt
 
 // IModuleNameFix -- фиксированное имя модуля.
 type IModuleNameFix interface {
+	defs.IString
 	// Get -- получить имя модуля
 	Get() AModuleName
-	// String -- строковое представление имени модуля
-	String() string
 	// Txt -- внутренне представление имени модуля
 	Txt() defs.ITxtFix
 }

+ 1 - 1
v4/lev3/mod_serv_http/btn_modules/btn_modules.go

@@ -42,7 +42,7 @@ var strBlockModules string
 var strBlockRow string
 
 // Событие клика по кнопке.
-func (sf *BtnModules) clickMonolit(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *BtnModules) clickMonolit(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	optMonolit := sf.kCtx.Get(defs.TxtFix("monolit"))
 	if optMonolit.IsNone() {
 		err := defs.Err("clickMonolit(): monolit module not found")

+ 1 - 1
v4/lev3/mod_serv_http/btn_modules/btn_modules_test.go

@@ -21,7 +21,7 @@ func TestBtnModules(t *testing.T) {
 	modName := module_name.IModuleNameFix(module_name.NewModuleName("test"))
 	mod := kmodule.NewKernelModule(modName)
 	kMon.Add(mod)
-	if str := btn.clickMonolit(map[string]string{}).
+	if str := btn.clickMonolit(map[defs.ATxt]defs.ATxt{}).
 		Hassert("TestBtnModules()"); str.Get() == "" {
 		t.Fatalf("strOut is empty")
 	}

+ 1 - 1
v4/lev3/mod_serv_http/btn_monolit/btn_monolit.go

@@ -31,7 +31,7 @@ func (sf *BtnMonolit) Html() defs.ITxtFix {
 var strBlockMonolit string
 
 // Событие клика по кнопке.
-func (sf *BtnMonolit) clickMonolit(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *BtnMonolit) clickMonolit(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	txtBlockMonolit := defs.TxtFix(strBlockMonolit)
 	return mL0.NewOk(txtBlockMonolit)
 }

+ 1 - 1
v4/lev3/mod_serv_http/btn_monolit/btn_monolit_test.go

@@ -21,7 +21,7 @@ func TestBtnModules(t *testing.T) {
 	modName := module_name.IModuleNameFix(module_name.NewModuleName("test"))
 	mod := kmodule.NewKernelModule(modName)
 	kMon.Add(mod)
-	if str := btn.clickMonolit(map[string]string{}).
+	if str := btn.clickMonolit(map[defs.ATxt]defs.ATxt{}).
 		Hassert("TestBtnModules()"); str.Get() == "" {
 		t.Fatalf("strOut is empty")
 	}

+ 3 - 3
v4/lev3/mod_wui/mod_wui.go

@@ -104,12 +104,12 @@ func (sf *ModuleWui) wuiClick(resp http.ResponseWriter, req *http.Request) {
 		_, _ = fmt.Fprint(resp, strOut)
 		return
 	}
-	dict := map[string]string{}
+	dict := map[defs.ATxt]defs.ATxt{}
 
 	// headers := ctx.GetReqHeaders()
 	for key, lstVal := range req.Header {
 		if len(lstVal) >= 1 {
-			dict[key] = lstVal[0]
+			dict[defs.ATxt(key)] = defs.ATxt(lstVal[0])
 			continue
 		}
 	}
@@ -120,7 +120,7 @@ func (sf *ModuleWui) wuiClick(resp http.ResponseWriter, req *http.Request) {
 	// values := req.ParseForm()
 	for key, lstVal := range req.Form {
 		if len(lstVal) >= 1 {
-			dict[key] = lstVal[0]
+			dict[defs.ATxt(key)] = defs.ATxt(lstVal[0])
 			continue
 		}
 	}

+ 1 - 1
v4/lev3/mod_wui/mod_wui_test.go

@@ -154,7 +154,7 @@ func (sf *tester) clickGood1() {
 }
 
 // Обратный вызов клика.
-func (sf *tester) fnClick(dict map[string]string) mL0.IResult[defs.ITxtFix] {
+func (sf *tester) fnClick(dict map[defs.ATxt]defs.ATxt) mL0.IResult[defs.ITxtFix] {
 	sf.t.Log("fnClick")
 	return mL0.NewOk(defs.TxtFix("test_click"))
 }