MCPcopy Index your code
hub / github.com/OpenListTeam/OpenList / ResolveLinkCacheMode

Method ResolveLinkCacheMode

drivers/alias/driver.go:556–577  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

554}
555
556func (d *Alias) ResolveLinkCacheMode(path string) driver.LinkCacheMode {
557 roots, sub := d.getRootsAndPath(path)
558 if len(roots) == 0 {
559 return 0
560 }
561 for _, root := range roots {
562 storage, actualPath, err := op.GetStorageAndActualPath(stdpath.Join(root, sub))
563 if err != nil {
564 continue
565 }
566 if storage.Config().CheckStatus && storage.GetStorage().Status != op.WORK {
567 continue
568 }
569 mode := storage.Config().LinkCacheMode
570 if mode == -1 {
571 return storage.(driver.LinkCacheModeResolver).ResolveLinkCacheMode(actualPath)
572 } else {
573 return mode
574 }
575 }
576 return 0
577}
578
579var _ driver.Driver = (*Alias)(nil)

Callers

nothing calls this directly

Calls 5

getRootsAndPathMethod · 0.95
GetStorageAndActualPathFunction · 0.92
ConfigMethod · 0.65
GetStorageMethod · 0.65
ResolveLinkCacheModeMethod · 0.65

Tested by

no test coverage detected