From 8f29959b87b68e76aadbc32dfa00f938604b1f6d Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Fri, 23 Jan 2026 20:02:21 +0100 Subject: add AGENTS.md --- AGENTS.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 AGENTS.md (limited to 'AGENTS.md') diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..8992a8c --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,25 @@ +# hh + +This projects is a code generation tool and library for creating wrapper functions around web +request handlers that parse data out of the request. + +The code generator tool is located at `./cmd/generate` and the library which shall be included is +located at `.`. In `./examples`, there are usage examples available. + +The tool, when invoked on a go module (a directory) goes through all go files and finds functions +with `//hh:route` directives. For each of these functions (which shall be route handlers), it +creates a wrapper function. To do this, it looks at a parameter defined as an inline struct which +specifies which fields should be retrieved from the request. + +## Commands + +To test the project, run these commands in order: + +- Run the code generation tool: `go generate ./examples` +- Compile the output: `go build -o /dev/null ./examples` + +## Tests + +This project only have integration tests, which also serve as examples. These are located in the +`./examples/` directory. They should test all available functionality of hh. Running `go test` is +therefore never relevant. -- cgit v1.2.3