Documentation
¶
Overview ¶
Package cache provides read/write access to the Evans's cache file.
All APIs which modify each config elements are provided as top-level functions which begin with Set*. Note that all changes by Set* functions aren't flushed until calling Save() of the returned cache object.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Version string `toml:"version"`
UpdateInfo UpdateInfo `toml:"updateInfo"`
InstalledBy MeansType `default:"" toml:"installedBy"`
CommandHistory []string `default:"" toml:"commandHistory"`
}
Cache represents cached items.
func Get ¶
func Get() *Cache
Get returns loaded cache contents. To reduce duplicatd function calls, Get caches the result of Get. See cachedCache comments for more implementation details.
func (*Cache) ClearUpdateInfo ¶ added in v0.7.3
ClearUpdateInfo clears c.UpdateInfo. ClearUpdateInfo also saves cleared cache to the file.
func (*Cache) Save ¶
Save writes the receiver to the cache file. It returns an *os.PathError if it can't create a new cache file. Also it returns an error if it failed to encode *Cache with TOML format.
func (*Cache) SetCommandHistory ¶ added in v0.7.3
func (*Cache) SetInstalledBy ¶ added in v0.7.3
SetInstalledBy sets means how Evans was installed.