Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CleanupDueDays 代表每次自動執行 cleanup 的間隔天數 CleanupDueDays = 30 // CheckUpdatesDueDays 代表每次自動執行檢查版本的間隔天數 CheckUpdatesDueDays = 15 )
Variables ¶
View Source
var ErrTokenNotExist = errors.New(`token not exist.
You might need to run 'slctl init'`)
ErrTokenNotExist 代表了 GitHub Token 在不存在於 config 中
Functions ¶
Types ¶
type ConfFile ¶
type ConfFile struct { Token string `json:"token"` // github token Cleanup time.Time `json:"cleanup"` // 下次要執行 cleanup 的時間 CheckUpdates time.Time `json:"checkUpdates"` // 下次要執行檢查版本的時間 }
ConfFile 內容等於 $SL_HOME/config/configs.yaml
func LoadConfFile ¶
LoadConfFile return a pointer of a ConfFile which read from path
func NewConfFile ¶
func NewConfFile() (c *ConfFile)
NewConfFile return a pointer of a blank ConfFile
func (*ConfFile) UpdateCheckUpdatesTime ¶
func (c *ConfFile) UpdateCheckUpdatesTime()
UpdateCheckUpdatesTime updates check updates time
func (*ConfFile) UpdateCheckUpdatesTimeInDays ¶
UpdateCheckUpdatesTimeInDays updates check updates time
func (*ConfFile) UpdateCleanupTime ¶
func (c *ConfFile) UpdateCleanupTime()
UpdateCleanupTime updates cleanup time
Click to show internal directories.
Click to hide internal directories.