Skip to content

Commit

Permalink
add readme install
Browse files Browse the repository at this point in the history
  • Loading branch information
tsbxmw committed Dec 2, 2019
1 parent f28e096 commit 409a50e
Show file tree
Hide file tree
Showing 2 changed files with 156 additions and 6 deletions.
62 changes: 56 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,73 @@
# datasource
Autotest datasource platform by go

性能数据收集平台后端项目,目前包含了 **性能数据** 收集存储。

- 支持高并发
- 大数据分表存储
- 提供开放式 API
- 提供 SDK 配合使用
- 其他


## OpenSource DataSource Platform


### Gin
整合了 Gin 框架和其他的通用功能,包括:

> 中间件
- logger :使用 logrus 构建
- auth :鉴权模块,使用 key 和 secret 进行校验
- exception : 重写 gin.Recovery() 中间件,提供了统一的 panic 捕捉

> HandlerFunc
- NoMethodHandler : 重写 gin.NoMethodHandler(),提供无 对应方法访问 的 统一返回
- NoRouterHandler : 重写 gin.NoRouterHandler(),提供无 对应路径访问 的 统一返回

> MQ
- 使用 RabbitMq 构建
- 提供 Worker 注册支持

> Consul
- 提供了 consul 的支持
- 提供了 http consul 的服务注册
- 提供了 grpc consul 的服务注册

> App 支持
### gorm
- 使用 github.com/urfave/cli 构建基础 App
- 提供了 统一的 config 读取文件服务

> transport
### redis
- 提供了 http 使用的基础服务

> model
- 提供了 ORM 使用的 Model
- 使用 gorm 构建

> 缓存
- 提供了基于 redis 的 redis pool

> Service
- 提供了基础 service,待完善

> utils
- 提供了一些工具


### Gin

### logrus
整个项目基于 Gin 框架构建。


### multi-micro-service

## Mysql Model design

Expand Down
100 changes: 100 additions & 0 deletions doc/Install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# How to Use DataSource


# Install these software first

## go

Go Version 1.13 or higher

https://golang.google.cn/

## Mysql

Mysql

https://www.mysql.com/

## Redis

https://redis.io/

## rabbit mq

https://www.rabbitmq.com/

## consul

https://www.consul.io/


# Get Code Source


## git clone the code source

```shell
git clone https://github.com/tsbxmw/datasource
```

## modify the config in auth/config and data/config


**change all configuration to yours!**

```json
{
"address": "172.22.96.83",
"consul_addr": "http://172.23.152.46",
"consul_port": 8500,
"db_uri": "root:mengwei@(tcloud.tsbx.com:3306)/datasource?parseTime=true&loc=Local",
"jaeger_addr": "tcloud-api.tsbx.com:5775",
"log_file": "log/auth.log",
"port": 9040,
"grpc_port": 9041,
"retry_max": 3,
"retry_timeout": 500,
"service_name": "auth_v1",
"redis_host": "tcloud.tsbx.com",
"redis_password": "",
"redis_port": "6379",
"redis_db": 1
}
```

# Go Build the Code

## build the auth

```shell
cd datasource
go build -o auth1 apps/auth/auth.go
```

## build the data

```shell
cd datasource
go build -o data1 apps/data/data.go
```


# Run the code

## auth service

```shell
./auth1 --config=./auth/config/dev.json httpserver
```

## data service

```shell
./data1 --config=./data/config/dev.json httpserver
```

## data worker

```shell
./data1 --config=./data/config/dev.json worker-server
```

0 comments on commit 409a50e

Please sign in to comment.