msg_serve.go 1.0 KB

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