move derp.go to derp module
Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
parent
2289a2acbf
commit
8c4c4c8633
6 changed files with 57 additions and 56 deletions
|
@ -23,12 +23,6 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
TlsALPN01ChallengeType = "TLS-ALPN-01"
|
||||
Http01ChallengeType = "HTTP-01"
|
||||
|
||||
JSONLogFormat = "json"
|
||||
TextLogFormat = "text"
|
||||
|
||||
defaultOIDCExpiryTime = 180 * 24 * time.Hour // 180 Days
|
||||
maxDuration time.Duration = 1<<63 - 1
|
||||
)
|
||||
|
|
16
hscontrol/types/const.go
Normal file
16
hscontrol/types/const.go
Normal file
|
@ -0,0 +1,16 @@
|
|||
package types
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
HTTPReadTimeout = 30 * time.Second
|
||||
HTTPShutdownTimeout = 3 * time.Second
|
||||
TlsALPN01ChallengeType = "TLS-ALPN-01"
|
||||
Http01ChallengeType = "HTTP-01"
|
||||
|
||||
JSONLogFormat = "json"
|
||||
TextLogFormat = "text"
|
||||
|
||||
KeepAliveInterval = 60 * time.Second
|
||||
MaxHostnameLength = 255
|
||||
)
|
|
@ -17,12 +17,6 @@ import (
|
|||
"tailscale.com/types/key"
|
||||
)
|
||||
|
||||
const (
|
||||
// TODO(kradalby): Move out of here when we got circdeps under control.
|
||||
keepAliveInterval = 60 * time.Second
|
||||
MaxHostnameLength = 255
|
||||
)
|
||||
|
||||
var (
|
||||
ErrMachineAddressesInvalid = errors.New("failed to parse machine addresses")
|
||||
ErrHostnameTooLong = errors.New("hostname too long")
|
||||
|
@ -160,7 +154,7 @@ func (machine *Machine) IsOnline() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
return machine.LastSeen.After(time.Now().Add(-keepAliveInterval))
|
||||
return machine.LastSeen.After(time.Now().Add(-KeepAliveInterval))
|
||||
}
|
||||
|
||||
// IsEphemeral returns if the machine is registered as an Ephemeral node.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue