mirror of
https://github.com/anchore/syft
synced 2024-11-10 06:14:16 +00:00
af3aaa0397
Signed-off-by: Keith Zantow <kzantow@gmail.com>
19 lines
289 B
Go
19 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,
|
|
}
|
|
}
|