|
1 | 1 | # Component |
2 | 2 |
|
3 | | -``` |
4 | | - xcfg 这里主要是借鉴douyu框架得config解析 |
5 | | - xgoven 系统监控api |
6 | | - xinvoker |
7 | | - -email email |
8 | | - -gorm gorm |
9 | | - -mongo mongo |
10 | | - -oss 云对象存储 |
11 | | - -redis redis |
12 | | - xlog 日志 |
13 | | - xmoniter 普罗米修斯 |
14 | | - xregistry 服务注册发现 |
15 | | - xtrace 链路追踪 |
16 | | - xgrpc grpc 拦截器 |
17 | | - pkg |
18 | | - -xcast spf13/cast不足的函数封装 |
19 | | - -xcolor 颜色输出 |
20 | | - -xdefer 统一defer函数 |
21 | | - -xerrgroup errgroup |
22 | | - -xfile 文件操作封装 |
23 | | - -xflag flag封装 |
24 | | - -xgp 协程池子 |
25 | | - -xmap map操作封装 |
26 | | - -xnet 本机网络操作封装 |
27 | | - -xreminder 定时任务 |
28 | | - -xsignals 信号 |
29 | | - -xtransform 数组转换封装 |
30 | | - -xvalidator 验证 |
31 | | -``` |
| 3 | +Self-use microservice framework |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +[](https://pkg.go.dev/github.com/coder2z/component) |
| 8 | + |
32 | 9 |
|
33 | | -方便开发,自用 |
| 10 | +## :rocket:Installation |
34 | 11 |
|
35 | | -很多东西都是来自开源的项目。 |
| 12 | +` |
| 13 | +go get -u github.com/coder2z/component |
| 14 | +` |
36 | 15 |
|
| 16 | +## :bell:Features |
37 | 17 |
|
38 | | -## Example |
| 18 | +Encapsulate many tool functions and methods, and continue to update. Most of the methods are open source and other open |
| 19 | +source projects. |
| 20 | + |
| 21 | +``` |
| 22 | +xapp = > runtime app info |
| 23 | +xcfg = > config |
| 24 | +xcode = > err coder encapsulation |
| 25 | +xgovern = > system monitoring |
| 26 | +xgrpc = > grpc encapsulation |
| 27 | +xinvoker = > invoker |
| 28 | +xmoniter = > prometheus |
| 29 | +xregistry = > service registration discovery |
| 30 | +xtrace = > trace |
| 31 | +xversion = > frame version |
| 32 | +``` |
39 | 33 |
|
40 | | -配置文件 |
| 34 | +## :anchor:Usage |
41 | 35 |
|
42 | 36 | ```toml |
43 | 37 | [db] |
44 | | -[db.dev] |
45 | | -password = "root" |
46 | | -dbName = "ndisk" |
| 38 | + [db.dev] |
| 39 | + password = "root" |
| 40 | + dbName = "ndisk" |
47 | 41 |
|
48 | 42 | [redis] |
49 | | -[redis.dev] |
| 43 | + [redis.dev] |
50 | 44 | ``` |
51 | 45 |
|
52 | 46 | 使用 |
|
121 | 115 |
|
122 | 116 | ```bash |
123 | 117 | go run main.go run -c=test.toml |
124 | | -``` |
| 118 | +``` |
| 119 | + |
| 120 | +## :tada:Contribute code |
| 121 | + |
| 122 | +Open source projects are inseparable from everyone’s support. If you have a good idea, encountered some bugs and fixed |
| 123 | +them, and corrected the errors in the document, please submit a Pull Request~ |
| 124 | + |
| 125 | +1. Fork this project to your own repo |
| 126 | +2. Clone the project in the past, that is, the project in your warehouse, to your local |
| 127 | +3. Modify the code |
| 128 | +4. Push to your own library after commit |
| 129 | +5. Initiate a PR (pull request) request and submit it to the `provide` branch |
| 130 | +6. Waiting to merge |
| 131 | + |
| 132 | +## :closed_book:License |
| 133 | + |
| 134 | +Distributed under MIT License, please see license file within the code for more details. |
0 commit comments