Documentation ¶
Overview ¶
Package cache provides an interface for interfacing with the Glide local cache
Glide has a local cache of metadata and repositories similar to the GOPATH. To store the cache Glide creates a .glide directory with a cache subdirectory. This is usually in the users home directory unless there is no accessible home directory in which case the .glide directory is in the root of the repository.
To get the cache location use the `cache.Location()` function. This will return the proper base location in your environment.
Within the cache directory there are two subdirectories. They are the src and info directories. The src directory contains version control checkouts of the packages. The info direcory contains metadata. The metadata maps to the RepoInfo struct. Both stores are happed to keys.
Using the `cache.Key()` function you can get a key for a repo. Pass in a location such as `https://github.com/foo/bar` or `git@example.com:foo.git` and a key will be returned that can be used for caching operations.
Note, the caching is based on repo rather than package. This is important for a couple reasons.
- Forks or package replacements are supported in Glide. Where a different repo maps to a package.
- Permissions enable different access. For example `https://example.com/foo.git` and `git@example.com:foo.git` may have access to different branches or tags.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Enabled = true
Enabled sets if the cache is globally enabled. Defaults to true.
var ErrCacheDisabled = errors.New("Cache disabled")
ErrCacheDisabled is returned with the cache is disabled.
Functions ¶
func SaveRepoData ¶
SaveRepoData stores data about a repo in the Glide cache
func SetupReset ¶
func SetupReset()
SetupReset resets if setup has been completed. The next time setup is run it will attempt a full setup.
func SystemLock ¶
func SystemLock() error
SystemLock starts a system rather than application lock. This way multiple app instances don't cause race conditions when working in the cache.