Skip to content

Commit

Permalink
microv6 -> micro
Browse files Browse the repository at this point in the history
  • Loading branch information
swxctx committed Oct 16, 2019
1 parent 5104e74 commit 2b3e14a
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 49 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ go version ≥ 1.12

```sh
go get -u -f -d github.com/xiaoenai/tp-micro/...
cd $GOPATH/src/github.com/xiaoenai/tp-micro/cmd/microv6
cd $GOPATH/src/github.com/xiaoenai/tp-micro/cmd/micro
go install
```

Expand Down Expand Up @@ -133,17 +133,17 @@ Command micro is deployment tools of tp-micro frameware.

```
NAME:
microv6 gen - Generate a tp-micro project
micro gen - Generate a tp-micro project
USAGE:
microv6 gen [command options] [arguments...]
micro gen [command options] [arguments...]
OPTIONS:
--template value, -t value The template for code generation(relative/absolute)
--app_path value, -p value The path(relative/absolute) of the project
```

example: `microv6 gen -p ./myapp` or default `microv6 gen myapp`
example: `micro gen -p ./myapp` or default `micro gen myapp`

- The initial template file `__tp-micro__tpl__.go`:

Expand Down Expand Up @@ -229,7 +229,7 @@ type Meta struct {
}
```

- The template generated by `microv6 gen` command.
- The template generated by `micro gen` command.

```
├── README.md
Expand Down Expand Up @@ -276,11 +276,11 @@ type Meta struct {

**Desc:**

- This `microv6 gen` command only covers files with the ".gen.go" suffix if the `__tp-micro__gen__.lock` file exists
- This `micro gen` command only covers files with the ".gen.go" suffix if the `__tp-micro__gen__.lock` file exists
- Add `.gen` suffix to the file name of the automatically generated file, DO NOT EDIT!
- `.tmp` is temporary code used to ensure successful compilation!<br>It will be overwritten when `microv6 gen` is run!<br>When the project is completed, it should be removed!
- `.tmp` is temporary code used to ensure successful compilation!<br>It will be overwritten when `micro gen` is run!<br>When the project is completed, it should be removed!
- The type of handler's parameter and result must be struct!
- You can modify the created template file `__tp-micro__tpl__.go`, and run the `microv6 gen` command again to update the project
- You can modify the created template file `__tp-micro__tpl__.go`, and run the `micro gen` command again to update the project

[Generated Default Sample](https://github.com/xiaoenai/tp-micro/tree/v3/examples/project)

Expand All @@ -290,10 +290,10 @@ type Meta struct {

```
NAME:
microv6 newdoc - Generate a tp-micro project README.md
micro newdoc - Generate a tp-micro project README.md
USAGE:
microv6 newdoc [command options] [arguments...]
micro newdoc [command options] [arguments...]
OPTIONS:
--app_path value, -p value The path(relative/absolute) of the project
Expand All @@ -305,33 +305,33 @@ OPTIONS:

```
NAME:
microv6 run - Compile and run gracefully (monitor changes) an any existing go project
micro run - Compile and run gracefully (monitor changes) an any existing go project
USAGE:
microv6 run [options] [arguments...]
micro run [options] [arguments...]
or
microv6 run [options except -app_path] [arguments...] {app_path}
micro run [options except -app_path] [arguments...] {app_path}
OPTIONS:
--watch_exts value, -x value Specified to increase the listening file suffix (default: ".go", ".ini", ".yaml", ".toml", ".xml")
--notwatch value, -n value Not watch files or directories
--app_path value, -p value The path(relative/absolute) of the project
```

example: `microv6 run -x .yaml -p myapp` or `microv6 run`
example: `micro run -x .yaml -p myapp` or `micro run`

### Add model

Add mysql model struct code to project template.

`microv6 tpl` command help:
`micro tpl` command help:

```
NAME:
microv6 tpl - Add mysql model struct code to project template
micro tpl - Add mysql model struct code to project template
USAGE:
microv6 tpl [command options] [arguments...]
micro tpl [command options] [arguments...]
OPTIONS:
--app_path value, -p value The path(relative/absolute) of the project
Expand All @@ -347,7 +347,7 @@ OPTIONS:
```


[More Micro Command](https://github.com/xiaoenai/tp-micro/tree/v6/cmd/microv6)
[More Micro Command](https://github.com/xiaoenai/tp-micro/tree/v6/cmd/micro)

## Usage

Expand Down
36 changes: 18 additions & 18 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ go version ≥ 1.12

```sh
go get -u -f -d github.com/xiaoenai/tp-micro/...
cd $GOPATH/src/github.com/xiaoenai/tp-micro/cmd/microv6
cd $GOPATH/src/github.com/xiaoenai/tp-micro/cmd/micro
go install
```

Expand Down Expand Up @@ -125,21 +125,21 @@ func main() {

### 生成项目

`microv6 gen` command help:
`micro gen` command help:

```
NAME:
microv6 gen - Generate a tp-micro project
micro gen - Generate a tp-micro project
USAGE:
microv6 gen [command options] [arguments...]
micro gen [command options] [arguments...]
OPTIONS:
--template value, -t value The template for code generation(relative/absolute)
--app_path value, -p value The path(relative/absolute) of the project
```

example: `microv6 gen -p ./myapp` or default `microv6 gen myapp`
example: `micro gen -p ./myapp` or default `micro gen myapp`

- 初始模版文件 `__tp-micro__tpl__.go`:

Expand Down Expand Up @@ -272,11 +272,11 @@ type Meta struct {

**说明:**

- 如果 `__tp-micro__gen__.lock` 文件存在,`microv6 gen` 命令只覆盖带有 ".gen.go" 后缀的文件
- 如果 `__tp-micro__gen__.lock` 文件存在,`micro gen` 命令只覆盖带有 ".gen.go" 后缀的文件
- 在自动生成的文件的文件名中增加 `.gen` 后缀进行标记,不要修改它们!
- `.tmp` 是为了通过编译而生成的临时文件,在运行`microv6 gen`时会被覆盖重写!项目完成后应该移除它!
- `.tmp` 是为了通过编译而生成的临时文件,在运行`micro gen`时会被覆盖重写!项目完成后应该移除它!
- handler的参数和返回值必须是结构体类型
- 你可以修改默认创建的模板文件 `__tp-micro__tpl __.go`,并再次运行 `microv6 gen` 命令来更新项目
- 你可以修改默认创建的模板文件 `__tp-micro__tpl __.go`,并再次运行 `micro gen` 命令来更新项目

[生成的默认示例](https://github.com/xiaoenai/tp-micro/tree/v3/examples/project)

Expand All @@ -286,48 +286,48 @@ type Meta struct {

```
NAME:
microv6 newdoc - Generate a tp-micro project README.md
micro newdoc - Generate a tp-micro project README.md
USAGE:
microv6 newdoc [command options] [arguments...]
micro newdoc [command options] [arguments...]
OPTIONS:
--app_path value, -p value The path(relative/absolute) of the project
```

### 热编译运行

`microv6 run` 命令帮助:
`micro run` 命令帮助:

```
NAME:
microv6 run - Compile and run gracefully (monitor changes) an any existing go project
micro run - Compile and run gracefully (monitor changes) an any existing go project
USAGE:
microv6 run [options] [arguments...]
micro run [options] [arguments...]
or
microv6 run [options except -app_path] [arguments...] {app_path}
micro run [options except -app_path] [arguments...] {app_path}
OPTIONS:
--watch_exts value, -x value Specified to increase the listening file suffix (default: ".go", ".ini", ".yaml", ".toml", ".xml")
--notwatch value, -n value Not watch files or directories
--app_path value, -p value The path(relative/absolute) of the project
```

example: `microv6 run -x .yaml -p myapp` or `microv6 run`
example: `micro run -x .yaml -p myapp` or `micro run`

### 添加数据模型

从 mysql 数据库表单添加相应结构体到项目模板文件。

`microv6 tpl` command help:
`micro tpl` command help:

```
NAME:
microv6 tpl - Add mysql model struct code to project template
micro tpl - Add mysql model struct code to project template
USAGE:
microv6 tpl [command options] [arguments...]
micro tpl [command options] [arguments...]
OPTIONS:
--app_path value, -p value The path(relative/absolute) of the project
Expand Down
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion micro/create/tpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ import (
micro "github.com/xiaoenai/tp-micro"
tp "github.com/henrylee2cn/teleport"
"github.com/henrylee2cn/teleport/socket"
"github.com/xiaoenai/tp-micro/discovery"
"github.com/xiaoenai/tp-micro/model/etcd"
Expand Down
8 changes: 0 additions & 8 deletions micro/create/tpl/_template.bak/doc/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
## 服务说明

## 服务规范

## 关联服务

## 注意事项

8 changes: 4 additions & 4 deletions micro/create/tpl/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2b3e14a

Please sign in to comment.