Skip to content

Commit

Permalink
doc: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dapeng committed Nov 13, 2024
1 parent f2354c0 commit 685caad
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@ Gone is a lightweight golang dependency injection framework; a series of Goners
- goner/viper, used to parse various configuration files.
- ...

## Quick Start
1. Install [gonectr](https://github.com/gone-io/gonectr) and [mockgen](https://github.com/uber-go/mock/tree/main)
```bash
go install github.com/gone-io/gonectr@latest
go install go.uber.org/mock/mockgen@latest
```
2. Create a new project
```bash
gonectr create myproject
```
3. Run the project
```bash
cd myproject
gonectr run ./cmd/server
```
Or use run Make command if you have installed [make](https://www.gnu.org/software/make/):
```bash
cd myproject
make run
```
Or with docker compose:
```bash
cd myproject
docker compose build
docker compose up
```

## Dependency Injection and Startup
Here's an example:
```go
Expand Down
27 changes: 27 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,33 @@ Gone 是一个轻量级的golang依赖注入框架;内置了一系列Goners组
- goner/viper,用于解析多种配置文件
- ...

## 快速开始
1. 安装 [gonectr](https://github.com/gone-io/gonectr)[mockgen](https://github.com/uber-go/mock/tree/main)
```bash
go install github.com/gone-io/gonectr@latest
go install go.uber.org/mock/mockgen@latest
```
2. 创建一个项目
```bash
gonectr create myproject
```
3. 运行项目
```bash
cd myproject
gonectr run ./cmd/server
```
或者,使用make命令运行,如果你已经安装[make](https://www.gnu.org/software/make/):
```bash
cd myproject
make run
```
或者使用docker compose来运行:
```bash
cd myproject
docker compose build
docker compose up
```

## 依赖注入与启动
看一个例子:
```go
Expand Down

0 comments on commit 685caad

Please sign in to comment.