msg_serve.go 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. )
  7. // ServeReq -- входящий запрос на обслуживание.
  8. type ServeReq struct {
  9. Topic_ *defs.Topic `json:"topic"`
  10. Uuid_ string `json:"uuid"`
  11. BinReq_ []byte `json:"req"`
  12. }
  13. // SelfCheck -- проверяет структуру на правильность полей.
  14. func (sf *ServeReq) SelfCheck() {
  15. mKh.Hassert(sf.Topic_.Get() != "", "ServeReq.SelfCheck(): topic is empty")
  16. mKh.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. mKh.Hassert(sf.Status_ != "", "ServeResp.SelfCheck(): status is empty")
  27. }