github.com/sercand/please@v13.4.0+incompatible/src/core/cache.go (about)

     1  package core
     2  
     3  // Cache is our general interface to caches for built targets.
     4  // The implementations are in //src/cache, but the interface is in this package because
     5  // it's passed around on the BuildState object.
     6  type Cache interface {
     7  	// Stores the results of a single build target.
     8  	// Optionally can store extra files against it at the same time.
     9  	Store(target *BuildTarget, key []byte, files ...string)
    10  	// Stores an extra file against a build target.
    11  	// The file name is relative to the target's out directory.
    12  	StoreExtra(target *BuildTarget, key []byte, file string)
    13  	// Retrieves the results of a single build target.
    14  	// If successful, the outputs will be placed into the output file tree.
    15  	Retrieve(target *BuildTarget, key []byte) bool
    16  	// Retrieves an extra file previously stored by StoreExtra.
    17  	// If successful, the file will be placed into the output file tree.
    18  	RetrieveExtra(target *BuildTarget, key []byte, file string) bool
    19  	// Cleans any artifacts associated with this target from the cache, for any possible key.
    20  	Clean(target *BuildTarget)
    21  	// Cleans the entire cache.
    22  	CleanAll()
    23  	// Shuts down the cache, blocking until any potentially pending requests are done.
    24  	Shutdown()
    25  }