mirror of
https://github.com/warmbly/warmbly.git
synced 2026-11-28 08:05:45 +00:00
24 lines
703 B
Go
24 lines
703 B
Go
package models
|
|
|
|
// PoolLinkExecutor says which side runs a linked mailbox's warmup. Cloud runs
|
|
// every mailbox; instance marks a legacy row whose credential Cloud never received.
|
|
type PoolLinkExecutor string
|
|
|
|
const (
|
|
PoolLinkExecutorCloud PoolLinkExecutor = "cloud"
|
|
PoolLinkExecutorInstance PoolLinkExecutor = "instance"
|
|
)
|
|
|
|
// Valid reports an executor this build knows; empty reads as cloud.
|
|
func (e PoolLinkExecutor) Valid() bool {
|
|
return e == "" || e == PoolLinkExecutorCloud || e == PoolLinkExecutorInstance
|
|
}
|
|
|
|
// OrCloud resolves the empty value older clients and rows carry.
|
|
func (e PoolLinkExecutor) OrCloud() PoolLinkExecutor {
|
|
if e == "" {
|
|
return PoolLinkExecutorCloud
|
|
}
|
|
return e
|
|
}
|