Skip to content

Commit db9c790

Browse files
author
greensheng
committed
Reinitialize
0 parents  commit db9c790

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+6405
-0
lines changed

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Go template
3+
# Binaries for programs and plugins
4+
*.exe
5+
*.exe~
6+
*.dll
7+
*.so
8+
*.dylib
9+
*.iml
10+
*.xml
11+
*。sum
12+
13+
# Test binary, built with `go test -c`
14+
*.test
15+
16+
# Output of the go coverage tool, specifically when used with LiteIDE
17+
*.out
18+
19+
# Dependency directories (remove the comment below to include it)
20+
vendor/
21+
algo
22+
/lastupdate.tmp
23+
/routers/commentsRouter_controllers.go
24+
/swagger/
25+
26+
data/
27+
data/*
28+
29+
.idea
30+
.idea/*

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<p align="center"><img width="40%" src="https://getbitex.oss-cn-beijing.aliyuncs.com/projects/image/logo.svg" /></p>
2+
3+
# GitBitEx - 高性能的开源数字货币交易系统
4+
5+
https://gitbitex.com:8080/trade/BTC-USDT
6+
7+
## 特性
8+
9+
## TODO
10+
- [ ] 拆分模块,分布式部署
11+
- [ ] 完善用户体系
12+
- [ ] 完善登录注册流程(安全)
13+
- [ ] 完善手续费体系
14+
- [ ] C2C交易
15+
- [ ] 钱包
16+
17+
## 性能测试

conf.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"dataSource": {
3+
"driverName": "mysql",
4+
"addr": "127.0.0.1:3306",
5+
"database": "spot",
6+
"user": "root",
7+
"password": ""
8+
},
9+
"redis": {
10+
"addr": ":6379",
11+
"password": ""
12+
},
13+
"kafka": {
14+
"brokers": [
15+
"localhost:9092"
16+
]
17+
},
18+
"pushServer": {
19+
"addr": ":8002",
20+
"path": "/ws"
21+
},
22+
"restServer": {
23+
"addr": ":8001"
24+
},
25+
"jwtToken": "flj23jfoi23apdl3jfslkj23za01mf3"
26+
}

conf/gbe_config.go

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Copyright 2019 GitBitEx.com
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package conf
16+
17+
import (
18+
"encoding/json"
19+
"io/ioutil"
20+
)
21+
22+
type GbeConfig struct {
23+
DataSource DataSourceConfig `json:"dataSource"`
24+
Redis RedisConfig `json:"redis"`
25+
Kafka KafkaConfig `json:"kafka"`
26+
PushServer PushServerConfig `json:"pushServer"`
27+
RestServer RestServerConfig `json:"restServer"`
28+
JwtSecret string `json:"jwtSecret"`
29+
}
30+
31+
type DataSourceConfig struct {
32+
DriverName string `json:"driverName"`
33+
Addr string `json:"addr"`
34+
Database string `json:"database"`
35+
User string `json:"user"`
36+
Password string `json:"password"`
37+
}
38+
39+
type RedisConfig struct {
40+
Addr string `json:"addr"`
41+
Password string `json:"password"`
42+
}
43+
44+
type KafkaConfig struct {
45+
Brokers []string `json:"brokers"`
46+
}
47+
48+
type PushServerConfig struct {
49+
Addr string `json:"addr"`
50+
Path string `json:"path"`
51+
}
52+
53+
type RestServerConfig struct {
54+
Addr string `json:"addr"`
55+
}
56+
57+
func GetConfig() (*GbeConfig, error) {
58+
bytes, err := ioutil.ReadFile("conf.json")
59+
if err != nil {
60+
return nil, err
61+
}
62+
63+
var config GbeConfig
64+
err = json.Unmarshal(bytes, &config)
65+
if err != nil {
66+
return nil, err
67+
}
68+
return &config, nil
69+
}

go.mod

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
module github.com/gitbitex/gitbitex-spot
2+
3+
go 1.12
4+
5+
require (
6+
github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect
7+
github.com/coreos/bbolt v1.3.3 // indirect
8+
github.com/coreos/etcd v3.3.15+incompatible // indirect
9+
github.com/coreos/go-semver v0.3.0 // indirect
10+
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect
11+
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect
12+
github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 // indirect
13+
github.com/cznic/sortutil v0.0.0-20181122101858-f5f958428db8 // indirect
14+
github.com/dgrijalva/jwt-go v3.2.0+incompatible
15+
github.com/emirpasic/gods v1.12.0
16+
github.com/etcd-io/gofail v0.0.0-20190801230047-ad7f989257ca // indirect
17+
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 // indirect
18+
github.com/gin-gonic/gin v1.3.0+incompatible
19+
github.com/go-redis/redis v6.15.2+incompatible
20+
github.com/go-sql-driver/mysql v1.4.1
21+
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
22+
github.com/google/uuid v1.1.1 // indirect
23+
github.com/gorilla/websocket v1.4.0
24+
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect
25+
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect
26+
github.com/grpc-ecosystem/grpc-gateway v1.9.5 // indirect
27+
github.com/hashicorp/golang-lru v0.5.0
28+
github.com/jinzhu/gorm v1.9.10
29+
github.com/jmoiron/sqlx v1.2.0 // indirect
30+
github.com/jonboulle/clockwork v0.1.0 // indirect
31+
github.com/json-iterator/go v1.1.7 // indirect
32+
github.com/juju/errors v0.0.0-20190806202954-0232dcc7464d // indirect
33+
github.com/juju/loggo v0.0.0-20190526231331-6e530bcce5d8 // indirect
34+
github.com/juju/testing v0.0.0-20190723135506-ce30eb24acd2 // indirect
35+
github.com/mattn/go-isatty v0.0.8 // indirect
36+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
37+
github.com/modern-go/reflect2 v1.0.1 // indirect
38+
github.com/myesui/uuid v1.0.0 // indirect
39+
github.com/ngaut/pools v0.0.0-20180318154953-b7bc8c42aac7 // indirect
40+
github.com/ngaut/sync2 v0.0.0-20141008032647-7a24ed77b2ef // indirect
41+
github.com/opentracing/opentracing-go v1.1.0 // indirect
42+
github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e // indirect
43+
github.com/pingcap/kvproto v0.0.0-20190904075355-9a1bd6a31da2 // indirect
44+
github.com/pingcap/tidb v2.0.11+incompatible // indirect
45+
github.com/pkg/errors v0.8.1
46+
github.com/prometheus/common v0.2.0
47+
github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 // indirect
48+
github.com/segmentio/kafka-go v0.3.2
49+
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24
50+
github.com/siddontang/go-log v0.0.0-20190221022429-1e957dd83bed
51+
github.com/siddontang/go-mysql v0.0.0-20190720022221-046188b858f9
52+
github.com/soheilhy/cmux v0.1.4 // indirect
53+
github.com/spaolacci/murmur3 v1.1.0 // indirect
54+
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5 // indirect
55+
github.com/twinj/uuid v1.0.0 // indirect
56+
github.com/uber-go/atomic v1.4.0 // indirect
57+
github.com/uber/jaeger-client-go v2.16.0+incompatible // indirect
58+
github.com/uber/jaeger-lib v2.0.0+incompatible // indirect
59+
github.com/ugorji/go v1.1.7 // indirect
60+
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
61+
go.etcd.io/bbolt v1.3.3 // indirect
62+
go.uber.org/atomic v1.4.0 // indirect
63+
go.uber.org/multierr v1.1.0 // indirect
64+
go.uber.org/zap v1.10.0 // indirect
65+
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
66+
gopkg.in/go-playground/validator.v8 v8.18.2 // indirect
67+
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce // indirect
68+
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
69+
sigs.k8s.io/yaml v1.1.0 // indirect
70+
)

0 commit comments

Comments
 (0)