github.com/replit/upm@v0.0.0-20240423230255-9ce4fc3ea24c/internal/store/types.go (about) 1 package store 2 3 // hash is used in the store to represent a serializable MD5 hash. 4 type hash string 5 6 type storeLanguage struct { 7 8 // The hash of the specfile, or an empty string to indicate 9 // that the file doesn't exist or the hash has never been 10 // computed. 11 SpecfileHash hash `json:"specfileHash,omitempty"` 12 13 // The hash of the lockfile, or an empty string to indicate 14 // that the file doesn't exist or the hash has never been 15 // computed. 16 LockfileHash hash `json:"lockfileHash,omitempty"` 17 18 // The last return value of b.Guess(), converted to a slice. 19 // This is only set if the language backend provides 20 // GuessRegexps. 21 GuessedImports []string `json:"guessedImports,omitempty"` 22 23 // The hash of the last sequence of matches for GuessRegexps 24 // against the project code. 25 GuessedImportsHash hash `json:"guessedImportsHash,omitempty"` 26 } 27 28 // store represents the JSON written (by default) to .upm/store.json. 29 type store struct { 30 31 // The version of the store file. This gets incremented every 32 // time we make a backwards-incompatible change, and causes 33 // the store to be invalidated. 34 Version int `json:"version,omitempty"` 35 36 // Map from backend names to per-backend data. 37 Languages map[string]*storeLanguage `json:"languages,omitempty"` 38 }