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)
| 20 | // Close is used to free resources associated with a reference. |
| 21 | // With ocidir, this may trigger a garbage collection process. |
| 22 | func (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 | } |
no test coverage detected