Repository navigation
Streamlined API
v0.2.0 is where vanitykeygen starts to look like a real two-binary system
instead of a server with a satellite. The wire-level types live in their own
package, the HTTP layer picks up a real router, and the build pipeline gets
the polish it needs to actually ship containers.
9 files changed, 266 insertions, 93 deletions.
A shared schema package
The new pkg/vkg package is the single source of truth for the types that
flow over the wire — Key, Match, Target. Previously the server defined
them in its own package and the client carried near-duplicate copies; any
field shift had to be edited in lockstep on both sides, and JSON tags drifted
easily. With pkg/vkg, the client now imports the same struct the server
marshals, so the schema is enforced by the type system at build time.
This is a small change in line count (~30 lines moved) but a meaningful one
for the project's shape: it's the first time the codebase admits that the
client and server are peers sharing a contract, not a server with an embedded
client.
Gin for the HTTP server
The server's HTTP handlers move from raw net/http.HandlerFunc to
Gin (#2). A new pkg/server/api.go introduces
setupRouter, and the existing match-post / target-fetch handlers are
rewritten as gin.HandlerFunc. pkg/server/main.go loses about 80 lines of
manual JSON decode/encode and status-code plumbing in the process. Routes
themselves don't change shape, so existing clients keep working without any
API adjustments.
Build & deploy cleanup
The Makefile gets a thorough sweep so containers can actually ship. Separated
buildserver / buildclient targets each emit their own image under
nugget/vkg-server and nugget/vkg-client, OCI labels now carry version
metadata derived from git describe --always --long --tags --dirty, and a
new vkgstatic target produces a CGO-free binary suitable for the client
image. Local-development affordances runserver and runclient make the
inner-loop match the production layout, and editor scratch files are
properly .gitignored.