Closed podhmo closed 2 years ago
in #110, I am implementing pagination, and this code need the information about the type of latestId ( latestIDType
), but the design that core generator (genchi.Generator) takes this info is not comfortable.
g := c.New(emitter)
return g.Generate(
context.Background(),
r,
design.HTTPStatusOf,
"", // latestId is string
)
instead of it, wanting something like plugin, and include this in runtime package generation.
if err := g.Generate(...); err != nil {
return err
}
myplugin.IncludeMe(g.RuntimePkg, myplugin.Options{LatestIDType: ""})
Currently, web/webgen/gen-chi/webruntime directory has different go.mod, so this package's requirements is simply ignored in normal use-case. (e.g. go-chi/chi), this point is also fit for plugin system (at least for apikit ) .
refs #110