generator.go 842 B

12345678910111213141516171819
  1. package generator
  2. import (
  3. conf "git.i2edu.net/i2/go-zero/tools/goctl/config"
  4. "git.i2edu.net/i2/go-zero/tools/goctl/rpc/parser"
  5. )
  6. // Generator defines a generator interface to describe how to generate rpc service
  7. type Generator interface {
  8. Prepare() error
  9. GenMain(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  10. GenCall(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  11. GenEtc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  12. GenConfig(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  13. GenLogic(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  14. GenServer(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  15. GenSvc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  16. GenPb(ctx DirContext, protoImportPath []string, proto parser.Proto, cfg *conf.Config) error
  17. }