@cryptotaxi247 / kubo / commits / ee8bcd559

added AutoUpdate to config

Henry committed Oct 18, 2014 at 14:34 UTC ee8bcd55972677ac200edad8aa19fedce99cf234
1 file changed +15
config/version.go
+15
@@ -22,6 +22,13 @@ type Version struct {
22 // CheckPeriod is the time duration over which the update check will not be performed
23 // (Note: cannot use time.Duration because marshalling with json breaks it)
24 CheckPeriod string
25 +
26 + // AutoUpdate is optional and has these these options:
27 + // - "never" do not auto-update
28 + // - "patch" auto-update on new patch versions
29 + // - "minor" auto-update on new minor (or patch) versions (Default)
30 + // - "major" auto-update on any new version
31 + AutoUpdate string
32 }
33
34 // supported Version.Check values
@@ -36,6 +43,14 @@ const (
43 CheckIgnore = "ignore"
44 )
45
46 +// supported Version.AutoUpdate values
47 +const (
48 + UpdateNever = "never"
49 + UpdatePatch = "patch"
50 + UpdateMinor = "minor"
51 + UpdateMajor = "major"
52 +)
53 +
54 // defaultCheckPeriod governs h
55 var defaultCheckPeriod = time.Hour * 48
56