2020-11-30 20:05:37 +00:00
|
|
|
package connection
|
|
|
|
|
|
|
|
// Event is something that happened to a connection, e.g. disconnection or registration.
|
|
|
|
type Event struct {
|
|
|
|
Index uint8
|
|
|
|
EventType Status
|
|
|
|
Location string
|
|
|
|
URL string
|
|
|
|
}
|
|
|
|
|
|
|
|
// Status is the status of a connection.
|
|
|
|
type Status int
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Disconnected means the connection to the edge was broken.
|
|
|
|
Disconnected Status = iota
|
|
|
|
// Connected means the connection to the edge was successfully established.
|
|
|
|
Connected
|
|
|
|
// Reconnecting means the connection to the edge is being re-established.
|
|
|
|
Reconnecting
|
2021-07-28 09:02:55 +00:00
|
|
|
// SetURL means this connection's tunnel was given a URL by the edge. Used for free tunnels.
|
2020-11-30 20:05:37 +00:00
|
|
|
SetURL
|
|
|
|
// RegisteringTunnel means the non-named tunnel is registering its connection.
|
|
|
|
RegisteringTunnel
|
2021-02-04 21:09:17 +00:00
|
|
|
// We're unregistering tunnel from the edge in preparation for a disconnect
|
|
|
|
Unregistering
|
2020-11-30 20:05:37 +00:00
|
|
|
)
|