1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-05 17:10:24 +08:00
Files
terasu-cloudflared/origin/external_control.go

22 lines
408 B
Go

package origin
import (
"time"
)
type ReconnectSignal struct {
// wait this many seconds before re-establish the connection
Delay time.Duration
}
// Error allows us to use ReconnectSignal as a special error to force connection abort
func (r *ReconnectSignal) Error() string {
return "reconnect signal"
}
func (r *ReconnectSignal) DelayBeforeReconnect() {
if r.Delay > 0 {
time.Sleep(r.Delay)
}
}