Documentation ¶
Index ¶
Constants ¶
View Source
const ( FileModeConstant = "constant" // 常量模式 FileModeModel = "model" // 模型模式 )
View Source
const ( LanguageGo = "go" // Go LanguageTs = "ts" // TypeScript )
支持的语言列表
View Source
const ( // 基础类型,常量仅支持基础类型 VarTypeAny = "any" VarTypeString = "string" VarTypeUint8 = "uint8" VarTypeUint16 = "uint16" VarTypeUint32 = "uint32" VarTypeUint64 = "uint64" VarTypeInt8 = "int8" VarTypeInt16 = "int16" VarTypeInt32 = "int32" VarTypeInt64 = "int64" VarTypeBool = "bool" VarTypeFloat32 = "float32" VarTypeFloat64 = "float64" // (模型专有类型) 扩展类型,数组"[]xxx"和映射"map[xxx]xxx"单独解析(采用Go的语法标准) VarTypeJson = "json" // JSON字符串,对外表现为字符串,但是需添加Get函数,解析或设置到对应的结构体 VarTypeExtend = "extend" // 继承类型,用于指定模型之间的继承关系 VarTypeReference = "reference" // 引用类型,对应模型的层级引用关系,需要在Refer中指定引用的模块和文件信息 VarTypeOther = "other" // 其他类型,需根据不同的语言插件,解析其他参数来确定 )
Variables ¶
View Source
var Plugins = map[string]Plugin{}
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Dir Directory // 目录信息 File File // 文件信息 Field Field // 字段信息 CurFileName string // 当前文件名称 }
上下文信息
func (Context) GetFieldVarType ¶
type Directory ¶
type Directory struct { Mode string `json:"mode"` // 目录模式,常量还是模型 ExtGo DirectoryGo `json:"ext-go"` // (Go)目录的扩展属性 ExtTs DirectoryTs `json:"ext-ts"` // (Ts)目录的扩展属性 }
目录整体配置信息
func (Directory) IsConstant ¶
type DirectoryGo ¶
type DirectoryGo struct { CopyExt []string `json:"copy-ext"` // 可以拷贝的文件后缀名列表 PackageName string `json:"package-name"` // go的包名 }
(Go)目录整体配置信息的扩展参数
func (DirectoryGo) GetPackageName ¶
func (m DirectoryGo) GetPackageName() string
type DirectoryTs ¶
type DirectoryTs struct {
CopyExt []string `json:"copy-ext"` // 可以拷贝的文件后缀名列表
}
(Ts)目录整体配置信息的扩展参数
type Field ¶
type Field struct { Name string `json:"name"` // 变量名 Type string `json:"type"` // 变量类型 Json string `json:"json"` // Json字段名 Label string `json:"label"` // 对应的展示内容 Comment string `json:"comment"` // 注释 Value string `json:"value"` // (mode=constant) 变量值 Refer ReferProperty `json:"refer"` // (type=extend) 扩展属性 ExtGo FieldGo `json:"ext-go"` // (Go)目录的扩展属性 ExtTs FieldTs `json:"ext-ts"` // (Ts)目录的扩展属性 }
单个列表项的基础部分
func (Field) GetComment ¶
func (Field) GetRefFile ¶
func (Field) GetRefName ¶
func (Field) IsJsonIgnore ¶
type File ¶
type File struct { Name string `json:"name"` // 模块名称 Comment string `json:"comment"` // 文件级注释 Language []string `json:"language"` // 导出的语言列表 VarType string `json:"vartype"` // 统一的变量类型,IOTA为必填,其他为选填,优先级不如字段的type Iota IotaProperty `json:"iota"` // (常量模式) 特定的IOTA自增数字模式 List []Field `json:"list"` // 常量或字段列表 ExtGo FileGo `json:"ext-go"` // (Go)目录的扩展属性 ExtTs FileTs `json:"ext-ts"` // (Ts)目录的扩展属性 }
文件的通用配置信息
func (File) HasComment ¶
type FileGo ¶
type FileGo struct { GormTableName string `json:"gorm-table-name"` // GORM数据库模式时的表名 ImportPkgs []string `json:"import-pkgs"` // 导入的包名列表 EnableSet bool `json:"enable-set"` // 是否导出获取label的函数 }
(Go)文件配置信息的扩展参数
func (FileGo) HasImportPkgs ¶
func (FileGo) IsGormEnabled ¶
type IotaProperty ¶
type Plugin ¶
type ReferProperty ¶
Click to show internal directories.
Click to hide internal directories.