MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / getNearestMeta

Function getNearestMeta

internal/op/meta.go:25–37  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

23 return getNearestMeta(utils.FixAndCleanPath(path))
24}
25func getNearestMeta(path string) (*model.Meta, error) {
26 meta, err := GetMetaByPath(path)
27 if err == nil {
28 return meta, nil
29 }
30 if errors.Cause(err) != errs.MetaNotFound {
31 return nil, err
32 }
33 if path == "/" {
34 return nil, errs.MetaNotFound
35 }
36 return getNearestMeta(stdpath.Dir(path))
37}
38
39func GetMetaByPath(path string) (*model.Meta, error) {
40 return getMetaByPath(utils.FixAndCleanPath(path))

Callers 1

GetNearestMetaFunction · 0.85

Calls 1

GetMetaByPathFunction · 0.70

Tested by

no test coverage detected