/go-http-route-gen

Primary LanguageGoMIT LicenseMIT

Development Tool

Generate bit map value of given component part rule:

go build github.com/yinyin/go-http-route-gen/dev-tool/get-bit-map

Sample HTTPd

Generate routing code:

./go-http-route-gen -in sample/route.yaml -out sample/handler_route.go  -package main -type sampleHandler

Build binary for sample HTTP server:

go build -o sample-httpd github.com/yinyin/go-http-route-gen/sample

Generate Code Template for Code Generator

go-literal-code-gen  -in httproutegen/codetemplate.md  -out httproutegen/codetemplate.go

Generate String() Method of RouteIdent

This step is optional for user.

Generated code should not rely on generated String() method.

stringer -type RouteIdent handler_route.go