feat(offsite): 异地副本加入 registry 用户镜像,按摘要加密去重,索引按版本保留 14 天,新增 fetch-images 回推恢复

This commit is contained in:
Lemon-miaow committed 2026-09-25 04:33:23 +08:00
1 parent 0e93e961ed
commit e3ac9cd545
13 files changed
+1626 -51

No files matched your search

+11
View File
@@ -452,3 +452,14 @@ func WriteMirrorStatus(path string, st MirrorStatus) error {
}
return os.Rename(tmp, path)
}
// Manifest fetches one manifest of host/repo by tag or digest and returns its
// bytes and media type; a digest reference is checked against the bytes.
func (s *Source) Manifest(ctx context.Context, host, repo, reference string) ([]byte, string, error) {
return s.manifest(ctx, SourceRef{Host: host, Repo: repo}, reference)
}
// Blob opens one blob of host/repo. The caller checks the bytes against digest.
func (s *Source) Blob(ctx context.Context, host, repo, digest string) (io.ReadCloser, error) {
return s.blob(ctx, SourceRef{Host: host, Repo: repo}, digest)
}