You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,8 @@ The goal is to generate code for service which not fun to write but it should be
8
8
go get -u github.com/devimteam/microgen/cmd/microgen
9
9
```
10
10
11
+
Note: If you have problems with building microgen, please, install [dep](https://github.com/golang/dep) and use `dep ensure` command to install correct versions of dependencies ([#29](https://github.com/devimteam/microgen/issues/29)).
12
+
11
13
## Usage
12
14
```sh
13
15
microgen [OPTIONS]
@@ -33,7 +35,7 @@ Typical syntax is: `// @<tag-name>:`
33
35
34
36
#### @microgen
35
37
Main tag for microgen tool. Microgen scan file for the first interface which docs contains this tag.
36
-
To add templates for generation, add their tags, separated by comma after `@microgen:`
38
+
To add templates for generation, add their [tags](#tags), separated by comma after `@microgen:`
37
39
Example:
38
40
```go
39
41
// @microgen middleware, logging
@@ -82,13 +84,26 @@ type FileService interface {
82
84
}
83
85
```
84
86
87
+
#### @logs-len
88
+
This tag is used for logging middleware. It prints length of parameters.
89
+
Example:
90
+
```go
91
+
// @microgen logging
92
+
typeFileServiceinterface {
93
+
// @logs-ignore data
94
+
// @logs-len data
95
+
UploadFile(ctx context.Context, name string, data []byte) (link string, err error)
96
+
}
97
+
```
98
+
85
99
### Tags
86
100
All allowed tags for customize generation provided here.
0 commit comments