cloudflare/cloudflared
Publicmirrored from https://github.com/cloudflare/cloudflaredAvailable
connection/event.go
27lines · 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 | URL string |
| 9 | } |
| 10 | |
| 11 | // Status is the status of a connection. |
| 12 | type Status int |
| 13 | |
| 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 | ) |