generator.go 852 B

123456789101112131415161718
  1. package generator
  2. import (
  3. conf "github.com/tal-tech/go-zero/tools/goctl/config"
  4. "github.com/tal-tech/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. GenMain(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  9. GenCall(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  10. GenEtc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  11. GenConfig(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  12. GenLogic(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  13. GenServer(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  14. GenSvc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
  15. GenPb(ctx DirContext, protoImportPath []string, proto parser.Proto, cfg *conf.Config, goOptions ...string) error
  16. }