Skip to content

Commit 7f2d409

Browse files
committed
更新redis
1 parent 79f8b03 commit 7f2d409

13 files changed

+345
-128
lines changed

_tests/config_test.WingiMac.local.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

_tests/config_test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#测试的配置文件
2+
configfile: /Users/gaoyunyun/Projs/WozhuWebServ/dev/conf/config_haokai.imacdev.yaml
3+
4+
'wing-mbp.local': /Users/ppd-03020144/Projs/go-web/dev/conf/config_ppdgzg.dev.yaml

config.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,17 @@ type WxConfig struct {
201201
EnableJsTicket bool `yaml:"enable_jsticket"`
202202
Token string //缓存用
203203
Miniapps []ThirdPartConfig `yaml:"mini"`
204+
Corp WxCorpConf
205+
}
206+
type WxCorpConf struct {
207+
CorpId string
208+
CorpSecret string
209+
OauthRedirect string `yaml:"oauth_redirect"`
204210
}
205211

206212
type RedisConf struct {
207-
Addr string //host:port 127.0.0.1:6379
213+
Addr string //host:port 127.0.0.1:6379
214+
Shards []string //host:port 127.0.0.1:6379
208215
Password string
209216
Database int
210217
UniqueIdKey string

config_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package utils
22

33
import (
4+
"runtime"
45
"testing"
56
"github.com/ungerik/go-dry"
67
"github.com/stretchr/testify/assert"
@@ -36,3 +37,8 @@ func TestMConfig_Addr(t *testing.T) {
3637
addr, _ := net.ResolveTCPAddr("tcp", fmt.Sprintf("%s:%s", conf.Host, conf.Port))
3738
assert.Equal(t, 7031, addr.Port)
3839
}
40+
41+
func TestLoadForTest(t *testing.T) {
42+
_, filename, _, _ := runtime.Caller(0)
43+
fmt.Println(filename)
44+
}

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,11 @@ require (
2222
github.com/garyburd/redigo v1.6.0
2323
github.com/gavv/monotime v0.0.0-20190418164738-30dba4353424 // indirect
2424
github.com/globalsign/mgo v0.0.0
25-
2625
github.com/go-errors/errors v1.0.1
2726
github.com/go-playground/form v3.1.4+incompatible
27+
github.com/go-redis/redis v6.15.2+incompatible
2828
github.com/go-sql-driver/mysql v1.4.1
29+
github.com/gomodule/redigo v2.0.0+incompatible
2930
github.com/imdario/mergo v0.3.7
3031
github.com/imkira/go-interpol v1.1.0 // indirect
3132
github.com/iris-contrib/blackfriday v2.0.0+incompatible // indirect

go.sum

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
9494
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
9595
github.com/go-playground/form v3.1.4+incompatible h1:lvKiHVxE2WvzDIoyMnWcjyiBxKt2+uFJyZcPYWsLnjI=
9696
github.com/go-playground/form v3.1.4+incompatible/go.mod h1:lhcKXfTuhRtIZCIKUeJ0b5F207aeQCPbZU09ScKjwWg=
97+
github.com/go-redis/redis v0.0.0-20190503082931-75795aa4236d/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A=
98+
github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4=
99+
github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
97100
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
98101
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
99102
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
@@ -224,8 +227,10 @@ github.com/olivere/elastic v6.2.17+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGe
224227
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
225228
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
226229
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
230+
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
227231
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
228232
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
233+
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
229234
github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
230235
github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=
231236
github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8=

object_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type structSameName2 struct {
6969
func printFields(t *testing.T, val reflect.Value) {
7070
for i := 0; i < val.NumField(); i++ {
7171
tfield := val.Type().Field(i)
72-
fmt.Sprintf("a", "b")
72+
fmt.Sprintf("%s", "b")
7373
t.Logf("%s %s", tfield.Name, tfield.Type)
7474
}
7575
}

0 commit comments

Comments
 (0)