@@ -25,13 +25,13 @@ import (
25
25
26
26
const lastUsedFileName = ".last-used"
27
27
28
- type buildCache struct {
28
+ type BuildCache struct {
29
29
baseDir * paths.Path
30
30
}
31
31
32
32
// GetOrCreate retrieves or creates the cache directory at the given path
33
33
// If the cache already exists the lifetime of the cache is extended.
34
- func (bc * buildCache ) GetOrCreate (key string ) (* paths.Path , error ) {
34
+ func (bc * BuildCache ) GetOrCreate (key string ) (* paths.Path , error ) {
35
35
keyDir := bc .baseDir .Join (key )
36
36
if err := keyDir .MkdirAll (); err != nil {
37
37
return nil , err
@@ -46,7 +46,7 @@ func (bc *buildCache) GetOrCreate(key string) (*paths.Path, error) {
46
46
// Purge removes all cache directories within baseDir that have expired
47
47
// To know how long ago a directory has been last used
48
48
// it checks into the .last-used file.
49
- func (bc * buildCache ) Purge (ttl time.Duration ) {
49
+ func (bc * BuildCache ) Purge (ttl time.Duration ) {
50
50
files , err := bc .baseDir .ReadDir ()
51
51
if err != nil {
52
52
return
@@ -59,8 +59,8 @@ func (bc *buildCache) Purge(ttl time.Duration) {
59
59
}
60
60
61
61
// New instantiates a build cache
62
- func New (baseDir * paths.Path ) * buildCache {
63
- return & buildCache {baseDir }
62
+ func New (baseDir * paths.Path ) * BuildCache {
63
+ return & BuildCache {baseDir }
64
64
}
65
65
66
66
func removeIfExpired (dir * paths.Path , ttl time.Duration ) {
0 commit comments