event.go 896 B

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