GetFileStat gets file info for validation
(path string)
| 247 | |
| 248 | // GetFileStat gets file info for validation |
| 249 | func GetFileStat(path string) (FileStat, error) { |
| 250 | info, err := os.Stat(path) |
| 251 | if err != nil { |
| 252 | if os.IsNotExist(err) { |
| 253 | return FileStat{Exists: false}, nil |
| 254 | } |
| 255 | return FileStat{}, err |
| 256 | } |
| 257 | |
| 258 | return FileStat{ |
| 259 | ModTime: info.ModTime(), |
| 260 | Size: info.Size(), |
| 261 | Exists: true, |
| 262 | }, nil |
| 263 | } |
| 264 | |
| 265 | // NewFileCache creates a new file cache using Olric |
| 266 | func NewFileCache(olricClient *olric.EmbeddedClient, namespace string) (*FileCache, error) { |
no test coverage detected