Refactor into packages, modernize deps, and add tests - #6
Open
JohanLindvall wants to merge 1 commit into
Open
Conversation
Restructure the codebase and bring it up to date: - Split package main: business logic moves into an `app` package (no global state), the HTTP registry server into a `registry` package with a route table, and tag-file handling into a `tagfile` package. main.go is now just flag parsing and dispatch. - Split the 500-line diz.go into archive/copy/manifest/registrymanifest files with clearer names; fix a bug in Merge that dropped all but the last new repo tag when coalescing manifests. - Fix the Docker-Content-Digest response header (was double hex encoded). - Update deflatewriter.go to the latest klauspost/pgzip, kept as a raw DEFLATE fork with every divergence documented. - Drop io/ioutil; replace the local str package with stdlib slices. - Update dependencies to latest and migrate to the modern docker client API, which lets the go.mod `replace` directive be removed. - Add a Makefile and tests across diz, dockerref, hashzip, imagesource, app, tagfile, util and registry (coverage ~67%). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Restructure the codebase and bring it up to date:
apppackage (no global state), the HTTP registry server into aregistrypackage with a route table, and tag-file handling into atagfilepackage. main.go is now just flag parsing and dispatch.replacedirective be removed.