Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feat-withreqworkpool
Browse files Browse the repository at this point in the history
  • Loading branch information
dickens7 committed May 12, 2024
2 parents fb56ac4 + b4444e9 commit 0e39b2f
Show file tree
Hide file tree
Showing 8 changed files with 142 additions and 167 deletions.
21 changes: 2 additions & 19 deletions codec/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
"encoding/json"
"errors"
"fmt"
pb "google.golang.org/protobuf/proto"
"reflect"

pb "google.golang.org/protobuf/proto"

"github.com/apache/thrift/lib/go/thrift"
"github.com/gogo/protobuf/proto"
jsoniter "github.com/json-iterator/go"
"github.com/tinylib/msgp/msgp"
"github.com/vmihailenco/msgpack/v5"
)
Expand Down Expand Up @@ -142,20 +142,3 @@ func (c ThriftCodec) Decode(data []byte, i interface{}) error {
d.Transport.Close()
return d.Read(context.Background(), i.(thrift.TStruct), data)
}

type JSONIterCodec struct{}

func (c JSONIterCodec) Encode(i interface{}) ([]byte, error) {
var buf bytes.Buffer
enc := jsoniter.NewEncoder(&buf)
enc.SetEscapeHTML(false)
err := enc.Encode(i)
return buf.Bytes(), err
}

// Decode decodes an object from slice of bytes.
func (c JSONIterCodec) Decode(data []byte, i interface{}) error {
d := jsoniter.NewDecoder(bytes.NewBuffer(data))
d.UseNumber()
return d.Decode(i)
}
69 changes: 35 additions & 34 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ require (
github.com/ChimeraCoder/gojson v1.1.0
github.com/akutz/memconn v0.1.0
github.com/alitto/pond v1.8.3
github.com/apache/thrift v0.18.1
github.com/apache/thrift v0.20.0
github.com/edwingeng/doublejump v1.0.1
github.com/fatih/color v1.14.1
github.com/go-echarts/go-echarts/v2 v2.3.2
github.com/fatih/color v1.16.0
github.com/go-echarts/go-echarts/v2 v2.3.3
github.com/go-ping/ping v1.1.0
github.com/go-redis/redis/v8 v8.11.5
github.com/go-redis/redis_rate/v9 v9.1.2
Expand All @@ -21,70 +21,71 @@ require (
github.com/golang/snappy v0.0.4
github.com/grandcat/zeroconf v1.0.0
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/golang-lru v0.5.4
github.com/hashicorp/golang-lru v1.0.2
github.com/jamiealquiza/tachymeter v2.0.0+incompatible
github.com/json-iterator/go v1.1.12
github.com/juju/ratelimit v1.0.2
github.com/julienschmidt/httprouter v1.3.0
github.com/kavu/go_reuseport v1.5.0
github.com/kr/pretty v0.2.0
github.com/quic-go/quic-go v0.42.0
github.com/kr/pretty v0.3.1
github.com/quic-go/quic-go v0.43.1
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475
github.com/rpcxio/libkv v0.5.1
github.com/rs/cors v1.8.3
github.com/rs/cors v1.11.0
github.com/rubyist/circuitbreaker v2.2.1+incompatible
github.com/smallnest/quick v0.1.0
github.com/smallnest/statsview v0.0.0-20231119085602-10700f9abec4
github.com/smallnest/quick v0.2.0
github.com/smallnest/statsview v1.0.1
github.com/soheilhy/cmux v0.1.5
github.com/stretchr/testify v1.7.2
github.com/tinylib/msgp v1.1.8
github.com/stretchr/testify v1.8.4
github.com/tinylib/msgp v1.1.9
github.com/valyala/fastrand v1.1.0
github.com/vmihailenco/msgpack/v5 v5.3.5
github.com/xtaci/kcp-go v5.4.20+incompatible
golang.org/x/net v0.17.0
golang.org/x/sync v0.2.0
google.golang.org/protobuf v1.33.0
golang.org/x/net v0.25.0
golang.org/x/sync v0.7.0
google.golang.org/protobuf v1.34.1
)

require (
github.com/StackExchange/wmi v1.2.1 // indirect
github.com/cenk/backoff v2.2.1+incompatible // indirect
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dgryski/go-jump v0.0.0-20211018200510-ba001c3ffce0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/facebookgo/clock v0.0.0-20150410010913-600d898af40a // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
github.com/google/pprof v0.0.0-20230228050547-1710fef4ab10 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/klauspost/reedsolomon v1.11.7 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/libp2p/go-sockaddr v0.1.1 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/klauspost/reedsolomon v1.12.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/libp2p/go-sockaddr v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/miekg/dns v1.1.51 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/onsi/ginkgo/v2 v2.9.5 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/miekg/dns v1.1.59 // indirect
github.com/onsi/ginkgo/v2 v2.17.2 // indirect
github.com/peterbourgon/g2s v0.0.0-20140925154142-ec76db4c1ac1 // indirect
github.com/philhofer/fwd v1.1.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/shirou/gopsutil/v3 v3.20.10 // indirect
github.com/templexxx/cpufeat v0.0.0-20180724012125-cef66df7f161 // indirect
github.com/templexxx/xor v0.0.0-20191217153810-f85b25db303b // indirect
github.com/tjfoc/gmsm v1.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/xtaci/lossyconn v0.0.0-20200209145036-adba10fffc37 // indirect
go.uber.org/mock v0.4.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/exp v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.11.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.9.1 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
golang.org/x/tools v0.21.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 0e39b2f

Please sign in to comment.