All Projects → gotomicro → egoctl

gotomicro / egoctl

Licence: other
Go graphics are generated as code tools

Programming Languages

typescript
32286 projects
go
31211 projects - #10 most used programming language
shell
77523 projects
javascript
184084 projects - #8 most used programming language
Less
1899 projects
EJS
674 projects
Makefile
30231 projects

Projects that are alternatives of or similar to egoctl

elemental-lowcode
Elemental lowcode development platform.
Stars: ✭ 44 (+18.92%)
Mutual labels:  lowcode
Imove
Move your mouse, generate code from flow chart
Stars: ✭ 3,282 (+8770.27%)
Mutual labels:  lowcode
citrus
🌈 低代码快速开发脚手架,灵活、高效,降低开发成本
Stars: ✭ 368 (+894.59%)
Mutual labels:  lowcode
Budibase
Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
Stars: ✭ 8,071 (+21713.51%)
Mutual labels:  lowcode
Blocks
A JSX-based page builder for creating beautiful websites without writing code
Stars: ✭ 4,300 (+11521.62%)
Mutual labels:  lowcode
mometa
🛠 [Beta] 面向研发的低代码元编程,代码可视编辑,辅助编码工具
Stars: ✭ 3,489 (+9329.73%)
Mutual labels:  lowcode
plasmic
Visual page builder and web design tool for any website or web app tech stack
Stars: ✭ 1,475 (+3886.49%)
Mutual labels:  lowcode
imove
INACTIVE: Move your mouse, generate code from flow chart
Stars: ✭ 3,598 (+9624.32%)
Mutual labels:  lowcode
Amis
前端低代码框架,通过 JSON 配置就能生成各种页面。
Stars: ✭ 8,930 (+24035.14%)
Mutual labels:  lowcode
dooring-electron-lowcode
基于electron的lowcode编辑器桌面端
Stars: ✭ 146 (+294.59%)
Mutual labels:  lowcode
Brick Design
全场景流式布局,可视化拖拽、随意嵌套组合、实时渲染、实时辅助线展示,实时组件间距展示、实时拖拽排序、状态域管理,可视化属性配置、可视化样式配置、多设备适配展示,支持逻辑渲染、模板字符变量、表达式、自定义方法、自定义状态
Stars: ✭ 4,048 (+10840.54%)
Mutual labels:  lowcode
H5 Dooring
H5 Page Maker, H5 Editor, LowCode. Make H5 as easy as building blocks. | 让H5制作像搭积木一样简单, 轻松搭建H5页面, H5网站, PC端网站,LowCode平台.
Stars: ✭ 5,832 (+15662.16%)
Mutual labels:  lowcode
lightning
A Django based no code Admin and low code develop framework
Stars: ✭ 122 (+229.73%)
Mutual labels:  lowcode
lowcode
React Lowcode - prototype, develop and maintain internal apps easier
Stars: ✭ 32 (-13.51%)
Mutual labels:  lowcode
ego
Go微服务.A simple and component-based microservice kit for go.
Stars: ✭ 765 (+1967.57%)
Mutual labels:  ego
vite-vue3-lowcode
vue3.x + vite2.x + vant + element-plus H5移动端低代码平台 lowcode 可视化拖拽 可视化编辑器 visual editor 类似易企秀的H5制作、建站工具、可视化搭建工具
Stars: ✭ 1,309 (+3437.84%)
Mutual labels:  lowcode
pc-Dooring
LowCode, PC Page Maker, PC Editor. Make PC as easy as building blocks. | 让网页制作像搭积木一样简单, 轻松搭建PC页面, Web网站, PC端网站. lowcode(low-code)可视化搭建平台
Stars: ✭ 407 (+1000%)
Mutual labels:  lowcode
openvalidation
Compose validation rules in the language you use every day, openVALIDATION handles code creation for you.
Stars: ✭ 62 (+67.57%)
Mutual labels:  lowcode
epage-core
epage 核心依赖 低代码可视化配置
Stars: ✭ 22 (-40.54%)
Mutual labels:  lowcode
appsmith-docs
Mirror of documentation at https://docs.appsmith.com. Raise Pull requests against this repository to update the documentation
Stars: ✭ 62 (+67.57%)
Mutual labels:  lowcode

egoctl

1 Requirements

  • Go version >= 1.16.

2 Installation

bash <(curl -L https://raw.githubusercontent.com/gotomicro/egoctl/main/getlatest.sh)

通过以上脚本,可以下载protoc工具全家桶,以及ego的protoc插件和egoctl

  • /usr/local/bin/protoc
  • /usr/local/bin/protoc-gen-go
  • /usr/local/bin/protoc-gen-go-grpc
  • /usr/local/bin/protoc-gen-openapiv2
  • /usr/local/bin/protoc-gen-go-errors
  • /usr/local/bin/protoc-gen-go-http
  • /usr/local/bin/egoctl

3 快速生成代码

  • 我们第一次进入页面,先配置生成代码的模板,你也可以自己自定义自己的模板

  • 然后在进入项目页面,创建项目

  • 编写DSL

  • 创建项目的go mod
mkdir /Users/askuy/tmp/egotest1 
cd /Users/askuy/tmp/egotest1 && go mod init egotest1
  • 点击生成代码
  • 运行你的代码
cd /Users/askuy/tmp/egotest1
go mod tidy
vim config/local.toml 更改db配置
export EGO_DEBUG=true && go run main.go

4 DSL配置

package egoctl
type User struct {
	Uid int `gorm:"AUTO_INCREMENT" json:"id" dto:"" ego:"primary_key"`    // id
    UserName string `gorm:"not null" json:"userName" dto:""` // 昵称
}

5 模板配置

5.1 根据模型设置模板

DSL配置

package egoctl
type User struct {
	Uid int `gorm:"AUTO_INCREMENT" json:"id" dto:"" ego:"primary_key"`                      // id
    UserName string `gorm:"not null" json:"userName" dto:""` // 昵称
}

5.2 获取主键

模版配置

{{modelSchemas|fieldsGetPrimaryKey|snakeString}}

5.3 生成结构体

模板配置

type {{modelName|upperFirst}} struct {
	{% for value in modelSchemas %}
	{{value.FieldName}} {{value.FieldType}} `gorm:"{{value|fieldGetTag:"gorm"}}"` {{value.Comment}}
	{% endfor %}
}

5.4 判断某字段是否存在

模板配置

{% if modelSchemas|fieldsExist:Uid %}
{% endif %}

6 根据单个字段设置模板

DSL配置

type User struct {
	Uid int `gorm:"AUTO_INCREMENT" json:"id" dto:"" ego:"primary_key"`                      // id
    UserName string `gorm:"not null" json:"userName" dto:""` // 昵称
}

6.1 获取某个字段的驼峰(常用于JSON,前后端对接)

{{value.FieldName|camelString|lowerFirst}}
UserName  变成   userName

6.2 获取某个字段的蛇形(常用于数据库)

{{value.FieldName|snakeString|lowerFirst}}
UserName  变成   user_name
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].