https://github.com/chenxyzl/gsgen
gsgen getter,setter,json.Marshal/Unmarshal,bson.Marshal/Unmarshal, support mongo dirty incremental update
https://github.com/chenxyzl/gsgen
bson code-generation dirty generate getter incremental-update json mongo setter
Last synced: about 1 month ago
JSON representation
gsgen getter,setter,json.Marshal/Unmarshal,bson.Marshal/Unmarshal, support mongo dirty incremental update
- Host: GitHub
- URL: https://github.com/chenxyzl/gsgen
- Owner: chenxyzl
- License: mit
- Created: 2024-03-12T09:01:04.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-03T08:05:20.000Z (almost 2 years ago)
- Last Synced: 2025-02-10T11:33:10.102Z (over 1 year ago)
- Topics: bson, code-generation, dirty, generate, getter, incremental-update, json, mongo, setter
- Language: Go
- Homepage:
- Size: 121 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## gsgen
- 用go的ast来生成struct对象的方法列表getter,setter,json.Marshal/Unmarshal,bson.Marshal/Unmarshal,String,Clone,Clean,支持增量mongo的更新
### 怎么使用/how to run
- 安装gsgen_tools: go install github.com/chenxyzl/gsgen/gsgen_tools@latest
- 执行: gsgen_tools -d="./example/nest" -f=".model.go,.mod.go" -s -b -a="// test head annotations" -i="github.com/chenxyzl/gsgen/example/common,github.com/chenxyzl/gsgen/example/common.Common"
- -d 表示目录
- -f 表示文件后缀
- -s 可选,表示导出setter[即true:Setter|false:setter]
- -b 可选,表示生成bson的序列化和反序列化
- -a 可选,数组,表示追加在头部的注释(一般用于给生成的文件添加额外的提示信息等)
- -i 可选,数组,表示忽略检查的外部包,也可以指定外部包的特定类型(用于导入外部包类型,注:外部包对象的的安全无法保证,增量更新都不支持,建议外部包对象也用本工具生成)
- 支持的命令参考请执行 ./gsgen_tools -h
- 参考: Makefile