From ee8bcd55972677ac200edad8aa19fedce99cf234 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 18 Oct 2014 14:34:08 +0200 Subject: [PATCH] added AutoUpdate to config --- config/version.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/config/version.go b/config/version.go index 3c08cd372..417be5bd8 100644 --- a/config/version.go +++ b/config/version.go @@ -22,6 +22,13 @@ type Version struct { // CheckPeriod is the time duration over which the update check will not be performed // (Note: cannot use time.Duration because marshalling with json breaks it) CheckPeriod string + + // AutoUpdate is optional and has these these options: + // - "never" do not auto-update + // - "patch" auto-update on new patch versions + // - "minor" auto-update on new minor (or patch) versions (Default) + // - "major" auto-update on any new version + AutoUpdate string } // supported Version.Check values @@ -36,6 +43,14 @@ const ( CheckIgnore = "ignore" ) +// supported Version.AutoUpdate values +const ( + UpdateNever = "never" + UpdatePatch = "patch" + UpdateMinor = "minor" + UpdateMajor = "major" +) + // defaultCheckPeriod governs h var defaultCheckPeriod = time.Hour * 48