cheapcash/cheapcash.go

29 lines
420 B
Go
Raw Normal View History

2021-11-16 04:56:33 +00:00
package cheapcash
import (
"errors"
"sync"
)
type Cache struct {
sync.Mutex
Path string
}
var ErrNotExists = errors.New("key does not exist")
var ErrInvalidPath = errors.New("path supplied is invalid")
var ErrDiskFull = errors.New("there was no space left on the device")
func Default() *Cache {
return &Cache{
Path: "/tmp/cheapcash/",
}
}
func New(path string) *Cache {
return &Cache{
Path: path,
}
}