msg_serve.go 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. // package msg_serve -- сообщения на обслуживание входящих запросов.
  2. package msg_serve
  3. import (
  4. "gitp78su.ipnodns.ru/svi/kern/v4/lev0/defs"
  5. mKh "gitp78su.ipnodns.ru/svi/kern/v4/lev0/helpers"
  6. "gitp78su.ipnodns.ru/svi/kern/v4/lev2/lti/bus_ent"
  7. )
  8. // ServeReq -- входящий запрос на обслуживание.
  9. type ServeReq struct {
  10. Topic_ bus_ent.ATopic `json:"topic"`
  11. Uuid_ defs.ITxtFix `json:"uuid"`
  12. BinReq_ []byte `json:"req"`
  13. }
  14. // SelfCheck -- проверяет структуру на правильность полей.
  15. func (sf *ServeReq) SelfCheck() {
  16. mKh.Hassert(sf.Topic_ != "", "ServeReq.SelfCheck(): topic is empty")
  17. mKh.Hassert(sf.Uuid_.Get() != "", "ServeReq.SelfCheck(): uuid is empty")
  18. }
  19. // ServeResp -- ответ на входящий запрос.
  20. type ServeResp struct {
  21. Status_ defs.ITxtFix `json:"status"`
  22. Uuid_ defs.ITxtFix `json:"uuid"`
  23. BinResp_ []byte `json:"resp"`
  24. }
  25. // SelfCheck -- проверяет правильность своих полей.
  26. func (sf *ServeResp) SelfCheck() {
  27. mKh.Hassert(sf.Status_.Get() != "", "ServeResp.SelfCheck(): status is empty")
  28. }