1
0
mirror of https://github.com/fumiama/terasu-cloudflared.git synced 2026-06-10 21:24:52 +08:00

TUN-3989: Check in with Updater service in more situations and convey messages to user

This commit is contained in:
Nuno Diegues
2021-02-28 23:24:38 +00:00
parent 5c7b451e17
commit bcd71b56e9
11 changed files with 245 additions and 107 deletions

View File

@@ -1,14 +1,15 @@
package updater
// Version is the functions needed to perform an update
type Version interface {
// CheckResult is the behaviour resulting from checking in with the Update Service
type CheckResult interface {
Apply() error
String() string
Version() string
UserMessage() string
}
// Service is the functions to get check for new updates
type Service interface {
Check() (Version, error)
Check() (CheckResult, error)
}
const (
@@ -23,4 +24,7 @@ const (
// VersionKeyName is the url parameter key to send to the checkin API to specific what version to upgrade or downgrade to
VersionKeyName = "version"
// ClientVersionName is the url parameter key to send the version that this cloudflared is currently running with
ClientVersionName = "clientVersion"
)