diff --git a/README.MD b/README.MD index 381f8b4840a..4a879635e7f 100644 --- a/README.MD +++ b/README.MD @@ -1,3 +1,4 @@ +English | [简体中文](README.zh_CN.MD)
goframe gf logo diff --git a/README.zh_CN.MD b/README.zh_CN.MD new file mode 100644 index 00000000000..f5eade92a0b --- /dev/null +++ b/README.zh_CN.MD @@ -0,0 +1,46 @@ +[English](README.MD) | 简体中文 + +
+goframe gf logo + +[![Go Reference](https://pkg.go.dev/badge/github.com/gogf/gf/v2.svg)](https://pkg.go.dev/github.com/gogf/gf/v2) +[![GoFrame CI](https://github.com/gogf/gf/actions/workflows/ci-main.yml/badge.svg)](https://github.com/gogf/gf/actions/workflows/ci-main.yml) +[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/gogf/gf/badge)](https://scorecard.dev/viewer/?uri=github.com/gogf/gf) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/9233/badge)](https://bestpractices.coreinfrastructure.org/projects/9233) +[![Go Report Card](https://goreportcard.com/badge/github.com/gogf/gf/v2)](https://goreportcard.com/report/github.com/gogf/gf/v2) +[![Code Coverage](https://codecov.io/gh/gogf/gf/branch/master/graph/badge.svg)](https://codecov.io/gh/gogf/gf) +[![Production Ready](https://img.shields.io/badge/production-ready-blue.svg?style=flat)](https://github.com/gogf/gf) +[![License](https://img.shields.io/github/license/gogf/gf.svg?style=flat)](https://github.com/gogf/gf) + +[![Release](https://img.shields.io/github/v/release/gogf/gf?style=flat)](https://github.com/gogf/gf/releases) +[![GitHub pull requests](https://img.shields.io/github/issues-pr/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls) +[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/pulls?q=is%3Apr+is%3Aclosed) +[![GitHub issues](https://img.shields.io/github/issues/gogf/gf?style=flat)](https://github.com/gogf/gf/issues) +[![GitHub closed issues](https://img.shields.io/github/issues-closed/gogf/gf?style=flat)](https://github.com/gogf/gf/issues?q=is%3Aissue+is%3Aclosed) +![Stars](https://img.shields.io/github/stars/gogf/gf?style=flat) +![Forks](https://img.shields.io/github/forks/gogf/gf?style=flat) + +
+ +一个强大的框架,为了更快、更轻松、更高效的项目开发。 + +## 文档 + +- 官方网站: [https://goframe.org](https://goframe.org) +- 官方网站(en): [https://goframe.org/en](https://goframe.org/en) +- 国内镜像: [https://goframe.org.cn](https://goframe.org.cn) +- 镜像网站: [Github Pages](https://pages.goframe.org) +- 镜像网站: [离线文档](https://github.com/gogf/goframe.org-pdf?tab=readme-ov-file#%E6%9C%80%E6%96%B0%E7%89%88%E6%9C%AC) +- GoDoc API: [https://pkg.go.dev/github.com/gogf/gf/v2](https://pkg.go.dev/github.com/gogf/gf/v2) + +## 贡献者 + +💖 [感谢所有使 GoFrame 成为可能的贡献者](https://github.com/gogf/gf/graphs/contributors) 💖 + + +goframe contributors + + +## 许可证 + +`GoFrame` 采用 [MIT License](LICENSE) 许可,100% 免费和开源,永久保持。 diff --git a/cmd/gf/README.MD b/cmd/gf/README.MD index 863644d4412..2e45e451e78 100644 --- a/cmd/gf/README.MD +++ b/cmd/gf/README.MD @@ -1,3 +1,5 @@ +English | [简体中文](README.zh_CN.MD) + # gf `gf` is a powerful CLI tool for building [GoFrame](https://goframe.org) application with convenience. @@ -21,18 +23,18 @@ You can also install `gf` tool using pre-built binaries: = v2 ## 2. Commands -```html -$ gf +```shell +$ gf -h USAGE gf COMMAND [OPTION] COMMAND - up upgrade GoFrame version/tool to latest one in current project - env show current Golang environment variables - fix auto fixing codes after upgrading to new GoFrame version - run running go codes with hot-compiled-like feature - gen automatically generate go files for dao/do/entity/pb/pbentity - tpl template parsing and building commands - init create and initialize an empty GoFrame project - pack packing any file/directory to a resource file, or a go file - build cross-building go project for lots of platforms - docker build docker image for current GoFrame project - install install gf binary to system (might need root/admin permission) - version show version information of current binary + up upgrade GoFrame version/tool to latest one in current project + env show current Golang environment variables + fix auto fixing codes after upgrading to new GoFrame version + run running go codes with hot-compiled-like feature + gen automatically generate go files for dao/do/entity/pb/pbentity + tpl template parsing and building commands + init create and initialize an empty GoFrame project + pack packing any file/directory to a resource file, or a go file + build cross-building go project for lots of platforms + docker build docker image for current GoFrame project + install install gf binary to system (might need root/admin permission) + version show version information of current binary + doc download https://pages.goframe.org/ to run locally OPTION - -y, --yes all yes for all command without prompt ask - -v, --version show version information of current binary - -d, --debug show internal detailed debugging information - -h, --help more information about this command + -y, --yes all yes for all command without prompt ask + -v, --version show version information of current binary + -d, --debug show internal detailed debugging information + -h, --help more information about this command ADDITIONAL Use "gf COMMAND -h" for details about a command. diff --git a/cmd/gf/README.zh_CN.MD b/cmd/gf/README.zh_CN.MD new file mode 100644 index 00000000000..06279854447 --- /dev/null +++ b/cmd/gf/README.zh_CN.MD @@ -0,0 +1,82 @@ +[English](README.MD) | 简体中文 + +# gf + +`gf` 是一个强大的 CLI 工具,用于便捷地构建 [GoFrame](https://goframe.org) 应用程序。 + +## 1. 安装 + +## 1) 预编译二进制文件 + +您也可以使用预构建的二进制文件安装 `gf` 工具: + +1. `Mac` & `Linux` + + ```shell + wget -O gf https://github.com/gogf/gf/releases/latest/download/gf_$(go env GOOS)_$(go env GOARCH) && chmod +x gf && ./gf install -y && rm ./gf + ``` + + > 如果您使用 `zsh`,您可能需要通过命令 `alias gf=gf` 重命名别名以解决 `gf` 和 `git fetch` 之间的冲突。 + +2. `Windows` + 手动下载,在命令行中执行,然后按照说明操作。 + +3. 数据库支持 + + | 数据库 | 内置支持 | 说明 | + | :--------: | :-------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------: | + | mysql | 是 | - | + | mariadb | 是 | - | + | tidb | 是 | - | + | mssql | 是 | - | + | oracle | 是 | - | + | pgsql | 是 | - | + | sqlite | 是 | - | + | sqlitecgo | 否 | 要在 32 位架构系统上支持 sqlite 数据库,请手动向[源代码](./internal/cmd/cmd_gen_dao.go)添加包导入并进行构建。 | + | clickhouse | 是 | - | + | dm | 否 | 手动向[源代码](./internal/cmd/cmd_gen_dao.go)添加包导入并进行构建。 | + +## 2) 手动安装 + +```shell +go install github.com/gogf/gf/cmd/gf/v2@latest # 最新版本 +go install github.com/gogf/gf/cmd/gf/v2@v2.5.5 # 特定版本(应该 >= v2.5.5) +``` + +## 2. 命令 + +```shell +$ gf -h +用法 + gf 命令 [选项] + +命令 + up 升级项目中的 GoFrame 版本/工具到最新版本 + env 显示当前 Golang 环境变量 + fix 升级到新 GoFrame 版本后自动修复代码 + run 运行 go 代码,具有热编译功能 + gen 自动生成 dao/do/entity/pb/pbentity 的 go 文件 + tpl 模板解析和构建命令 + init 创建并初始化一个空的 GoFrame 项目 + pack 将任何文件/目录打包到资源文件或 go 文件 + build 为多个平台交叉编译 go 项目 + docker 为当前 GoFrame 项目构建 docker 镜像 + install 将 gf 二进制文件安装到系统(可能需要 root/admin 权限) + version 显示当前二进制文件的版本信息 + doc 下载 https://pages.goframe.org/ 本地运行 + +选项 + -y, --yes 对所有命令都使用 yes,不再提示 + -v, --version 显示当前二进制文件的版本信息 + -d, --debug 显示内部详细的调试信息 + -h, --help 显示此命令的更多信息 + +附加信息 + 使用 "gf 命令 -h" 获取有关命令的详细信息。 +``` + +## 3. 常见问题 + +### 1). 命令 `gf run` 返回 `pipe: too many open files` + +请使用 `ulimit -n 65535` 扩大系统配置以增加当前终端 shell 会话的最大打开文件数,然后再运行 `gf run`。 diff --git a/contrib/drivers/README.MD b/contrib/drivers/README.MD index da22dc56ca0..ef3bd361c50 100644 --- a/contrib/drivers/README.MD +++ b/contrib/drivers/README.MD @@ -1,4 +1,4 @@ -[简体中文](README.zh_CN.MD) +English | [简体中文](README.zh_CN.MD) # Database drivers @@ -9,15 +9,15 @@ Powerful database drivers for package gdb. Let's take `mysql` for example. ```shell -go get -u github.com/gogf/gf/contrib/drivers/mysql/v2 +go get github.com/gogf/gf/contrib/drivers/mysql/v2@latest # Easy to copy -go get -u github.com/gogf/gf/contrib/drivers/clickhouse/v2 -go get -u github.com/gogf/gf/contrib/drivers/dm/v2 -go get -u github.com/gogf/gf/contrib/drivers/mssql/v2 -go get -u github.com/gogf/gf/contrib/drivers/oracle/v2 -go get -u github.com/gogf/gf/contrib/drivers/pgsql/v2 -go get -u github.com/gogf/gf/contrib/drivers/sqlite/v2 -go get -u github.com/gogf/gf/contrib/drivers/sqlitecgo/v2 +go get github.com/gogf/gf/contrib/drivers/clickhouse/v2@latest +go get github.com/gogf/gf/contrib/drivers/dm/v2@latest +go get github.com/gogf/gf/contrib/drivers/mssql/v2@latest +go get github.com/gogf/gf/contrib/drivers/oracle/v2@latest +go get github.com/gogf/gf/contrib/drivers/pgsql/v2@latest +go get github.com/gogf/gf/contrib/drivers/sqlite/v2@latest +go get github.com/gogf/gf/contrib/drivers/sqlitecgo/v2@latest ``` Choose and import the driver to your project: diff --git a/contrib/drivers/README.zh_CN.MD b/contrib/drivers/README.zh_CN.MD index 4c7b4f08a0f..0d5b1d214bb 100644 --- a/contrib/drivers/README.zh_CN.MD +++ b/contrib/drivers/README.zh_CN.MD @@ -1,3 +1,5 @@ +[English](README.MD) | 简体中文 + # 数据库驱动程序 用于gdb包的数据库驱动程序。 @@ -7,15 +9,15 @@ 以 `mysql` 为例。 ```shell -go get -u github.com/gogf/gf/contrib/drivers/mysql/v2 +go get github.com/gogf/gf/contrib/drivers/mysql/v2@latest # 方便复制 -go get -u github.com/gogf/gf/contrib/drivers/clickhouse/v2 -go get -u github.com/gogf/gf/contrib/drivers/dm/v2 -go get -u github.com/gogf/gf/contrib/drivers/mssql/v2 -go get -u github.com/gogf/gf/contrib/drivers/oracle/v2 -go get -u github.com/gogf/gf/contrib/drivers/pgsql/v2 -go get -u github.com/gogf/gf/contrib/drivers/sqlite/v2 -go get -u github.com/gogf/gf/contrib/drivers/sqlitecgo/v2 +go get github.com/gogf/gf/contrib/drivers/clickhouse/v2@latest +go get github.com/gogf/gf/contrib/drivers/dm/v2@latest +go get github.com/gogf/gf/contrib/drivers/mssql/v2@latest +go get github.com/gogf/gf/contrib/drivers/oracle/v2@latest +go get github.com/gogf/gf/contrib/drivers/pgsql/v2@latest +go get github.com/gogf/gf/contrib/drivers/sqlite/v2@latest +go get github.com/gogf/gf/contrib/drivers/sqlitecgo/v2@latest ``` 选择并将驱动程序导入到您的项目中: