event.go 852 B

1234567891011121314151617181920212223242526272829
  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. Protocol Protocol
  8. URL string
  9. }
  10. // Status is the status of a connection.
  11. type Status int
  12. const (
  13. // Disconnected means the connection to the edge was broken.
  14. Disconnected Status = iota
  15. // Connected means the connection to the edge was successfully established.
  16. Connected
  17. // Reconnecting means the connection to the edge is being re-established.
  18. Reconnecting
  19. // SetURL means this connection's tunnel was given a URL by the edge. Used for quick tunnels.
  20. SetURL
  21. // RegisteringTunnel means the non-named tunnel is registering its connection.
  22. RegisteringTunnel
  23. // We're unregistering tunnel from the edge in preparation for a disconnect
  24. Unregistering
  25. )