Documentation ¶
Overview ¶
Package store handles reading and writing the .upm/store.json file. This file is used to cache several things for performance reasons, as described in the README.
Index ¶
- func ClearGuesses(ctx context.Context, b api.LanguageBackend)
- func GuessWithCache(ctx context.Context, b api.LanguageBackend, forceGuess bool) map[string][]api.PkgName
- func HasLockfileChanged(b api.LanguageBackend) bool
- func HasSpecfileChanged(b api.LanguageBackend) bool
- func Read(ctx context.Context, b api.LanguageBackend)
- func UpdateFileHashes(ctx context.Context, b api.LanguageBackend)
- func Write(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearGuesses ¶
func ClearGuesses(ctx context.Context, b api.LanguageBackend)
func GuessWithCache ¶
func GuessWithCache(ctx context.Context, b api.LanguageBackend, forceGuess bool) map[string][]api.PkgName
GuessWithCache returns b.Guess(), but re-uses a cached return value if possible. The cache is used if the matches of b.GuessRegexps against b.FilenamePatterns has not changed since the last time GuessWithCache was invoked. (This is only possible if the backend specifies b.GuessRegexps, which is not always the case. If the backend does specify b.GuessRegexps, then the return value of this function is cached.) If forceGuess is true, then write to but do not read from the cache.
func HasLockfileChanged ¶
func HasLockfileChanged(b api.LanguageBackend) bool
HasLockfileChanged returns false if the lockfile exists and has not changed since the last time UpdateFileHashes was called, or if it doesn't exist and it didn't exist last time either. Otherwise, it returns true.
func HasSpecfileChanged ¶
func HasSpecfileChanged(b api.LanguageBackend) bool
HasSpecfileChanged returns false if the specfile exists and has not changed since the last time UpdateFileHashes was called, or if it doesn't exist and it didn't exist last time either. Otherwise, it returns true.
func UpdateFileHashes ¶
func UpdateFileHashes(ctx context.Context, b api.LanguageBackend)
UpdateFileHashes caches the current states of the specfile and lockfile. Neither file need exist.
Types ¶
This section is empty.