store

package
v0.0.0-...-9ce4fc3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 10 Imported by: 0

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

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 Read

func Read(ctx context.Context, b api.LanguageBackend)

func UpdateFileHashes

func UpdateFileHashes(ctx context.Context, b api.LanguageBackend)

UpdateFileHashes caches the current states of the specfile and lockfile. Neither file need exist.

func Write

func Write(ctx context.Context)

Write writes the current contents of the store from memory back to disk. If there is an error, it terminates the process.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL