public interface GlobalCacheManager
| Modifier and Type | Method and Description |
|---|---|
boolean |
currentRepositoryIsUpToDate(NotationDependency dependency)
Check if the repository corresponding to a dependency package has been updated recently in global cache.
|
void |
ensureGlobalCacheExistAndWritable()
Ensures global cache exists and is writable.
|
java.nio.file.Path |
getGlobalGoBinCache(java.lang.String relativePath)
Get the path which locates in
relativePath relative to ~/.gradle/go/binary |
java.nio.file.Path |
getGlobalPackageCachePath(java.lang.String packagePath)
Get the go repository in global cache corresponding to
packagePath |
java.util.Optional<GlobalCacheMetadata> |
getMetadata(java.nio.file.Path packagePath)
Get the metadata of a package specified by
packagePath |
<T> T |
runWithGlobalCacheLock(GolangDependency dependency,
java.util.concurrent.Callable<T> callable)
Locks global cache directory of
dependency, and call the callable |
void |
updateCurrentDependencyLock(GolangDependency dependency)
Updates corresponding metadata (i.e.
|
void ensureGlobalCacheExistAndWritable()
java.nio.file.Path getGlobalPackageCachePath(java.lang.String packagePath)
packagePathpackagePath - import path of the packagejava.nio.file.Path getGlobalGoBinCache(java.lang.String relativePath)
relativePath relative to ~/.gradle/go/binaryrelativePath - the relative path to ~/.gradle/go/binaryjava.util.Optional<GlobalCacheMetadata> getMetadata(java.nio.file.Path packagePath)
packagePathpackagePath - import path of the packageOptional.empty() otherwise.<T> T runWithGlobalCacheLock(GolangDependency dependency, java.util.concurrent.Callable<T> callable) throws java.lang.Exception
dependency, and call the callableT - return value type of callabledependency - dependency to be lockedcallable - code to be executed under lockjava.lang.Exception - exception thrown by callablevoid updateCurrentDependencyLock(GolangDependency dependency)
dependency - the dependency packageboolean currentRepositoryIsUpToDate(NotationDependency dependency)
dependency - the dependency packagetrue if the package is up-to-date, false otherwise.GolangPluginSetting.getGlobalCacheSecond()