MCPcopy Create free account
hub / github.com/regclient/regclient / Close

Method Close

scheme.go:22–33  ·  view source on GitHub ↗

Close is used to free resources associated with a reference. With ocidir, this may trigger a garbage collection process.

(ctx context.Context, r ref.Ref)

Source from the content-addressed store, hash-verified

20// Close is used to free resources associated with a reference.
21// With ocidir, this may trigger a garbage collection process.
22func (rc *RegClient) Close(ctx context.Context, r ref.Ref) error {
23 schemeAPI, err := rc.schemeGet(r.Scheme)
24 if err != nil {
25 return err
26 }
27 // verify Closer api is defined, noop if missing
28 sc, ok := schemeAPI.(scheme.Closer)
29 if !ok {
30 return nil
31 }
32 return sc.Close(ctx, r)
33}

Callers 1

ImageCheckBaseMethod · 0.95

Calls 2

schemeGetMethod · 0.95
CloseMethod · 0.65

Tested by

no test coverage detected