提交 ee8bcd55 作者: Henry

added AutoUpdate to config

上级 2806260f
...@@ -22,6 +22,13 @@ type Version struct { ...@@ -22,6 +22,13 @@ type Version struct {
// CheckPeriod is the time duration over which the update check will not be performed // 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) // (Note: cannot use time.Duration because marshalling with json breaks it)
CheckPeriod string 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 // supported Version.Check values
...@@ -36,6 +43,14 @@ const ( ...@@ -36,6 +43,14 @@ const (
CheckIgnore = "ignore" CheckIgnore = "ignore"
) )
// supported Version.AutoUpdate values
const (
UpdateNever = "never"
UpdatePatch = "patch"
UpdateMinor = "minor"
UpdateMajor = "major"
)
// defaultCheckPeriod governs h // defaultCheckPeriod governs h
var defaultCheckPeriod = time.Hour * 48 var defaultCheckPeriod = time.Hour * 48
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论