codegen

package
v0.0.0-...-f07db7a Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: AGPL-3.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTemplateFunc = template.FuncMap{
	"ToCamel":      stringx.ToCamel,
	"ToSmallCamel": stringx.ToSmallCamel,
	"ToSnake":      stringx.ToSnake,
	"ToLower":      strings.ToLower,
	"ToUpper":      strings.ToUpper,
	"ToTitle":      strings.ToTitle,
	"ReplaceAll":   strings.ReplaceAll,

	"Snake2Camel":      stringx.Snake2Camel,
	"Snake2SmallCamel": stringx.Snake2SmallCamel,

	"TrimPrefix": strings.TrimPrefix,
	"TrimSuffix": strings.TrimSuffix,
	"HasPrefix":  strings.HasPrefix,
	"HasSuffix":  strings.HasSuffix,

	"PluckString": anyx.PluckString,
	"PluckInt":    anyx.PluckInt,
	"PluckInt32":  anyx.PluckInt32,
	"PluckUint32": anyx.PluckUint32,
	"PluckInt64":  anyx.PluckInt64,
	"PluckUint64": anyx.PluckUint64,

	"StringSliceEmpty": func(ss []string) bool {
		return len(ss) == 0
	},

	"Unique":   candy.Unique[string],
	"Sort":     candy.Sort[string],
	"Reverse":  candy.Reverse[string],
	"Top":      candy.Top[string],
	"First":    candy.First[string],
	"Last":     candy.Last[string],
	"Contains": candy.Contains[string],
	"Self": func(s string) string {
		return fmt.Sprintf("{{ %s }}", s)
	},

	"IncrKey": IncrWithKey,
	"DecrKey": DecrWithKey,
}
View Source
var I18NFieldFirstTemplate = `` /* 168-byte string literal not displayed */
View Source
var I18NFieldMiddleTemplate = "" /* 631-byte string literal not displayed */
View Source
var I18nFieldLastTemplate = "" /* 322-byte string literal not displayed */
View Source
var NameStyle = map[state.CfgStyleName]NameStyleHandler{
	state.CfgStyleNameDefault: func(source string, modele string) string {
		return source
	},
	state.CfgStyleNameCamel: func(source string, modele string) string {
		return stringx.ToSmallCamel(source)
	},
	state.CfgStyleNameSnake: func(source string, modele string) string {
		return stringx.ToSnake(source)
	},
	state.CfgStyleNameKebab: func(source string, modele string) string {
		return stringx.ToKebab(source)
	},
	state.CfgStyleNamePascal: func(source string, modele string) string {
		return stringx.ToCamel(source)
	},

	state.CfgStyleNameSlash: func(source string, modele string) string {
		return stringx.ToSlash(source)
	},
	state.CfgStyleNameSlashSnake: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")
		return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + modele
	},
	state.CfgStyleNameSlashPascal: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")
		return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToCamel(modele)
	},
	state.CfgStyleNameSlashCamel: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")
		return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToSmallCamel(modele)
	},
	state.CfgStyleNameSlashKebab: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")
		return stringx.ToSlash(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "/" + stringx.ToKebab(modele)
	},

	state.CfgStyleNameSlashReverse: func(source string, modele string) (path string) {
		return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), "/")
	},
	state.CfgStyleNameSlashReverseSnake: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return modele + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/")
	},
	state.CfgStyleNameSlashReversePascal: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/")
	},
	state.CfgStyleNameSlashReverseCamel: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToSmallCamel(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/")
	},
	state.CfgStyleNameSlashReverseKebab: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToKebab(modele) + "/" + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), "/")
	},

	state.CfgStyleNameDot: func(source string, modele string) string {
		return stringx.ToDot(source)
	},
	state.CfgStyleNameDotSnake: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + modele
	},
	state.CfgStyleNameDotPascal: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToCamel(modele)
	},
	state.CfgStyleNameDotCamel: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToSmallCamel(modele)
	},
	state.CfgStyleNameDotKebab: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToDot(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele)) + "." + stringx.ToKebab(modele)
	},

	state.CfgStyleNameDotReverse: func(source string, modele string) (path string) {
		return strings.Join(candy.Reverse(strings.Split(stringx.ToSnake(source), "_")), ".")
	},
	state.CfgStyleNameDotReverseSnake: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return modele + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".")
	},
	state.CfgStyleNameDotReversePascal: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".")
	},
	state.CfgStyleNameDotReverseCamel: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToSmallCamel(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".")
	},
	state.CfgStyleNameDotReverseKebab: func(source string, modele string) (path string) {
		modele = strings.TrimPrefix(stringx.ToSnake(modele), "model_")

		return stringx.ToKebab(modele) + "." + strings.Join(candy.Reverse(strings.Split(strings.TrimSuffix(stringx.ToSnake(source), "_"+modele), "_")), ".")
	},
}

Functions

func CheckEnvironments

func CheckEnvironments() (err error)

func CoverageStyledName

func CoverageStyledName(source string, model string) string

func DecrWithKey

func DecrWithKey(key string, def int64) int64

func FindGitRoot

func FindGitRoot(dir string) (string, error)

func GenPbFile

func GenPbFile(pb *PbPackage) error

func GenerateAddRpc

func GenerateAddRpc(pb *PbPackage, msg *PbMessage, opt *AddRpcOption) (err error)

func GenerateCache

func GenerateCache(pb *PbPackage) (err error)

func GenerateClient

func GenerateClient(pb *PbPackage) (err error)

func GenerateCmd

func GenerateCmd(pb *PbPackage) (err error)

func GenerateConf

func GenerateConf(pb *PbPackage) (err error)

func GenerateDockerignote

func GenerateDockerignote(pb *PbPackage) (err error)

func GenerateEditorconfig

func GenerateEditorconfig(pb *PbPackage) (err error)

func GenerateGitignote

func GenerateGitignote(pb *PbPackage) (err error)

func GenerateGolangci

func GenerateGolangci(pb *PbPackage) (err error)

func GenerateGoreleaser

func GenerateGoreleaser(pb *PbPackage) (err error)

func GenerateI18n

func GenerateI18n(pb *PbPackage) (err error)

func GenerateI18nConst

func GenerateI18nConst(dstLocalize map[string]any, path string) (err error)

func GenerateI18nField

func GenerateI18nField(dstLocalize map[string]any, path string) (err error)

GenerateI18nField 这里是一个比较特殊的东西,我还没有搞明白这么用 go-template 实现,就现用 golang 的方式实现一个

func GenerateImpl

func GenerateImpl(pb *PbPackage) (err error)

func GenerateImplRpcPath

func GenerateImplRpcPath(pb *PbPackage) (err error)

func GenerateImplRpcRoute

func GenerateImplRpcRoute(pb *PbPackage) (err error)

func GenerateMakefile

func GenerateMakefile(pb *PbPackage) (err error)

func GenerateMod

func GenerateMod(pb *PbPackage) (err error)

func GenerateOrm

func GenerateOrm(pb *PbPackage) (err error)

func GenerateProto

func GenerateProto(pb *PbPackage) error

func GenerateState

func GenerateState(pb *PbPackage) (err error)

func GenerateStateConf

func GenerateStateConf(pb *PbPackage) (err error)

func GenerateStateTable

func GenerateStateTable(pb *PbPackage) (err error)

func GenerateTableField

func GenerateTableField(pb *PbPackage) (err error)

func GenerateTableName

func GenerateTableName(pb *PbPackage) (err error)

func GetFullName

func GetFullName(e proto.Visitee) string

func GetFullNames

func GetFullNames(e proto.Visitee) []string

func GetPath

func GetPath(t PathType, pb *PbPackage) string

func GetTemplate

func GetTemplate(t TemplateType, args ...string) (tpl *template.Template, err error)

func IncrWithKey

func IncrWithKey(key string, def int64) int64

func InjectTagParseFile

func InjectTagParseFile(inputPath string) ([]textArea, error)

func InjectTagWriteFile

func InjectTagWriteFile(inputPath string, areas []textArea) error

func ParseGoDir

func ParseGoDir(dir string) (map[string]*GoPackage, error)

func UpdateGoMod

func UpdateGoMod(modPath string) (err error)

Types

type AddRpcOption

type AddRpcOption struct {
	Model string
	GenTo string

	DefaultRole string

	Action map[string]*AddRpcOptionAction

	ListOptions map[string]string
}

func NewAddRpcOption

func NewAddRpcOption() *AddRpcOption

func (*AddRpcOption) ParseActions

func (p *AddRpcOption) ParseActions(s string)

func (*AddRpcOption) ParseListOption

func (p *AddRpcOption) ParseListOption(s string, msg *PbMessage)

type AddRpcOptionAction

type AddRpcOptionAction struct {
	Roles []string
}

type GitRepository

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

func ParseGit

func ParseGit(gitDir string) (*GitRepository, error)

func (*GitRepository) HeadHash

func (p *GitRepository) HeadHash() string

func (*GitRepository) HeadName

func (p *GitRepository) HeadName() string

type GoContext

type GoContext struct {
	GoPathList          []string
	ModPath2RealPathMap map[string]string
	ModPath2ModNameMap  map[string]string
}

func (*GoContext) FindPackageName

func (ctx *GoContext) FindPackageName(modPath string) string

func (*GoContext) FindPackagePath

func (ctx *GoContext) FindPackagePath(modPath string) string

type GoFile

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

func ParseGoFile

func ParseGoFile(filePath string) (*GoFile, error)

type GoFunc

type GoFunc struct {
	Name      string
	FuncCalls []*GoFuncCall

	Returns []*GoReturn
	Params  []*GoParams

	// 接收类型,struct的类型
	RecvType string
}

func (*GoFunc) Clone

func (p *GoFunc) Clone() *GoFunc

func (*GoFunc) String

func (p *GoFunc) String() string

func (*GoFunc) StringWithColor

func (p *GoFunc) StringWithColor() string

type GoFuncCall

type GoFuncCall struct {
	Names []string
	Args  []*GoFuncCallArg
}

type GoFuncCallArg

type GoFuncCallArg struct {
	Names []string
}

type GoFuncNode

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

func (*GoFuncNode) GetFile

func (g *GoFuncNode) GetFile() *GoFile

func (*GoFuncNode) GetFunc

func (g *GoFuncNode) GetFunc() *GoFunc

type GoImport

type GoImport struct {
	Name string
	Path string
}

type GoPackage

type GoPackage struct {
	Name    string
	FileMap map[string]*GoFile
	FuncMap map[string]*GoFuncNode
}

func (*GoPackage) GetFunc

func (p *GoPackage) GetFunc(name string) *GoFuncNode

type GoParams

type GoParams struct {
	TypeName  string
	FieldName string

	// typename == func
	GoFunc *GoFunc
}

func (*GoParams) String

func (p *GoParams) String() string

func (*GoParams) StringWithColor

func (p *GoParams) StringWithColor() string

type GoReturn

type GoReturn struct {
	Name string
}

func (*GoReturn) String

func (p *GoReturn) String() string

func (*GoReturn) StringWithColor

func (p *GoReturn) StringWithColor() string

type GoStruct

type GoStruct struct {
	Name string
}

type ListOptionFieldOption

type ListOptionFieldOption struct {
	Key       string
	KeyField  string
	Value     int
	FieldName string
	FieldType string
}

type ModVersionRsp

type ModVersionRsp struct {
	Version string `json:"Version"`
}

type NameStyleHandler

type NameStyleHandler func(source string, model string) (path string)

type PathType

type PathType uint8
const (
	PathTypeRoot PathType = iota + 1
	PathTypePbGo
	PathTypeGoMod
	PathTypeConf

	PathTypeOrm
	PathTypeTableName
	PathTypeTableField

	PathTypeInternal

	PathTypeState
	PathTypeStateTable
	PathTypeStateConf
	PathTypeStateCache
	PathTypeStateState
	PathTypeStateI18n

	PathTypeImpl
	PathTypeImplPath
	PathTypeImplRoute
	PathTypeImplClient

	PathTypeCmd
	PathTypeCmdMain

	PathTypeGoreleaser
	PathTypeMakefile
	PathTypeEditorconfig
	PathTypeGolangci
	PathTypeGitignore
	PathTypeDockerignore
)

type PbComment

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

func NewPbComment

func NewPbComment(c *proto.Comment) *PbComment

func (*PbComment) Comment

func (p *PbComment) Comment() *proto.Comment

type PbCommentTag

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

func NewPbCommentTag

func NewPbCommentTag(tag string) *PbCommentTag

func (*PbCommentTag) Lines

func (p *PbCommentTag) Lines() []string

func (*PbCommentTag) Tag

func (p *PbCommentTag) Tag() string

type PbEnum

type PbEnum struct {
	Name     string
	FullName string
	// contains filtered or unexported fields
}

func NewPbEnum

func NewPbEnum(e *proto.Enum) *PbEnum

func (*PbEnum) Enum

func (p *PbEnum) Enum() *proto.Enum

type PbEnumField

type PbEnumField struct {
	Name string

	FullName string
	// contains filtered or unexported fields
}

func NewPbEnumField

func NewPbEnumField(f *proto.EnumField) *PbEnumField

func (*PbEnumField) FieldName

func (p *PbEnumField) FieldName() string

func (*PbEnumField) FieldType

func (p *PbEnumField) FieldType() string

func (*PbEnumField) IsSlice

func (p *PbEnumField) IsSlice() bool

type PbField

type PbField interface {
	FieldName() string
	FieldType() string
	IsSlice() bool
}

type PbMapField

type PbMapField struct {
	Name string
	// contains filtered or unexported fields
}

func NewPbMapField

func NewPbMapField(f *proto.MapField) *PbMapField

func (*PbMapField) FieldName

func (p *PbMapField) FieldName() string

func (*PbMapField) FieldType

func (p *PbMapField) FieldType() string

func (*PbMapField) IsSlice

func (p *PbMapField) IsSlice() bool

type PbMessage

type PbMessage struct {
	FullName string
	Name     string
	// contains filtered or unexported fields
}

func NewPbMessage

func NewPbMessage(m *proto.Message) *PbMessage

func (*PbMessage) EnumFields

func (p *PbMessage) EnumFields() []*PbEnumField

func (*PbMessage) IsTable

func (p *PbMessage) IsTable() bool

func (*PbMessage) MapFields

func (p *PbMessage) MapFields() []*PbMapField

func (*PbMessage) Message

func (p *PbMessage) Message() *proto.Message

func (*PbMessage) NeedOrm

func (p *PbMessage) NeedOrm() bool

func (*PbMessage) NormalFields

func (p *PbMessage) NormalFields() []*PbNormalField

func (*PbMessage) PrimaryField

func (p *PbMessage) PrimaryField() (pkField *PbNormalField)

type PbNormalField

type PbNormalField struct {
	Name string
	// contains filtered or unexported fields
}

func NewPbNormalField

func NewPbNormalField(f *proto.NormalField) *PbNormalField

func (*PbNormalField) Field

func (p *PbNormalField) Field() *proto.NormalField

func (*PbNormalField) FieldName

func (p *PbNormalField) FieldName() string

func (*PbNormalField) FieldType

func (p *PbNormalField) FieldType() string

func (*PbNormalField) FullType

func (p *PbNormalField) FullType() string

func (*PbNormalField) IsSlice

func (p *PbNormalField) IsSlice() bool

func (*PbNormalField) Type

func (p *PbNormalField) Type() string

type PbOption

type PbOption struct {
	Name  string
	Value string
	// contains filtered or unexported fields
}

func NewPbOption

func NewPbOption(o *proto.Option) *PbOption

type PbPackage

type PbPackage struct {
	RawGoPackage   string
	RawPackageName string

	ProtoBuffer string

	// 自定义的一些字段
	Port int64
	Host string
	// contains filtered or unexported fields
}

func NewPbPackage

func NewPbPackage(protoFilePath string, p *proto.Proto) *PbPackage

func ParseProto

func ParseProto(path string, cacheFiles ...bool) (*PbPackage, error)

func (*PbPackage) Enums

func (p *PbPackage) Enums() []*PbEnum

func (*PbPackage) GetEnum

func (p *PbPackage) GetEnum(e string) *PbEnum

func (*PbPackage) GetMessage

func (p *PbPackage) GetMessage(msg string) *PbMessage

func (*PbPackage) GetRPC

func (p *PbPackage) GetRPC(rpc string) *PbRPC

func (*PbPackage) GetService

func (p *PbPackage) GetService(s string) *PbService

func (*PbPackage) GoPackage

func (p *PbPackage) GoPackage() string

func (*PbPackage) GoPackageName

func (p *PbPackage) GoPackageName() string

func (*PbPackage) Messages

func (p *PbPackage) Messages() []*PbMessage

func (*PbPackage) PackageName

func (p *PbPackage) PackageName() string

func (*PbPackage) ProjectRoot

func (p *PbPackage) ProjectRoot() string

func (*PbPackage) Proto

func (p *PbPackage) Proto() *proto.Proto

func (*PbPackage) ProtoFileName

func (p *PbPackage) ProtoFileName() string

func (*PbPackage) ProtoFilePath

func (p *PbPackage) ProtoFilePath() string

func (*PbPackage) RPCs

func (p *PbPackage) RPCs() []*PbRPC

func (*PbPackage) Services

func (p *PbPackage) Services() []*PbService

func (*PbPackage) Walk

func (p *PbPackage) Walk()

type PbRPC

type PbRPC struct {
	Name string
	// contains filtered or unexported fields
}

func NewPbRPC

func NewPbRPC(rpc *proto.RPC) *PbRPC

func (*PbRPC) RPC

func (p *PbRPC) RPC() *proto.RPC

func (*PbRPC) RequestPackage

func (p *PbRPC) RequestPackage() string

func (*PbRPC) RequestType

func (p *PbRPC) RequestType() string

func (*PbRPC) ResponsePackage

func (p *PbRPC) ResponsePackage() string

func (*PbRPC) ReturnsType

func (p *PbRPC) ReturnsType() string

type PbRpcGenOptions

type PbRpcGenOptions struct {
	GenTo        string
	Model        string
	Action       string
	Role         string
	SkipGenRoute bool
	Method       string
	Path         string
}

type PbService

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

func NewPbService

func NewPbService(service *proto.Service) *PbService

func (*PbService) Service

func (p *PbService) Service() *proto.Service

type ProtoVisitor

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

func (*ProtoVisitor) VisitComment

func (p *ProtoVisitor) VisitComment(e *proto.Comment)

func (*ProtoVisitor) VisitEnum

func (p *ProtoVisitor) VisitEnum(e *proto.Enum)

func (*ProtoVisitor) VisitEnumField

func (p *ProtoVisitor) VisitEnumField(i *proto.EnumField)

func (*ProtoVisitor) VisitExtensions

func (p *ProtoVisitor) VisitExtensions(e *proto.Extensions)

func (*ProtoVisitor) VisitGroup

func (p *ProtoVisitor) VisitGroup(g *proto.Group)

func (*ProtoVisitor) VisitImport

func (p *ProtoVisitor) VisitImport(i *proto.Import)

func (*ProtoVisitor) VisitMapField

func (p *ProtoVisitor) VisitMapField(f *proto.MapField)

func (*ProtoVisitor) VisitMessage

func (p *ProtoVisitor) VisitMessage(m *proto.Message)

func (*ProtoVisitor) VisitNormalField

func (p *ProtoVisitor) VisitNormalField(i *proto.NormalField)

func (*ProtoVisitor) VisitOneof

func (p *ProtoVisitor) VisitOneof(o *proto.Oneof)

func (*ProtoVisitor) VisitOneofField

func (p *ProtoVisitor) VisitOneofField(o *proto.OneOfField)

func (*ProtoVisitor) VisitOption

func (p *ProtoVisitor) VisitOption(o *proto.Option)

func (*ProtoVisitor) VisitOptions

func (p *ProtoVisitor) VisitOptions(o *proto.Option)

func (*ProtoVisitor) VisitPackage

func (p *ProtoVisitor) VisitPackage(pkg *proto.Package)

func (*ProtoVisitor) VisitProto

func (p *ProtoVisitor) VisitProto(*proto.Proto)

func (*ProtoVisitor) VisitRPC

func (p *ProtoVisitor) VisitRPC(rpc *proto.RPC)

func (*ProtoVisitor) VisitReserved

func (p *ProtoVisitor) VisitReserved(rs *proto.Reserved)

func (*ProtoVisitor) VisitService

func (p *ProtoVisitor) VisitService(v *proto.Service)

func (*ProtoVisitor) VisitSyntax

func (p *ProtoVisitor) VisitSyntax(s *proto.Syntax)

type RpcRouteOption

type RpcRouteOption struct {
	RpcName      string
	Path         string
	Method       string
	Role         string
	SkipGenRoute bool
}

type ScanErrCodeContext

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

func NewScanErrCodeContext

func NewScanErrCodeContext() *ScanErrCodeContext

func (*ScanErrCodeContext) GetErrListAndClear

func (p *ScanErrCodeContext) GetErrListAndClear() []string

func (*ScanErrCodeContext) GetModList

func (p *ScanErrCodeContext) GetModList() []string

func (*ScanErrCodeContext) MergePkgMap

func (p *ScanErrCodeContext) MergePkgMap(m map[string]*GoPackage)

func (*ScanErrCodeContext) MergePkgMapWithPkgName

func (p *ScanErrCodeContext) MergePkgMapWithPkgName(m map[string]*GoPackage, pkg string)

func (*ScanErrCodeContext) Scan

func (p *ScanErrCodeContext) Scan(mod, name string)

type TemplateType

type TemplateType uint8
const (
	TemplateTypeOrm TemplateType = iota + 1
	TemplateTypeTableName
	TemplateTypeTableField

	TemplateTypeI18nConst

	TemplateTypeCmd

	TemplateTypeProtoRpc
	TemplateTypeProtoRpcName
	TemplateTypeProtoRpcReq
	TemplateTypeProtoRpcResp

	TemplateTypeStateTable
	TemplateTypeStateConf
	TemplateTypeStateCache
	TemplateTypeStateState
	TemplateTypeStateI18n

	TemplateTypeImpl
	TemplateTypeImplAction
	TemplateTypeImplPath
	TemplateTypeImplRoute
	TemplateTypeImplClient
	TemplateTypeImplClientCall

	TemplateTypeGoreleaser
	TemplateTypeMakefile
	TemplateTypeEditorconfig
	TemplateTypeGolangci
	TemplateTypeGitignore
	TemplateTypeDockerignore
	TemplateTypeConf
)

Jump to

Keyboard shortcuts

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