Project Moscato Team Messaging Middleware Implemetation Message Middleware by Golang Operate as Secure, Effectively
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

message.go 895B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package modules
  2. //*****메세지 틀*****
  3. type Message struct {
  4. From string
  5. Version string
  6. Time string
  7. Type string
  8. Content MsgUnit
  9. }
  10. type MsgUnit interface {
  11. // ConvertToJson - send 전 json형식으로 바꾸는 함수
  12. ConvertToJson() ([]byte, error)
  13. // Send - rpc를 이용하여 msg전송
  14. Send() (Message, error)
  15. // Recieve - rpc를 이용하여 msg전달 받음(rpc call)
  16. Recieve() (Message, error)
  17. }
  18. //**********************
  19. //*****각 메세지 형식 및 정의**********
  20. //KeyGen 명령 메세지
  21. type KeyGenMsg struct {
  22. }
  23. //Key공유 메세지
  24. type KeyShareMsg struct {
  25. }
  26. //전달할 내용을 담은 메세지
  27. type PublishMsg struct {
  28. }
  29. //구독 정보를 담은 메세지
  30. type SubscriptionMsg struct {
  31. }
  32. //Microservice 등록 메세지
  33. type RegisterMsg struct {
  34. }
  35. //Microservice 탈퇴 메세지
  36. type WithdrawMsg struct {
  37. }
  38. //**************************