gen

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Style              string
	RemoveSuffix       bool
	ChangeReplaceTypes bool
)
View Source
var (
	// ModelMysqlIgnoreColumns goctl model flags
	ModelMysqlIgnoreColumns []string

	ModelMysqlCache       bool
	ModelMysqlCachePrefix string

	// ModelMysqlDatasource goctl model datasource
	ModelMysqlDatasource      bool
	ModelMysqlDatasourceUrl   string
	ModelMysqlDatasourceTable []string
)

Functions

func Gen

func Gen(_ *cobra.Command, _ []string) error

func GetApiServiceName

func GetApiServiceName(apiDirName string) string

func GetMainApiFilePath

func GetMainApiFilePath(apiDirName string) (string, bool, error)

func GetProtoFilepath added in v0.20.0

func GetProtoFilepath(protoDirPath string) ([]string, error)

func RemoveExtraFiles added in v0.20.0

func RemoveExtraFiles(wd string)

Types

type ApiFileTypes

type ApiFileTypes struct {
	Filepath string
	ApiSpec  spec.ApiSpec
	GenTypes []spec.Type

	Base bool
}

type HandlerFile

type HandlerFile struct {
	Group   string
	Handler string
	Path    string
}

type ImportLines

type ImportLines []string

func (ImportLines) String

func (l ImportLines) String() string

type JzeroApi

type JzeroApi struct {
	Wd                 string
	Module             string
	Style              string
	RemoveSuffix       bool
	ChangeReplaceTypes bool
}

func (*JzeroApi) Gen

func (ja *JzeroApi) Gen() error

type JzeroRpc

type JzeroRpc struct {
	Wd           string
	Module       string
	Style        string
	RemoveSuffix bool
	Etc          string // 配置文件路径
}

func (*JzeroRpc) Gen

func (jr *JzeroRpc) Gen() error

func (*JzeroRpc) GetAllLogicFiles added in v0.20.0

func (jr *JzeroRpc) GetAllLogicFiles(protoSpec rpcparser.Proto) ([]LogicFile, error)

func (*JzeroRpc) GetAllServerFiles added in v0.20.0

func (jr *JzeroRpc) GetAllServerFiles(protoSpec rpcparser.Proto) ([]ServerFile, error)

type JzeroSql

type JzeroSql struct {
	Wd                        string
	AppDir                    string
	Style                     string
	ModelIgnoreColumns        []string
	ModelMysqlDatasource      bool
	ModelMysqlDatasourceUrl   string
	ModelMysqlDatasourceTable []string
	ModelMysqlCache           bool
	ModelMysqlCachePrefix     string
}

func (*JzeroSql) Gen

func (js *JzeroSql) Gen() error

type LogicFile

type LogicFile struct {
	Group   string
	Handler string
	Path    string

	RequestTypeName  string
	ResponseTypeName string
	ClientStream     bool
	ServerStream     bool
}

type RegisterLines

type RegisterLines []string

func (RegisterLines) String

func (l RegisterLines) String() string

type ServerFile

type ServerFile struct {
	Path string
}

type Table added in v0.18.5

type Table struct {
	Name string `db:"name"`
}

Jump to

Keyboard shortcuts

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