Skip to content

Commit 43ffcfe

Browse files
committed
clean up
delete to old depend repo and fix for go 1.17.7 remove run.group a comment from reddit say run.group is comfuse
1 parent bec191c commit 43ffcfe

File tree

16 files changed

+598
-152
lines changed

16 files changed

+598
-152
lines changed

cmd/test-client/main.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ package main
22

33
import (
44
"github.com/sanity-io/litter"
5-
"github.com/savsgio/gotils"
5+
66
"github.com/valyala/fasthttp"
77

8-
"github.com/tsingson/fasthttp-example/webclient"
8+
"github.com/tsingson/fasthttp-guide/webclient"
9+
10+
"github.com/tsingson/fasthttp-guide/pkg/vtils"
911
)
1012

1113
func main() {
@@ -19,7 +21,7 @@ func main() {
1921
if err != nil {
2022
}
2123
if resp != nil {
22-
litter.Dump(gotils.B2S(resp.Body()))
24+
litter.Dump(vtils.B2S(resp.Body()))
2325
}
2426
// clean-up
2527
fasthttp.ReleaseResponse(resp)
@@ -35,7 +37,7 @@ func main() {
3537
if er1 != nil {
3638
}
3739
if resp1 != nil {
38-
litter.Dump(gotils.B2S(resp1.Body()))
40+
litter.Dump(vtils.B2S(resp1.Body()))
3941
}
4042
// clenn-up
4143
fasthttp.ReleaseResponse(resp1)

cmd/test-server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
"go.uber.org/zap"
88

9-
"github.com/tsingson/fasthttp-example/webserver"
9+
"github.com/tsingson/fasthttp-guide/webserver"
1010
)
1111

1212
func main() {

example/helloworld/hello-web/hello-client/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import (
55
"os"
66
"time"
77

8-
"github.com/savsgio/gotils"
98
"github.com/valyala/fasthttp"
109
"go.uber.org/zap"
1110

12-
"github.com/tsingson/fasthttp-example/logger"
13-
"github.com/tsingson/fasthttp-example/pkg/goutils"
11+
"github.com/tsingson/fasthttp-guide/logger"
12+
13+
"github.com/tsingson/fasthttp-guide/pkg/vtils"
1414
)
1515

1616
func main() {
@@ -78,7 +78,7 @@ func main() {
7878
// 设置 HTTP 请求的 HTTP header
7979

8080
req.Header.SetBytesKV([]byte("Content-Type"), []byte("text/plain; charset=utf8"))
81-
req.Header.SetBytesKV([]byte("User-Agent"), []byte("fasthttp-example web client"))
81+
req.Header.SetBytesKV([]byte("User-Agent"), []byte("fasthttp-guide web client"))
8282
req.Header.SetBytesKV([]byte("Accept"), []byte("text/plain; charset=utf8"))
8383
req.Header.SetBytesKV([]byte("TransactionID"), []byte(tid))
8484

@@ -114,15 +114,15 @@ func main() {
114114
{
115115
log.Debug("---------------- HTTP header 每一个键值对-------------")
116116
resp.Header.VisitAll(func(key, value []byte) {
117-
// l.Info("requestHeader", zap.String("key", gotils.B2S(key)), zap.String("value", gotils.B2S(value)))
118-
log.Debug(tid, zap.String("key", goutils.B2S(key)), zap.String("value", goutils.B2S(value)))
117+
118+
log.Debug(tid, zap.String("key", vtils.B2S(key)), zap.String("value", vtils.B2S(value)))
119119
})
120120

121121
}
122122
// 取出 web client 请求中的 HTTP payload
123123
{
124124
log.Debug("---------------- HTTP payload -------------")
125-
log.Debug(tid, zap.String("http payload", gotils.B2S(resp.Body())))
125+
log.Debug(tid, zap.String("http payload", vtils.B2S(resp.Body())))
126126
}
127127
}
128128
}

example/helloworld/hello-web/hello-server/main.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ import (
88
"github.com/valyala/fasthttp"
99
"go.uber.org/zap"
1010

11-
"github.com/tsingson/fasthttp-example/logger"
12-
"github.com/tsingson/fasthttp-example/pkg/goutils"
11+
"github.com/tsingson/fasthttp-guide/logger"
12+
13+
"github.com/tsingson/fasthttp-guide/pkg/vtils"
1314
)
1415

1516
/**
@@ -52,7 +53,7 @@ func main() {
5253
log.Debug("在 URI 中的原始数据 > " + string(uri))
5354
log.Debug("---------------- HTTP URI 每一个键值对 -------------")
5455
ctx.URI().QueryArgs().VisitAll(func(key, value []byte) {
55-
log.Debug(tid, zap.String("key", goutils.B2S(key)), zap.String("value", goutils.B2S(value)))
56+
log.Debug(tid, zap.String("key", vtils.B2S(key)), zap.String("value", vtils.B2S(value)))
5657
})
5758
}
5859
// -------------------------------------------------------
@@ -63,14 +64,14 @@ func main() {
6364
{
6465
log.Debug("---------------- HTTP header 每一个键值对-------------")
6566
ctx.Request.Header.VisitAll(func(key, value []byte) {
66-
// l.Info("requestHeader", zap.String("key", goutils.B2S(key)), zap.String("value", goutils.B2S(value)))
67-
log.Debug(tid, zap.String("key", goutils.B2S(key)), zap.String("value", goutils.B2S(value)))
67+
// l.Info("requestHeader", zap.String("key", vtils.B2S(key)), zap.String("value", vtils.B2S(value)))
68+
log.Debug(tid, zap.String("key", vtils.B2S(key)), zap.String("value", vtils.B2S(value)))
6869
})
6970
}
7071
// 取出 web client 请求中的 HTTP payload
7172
{
7273
log.Debug("---------------- request HTTP payload -------------")
73-
log.Debug(tid, zap.String("http payload", goutils.B2S(ctx.Request.Body())))
74+
log.Debug(tid, zap.String("http payload", vtils.B2S(ctx.Request.Body())))
7475
}
7576
}
7677
switch {

go.mod

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
1-
module github.com/tsingson/fasthttp-example
1+
module github.com/tsingson/fasthttp-guide
22

3-
go 1.13
3+
go 1.17
44

55
require (
66
github.com/buaazp/fasthttprouter v0.1.1
7-
github.com/fasthttp/router v0.5.0
8-
github.com/oklog/run v1.0.0
9-
github.com/prometheus/client_golang v1.1.0
10-
github.com/sanity-io/litter v1.1.0
11-
github.com/savsgio/gotils v0.0.0-20190714152828-365999d0a274
12-
github.com/stretchr/testify v1.4.0
13-
github.com/valyala/fasthttp v1.5.0
14-
go.uber.org/zap v1.12.0
15-
golang.org/x/tools v0.0.0-20191030062658-86caa796c7ab // indirect
7+
github.com/fasthttp/router v1.4.6
8+
github.com/prometheus/client_golang v1.12.1
9+
github.com/sanity-io/litter v1.5.2
10+
github.com/stretchr/testify v1.7.0
11+
github.com/valyala/fasthttp v1.33.0
12+
go.uber.org/zap v1.21.0
13+
)
14+
15+
require (
16+
github.com/andybalholm/brotli v1.0.4 // indirect
17+
github.com/beorn7/perks v1.0.1 // indirect
18+
github.com/cespare/xxhash/v2 v2.1.2 // indirect
19+
github.com/davecgh/go-spew v1.1.1 // indirect
20+
github.com/golang/protobuf v1.5.2 // indirect
21+
github.com/klauspost/compress v1.14.1 // indirect
22+
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
23+
github.com/pmezard/go-difflib v1.0.0 // indirect
24+
github.com/prometheus/client_model v0.2.0 // indirect
25+
github.com/prometheus/common v0.32.1 // indirect
26+
github.com/prometheus/procfs v0.7.3 // indirect
27+
github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect
28+
github.com/valyala/bytebufferpool v1.0.0 // indirect
29+
github.com/valyala/tcplisten v1.0.0 // indirect
30+
go.uber.org/atomic v1.7.0 // indirect
31+
go.uber.org/multierr v1.6.0 // indirect
32+
golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect
33+
google.golang.org/protobuf v1.26.0 // indirect
34+
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
1635
)

0 commit comments

Comments
 (0)