MCPcopy Index your code
hub / github.com/opencloud-eu/opencloud / generatePath

Function generatePath

opencloud/pkg/command/revisions.go:147–163  ·  view source on GitHub ↗
(basePath string, rid *provider.ResourceId)

Source from the content-addressed store, hash-verified

145}
146
147func generatePath(basePath string, rid *provider.ResourceId) string {
148 if rid == nil {
149 return filepath.Join(basePath, _nodesGlobPattern)
150 }
151
152 sid := lookup.Pathify(rid.GetSpaceId(), 1, 2)
153 if sid == "" {
154 return ""
155 }
156
157 nid := lookup.Pathify(rid.GetOpaqueId(), 4, 2)
158 if nid == "" {
159 return filepath.Join(basePath, "spaces", sid, "nodes")
160 }
161
162 return filepath.Join(basePath, "spaces", sid, "nodes", nid+"*")
163}
164
165func init() {
166 register.AddCommand(RevisionsCommand)

Callers 1

PurgeRevisionsCommandFunction · 0.85

Calls 2

GetSpaceIdMethod · 0.45
GetOpaqueIdMethod · 0.45

Tested by

no test coverage detected