|
@@ -10,9 +10,9 @@ import (
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
"github.com/google/uuid"
|
|
|
|
|
|
|
|
- . "gitp78su.ipnodns.ru/svi/kern/v4/lev0/kalias"
|
|
|
|
|
- . "gitp78su.ipnodns.ru/svi/kern/v4/lev0/ktypes"
|
|
|
|
|
- . "gitp78su.ipnodns.ru/svi/kern/v4/lev1"
|
|
|
|
|
|
|
+ mKa "gitp78su.ipnodns.ru/svi/kern/v4/lev0/kalias"
|
|
|
|
|
+ mKt "gitp78su.ipnodns.ru/svi/kern/v4/lev0/ktypes"
|
|
|
|
|
+ mL1 "gitp78su.ipnodns.ru/svi/kern/v4/lev1"
|
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_pub"
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_pub"
|
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_serve"
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_serve"
|
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_sub"
|
|
"gitp78su.ipnodns.ru/svi/kern/v4/lev1/kbus_msg/msg_sub"
|
|
@@ -24,56 +24,56 @@ import (
|
|
|
|
|
|
|
|
// ClientBusHttp -- клиент HTTP-шины.
|
|
// ClientBusHttp -- клиент HTTP-шины.
|
|
|
type ClientBusHttp struct {
|
|
type ClientBusHttp struct {
|
|
|
- bus IKernelBus
|
|
|
|
|
- ctx ILocalCtx
|
|
|
|
|
- log ILogBuf
|
|
|
|
|
- isWork ISafeBool
|
|
|
|
|
|
|
+ bus mKt.IKernelBus
|
|
|
|
|
+ ctx mKt.ILocalCtx
|
|
|
|
|
+ log mKt.ILogBuf
|
|
|
|
|
+ isWork mKt.ISafeBool
|
|
|
urlRemote string // URL дистанционной шины
|
|
urlRemote string // URL дистанционной шины
|
|
|
urlLocal string // URL локальной шины для веб-хуков
|
|
urlLocal string // URL локальной шины для веб-хуков
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// NewClientBusHttp - -возвращает новый клиент HTTP-шины.
|
|
// NewClientBusHttp - -возвращает новый клиент HTTP-шины.
|
|
|
-func NewClientBusHttp(urlRemote string) IResult[IBusClient] {
|
|
|
|
|
- log := NewLogBuf(OptIsTerm(true), OptPrefix("ClientBusHttp"))
|
|
|
|
|
|
|
+func NewClientBusHttp(urlRemote string) mKt.IResult[mKt.IBusClient] {
|
|
|
|
|
+ log := mL1.NewLogBuf(mL1.OptIsTerm(true), mL1.OptPrefix("ClientBusHttp"))
|
|
|
log.Debug("NewClientBusHttp()")
|
|
log.Debug("NewClientBusHttp()")
|
|
|
if urlRemote == "" {
|
|
if urlRemote == "" {
|
|
|
err := fmt.Errorf("NewClientBusHttp(): urlRemote is empty")
|
|
err := fmt.Errorf("NewClientBusHttp(): urlRemote is empty")
|
|
|
- return NewErr[IBusClient](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[mKt.IBusClient](err)
|
|
|
}
|
|
}
|
|
|
resKernCtx := kctx.GetKernelCtx()
|
|
resKernCtx := kctx.GetKernelCtx()
|
|
|
if resKernCtx.IsErr() {
|
|
if resKernCtx.IsErr() {
|
|
|
err := fmt.Errorf("NewClientBusHttp(): in get ctx, err=\n\t%w", resKernCtx.Err())
|
|
err := fmt.Errorf("NewClientBusHttp(): in get ctx, err=\n\t%w", resKernCtx.Err())
|
|
|
- return NewErr[IBusClient](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[mKt.IBusClient](err)
|
|
|
}
|
|
}
|
|
|
kCtx := resKernCtx.Val()
|
|
kCtx := resKernCtx.Val()
|
|
|
resLocal := safe_string.NewSafeStringGetenv("LOCAL_HTTP_URL")
|
|
resLocal := safe_string.NewSafeStringGetenv("LOCAL_HTTP_URL")
|
|
|
if resLocal.IsErr() {
|
|
if resLocal.IsErr() {
|
|
|
err := fmt.Errorf("NewClientBusHttp(): in get env LOCAL_HTTP_URL, err=\n\t%w", resLocal.Err())
|
|
err := fmt.Errorf("NewClientBusHttp(): in get env LOCAL_HTTP_URL, err=\n\t%w", resLocal.Err())
|
|
|
- return NewErr[IBusClient](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[mKt.IBusClient](err)
|
|
|
}
|
|
}
|
|
|
urlLocal := resLocal.Val()
|
|
urlLocal := resLocal.Val()
|
|
|
resBus := kbus_http.GetKernelBusHttp()
|
|
resBus := kbus_http.GetKernelBusHttp()
|
|
|
if resBus.IsErr() {
|
|
if resBus.IsErr() {
|
|
|
err := fmt.Errorf("NewClientBusHttp(): in get bus, err=\n\t%w", resBus.Err())
|
|
err := fmt.Errorf("NewClientBusHttp(): in get bus, err=\n\t%w", resBus.Err())
|
|
|
- return NewErr[IBusClient](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[mKt.IBusClient](err)
|
|
|
}
|
|
}
|
|
|
kBusHttp := resBus.Val()
|
|
kBusHttp := resBus.Val()
|
|
|
- lCtx := NewLocalCtx(kCtx.Ctx())
|
|
|
|
|
|
|
+ lCtx := mL1.NewLocalCtx(kCtx.Ctx())
|
|
|
sf := &ClientBusHttp{
|
|
sf := &ClientBusHttp{
|
|
|
ctx: lCtx.Val(),
|
|
ctx: lCtx.Val(),
|
|
|
log: log,
|
|
log: log,
|
|
|
bus: kBusHttp,
|
|
bus: kBusHttp,
|
|
|
- isWork: NewSafeBool(),
|
|
|
|
|
|
|
+ isWork: mL1.NewSafeBool(),
|
|
|
urlRemote: strings.TrimSuffix(urlRemote, "/"),
|
|
urlRemote: strings.TrimSuffix(urlRemote, "/"),
|
|
|
urlLocal: strings.TrimSuffix(urlLocal.Get(), "/"),
|
|
urlLocal: strings.TrimSuffix(urlLocal.Get(), "/"),
|
|
|
}
|
|
}
|
|
|
- return NewRes(IBusClient(sf))
|
|
|
|
|
|
|
+ return mL1.NewRes(mKt.IBusClient(sf))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Unsubscribe -- отписывается от топика в дистанционной шине.
|
|
// Unsubscribe -- отписывается от топика в дистанционной шине.
|
|
|
-func (sf *ClientBusHttp) Unsubscribe(handler IBusHandlerSubscribe) {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) Unsubscribe(handler mKt.IBusHandlerSubscribe) {
|
|
|
_uuid, err := uuid.NewV6()
|
|
_uuid, err := uuid.NewV6()
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in generate UUID v6, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in generate UUID v6, err=\n\t%v", err)
|
|
|
|
|
|
|
|
req := &msg_unsub.UnsubReq{
|
|
req := &msg_unsub.UnsubReq{
|
|
|
Name_: handler.Name(),
|
|
Name_: handler.Name(),
|
|
@@ -81,11 +81,11 @@ func (sf *ClientBusHttp) Unsubscribe(handler IBusHandlerSubscribe) {
|
|
|
}
|
|
}
|
|
|
req.SelfCheck()
|
|
req.SelfCheck()
|
|
|
binReq, err := json.MarshalIndent(req, "", " ")
|
|
binReq, err := json.MarshalIndent(req, "", " ")
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in marshal to JSON unsubscribe request, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in marshal to JSON unsubscribe request, err=\n\t%v", err)
|
|
|
reader := strings.NewReader(string(binReq))
|
|
reader := strings.NewReader(string(binReq))
|
|
|
|
|
|
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/unsub", reader)
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/unsub", reader)
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in new request, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Unsubscribe(): in new request, err=\n\t%v", err)
|
|
|
|
|
|
|
|
binBody, err := sf.makePost(hReq)
|
|
binBody, err := sf.makePost(hReq)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -107,9 +107,9 @@ func (sf *ClientBusHttp) Unsubscribe(handler IBusHandlerSubscribe) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Subscribe -- подписывается на топик в дистанционной шине.
|
|
// Subscribe -- подписывается на топик в дистанционной шине.
|
|
|
-func (sf *ClientBusHttp) Subscribe(handler IBusHandlerSubscribe) IResult[bool] {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) Subscribe(handler mKt.IBusHandlerSubscribe) mKt.IResult[bool] {
|
|
|
_uuid, err := uuid.NewV6()
|
|
_uuid, err := uuid.NewV6()
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Subscribe(): in generate UUID v6, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Subscribe(): in generate UUID v6, err=\n\t%v", err)
|
|
|
req := &msg_sub.SubscribeReq{
|
|
req := &msg_sub.SubscribeReq{
|
|
|
Topic_: handler.Topic(),
|
|
Topic_: handler.Topic(),
|
|
|
Uuid_: _uuid.String(),
|
|
Uuid_: _uuid.String(),
|
|
@@ -120,35 +120,35 @@ func (sf *ClientBusHttp) Subscribe(handler IBusHandlerSubscribe) IResult[bool] {
|
|
|
body := strings.NewReader(string(binReq))
|
|
body := strings.NewReader(string(binReq))
|
|
|
|
|
|
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/sub", body)
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/sub", body)
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Subscribe(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Subscribe(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
|
binBody, err := sf.makePost(hReq)
|
|
binBody, err := sf.makePost(hReq)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): in make request, err=\n\t%w", err)
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): in make request, err=\n\t%w", err)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
resp := &msg_sub.SubscribeResp{}
|
|
resp := &msg_sub.SubscribeResp{}
|
|
|
err = json.Unmarshal(binBody, resp)
|
|
err = json.Unmarshal(binBody, resp)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): in unmarshal response, err=\n\t%v", err)
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): in unmarshal response, err=\n\t%v", err)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
if resp.Status_ != "ok" {
|
|
if resp.Status_ != "ok" {
|
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): resp uuid(%v) bad", resp.Uuid_)
|
|
err := fmt.Errorf("ClientBusHttp.Subscribe(): resp uuid(%v) bad", resp.Uuid_)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
res := sf.bus.Subscribe(handler)
|
|
res := sf.bus.Subscribe(handler)
|
|
|
return res
|
|
return res
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// SendRequest -- отправляет в дистанционную шину запрос.
|
|
// SendRequest -- отправляет в дистанционную шину запрос.
|
|
|
-func (sf *ClientBusHttp) SendRequest(topic ATopic, binReq []byte) IResult[[]byte] {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) SendRequest(topic mKa.ATopic, binReq []byte) mKt.IResult[[]byte] {
|
|
|
_uuid, err := uuid.NewV6()
|
|
_uuid, err := uuid.NewV6()
|
|
|
- Hassert()(err == nil, "ClientBusHttp.SendRequest(): in generate UUID v6, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.SendRequest(): in generate UUID v6, err=\n\t%v", err)
|
|
|
req := &msg_serve.ServeReq{
|
|
req := &msg_serve.ServeReq{
|
|
|
Topic_: topic,
|
|
Topic_: topic,
|
|
|
Uuid_: _uuid.String(),
|
|
Uuid_: _uuid.String(),
|
|
@@ -159,47 +159,47 @@ func (sf *ClientBusHttp) SendRequest(topic ATopic, binReq []byte) IResult[[]byte
|
|
|
body := strings.NewReader(string(_binReq))
|
|
body := strings.NewReader(string(_binReq))
|
|
|
|
|
|
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/request", body)
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/request", body)
|
|
|
- Hassert()(err == nil, "ClientBusHttp.SendRequest(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.SendRequest(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
|
binBody, err := sf.makePost(hReq)
|
|
binBody, err := sf.makePost(hReq)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): in make request, err=\n\t%w", err)
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): in make request, err=\n\t%w", err)
|
|
|
- return NewErr[[]byte](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[[]byte](err)
|
|
|
}
|
|
}
|
|
|
resp := &msg_serve.ServeResp{}
|
|
resp := &msg_serve.ServeResp{}
|
|
|
err = json.Unmarshal(binBody, resp)
|
|
err = json.Unmarshal(binBody, resp)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): in unmarshal response, err=\n\t%v", err)
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): in unmarshal response, err=\n\t%v", err)
|
|
|
- return NewErr[[]byte](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[[]byte](err)
|
|
|
}
|
|
}
|
|
|
if resp.Status_ != "ok" {
|
|
if resp.Status_ != "ok" {
|
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
|
- return NewErr[[]byte](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[[]byte](err)
|
|
|
}
|
|
}
|
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): resp uuid(%v) bad", resp.Uuid_)
|
|
err := fmt.Errorf("ClientBusHttp.SendRequest(): resp uuid(%v) bad", resp.Uuid_)
|
|
|
- return NewErr[[]byte](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[[]byte](err)
|
|
|
}
|
|
}
|
|
|
- return NewRes(resp.BinResp_)
|
|
|
|
|
|
|
+ return mL1.NewRes(resp.BinResp_)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// RegisterServe -- регистрирует в локальной шине обработчик.
|
|
// RegisterServe -- регистрирует в локальной шине обработчик.
|
|
|
-func (sf *ClientBusHttp) RegisterServe(handler IBusHandlerServe) IResult[bool] {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) RegisterServe(handler mKt.IBusHandlerServe) mKt.IResult[bool] {
|
|
|
if handler == nil {
|
|
if handler == nil {
|
|
|
- return NewErr[bool](fmt.Errorf("ClientBusHttp.RegisterServe(): handler==nil"))
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](fmt.Errorf("ClientBusHttp.RegisterServe(): handler==nil"))
|
|
|
}
|
|
}
|
|
|
res := sf.bus.RegisterServe(handler)
|
|
res := sf.bus.RegisterServe(handler)
|
|
|
if res.IsErr() {
|
|
if res.IsErr() {
|
|
|
err := fmt.Errorf("ClientBusHttp.RegisterServe(): in register serve to bus, err=\n\t%v", res.Err())
|
|
err := fmt.Errorf("ClientBusHttp.RegisterServe(): in register serve to bus, err=\n\t%v", res.Err())
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
- return NewRes(true)
|
|
|
|
|
|
|
+ return mL1.NewRes(true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Publish -- публикует сообщение в дистанционной шину.
|
|
// Publish -- публикует сообщение в дистанционной шину.
|
|
|
-func (sf *ClientBusHttp) Publish(topic ATopic, binMsg []byte) IResult[bool] {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) Publish(topic mKa.ATopic, binMsg []byte) mKt.IResult[bool] {
|
|
|
_uuid, err := uuid.NewV6()
|
|
_uuid, err := uuid.NewV6()
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Publish(): in generate UUID v6, err=\n\t%v", err)
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Publish(): in generate UUID v6, err=\n\t%v", err)
|
|
|
req := &msg_pub.PublishReq{
|
|
req := &msg_pub.PublishReq{
|
|
|
Topic_: topic,
|
|
Topic_: topic,
|
|
|
Uuid_: _uuid.String(),
|
|
Uuid_: _uuid.String(),
|
|
@@ -210,28 +210,28 @@ func (sf *ClientBusHttp) Publish(topic ATopic, binMsg []byte) IResult[bool] {
|
|
|
body := strings.NewReader(string(binReq))
|
|
body := strings.NewReader(string(binReq))
|
|
|
|
|
|
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/pub", body)
|
|
hReq, err := http.NewRequest(http.MethodPost, sf.urlRemote+"/bus/pub", body)
|
|
|
- Hassert()(err == nil, "ClientBusHttp.Publish(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
+ mL1.Hassert()(err == nil, "ClientBusHttp.Publish(): in new request, err=\n\t%v")
|
|
|
|
|
|
|
|
binBody, err := sf.makePost(hReq)
|
|
binBody, err := sf.makePost(hReq)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): in make request, err=\n\t%w", err)
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): in make request, err=\n\t%w", err)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
resp := &msg_pub.PublishResp{}
|
|
resp := &msg_pub.PublishResp{}
|
|
|
err = json.Unmarshal(binBody, resp)
|
|
err = json.Unmarshal(binBody, resp)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): in unmarshal response, err=\n\t%v", err)
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): in unmarshal response, err=\n\t%v", err)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
if resp.Status_ != "ok" {
|
|
if resp.Status_ != "ok" {
|
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): resp!='ok', err=\n\t%v", resp.Status_)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
if resp.Uuid_ != req.Uuid_ {
|
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): resp uuid(%v) bad", resp.Uuid_)
|
|
err := fmt.Errorf("ClientBusHttp.Publish(): resp uuid(%v) bad", resp.Uuid_)
|
|
|
- return NewErr[bool](err)
|
|
|
|
|
|
|
+ return mL1.NewErr[bool](err)
|
|
|
}
|
|
}
|
|
|
- return NewRes(true)
|
|
|
|
|
|
|
+ return mL1.NewRes(true)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Единый обработчик запросов.
|
|
// Единый обработчик запросов.
|
|
@@ -253,7 +253,7 @@ func (sf *ClientBusHttp) makePost(hReq *http.Request) ([]byte, error) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// Log -- возвращает локальный лог клиента.
|
|
// Log -- возвращает локальный лог клиента.
|
|
|
-func (sf *ClientBusHttp) Log() ILogBuf {
|
|
|
|
|
|
|
+func (sf *ClientBusHttp) Log() mKt.ILogBuf {
|
|
|
return sf.log
|
|
return sf.log
|
|
|
}
|
|
}
|
|
|
|
|
|