2020-11-05 14:12:47 +08:00
|
|
|
package generator
|
|
|
|
|
2020-11-24 15:11:18 +08:00
|
|
|
import (
|
|
|
|
conf "github.com/tal-tech/go-zero/tools/goctl/config"
|
|
|
|
"github.com/tal-tech/go-zero/tools/goctl/rpc/parser"
|
|
|
|
)
|
2020-11-05 14:12:47 +08:00
|
|
|
|
2021-02-26 16:11:47 +08:00
|
|
|
// Generator defines a generator interface to describe how to generate rpc service
|
2020-11-05 14:12:47 +08:00
|
|
|
type Generator interface {
|
2021-09-11 20:57:58 +08:00
|
|
|
Prepare() error
|
2020-11-24 15:11:18 +08:00
|
|
|
GenMain(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenCall(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenEtc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenConfig(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenLogic(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenServer(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
|
|
|
GenSvc(ctx DirContext, proto parser.Proto, cfg *conf.Config) error
|
2021-07-08 10:11:11 +08:00
|
|
|
GenPb(ctx DirContext, protoImportPath []string, proto parser.Proto, cfg *conf.Config, goOptions ...string) error
|
2020-11-05 14:12:47 +08:00
|
|
|
}
|