event.go 831 B

12345678910111213141516171819202122232425262728
  1. package connection
  2. // Event is something that happened to a connection, e.g. disconnection or registration.
  3. type Event struct {
  4. Index uint8
  5. EventType Status
  6. Location string
  7. URL string
  8. }
  9. // Status is the status of a connection.
  10. type Status int
  11. const (
  12. // Disconnected means the connection to the edge was broken.
  13. Disconnected Status = iota
  14. // Connected means the connection to the edge was successfully established.
  15. Connected
  16. // Reconnecting means the connection to the edge is being re-established.
  17. Reconnecting
  18. // SetURL means this connection's tunnel was given a URL by the edge. Used for free tunnels.
  19. SetURL
  20. // RegisteringTunnel means the non-named tunnel is registering its connection.
  21. RegisteringTunnel
  22. // We're unregistering tunnel from the edge in preparation for a disconnect
  23. Unregistering
  24. )