MCPcopy
hub / github.com/kopia/kopia / handleMountDelete

Function handleMountDelete

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

Source from the content-addressed store, hash-verified

54}
55
56func handleMountDelete(ctx context.Context, rc requestContext) (any, *apiError) {
57 oid, err := object.ParseID(rc.muxVar("rootObjectID"))
58 if err != nil {
59 return nil, requestError(serverapi.ErrorMalformedRequest, "invalid root object ID")
60 }
61
62 c, err := rc.srv.getMountController(ctx, rc.rep, oid, false)
63 if err != nil {
64 return nil, internalServerError(err)
65 }
66
67 if c == nil {
68 return nil, notFoundError("mount point not found")
69 }
70
71 if err := c.Unmount(ctx); err != nil {
72 return nil, internalServerError(err)
73 }
74
75 rc.srv.deleteMount(oid)
76
77 return &serverapi.Empty{}, nil
78}
79
80func handleMountList(_ context.Context, rc requestContext) (any, *apiError) {
81 res := &serverapi.MountedSnapshots{

Callers

nothing calls this directly

Calls 8

ParseIDFunction · 0.92
requestErrorFunction · 0.85
internalServerErrorFunction · 0.85
notFoundErrorFunction · 0.85
muxVarMethod · 0.80
getMountControllerMethod · 0.65
UnmountMethod · 0.65
deleteMountMethod · 0.65

Tested by

no test coverage detected