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.

20 lines
412 B

2 years ago
  1. package events
  2. import "fmt"
  3. type Connected struct {
  4. Prefix string `json:"prefix"`
  5. }
  6. func (e Connected) EventDescription() string {
  7. return fmt.Sprintf("Connect(prefix:%s)", e.Prefix)
  8. }
  9. type Disconnected struct {
  10. Prefix string `json:"prefix"`
  11. Reason string `json:"reason"`
  12. }
  13. func (e Disconnected) EventDescription() string {
  14. return fmt.Sprintf("Disconnected(prefix:%s, reason:%s)", e.Prefix, e.Reason)
  15. }