cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
connection/event.go
28lines · modecode
| 1 | package connection |
| 2 | |
| 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 | } |
| 11 | |
| 12 | // Status is the status of a connection. |
| 13 | type Status int |
| 14 | |
| 15 | const ( |
| 16 | // Disconnected means the connection to the edge was broken. |
| 17 | Disconnected Status = iota |
| 18 | // Connected means the connection to the edge was successfully established. |
| 19 | Connected |
| 20 | // Reconnecting means the connection to the edge is being re-established. |
| 21 | Reconnecting |
| 22 | // SetURL means this connection's tunnel was given a URL by the edge. Used for quick tunnels. |
| 23 | SetURL |
| 24 | // RegisteringTunnel means the non-named tunnel is registering its connection. |
| 25 | RegisteringTunnel |
| 26 | // We're unregistering tunnel from the edge in preparation for a disconnect |
| 27 | Unregistering |
| 28 | ) |
| 29 | |