NewMemory builds this cache storage defaultExpiration will set the expiry time of chunks in this storage
(defaultExpiration time.Duration)
| 20 | // NewMemory builds this cache storage |
| 21 | // defaultExpiration will set the expiry time of chunks in this storage |
| 22 | func NewMemory(defaultExpiration time.Duration) *Memory { |
| 23 | mem := &Memory{} |
| 24 | err := mem.Connect(defaultExpiration) |
| 25 | if err != nil { |
| 26 | fs.Errorf("cache", "can't open ram connection: %v", err) |
| 27 | } |
| 28 | |
| 29 | return mem |
| 30 | } |
| 31 | |
| 32 | // Connect will create a connection for the storage |
| 33 | func (m *Memory) Connect(defaultExpiration time.Duration) error { |
no test coverage detected
searching dependent graphs…