generator

package
v1.1.5-0...-dfb45c8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Category

func Category() string

func Clean

func Clean() error

func GenTemplates

func GenTemplates(_ *cli.Context) error

func NewDefaultGenerator

func NewDefaultGenerator() *defaultGenerator

func ProtoTmpl

func ProtoTmpl(out string) error

func RevertTemplate

func RevertTemplate(name string) error

func Update

func Update() error

Types

type Dir

type Dir struct {
	Base     string
	Filename string
	Package  string
}

func (*Dir) Valid

func (d *Dir) Valid() bool

type DirContext

type DirContext interface {
	GetCall() Dir
	GetEtc() Dir
	GetInternal() Dir
	GetConfig() Dir
	GetLogic() Dir
	GetServer() Dir
	GetSvc() Dir
	GetPb() Dir
	GetMain() Dir
	GetServiceName() stringx.String
}

type Generator

type Generator interface {
	Prepare() error
	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
	GenPb(ctx DirContext, protoImportPath []string, proto parser.Proto, cfg *conf.Config) error
}

type RpcGenerator

type RpcGenerator struct {
	// contains filtered or unexported fields
}

func NewDefaultRpcGenerator

func NewDefaultRpcGenerator(style string) (*RpcGenerator, error)

func NewRpcGenerator

func NewRpcGenerator(g Generator, cfg *conf.Config) *RpcGenerator

func (*RpcGenerator) Generate

func (g *RpcGenerator) Generate(src, target string, protoImportPath []string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL