MCPcopy
hub / github.com/filebrowser/filebrowser / open

Method open

diskcache/file_cache.go:77–88  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

75}
76
77func (f *FileCache) open(key string) (afero.File, bool, error) {
78 fileName := f.getFileName(key)
79 file, err := f.fs.Open(fileName)
80 if err != nil {
81 if errors.Is(err, os.ErrNotExist) {
82 return nil, false, nil
83 }
84 return nil, false, err
85 }
86
87 return file, true, nil
88}
89
90// getScopedLocks pull lock from the map if found or create a new one
91func (f *FileCache) getScopedLocks(key string) (lock sync.Locker) {

Callers 4

LoadMethod · 0.95
downloadFunction · 0.80
postResourcesFunction · 0.80
downloadFunction · 0.80

Implementers 2

NoOpdiskcache/noop_cache.go
FileCachediskcache/file_cache.go

Calls 2

getFileNameMethod · 0.95
OpenMethod · 0.45

Tested by

no test coverage detected