project_generator

package
v0.0.0-...-69e0da2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProjectTypeMono = iota
	ProjectTypeSubMono
	ProjectTypeSingle
)

Variables

This section is empty.

Functions

func GenMono

func GenMono(name string) error

func GenSingle

func GenSingle(name string) error

func GenSubMono

func GenSubMono(name string, isBff bool) error

Types

type CmdTmpl

type CmdTmpl struct {
	AppPkgPath  string
	ServiceName string
	OutPath     string
	IsBff       bool
}

func (CmdTmpl) Generate

func (ct CmdTmpl) Generate() error

type DataTmpl

type DataTmpl struct {
	AppPkgPath   string
	DBDriverType string
	LoggerName   string
	DataPath     string
}

func NewDataTmpl

func NewDataTmpl(name, appPkgPath, dataPath string) DataTmpl

func (DataTmpl) Generate

func (dt DataTmpl) Generate(text string) error

type LogTmpl

type LogTmpl struct {
	AppPkgPath string
	LogPath    string
	ModName    string
}

func NewLogTmpl

func NewLogTmpl(appPkgPath, logPath string, options ...LogTmplOption) *LogTmpl

func (LogTmpl) Generate

func (st LogTmpl) Generate() error

type LogTmplOption

type LogTmplOption func(*LogTmpl)

type Project

type Project struct {
	Type  ProjectType
	Name  string
	IsBff bool
}

func NewProject

func NewProject() *Project

func (*Project) Gen

func (p *Project) Gen() error

func (*Project) SetProjectType

func (p *Project) SetProjectType(isMono bool)

type ProjectType

type ProjectType int

type ServerTmpl

type ServerTmpl struct {
	AppPkgPath string
	ServerPath string
	GenGrpc    bool
	GenHttp    bool
}

func NewServerTmpl

func NewServerTmpl(appPkgPath, serverPath string, options ...ServerTmplOption) *ServerTmpl

func (ServerTmpl) Generate

func (st ServerTmpl) Generate() error

type ServerTmplOption

type ServerTmplOption func(*ServerTmpl)

func NonGenGrpc

func NonGenGrpc() ServerTmplOption

func NonGenHttp

func NonGenHttp() ServerTmplOption

Jump to

Keyboard shortcuts

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