Generating the helpers file
Helpers are methods you call inside handlers and for route registration. To produce the helpers file you need to run the helpers subcommand.
cd <handlers directory>
gohandlers helpers
That’s all. If everything goes right, you’ll see a gh.go
file at the same directory. Inside the helpers file, there should be your listers, request builders, request parsers, request validators, response builders and response writers.
func (pe *Pets) ListHandlers() map[string]gohandlers.HandlerInfo
func (bq CreateRequest) Build(host string) (*http.Request, error)
func (bq *CreateRequest) Parse(rq *http.Request) error
func (bq CreateRequest) Validate() (issues map[string]any)
func (bs CreateResponse) Write(w http.ResponseWriter) error
func (bs *CreateResponse) Parse(rs *http.Response) error
// ...