Project Moscato Team Messaging Middleware Implemetation Message Middleware by Golang Operate as Secure, Effectively
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

message.go 949B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package modules
  2. //*****메세지 틀*****
  3. type Message struct {
  4. from string
  5. version string
  6. time string
  7. kine 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. Message
  23. }
  24. //Key공유 메세지
  25. type KeyShareMsg struct {
  26. Message
  27. }
  28. //전달할 내용을 담은 메세지
  29. type PublishMsg struct {
  30. Message
  31. }
  32. //구독 정보를 담은 메세지
  33. type SubscriptionMsg struct {
  34. Message
  35. }
  36. //Microservice 등록 메세지
  37. type RegisterMsg struct {
  38. Message
  39. }
  40. //Microservice 탈퇴 메세지
  41. type WithdrawMsg struct {
  42. Message
  43. }
  44. //**************************