MCPcopy
hub / github.com/kopia/kopia / handleMountGet

Function handleMountGet

internal/server/api_mount.go:35–54  ·  view source on GitHub ↗
(ctx context.Context, rc requestContext)

Source from the content-addressed store, hash-verified

33}
34
35func handleMountGet(ctx context.Context, rc requestContext) (any, *apiError) {
36 oid, err := object.ParseID(rc.muxVar("rootObjectID"))
37 if err != nil {
38 return nil, requestError(serverapi.ErrorMalformedRequest, "invalid root object ID")
39 }
40
41 c, err := rc.srv.getMountController(ctx, rc.rep, oid, false)
42 if err != nil {
43 return nil, internalServerError(err)
44 }
45
46 if c == nil {
47 return nil, notFoundError("mount point not found")
48 }
49
50 return &serverapi.MountedSnapshot{
51 Path: c.MountPath(),
52 Root: oid,
53 }, nil
54}
55
56func handleMountDelete(ctx context.Context, rc requestContext) (any, *apiError) {
57 oid, err := object.ParseID(rc.muxVar("rootObjectID"))

Callers

nothing calls this directly

Calls 7

ParseIDFunction · 0.92
requestErrorFunction · 0.85
internalServerErrorFunction · 0.85
notFoundErrorFunction · 0.85
muxVarMethod · 0.80
getMountControllerMethod · 0.65
MountPathMethod · 0.65

Tested by

no test coverage detected