Documentation
¶
Index ¶
Constants ¶
const MB int64 = 1024 * 1024
Variables ¶
This section is empty.
Functions ¶
func NewTestArtifactCache ¶
NewTestArtifactCache is only meant to be called from tests. Use New() instead.
Types ¶
type ArtifactCache ¶
type ArtifactCache struct {
// contains filtered or unexported fields
}
ArtifactCache is a cache of downloaded artifacts from the ActiveState Platform. The State Tool prefers to use this cache instead of redownloading artifacts.
func New ¶
func New() (*ArtifactCache, error)
New returns a new artifact cache in the State Tool's cache directory with the default maximum size of 1GB.
func (*ArtifactCache) Get ¶
func (cache *ArtifactCache) Get(a strfmt.UUID) (string, bool)
Get returns the path to the cached artifact with the given id along with true if it exists. Otherwise returns an empty string and false. Updates the access timestamp if possible so that this artifact is not removed anytime soon.
func (*ArtifactCache) Save ¶
func (cache *ArtifactCache) Save() error
Saves this cache's information to disk. You must call this function when you are done utilizing the cache.