2020-08-12 16:16:14 +00:00
|
|
|
package updater
|
|
|
|
|
2021-02-28 23:24:38 +00:00
|
|
|
// CheckResult is the behaviour resulting from checking in with the Update Service
|
|
|
|
type CheckResult interface {
|
2020-08-12 16:16:14 +00:00
|
|
|
Apply() error
|
2021-02-28 23:24:38 +00:00
|
|
|
Version() string
|
|
|
|
UserMessage() string
|
2020-08-12 16:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Service is the functions to get check for new updates
|
|
|
|
type Service interface {
|
2021-02-28 23:24:38 +00:00
|
|
|
Check() (CheckResult, error)
|
2020-08-12 16:16:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const (
|
|
|
|
// OSKeyName is the url parameter key to send to the checkin API for the operating system of the local cloudflared (e.g. windows, darwin, linux)
|
|
|
|
OSKeyName = "os"
|
|
|
|
|
|
|
|
// ArchitectureKeyName is the url parameter key to send to the checkin API for the architecture of the local cloudflared (e.g. amd64, x86)
|
|
|
|
ArchitectureKeyName = "arch"
|
|
|
|
|
|
|
|
// BetaKeyName is the url parameter key to send to the checkin API to signal if the update should be a beta version or not
|
|
|
|
BetaKeyName = "beta"
|
|
|
|
|
|
|
|
// VersionKeyName is the url parameter key to send to the checkin API to specific what version to upgrade or downgrade to
|
|
|
|
VersionKeyName = "version"
|
2021-02-28 23:24:38 +00:00
|
|
|
|
|
|
|
// ClientVersionName is the url parameter key to send the version that this cloudflared is currently running with
|
|
|
|
ClientVersionName = "clientVersion"
|
2020-08-12 16:16:14 +00:00
|
|
|
)
|