mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
20 lines
289 B
Go
20 lines
289 B
Go
package cache
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/spf13/afero"
|
|
)
|
|
|
|
// NewInMemory returns an in-memory only cache manager
|
|
func NewInMemory(ttl time.Duration) Manager {
|
|
if ttl <= 0 {
|
|
return &bypassedCache{}
|
|
}
|
|
return &filesystemCache{
|
|
dir: "",
|
|
fs: afero.NewMemMapFs(),
|
|
ttl: ttl,
|
|
}
|
|
}
|