diff --git a/.gitignore b/.gitignore
index a9ea21f..5c75b7d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,6 @@
.idea
.vscode
*.log
-goinit.sh
gomod.sh
-*_test.go
\ No newline at end of file
+*_test.go
+/vendor/
diff --git a/client.go b/client.go
index 6f4b989..cddc9bd 100644
--- a/client.go
+++ b/client.go
@@ -4,23 +4,22 @@ import (
"go.dtapp.net/dorm"
"go.dtapp.net/golog"
"go.dtapp.net/gorequest"
- "gorm.io/gorm"
)
type ConfigClient struct {
- AppKey string // 应用Key
- SecretKey string // 密钥
- SiteId string // 网站ID/APP ID
- PositionId string // 推广位id
- MongoDb *dorm.MongoClient // 日志数据库
- PgsqlDb *gorm.DB // 日志数据库
- DatabaseName string // 库名
+ AppKey string // 应用Key
+ SecretKey string // 密钥
+ SiteId string // 网站ID/APP ID
+ PositionId string // 推广位id
+ GormClient *dorm.GormClient // 日志数据库
+ LogClient *golog.ZapLog // 日志驱动
+ LogDebug bool // 日志开关
}
type Client struct {
- client *gorequest.App // 请求客户端
- log *golog.ApiClient // 日志服务
- config *ConfigClient // 配置
+ requestClient *gorequest.App // 请求服务
+ logClient *golog.ApiClient // 日志服务
+ config *ConfigClient // 配置
}
func NewClient(config *ConfigClient) (*Client, error) {
@@ -28,24 +27,16 @@ func NewClient(config *ConfigClient) (*Client, error) {
var err error
c := &Client{config: config}
- c.client = gorequest.NewHttp()
- c.client.Uri = apiUrl
+ c.requestClient = gorequest.NewHttp()
+ c.requestClient.Uri = apiUrl
- if c.config.PgsqlDb != nil {
- c.log, err = golog.NewApiClient(
- golog.WithGormClient(c.config.PgsqlDb),
- golog.WithTableName(logTable),
- )
- if err != nil {
- return nil, err
- }
- }
- if c.config.MongoDb != nil {
- c.log, err = golog.NewApiClient(
- golog.WithMongoClient(c.config.MongoDb),
- golog.WithDatabaseName(c.config.DatabaseName),
- golog.WithCollectionName(logTable),
- )
+ if c.config.GormClient.Db != nil {
+ c.logClient, err = golog.NewApiClient(&golog.ApiClientConfig{
+ GormClient: c.config.GormClient,
+ TableName: logTable,
+ LogClient: c.config.LogClient,
+ LogDebug: c.config.LogDebug,
+ })
if err != nil {
return nil, err
}
diff --git a/const.go b/const.go
index 506dd99..0942802 100644
--- a/const.go
+++ b/const.go
@@ -8,4 +8,4 @@ const (
logTable = "jd"
)
-const Version = "1.0.4"
+const Version = "1.0.5"
diff --git a/go.mod b/go.mod
index a01c1fe..ae744e7 100644
--- a/go.mod
+++ b/go.mod
@@ -3,11 +3,10 @@ module go.dtapp.net/jd
go 1.19
require (
- go.dtapp.net/dorm v1.0.17
- go.dtapp.net/golog v1.0.24
- go.dtapp.net/gorequest v1.0.26
+ go.dtapp.net/dorm v1.0.27
+ go.dtapp.net/golog v1.0.29
+ go.dtapp.net/gorequest v1.0.27
go.dtapp.net/gostring v1.0.6
- gorm.io/gorm v1.23.8
)
require (
@@ -37,13 +36,15 @@ require (
github.com/klauspost/compress v1.15.9 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/lib/pq v1.10.6 // indirect
- github.com/mattn/go-isatty v0.0.14 // indirect
+ github.com/mattn/go-colorable v0.1.12 // indirect
+ github.com/mattn/go-isatty v0.0.16 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/montanaflynn/stats v0.6.6 // indirect
github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
+ github.com/rs/zerolog v1.27.0 // indirect
github.com/saracen/go7z v0.0.0-20191010121135-9c09b6bd7fda // indirect
github.com/saracen/solidblock v0.0.0-20190426153529-45df20abab6f // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
@@ -62,11 +63,11 @@ require (
github.com/xdg-go/scram v1.1.1 // indirect
github.com/xdg-go/stringprep v1.0.3 // indirect
github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a // indirect
- go.dtapp.net/goip v1.0.24 // indirect
+ go.dtapp.net/goip v1.0.25 // indirect
go.dtapp.net/gojson v1.0.1 // indirect
go.dtapp.net/gorandom v1.0.1 // indirect
go.dtapp.net/gotime v1.0.5 // indirect
- go.dtapp.net/gotrace_id v1.0.0 // indirect
+ go.dtapp.net/gotrace_id v1.0.5 // indirect
go.dtapp.net/gourl v1.0.0 // indirect
go.dtapp.net/goxml v1.0.1 // indirect
go.mongodb.org/mongo-driver v1.10.1 // indirect
@@ -82,8 +83,9 @@ require (
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gorm.io/datatypes v1.0.7 // indirect
- gorm.io/driver/mysql v1.3.5 // indirect
- gorm.io/driver/postgres v1.3.8 // indirect
+ gorm.io/driver/mysql v1.3.6 // indirect
+ gorm.io/driver/postgres v1.3.9 // indirect
+ gorm.io/gorm v1.23.8 // indirect
mellium.im/sasl v0.2.1 // indirect
xorm.io/builder v0.3.12 // indirect
xorm.io/xorm v1.3.1 // indirect
diff --git a/go.sum b/go.sum
index 3ab1243..455b216 100644
--- a/go.sum
+++ b/go.sum
@@ -52,6 +52,7 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
github.com/coreos/go-systemd v0.0.0-20180511133405-39ca1b05acc7/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
+github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
@@ -110,6 +111,7 @@ github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/me
github.com/goccy/go-json v0.8.1/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/goccy/go-json v0.9.10 h1:hCeNmprSNLB8B8vQKWl6DpuH0t60oEs+TAk9a7CScKc=
github.com/goccy/go-json v0.9.10/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
+github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPhW6m+TnJw=
github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
@@ -307,6 +309,8 @@ github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaO
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
+github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40=
+github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
@@ -314,8 +318,9 @@ github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
-github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/mattn/go-sqlite3 v1.14.12/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
@@ -412,8 +417,11 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
+github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
+github.com/rs/zerolog v1.27.0 h1:1T7qCieN22GVc8S4Q2yuexzBb1EqjbgjSH9RohbMjKs=
+github.com/rs/zerolog v1.27.0/go.mod h1:7frBqO0oezxmnO7GF86FY++uy8I0Tk/If5ni1G9Qc0U=
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
@@ -499,24 +507,24 @@ github.com/youmark/pkcs8 v0.0.0-20201027041543-1326539a0a0a/go.mod h1:ul22v+Nro/
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q=
github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
-go.dtapp.net/dorm v1.0.17 h1:3VQKUl05CDxFg3T1c/M8wYf2I+H+oVGBDh4NCV30nn0=
-go.dtapp.net/dorm v1.0.17/go.mod h1:bHG7BmgeLaAlc56myYF63lwZAIuMeWRAqHBb/L84dLM=
-go.dtapp.net/goip v1.0.24 h1:62k3xt9I/YLUwA5tLp7YC8XPskkswc4RJrvxRRxjwIY=
-go.dtapp.net/goip v1.0.24/go.mod h1:tps0yoq5kSykLGDb01vuai47hzAQ6nYUPFWLdlQA2Oo=
+go.dtapp.net/dorm v1.0.27 h1:TnRWVfYYjfvZ1Zi2cyb41ZmsbytB4+5fN/FVnodd2NQ=
+go.dtapp.net/dorm v1.0.27/go.mod h1:bHG7BmgeLaAlc56myYF63lwZAIuMeWRAqHBb/L84dLM=
+go.dtapp.net/goip v1.0.25 h1:GSgQkR7dc28TX8E1mF3wAy+EEGZ++tgqc8Q85OKZPEY=
+go.dtapp.net/goip v1.0.25/go.mod h1:dKeNuWJttH4AvvYVHV0FagB6BVvFM1HGDKFxLKr+hkQ=
go.dtapp.net/gojson v1.0.1 h1:MHeSGlq1KxzL7rCkm18fhwW4GNORHohdDMmxY5PupKY=
go.dtapp.net/gojson v1.0.1/go.mod h1:TkkpTNxHBKxul0e7gC5MrL1K4ICFB9mQ7wHzjBah3/k=
-go.dtapp.net/golog v1.0.24 h1:A26GN2fEJOsMWRb+jqG2LKRmB8aEuWFYNNXGT23VNbc=
-go.dtapp.net/golog v1.0.24/go.mod h1:P1CFwGZ6xm2nLXCi0DTwO8aHNfT2dkdjz+9b2ph1TNQ=
+go.dtapp.net/golog v1.0.29 h1:tkNZ2KENquglBVaim5ISj0yOeXxwmuPxgQTeUd3I75c=
+go.dtapp.net/golog v1.0.29/go.mod h1:W0fqSbKfiTLZjF92TbUp6v0TlqGpKKOIvLy/O3hQXcU=
go.dtapp.net/gorandom v1.0.1 h1:IWfMClh1ECPvyUjlqD7MwLq4mZdUusD1qAwAdsvEJBs=
go.dtapp.net/gorandom v1.0.1/go.mod h1:ZPdgalKpvFV/ATQqR0k4ns/F/IpITAZpx6WkWirr5Y8=
-go.dtapp.net/gorequest v1.0.26 h1:t+rMW7liLHz1RgY60ztWIghSkTeQePKWM0EsDG1IqMI=
-go.dtapp.net/gorequest v1.0.26/go.mod h1:sDhiEPwdZnUbyDuq/3OAzA1qvpU5yo49v1fY5sVgj18=
+go.dtapp.net/gorequest v1.0.27 h1:Hip1mfSZJDNcmE2iZgB3PYa0C/7BAMEJLsCaMd6t9iE=
+go.dtapp.net/gorequest v1.0.27/go.mod h1:922s7pjYulKIytUMGAYS4aHU6cnzTbOQURGBPCKSxAk=
go.dtapp.net/gostring v1.0.6 h1:XqNaThEfHpweLofru5sBqm1UUzc9JWsXyB/M/rTk29w=
go.dtapp.net/gostring v1.0.6/go.mod h1:AMnnLjyNxH+cphxyASJGYCzWpVrkP5RncuVo8xL8s3E=
go.dtapp.net/gotime v1.0.5 h1:12aNgB2ULpP6QgQHEUkLilZ4ASvhpFxMFQkBwn0par8=
go.dtapp.net/gotime v1.0.5/go.mod h1:Gq7eNLr2iMLP18UNWONRq4V3Uhf/ADp4bIrS+Tc6ktY=
-go.dtapp.net/gotrace_id v1.0.0 h1:nlI8KEEf2l394SCzmJxffEIiOBfR4kIOuobBhpRSV3g=
-go.dtapp.net/gotrace_id v1.0.0/go.mod h1:HDwMY1vLoC759z6VGKVgCpIqwKQTDYV9DNdxiyN1OeQ=
+go.dtapp.net/gotrace_id v1.0.5 h1:znUwvMcX7ADQn8f750yIb5xJa9tJ4P0fHb5tSo7EFeg=
+go.dtapp.net/gotrace_id v1.0.5/go.mod h1:476T5KMJw9c6DM/rJn7y6d28hcNDv4+wew4sd+powes=
go.dtapp.net/gourl v1.0.0 h1:Zbe0GiMFyyRy2+bjbVsYulakH5d58w3CDZkUPonlMoQ=
go.dtapp.net/gourl v1.0.0/go.mod h1:x9A/pJ3iKDTb6Gu2RtJy2iHg56IowXIcIGQdogqpGjs=
go.dtapp.net/goxml v1.0.1 h1:WODsjNpmHTtoeLsXgOjC81qRbu4aXZ3LKBHApNGaPjY=
@@ -648,6 +656,7 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210902050250-f475640dd07b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
@@ -739,17 +748,18 @@ gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gorm.io/datatypes v1.0.7 h1:8NhJN4+annFjwV1WufDhFiPjdUvV1lSGUdg1UCjQIWY=
gorm.io/datatypes v1.0.7/go.mod h1:l9qkCuy0CdzDEop9HKUdcnC9gHC2sRlaFtHkTzsZRqg=
gorm.io/driver/mysql v1.3.2/go.mod h1:ChK6AHbHgDCFZyJp0F+BmVGb06PSIoh9uVYKAlRbb2U=
-gorm.io/driver/mysql v1.3.5 h1:iWBTVW/8Ij5AG4e0G/zqzaJblYkBI1VIL1LG2HUGsvY=
-gorm.io/driver/mysql v1.3.5/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c=
+gorm.io/driver/mysql v1.3.6 h1:BhX1Y/RyALb+T9bZ3t07wLnPZBukt+IRkMn8UZSNbGM=
+gorm.io/driver/mysql v1.3.6/go.mod h1:sSIebwZAVPiT+27jK9HIwvsqOGKx3YMPmrA3mBJR10c=
gorm.io/driver/postgres v1.3.4/go.mod h1:y0vEuInFKJtijuSGu9e5bs5hzzSzPK+LancpKpvbRBw=
-gorm.io/driver/postgres v1.3.8 h1:8bEphSAB69t3odsCR4NDzt581iZEWQuRM27Cg6KgfPY=
-gorm.io/driver/postgres v1.3.8/go.mod h1:qB98Aj6AhRO/oyu/jmZsi/YM9g6UzVCjMxO/6frFvcA=
+gorm.io/driver/postgres v1.3.9 h1:lWGiVt5CijhQAg0PWB7Od1RNcBw/jS4d2cAScBcSDXg=
+gorm.io/driver/postgres v1.3.9/go.mod h1:qw/FeqjxmYqW5dBcYNBsnhQULIApQdk7YuuDPktVi1U=
gorm.io/driver/sqlite v1.3.1/go.mod h1:wJx0hJspfycZ6myN38x1O/AqLtNS6c5o9TndewFbELg=
gorm.io/driver/sqlite v1.3.6 h1:Fi8xNYCUplOqWiPa3/GuCeowRNBRGTf62DEmhMDHeQQ=
gorm.io/driver/sqlserver v1.3.1/go.mod h1:w25Vrx2BG+CJNUu/xKbFhaKlGxT/nzRkhWCCoptX8tQ=
gorm.io/driver/sqlserver v1.3.2 h1:yYt8f/xdAKLY7lCCyXxIUEgZ/WsURos3dHrx8MKFGAk=
gorm.io/gorm v1.23.1/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.23.6/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
+gorm.io/gorm v1.23.7/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
gorm.io/gorm v1.23.8 h1:h8sGJ+biDgBA1AD1Ha9gFCx7h8npU7AsLdlkX0n2TpE=
gorm.io/gorm v1.23.8/go.mod h1:l2lP/RyAtc1ynaTjFksBde/O8v9oOGIApu2/xRitmZk=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/request.go b/request.go
index e806b09..423a653 100644
--- a/request.go
+++ b/request.go
@@ -13,7 +13,7 @@ func (c *Client) request(ctx context.Context, params map[string]interface{}) (go
c.Sign(params)
// 创建请求
- client := c.client
+ client := c.requestClient
// 设置格式
client.SetContentTypeForm()
@@ -28,11 +28,8 @@ func (c *Client) request(ctx context.Context, params map[string]interface{}) (go
}
// 日志
- if c.config.PgsqlDb != nil {
- go c.log.GormMiddlewareCustom(ctx, gostring.ToString(params["method"]), request, Version)
- }
- if c.config.MongoDb != nil {
- go c.log.MongoMiddlewareCustom(ctx, gostring.ToString(params["method"]), request, Version)
+ if c.config.GormClient.Db != nil {
+ go c.logClient.GormMiddlewareCustom(ctx, gostring.ToString(params["method"]), request, Version)
}
return request, err
diff --git a/vendor/github.com/basgys/goxml2json/.gitignore b/vendor/github.com/basgys/goxml2json/.gitignore
deleted file mode 100644
index 6bfad54..0000000
--- a/vendor/github.com/basgys/goxml2json/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-*.test
-*.prof
-/.tags
diff --git a/vendor/github.com/basgys/goxml2json/LICENSE b/vendor/github.com/basgys/goxml2json/LICENSE
deleted file mode 100644
index dc5a2e3..0000000
--- a/vendor/github.com/basgys/goxml2json/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Bastien Gysler
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/vendor/github.com/basgys/goxml2json/README.md b/vendor/github.com/basgys/goxml2json/README.md
deleted file mode 100644
index 04e0b7f..0000000
--- a/vendor/github.com/basgys/goxml2json/README.md
+++ /dev/null
@@ -1,82 +0,0 @@
-# goxml2json [![CircleCI](https://circleci.com/gh/basgys/goxml2json.svg?style=svg)](https://circleci.com/gh/basgys/goxml2json)
-
-Go package that converts XML to JSON
-
-### Install
-
- go get -u github.com/basgys/goxml2json
-
-### Importing
-
- import github.com/basgys/goxml2json
-
-### Usage
-
-**Code example**
-
-```go
- package main
-
- import (
- "fmt"
- "strings"
-
- xj "github.com/basgys/goxml2json"
- )
-
- func main() {
- // xml is an io.Reader
- xml := strings.NewReader(`world`)
- json, err := xj.Convert(xml)
- if err != nil {
- panic("That's embarrassing...")
- }
-
- fmt.Println(json.String())
- // {"hello": "world"}
- }
-
-```
-
-**Input**
-
-```xml
-
-
-
- bar
-
-```
-
-**Output**
-
-```json
- {
- "osm": {
- "-version": "0.6",
- "-generator": "CGImap 0.0.2",
- "bounds": {
- "-minlat": "54.0889580",
- "-minlon": "12.2487570",
- "-maxlat": "54.0913900",
- "-maxlon": "12.2524800"
- },
- "foo": "bar"
- }
- }
-```
-
-### Contributing
-Feel free to contribute to this project if you want to fix/extend/improve it.
-
-### Contributors
-
- - [DirectX](https://github.com/directx)
- - [samuelhug](https://github.com/samuelhug)
-
-### TODO
-
- * Extract data types in JSON (numbers, boolean, ...)
- * Categorise errors
- * Option to prettify the JSON output
- * Benchmark
diff --git a/vendor/github.com/basgys/goxml2json/converter.go b/vendor/github.com/basgys/goxml2json/converter.go
deleted file mode 100644
index 3e4cbce..0000000
--- a/vendor/github.com/basgys/goxml2json/converter.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package xml2json
-
-import (
- "bytes"
- "io"
-)
-
-// Convert converts the given XML document to JSON
-func Convert(r io.Reader) (*bytes.Buffer, error) {
- // Decode XML document
- root := &Node{}
- err := NewDecoder(r).Decode(root)
- if err != nil {
- return nil, err
- }
-
- // Then encode it in JSON
- buf := new(bytes.Buffer)
- err = NewEncoder(buf).Encode(root)
- if err != nil {
- return nil, err
- }
-
- return buf, nil
-}
diff --git a/vendor/github.com/basgys/goxml2json/decoder.go b/vendor/github.com/basgys/goxml2json/decoder.go
deleted file mode 100644
index af03356..0000000
--- a/vendor/github.com/basgys/goxml2json/decoder.go
+++ /dev/null
@@ -1,140 +0,0 @@
-package xml2json
-
-import (
- "encoding/xml"
- "io"
- "unicode"
-
- "golang.org/x/net/html/charset"
-)
-
-const (
- attrPrefix = "-"
- contentPrefix = "#"
-)
-
-// A Decoder reads and decodes XML objects from an input stream.
-type Decoder struct {
- r io.Reader
- err error
- attributePrefix string
- contentPrefix string
-}
-
-type element struct {
- parent *element
- n *Node
- label string
-}
-
-func (dec *Decoder) SetAttributePrefix(prefix string) {
- dec.attributePrefix = prefix
-}
-
-func (dec *Decoder) SetContentPrefix(prefix string) {
- dec.contentPrefix = prefix
-}
-
-func (dec *Decoder) DecodeWithCustomPrefixes(root *Node, contentPrefix string, attributePrefix string) error {
- dec.contentPrefix = contentPrefix
- dec.attributePrefix = attributePrefix
- return dec.Decode(root)
-}
-
-// NewDecoder returns a new decoder that reads from r.
-func NewDecoder(r io.Reader) *Decoder {
- return &Decoder{r: r}
-}
-
-// Decode reads the next JSON-encoded value from its
-// input and stores it in the value pointed to by v.
-func (dec *Decoder) Decode(root *Node) error {
-
- if dec.contentPrefix == "" {
- dec.contentPrefix = contentPrefix
- }
- if dec.attributePrefix == "" {
- dec.attributePrefix = attrPrefix
- }
-
- xmlDec := xml.NewDecoder(dec.r)
-
- // That will convert the charset if the provided XML is non-UTF-8
- xmlDec.CharsetReader = charset.NewReaderLabel
-
- // Create first element from the root node
- elem := &element{
- parent: nil,
- n: root,
- }
-
- for {
- t, _ := xmlDec.Token()
- if t == nil {
- break
- }
-
- switch se := t.(type) {
- case xml.StartElement:
- // Build new a new current element and link it to its parent
- elem = &element{
- parent: elem,
- n: &Node{},
- label: se.Name.Local,
- }
-
- // Extract attributes as children
- for _, a := range se.Attr {
- elem.n.AddChild(dec.attributePrefix+a.Name.Local, &Node{Data: a.Value})
- }
- case xml.CharData:
- // Extract XML data (if any)
- elem.n.Data = trimNonGraphic(string(xml.CharData(se)))
- case xml.EndElement:
- // And add it to its parent list
- if elem.parent != nil {
- elem.parent.n.AddChild(elem.label, elem.n)
- }
-
- // Then change the current element to its parent
- elem = elem.parent
- }
- }
-
- return nil
-}
-
-// trimNonGraphic returns a slice of the string s, with all leading and trailing
-// non graphic characters and spaces removed.
-//
-// Graphic characters include letters, marks, numbers, punctuation, symbols,
-// and spaces, from categories L, M, N, P, S, Zs.
-// Spacing characters are set by category Z and property Pattern_White_Space.
-func trimNonGraphic(s string) string {
- if s == "" {
- return s
- }
-
- var first *int
- var last int
- for i, r := range []rune(s) {
- if !unicode.IsGraphic(r) || unicode.IsSpace(r) {
- continue
- }
-
- if first == nil {
- f := i // copy i
- first = &f
- last = i
- } else {
- last = i
- }
- }
-
- // If first is nil, it means there are no graphic characters
- if first == nil {
- return ""
- }
-
- return string([]rune(s)[*first : last+1])
-}
diff --git a/vendor/github.com/basgys/goxml2json/doc.go b/vendor/github.com/basgys/goxml2json/doc.go
deleted file mode 100644
index 8a68bd3..0000000
--- a/vendor/github.com/basgys/goxml2json/doc.go
+++ /dev/null
@@ -1,2 +0,0 @@
-// Package xml2json is an XML to JSON converter
-package xml2json
diff --git a/vendor/github.com/basgys/goxml2json/encoder.go b/vendor/github.com/basgys/goxml2json/encoder.go
deleted file mode 100644
index 0a542b8..0000000
--- a/vendor/github.com/basgys/goxml2json/encoder.go
+++ /dev/null
@@ -1,197 +0,0 @@
-package xml2json
-
-import (
- "bytes"
- "io"
- "unicode/utf8"
-)
-
-// An Encoder writes JSON objects to an output stream.
-type Encoder struct {
- w io.Writer
- err error
- contentPrefix string
- attributePrefix string
-}
-
-// NewEncoder returns a new encoder that writes to w.
-func NewEncoder(w io.Writer) *Encoder {
- return &Encoder{w: w}
-}
-
-func (enc *Encoder) SetAttributePrefix(prefix string) {
- enc.attributePrefix = prefix
-}
-
-func (enc *Encoder) SetContentPrefix(prefix string) {
- enc.contentPrefix = prefix
-}
-
-func (enc *Encoder) EncodeWithCustomPrefixes(root *Node, contentPrefix string, attributePrefix string) error {
- enc.contentPrefix = contentPrefix
- enc.attributePrefix = attributePrefix
- return enc.Encode(root)
-}
-
-// Encode writes the JSON encoding of v to the stream
-func (enc *Encoder) Encode(root *Node) error {
- if enc.err != nil {
- return enc.err
- }
- if root == nil {
- return nil
- }
- if enc.contentPrefix == "" {
- enc.contentPrefix = contentPrefix
- }
- if enc.attributePrefix == "" {
- enc.attributePrefix = attrPrefix
- }
-
- enc.err = enc.format(root, 0)
-
- // Terminate each value with a newline.
- // This makes the output look a little nicer
- // when debugging, and some kind of space
- // is required if the encoded value was a number,
- // so that the reader knows there aren't more
- // digits coming.
- enc.write("\n")
-
- return enc.err
-}
-
-func (enc *Encoder) format(n *Node, lvl int) error {
- if n.IsComplex() {
- enc.write("{")
-
- // Add data as an additional attibute (if any)
- if len(n.Data) > 0 {
- enc.write("\"")
- enc.write(enc.contentPrefix)
- enc.write("content")
- enc.write("\": ")
- enc.write(sanitiseString(n.Data))
- enc.write(", ")
- }
-
- i := 0
- tot := len(n.Children)
- for label, children := range n.Children {
- enc.write("\"")
- enc.write(label)
- enc.write("\": ")
-
- if len(children) > 1 {
- // Array
- enc.write("[")
- for j, c := range children {
- enc.format(c, lvl+1)
-
- if j < len(children)-1 {
- enc.write(", ")
- }
- }
- enc.write("]")
- } else {
- // Map
- enc.format(children[0], lvl+1)
- }
-
- if i < tot-1 {
- enc.write(", ")
- }
- i++
- }
-
- enc.write("}")
- } else {
- // TODO : Extract data type
- enc.write(sanitiseString(n.Data))
- }
-
- return nil
-}
-
-func (enc *Encoder) write(s string) {
- enc.w.Write([]byte(s))
-}
-
-// https://golang.org/src/encoding/json/encode.go?s=5584:5627#L788
-var hex = "0123456789abcdef"
-
-func sanitiseString(s string) string {
- var buf bytes.Buffer
-
- buf.WriteByte('"')
- start := 0
- for i := 0; i < len(s); {
- if b := s[i]; b < utf8.RuneSelf {
- if 0x20 <= b && b != '\\' && b != '"' && b != '<' && b != '>' && b != '&' {
- i++
- continue
- }
- if start < i {
- buf.WriteString(s[start:i])
- }
- switch b {
- case '\\', '"':
- buf.WriteByte('\\')
- buf.WriteByte(b)
- case '\n':
- buf.WriteByte('\\')
- buf.WriteByte('n')
- case '\r':
- buf.WriteByte('\\')
- buf.WriteByte('r')
- case '\t':
- buf.WriteByte('\\')
- buf.WriteByte('t')
- default:
- // This encodes bytes < 0x20 except for \n and \r,
- // as well as <, > and &. The latter are escaped because they
- // can lead to security holes when user-controlled strings
- // are rendered into JSON and served to some browsers.
- buf.WriteString(`\u00`)
- buf.WriteByte(hex[b>>4])
- buf.WriteByte(hex[b&0xF])
- }
- i++
- start = i
- continue
- }
- c, size := utf8.DecodeRuneInString(s[i:])
- if c == utf8.RuneError && size == 1 {
- if start < i {
- buf.WriteString(s[start:i])
- }
- buf.WriteString(`\ufffd`)
- i += size
- start = i
- continue
- }
- // U+2028 is LINE SEPARATOR.
- // U+2029 is PARAGRAPH SEPARATOR.
- // They are both technically valid characters in JSON strings,
- // but don't work in JSONP, which has to be evaluated as JavaScript,
- // and can lead to security holes there. It is valid JSON to
- // escape them, so we do so unconditionally.
- // See http://timelessrepo.com/json-isnt-a-javascript-subset for discussion.
- if c == '\u2028' || c == '\u2029' {
- if start < i {
- buf.WriteString(s[start:i])
- }
- buf.WriteString(`\u202`)
- buf.WriteByte(hex[c&0xF])
- i += size
- start = i
- continue
- }
- i += size
- }
- if start < len(s) {
- buf.WriteString(s[start:])
- }
- buf.WriteByte('"')
- return buf.String()
-}
diff --git a/vendor/github.com/basgys/goxml2json/struct.go b/vendor/github.com/basgys/goxml2json/struct.go
deleted file mode 100644
index 1f423b1..0000000
--- a/vendor/github.com/basgys/goxml2json/struct.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package xml2json
-
-// Node is a data element on a tree
-type Node struct {
- Children map[string]Nodes
- Data string
-}
-
-// Nodes is a list of nodes
-type Nodes []*Node
-
-// AddChild appends a node to the list of children
-func (n *Node) AddChild(s string, c *Node) {
- // Lazy lazy
- if n.Children == nil {
- n.Children = map[string]Nodes{}
- }
-
- n.Children[s] = append(n.Children[s], c)
-}
-
-// IsComplex returns whether it is a complex type (has children)
-func (n *Node) IsComplex() bool {
- return len(n.Children) > 0
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/LICENSE.txt b/vendor/github.com/cespare/xxhash/v2/LICENSE.txt
deleted file mode 100644
index 24b5306..0000000
--- a/vendor/github.com/cespare/xxhash/v2/LICENSE.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2016 Caleb Spare
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/github.com/cespare/xxhash/v2/README.md b/vendor/github.com/cespare/xxhash/v2/README.md
deleted file mode 100644
index 792b4a6..0000000
--- a/vendor/github.com/cespare/xxhash/v2/README.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# xxhash
-
-[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2)
-[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml)
-
-xxhash is a Go implementation of the 64-bit
-[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a
-high-quality hashing algorithm that is much faster than anything in the Go
-standard library.
-
-This package provides a straightforward API:
-
-```
-func Sum64(b []byte) uint64
-func Sum64String(s string) uint64
-type Digest struct{ ... }
- func New() *Digest
-```
-
-The `Digest` type implements hash.Hash64. Its key methods are:
-
-```
-func (*Digest) Write([]byte) (int, error)
-func (*Digest) WriteString(string) (int, error)
-func (*Digest) Sum64() uint64
-```
-
-This implementation provides a fast pure-Go implementation and an even faster
-assembly implementation for amd64.
-
-## Compatibility
-
-This package is in a module and the latest code is in version 2 of the module.
-You need a version of Go with at least "minimal module compatibility" to use
-github.com/cespare/xxhash/v2:
-
-* 1.9.7+ for Go 1.9
-* 1.10.3+ for Go 1.10
-* Go 1.11 or later
-
-I recommend using the latest release of Go.
-
-## Benchmarks
-
-Here are some quick benchmarks comparing the pure-Go and assembly
-implementations of Sum64.
-
-| input size | purego | asm |
-| --- | --- | --- |
-| 5 B | 979.66 MB/s | 1291.17 MB/s |
-| 100 B | 7475.26 MB/s | 7973.40 MB/s |
-| 4 KB | 17573.46 MB/s | 17602.65 MB/s |
-| 10 MB | 17131.46 MB/s | 17142.16 MB/s |
-
-These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using
-the following commands under Go 1.11.2:
-
-```
-$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes'
-$ go test -benchtime 10s -bench '/xxhash,direct,bytes'
-```
-
-## Projects using this package
-
-- [InfluxDB](https://github.com/influxdata/influxdb)
-- [Prometheus](https://github.com/prometheus/prometheus)
-- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics)
-- [FreeCache](https://github.com/coocood/freecache)
-- [FastCache](https://github.com/VictoriaMetrics/fastcache)
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash.go b/vendor/github.com/cespare/xxhash/v2/xxhash.go
deleted file mode 100644
index 15c835d..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash.go
+++ /dev/null
@@ -1,235 +0,0 @@
-// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described
-// at http://cyan4973.github.io/xxHash/.
-package xxhash
-
-import (
- "encoding/binary"
- "errors"
- "math/bits"
-)
-
-const (
- prime1 uint64 = 11400714785074694791
- prime2 uint64 = 14029467366897019727
- prime3 uint64 = 1609587929392839161
- prime4 uint64 = 9650029242287828579
- prime5 uint64 = 2870177450012600261
-)
-
-// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where
-// possible in the Go code is worth a small (but measurable) performance boost
-// by avoiding some MOVQs. Vars are needed for the asm and also are useful for
-// convenience in the Go code in a few places where we need to intentionally
-// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the
-// result overflows a uint64).
-var (
- prime1v = prime1
- prime2v = prime2
- prime3v = prime3
- prime4v = prime4
- prime5v = prime5
-)
-
-// Digest implements hash.Hash64.
-type Digest struct {
- v1 uint64
- v2 uint64
- v3 uint64
- v4 uint64
- total uint64
- mem [32]byte
- n int // how much of mem is used
-}
-
-// New creates a new Digest that computes the 64-bit xxHash algorithm.
-func New() *Digest {
- var d Digest
- d.Reset()
- return &d
-}
-
-// Reset clears the Digest's state so that it can be reused.
-func (d *Digest) Reset() {
- d.v1 = prime1v + prime2
- d.v2 = prime2
- d.v3 = 0
- d.v4 = -prime1v
- d.total = 0
- d.n = 0
-}
-
-// Size always returns 8 bytes.
-func (d *Digest) Size() int { return 8 }
-
-// BlockSize always returns 32 bytes.
-func (d *Digest) BlockSize() int { return 32 }
-
-// Write adds more data to d. It always returns len(b), nil.
-func (d *Digest) Write(b []byte) (n int, err error) {
- n = len(b)
- d.total += uint64(n)
-
- if d.n+n < 32 {
- // This new data doesn't even fill the current block.
- copy(d.mem[d.n:], b)
- d.n += n
- return
- }
-
- if d.n > 0 {
- // Finish off the partial block.
- copy(d.mem[d.n:], b)
- d.v1 = round(d.v1, u64(d.mem[0:8]))
- d.v2 = round(d.v2, u64(d.mem[8:16]))
- d.v3 = round(d.v3, u64(d.mem[16:24]))
- d.v4 = round(d.v4, u64(d.mem[24:32]))
- b = b[32-d.n:]
- d.n = 0
- }
-
- if len(b) >= 32 {
- // One or more full blocks left.
- nw := writeBlocks(d, b)
- b = b[nw:]
- }
-
- // Store any remaining partial block.
- copy(d.mem[:], b)
- d.n = len(b)
-
- return
-}
-
-// Sum appends the current hash to b and returns the resulting slice.
-func (d *Digest) Sum(b []byte) []byte {
- s := d.Sum64()
- return append(
- b,
- byte(s>>56),
- byte(s>>48),
- byte(s>>40),
- byte(s>>32),
- byte(s>>24),
- byte(s>>16),
- byte(s>>8),
- byte(s),
- )
-}
-
-// Sum64 returns the current hash.
-func (d *Digest) Sum64() uint64 {
- var h uint64
-
- if d.total >= 32 {
- v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
- h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
- h = mergeRound(h, v1)
- h = mergeRound(h, v2)
- h = mergeRound(h, v3)
- h = mergeRound(h, v4)
- } else {
- h = d.v3 + prime5
- }
-
- h += d.total
-
- i, end := 0, d.n
- for ; i+8 <= end; i += 8 {
- k1 := round(0, u64(d.mem[i:i+8]))
- h ^= k1
- h = rol27(h)*prime1 + prime4
- }
- if i+4 <= end {
- h ^= uint64(u32(d.mem[i:i+4])) * prime1
- h = rol23(h)*prime2 + prime3
- i += 4
- }
- for i < end {
- h ^= uint64(d.mem[i]) * prime5
- h = rol11(h) * prime1
- i++
- }
-
- h ^= h >> 33
- h *= prime2
- h ^= h >> 29
- h *= prime3
- h ^= h >> 32
-
- return h
-}
-
-const (
- magic = "xxh\x06"
- marshaledSize = len(magic) + 8*5 + 32
-)
-
-// MarshalBinary implements the encoding.BinaryMarshaler interface.
-func (d *Digest) MarshalBinary() ([]byte, error) {
- b := make([]byte, 0, marshaledSize)
- b = append(b, magic...)
- b = appendUint64(b, d.v1)
- b = appendUint64(b, d.v2)
- b = appendUint64(b, d.v3)
- b = appendUint64(b, d.v4)
- b = appendUint64(b, d.total)
- b = append(b, d.mem[:d.n]...)
- b = b[:len(b)+len(d.mem)-d.n]
- return b, nil
-}
-
-// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
-func (d *Digest) UnmarshalBinary(b []byte) error {
- if len(b) < len(magic) || string(b[:len(magic)]) != magic {
- return errors.New("xxhash: invalid hash state identifier")
- }
- if len(b) != marshaledSize {
- return errors.New("xxhash: invalid hash state size")
- }
- b = b[len(magic):]
- b, d.v1 = consumeUint64(b)
- b, d.v2 = consumeUint64(b)
- b, d.v3 = consumeUint64(b)
- b, d.v4 = consumeUint64(b)
- b, d.total = consumeUint64(b)
- copy(d.mem[:], b)
- d.n = int(d.total % uint64(len(d.mem)))
- return nil
-}
-
-func appendUint64(b []byte, x uint64) []byte {
- var a [8]byte
- binary.LittleEndian.PutUint64(a[:], x)
- return append(b, a[:]...)
-}
-
-func consumeUint64(b []byte) ([]byte, uint64) {
- x := u64(b)
- return b[8:], x
-}
-
-func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }
-func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }
-
-func round(acc, input uint64) uint64 {
- acc += input * prime2
- acc = rol31(acc)
- acc *= prime1
- return acc
-}
-
-func mergeRound(acc, val uint64) uint64 {
- val = round(0, val)
- acc ^= val
- acc = acc*prime1 + prime4
- return acc
-}
-
-func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) }
-func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) }
-func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
-func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
-func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
-func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
-func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
-func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go b/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go
deleted file mode 100644
index ad14b80..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-//
-//go:noescape
-func Sum64(b []byte) uint64
-
-//go:noescape
-func writeBlocks(d *Digest, b []byte) int
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s b/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s
deleted file mode 100644
index be8db5b..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s
+++ /dev/null
@@ -1,215 +0,0 @@
-// +build !appengine
-// +build gc
-// +build !purego
-
-#include "textflag.h"
-
-// Register allocation:
-// AX h
-// SI pointer to advance through b
-// DX n
-// BX loop end
-// R8 v1, k1
-// R9 v2
-// R10 v3
-// R11 v4
-// R12 tmp
-// R13 prime1v
-// R14 prime2v
-// DI prime4v
-
-// round reads from and advances the buffer pointer in SI.
-// It assumes that R13 has prime1v and R14 has prime2v.
-#define round(r) \
- MOVQ (SI), R12 \
- ADDQ $8, SI \
- IMULQ R14, R12 \
- ADDQ R12, r \
- ROLQ $31, r \
- IMULQ R13, r
-
-// mergeRound applies a merge round on the two registers acc and val.
-// It assumes that R13 has prime1v, R14 has prime2v, and DI has prime4v.
-#define mergeRound(acc, val) \
- IMULQ R14, val \
- ROLQ $31, val \
- IMULQ R13, val \
- XORQ val, acc \
- IMULQ R13, acc \
- ADDQ DI, acc
-
-// func Sum64(b []byte) uint64
-TEXT ·Sum64(SB), NOSPLIT, $0-32
- // Load fixed primes.
- MOVQ ·prime1v(SB), R13
- MOVQ ·prime2v(SB), R14
- MOVQ ·prime4v(SB), DI
-
- // Load slice.
- MOVQ b_base+0(FP), SI
- MOVQ b_len+8(FP), DX
- LEAQ (SI)(DX*1), BX
-
- // The first loop limit will be len(b)-32.
- SUBQ $32, BX
-
- // Check whether we have at least one block.
- CMPQ DX, $32
- JLT noBlocks
-
- // Set up initial state (v1, v2, v3, v4).
- MOVQ R13, R8
- ADDQ R14, R8
- MOVQ R14, R9
- XORQ R10, R10
- XORQ R11, R11
- SUBQ R13, R11
-
- // Loop until SI > BX.
-blockLoop:
- round(R8)
- round(R9)
- round(R10)
- round(R11)
-
- CMPQ SI, BX
- JLE blockLoop
-
- MOVQ R8, AX
- ROLQ $1, AX
- MOVQ R9, R12
- ROLQ $7, R12
- ADDQ R12, AX
- MOVQ R10, R12
- ROLQ $12, R12
- ADDQ R12, AX
- MOVQ R11, R12
- ROLQ $18, R12
- ADDQ R12, AX
-
- mergeRound(AX, R8)
- mergeRound(AX, R9)
- mergeRound(AX, R10)
- mergeRound(AX, R11)
-
- JMP afterBlocks
-
-noBlocks:
- MOVQ ·prime5v(SB), AX
-
-afterBlocks:
- ADDQ DX, AX
-
- // Right now BX has len(b)-32, and we want to loop until SI > len(b)-8.
- ADDQ $24, BX
-
- CMPQ SI, BX
- JG fourByte
-
-wordLoop:
- // Calculate k1.
- MOVQ (SI), R8
- ADDQ $8, SI
- IMULQ R14, R8
- ROLQ $31, R8
- IMULQ R13, R8
-
- XORQ R8, AX
- ROLQ $27, AX
- IMULQ R13, AX
- ADDQ DI, AX
-
- CMPQ SI, BX
- JLE wordLoop
-
-fourByte:
- ADDQ $4, BX
- CMPQ SI, BX
- JG singles
-
- MOVL (SI), R8
- ADDQ $4, SI
- IMULQ R13, R8
- XORQ R8, AX
-
- ROLQ $23, AX
- IMULQ R14, AX
- ADDQ ·prime3v(SB), AX
-
-singles:
- ADDQ $4, BX
- CMPQ SI, BX
- JGE finalize
-
-singlesLoop:
- MOVBQZX (SI), R12
- ADDQ $1, SI
- IMULQ ·prime5v(SB), R12
- XORQ R12, AX
-
- ROLQ $11, AX
- IMULQ R13, AX
-
- CMPQ SI, BX
- JL singlesLoop
-
-finalize:
- MOVQ AX, R12
- SHRQ $33, R12
- XORQ R12, AX
- IMULQ R14, AX
- MOVQ AX, R12
- SHRQ $29, R12
- XORQ R12, AX
- IMULQ ·prime3v(SB), AX
- MOVQ AX, R12
- SHRQ $32, R12
- XORQ R12, AX
-
- MOVQ AX, ret+24(FP)
- RET
-
-// writeBlocks uses the same registers as above except that it uses AX to store
-// the d pointer.
-
-// func writeBlocks(d *Digest, b []byte) int
-TEXT ·writeBlocks(SB), NOSPLIT, $0-40
- // Load fixed primes needed for round.
- MOVQ ·prime1v(SB), R13
- MOVQ ·prime2v(SB), R14
-
- // Load slice.
- MOVQ b_base+8(FP), SI
- MOVQ b_len+16(FP), DX
- LEAQ (SI)(DX*1), BX
- SUBQ $32, BX
-
- // Load vN from d.
- MOVQ d+0(FP), AX
- MOVQ 0(AX), R8 // v1
- MOVQ 8(AX), R9 // v2
- MOVQ 16(AX), R10 // v3
- MOVQ 24(AX), R11 // v4
-
- // We don't need to check the loop condition here; this function is
- // always called with at least one block of data to process.
-blockLoop:
- round(R8)
- round(R9)
- round(R10)
- round(R11)
-
- CMPQ SI, BX
- JLE blockLoop
-
- // Copy vN back to d.
- MOVQ R8, 0(AX)
- MOVQ R9, 8(AX)
- MOVQ R10, 16(AX)
- MOVQ R11, 24(AX)
-
- // The number of bytes written is SI minus the old base pointer.
- SUBQ b_base+8(FP), SI
- MOVQ SI, ret+32(FP)
-
- RET
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go b/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
deleted file mode 100644
index 4a5a821..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_other.go
+++ /dev/null
@@ -1,76 +0,0 @@
-// +build !amd64 appengine !gc purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-func Sum64(b []byte) uint64 {
- // A simpler version would be
- // d := New()
- // d.Write(b)
- // return d.Sum64()
- // but this is faster, particularly for small inputs.
-
- n := len(b)
- var h uint64
-
- if n >= 32 {
- v1 := prime1v + prime2
- v2 := prime2
- v3 := uint64(0)
- v4 := -prime1v
- for len(b) >= 32 {
- v1 = round(v1, u64(b[0:8:len(b)]))
- v2 = round(v2, u64(b[8:16:len(b)]))
- v3 = round(v3, u64(b[16:24:len(b)]))
- v4 = round(v4, u64(b[24:32:len(b)]))
- b = b[32:len(b):len(b)]
- }
- h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
- h = mergeRound(h, v1)
- h = mergeRound(h, v2)
- h = mergeRound(h, v3)
- h = mergeRound(h, v4)
- } else {
- h = prime5
- }
-
- h += uint64(n)
-
- i, end := 0, len(b)
- for ; i+8 <= end; i += 8 {
- k1 := round(0, u64(b[i:i+8:len(b)]))
- h ^= k1
- h = rol27(h)*prime1 + prime4
- }
- if i+4 <= end {
- h ^= uint64(u32(b[i:i+4:len(b)])) * prime1
- h = rol23(h)*prime2 + prime3
- i += 4
- }
- for ; i < end; i++ {
- h ^= uint64(b[i]) * prime5
- h = rol11(h) * prime1
- }
-
- h ^= h >> 33
- h *= prime2
- h ^= h >> 29
- h *= prime3
- h ^= h >> 32
-
- return h
-}
-
-func writeBlocks(d *Digest, b []byte) int {
- v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
- n := len(b)
- for len(b) >= 32 {
- v1 = round(v1, u64(b[0:8:len(b)]))
- v2 = round(v2, u64(b[8:16:len(b)]))
- v3 = round(v3, u64(b[16:24:len(b)]))
- v4 = round(v4, u64(b[24:32:len(b)]))
- b = b[32:len(b):len(b)]
- }
- d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4
- return n - len(b)
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
deleted file mode 100644
index fc9bea7..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build appengine
-
-// This file contains the safe implementations of otherwise unsafe-using code.
-
-package xxhash
-
-// Sum64String computes the 64-bit xxHash digest of s.
-func Sum64String(s string) uint64 {
- return Sum64([]byte(s))
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-func (d *Digest) WriteString(s string) (n int, err error) {
- return d.Write([]byte(s))
-}
diff --git a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go b/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
deleted file mode 100644
index 376e0ca..0000000
--- a/vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// +build !appengine
-
-// This file encapsulates usage of unsafe.
-// xxhash_safe.go contains the safe implementations.
-
-package xxhash
-
-import (
- "unsafe"
-)
-
-// In the future it's possible that compiler optimizations will make these
-// XxxString functions unnecessary by realizing that calls such as
-// Sum64([]byte(s)) don't need to copy s. See https://golang.org/issue/2205.
-// If that happens, even if we keep these functions they can be replaced with
-// the trivial safe code.
-
-// NOTE: The usual way of doing an unsafe string-to-[]byte conversion is:
-//
-// var b []byte
-// bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
-// bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
-// bh.Len = len(s)
-// bh.Cap = len(s)
-//
-// Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough
-// weight to this sequence of expressions that any function that uses it will
-// not be inlined. Instead, the functions below use a different unsafe
-// conversion designed to minimize the inliner weight and allow both to be
-// inlined. There is also a test (TestInlining) which verifies that these are
-// inlined.
-//
-// See https://github.com/golang/go/issues/42739 for discussion.
-
-// Sum64String computes the 64-bit xxHash digest of s.
-// It may be faster than Sum64([]byte(s)) by avoiding a copy.
-func Sum64String(s string) uint64 {
- b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))
- return Sum64(b)
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-// It may be faster than Write([]byte(s)) by avoiding a copy.
-func (d *Digest) WriteString(s string) (n int, err error) {
- d.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})))
- // d.Write always returns len(s), nil.
- // Ignoring the return output and returning these fixed values buys a
- // savings of 6 in the inliner's cost model.
- return len(s), nil
-}
-
-// sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout
-// of the first two words is the same as the layout of a string.
-type sliceHeader struct {
- s string
- cap int
-}
diff --git a/vendor/github.com/dgryski/go-rendezvous/LICENSE b/vendor/github.com/dgryski/go-rendezvous/LICENSE
deleted file mode 100644
index 22080f7..0000000
--- a/vendor/github.com/dgryski/go-rendezvous/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2017-2020 Damian Gryski
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/github.com/dgryski/go-rendezvous/rdv.go b/vendor/github.com/dgryski/go-rendezvous/rdv.go
deleted file mode 100644
index 7a6f820..0000000
--- a/vendor/github.com/dgryski/go-rendezvous/rdv.go
+++ /dev/null
@@ -1,79 +0,0 @@
-package rendezvous
-
-type Rendezvous struct {
- nodes map[string]int
- nstr []string
- nhash []uint64
- hash Hasher
-}
-
-type Hasher func(s string) uint64
-
-func New(nodes []string, hash Hasher) *Rendezvous {
- r := &Rendezvous{
- nodes: make(map[string]int, len(nodes)),
- nstr: make([]string, len(nodes)),
- nhash: make([]uint64, len(nodes)),
- hash: hash,
- }
-
- for i, n := range nodes {
- r.nodes[n] = i
- r.nstr[i] = n
- r.nhash[i] = hash(n)
- }
-
- return r
-}
-
-func (r *Rendezvous) Lookup(k string) string {
- // short-circuit if we're empty
- if len(r.nodes) == 0 {
- return ""
- }
-
- khash := r.hash(k)
-
- var midx int
- var mhash = xorshiftMult64(khash ^ r.nhash[0])
-
- for i, nhash := range r.nhash[1:] {
- if h := xorshiftMult64(khash ^ nhash); h > mhash {
- midx = i + 1
- mhash = h
- }
- }
-
- return r.nstr[midx]
-}
-
-func (r *Rendezvous) Add(node string) {
- r.nodes[node] = len(r.nstr)
- r.nstr = append(r.nstr, node)
- r.nhash = append(r.nhash, r.hash(node))
-}
-
-func (r *Rendezvous) Remove(node string) {
- // find index of node to remove
- nidx := r.nodes[node]
-
- // remove from the slices
- l := len(r.nstr)
- r.nstr[nidx] = r.nstr[l]
- r.nstr = r.nstr[:l]
-
- r.nhash[nidx] = r.nhash[l]
- r.nhash = r.nhash[:l]
-
- // update the map
- delete(r.nodes, node)
- moved := r.nstr[nidx]
- r.nodes[moved] = nidx
-}
-
-func xorshiftMult64(x uint64) uint64 {
- x ^= x >> 12 // a
- x ^= x << 25 // b
- x ^= x >> 27 // c
- return x * 2685821657736338717
-}
diff --git a/vendor/github.com/gin-contrib/sse/.travis.yml b/vendor/github.com/gin-contrib/sse/.travis.yml
deleted file mode 100644
index d0e8fcf..0000000
--- a/vendor/github.com/gin-contrib/sse/.travis.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-language: go
-sudo: false
-go:
- - 1.8.x
- - 1.9.x
- - 1.10.x
- - 1.11.x
- - 1.12.x
- - master
-
-git:
- depth: 10
-
-matrix:
- fast_finish: true
- include:
- - go: 1.11.x
- env: GO111MODULE=on
- - go: 1.12.x
- env: GO111MODULE=on
-
-script:
- - go test -v -covermode=count -coverprofile=coverage.out
-
-after_success:
- - bash <(curl -s https://codecov.io/bash)
diff --git a/vendor/github.com/gin-contrib/sse/LICENSE b/vendor/github.com/gin-contrib/sse/LICENSE
deleted file mode 100644
index 1ff7f37..0000000
--- a/vendor/github.com/gin-contrib/sse/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Manuel Martínez-Almeida
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/vendor/github.com/gin-contrib/sse/README.md b/vendor/github.com/gin-contrib/sse/README.md
deleted file mode 100644
index c9c49cf..0000000
--- a/vendor/github.com/gin-contrib/sse/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Server-Sent Events
-
-[![GoDoc](https://godoc.org/github.com/gin-contrib/sse?status.svg)](https://godoc.org/github.com/gin-contrib/sse)
-[![Build Status](https://travis-ci.org/gin-contrib/sse.svg)](https://travis-ci.org/gin-contrib/sse)
-[![codecov](https://codecov.io/gh/gin-contrib/sse/branch/master/graph/badge.svg)](https://codecov.io/gh/gin-contrib/sse)
-[![Go Report Card](https://goreportcard.com/badge/github.com/gin-contrib/sse)](https://goreportcard.com/report/github.com/gin-contrib/sse)
-
-Server-sent events (SSE) is a technology where a browser receives automatic updates from a server via HTTP connection. The Server-Sent Events EventSource API is [standardized as part of HTML5[1] by the W3C](http://www.w3.org/TR/2009/WD-eventsource-20091029/).
-
-- [Read this great SSE introduction by the HTML5Rocks guys](http://www.html5rocks.com/en/tutorials/eventsource/basics/)
-- [Browser support](http://caniuse.com/#feat=eventsource)
-
-## Sample code
-
-```go
-import "github.com/gin-contrib/sse"
-
-func httpHandler(w http.ResponseWriter, req *http.Request) {
- // data can be a primitive like a string, an integer or a float
- sse.Encode(w, sse.Event{
- Event: "message",
- Data: "some data\nmore data",
- })
-
- // also a complex type, like a map, a struct or a slice
- sse.Encode(w, sse.Event{
- Id: "124",
- Event: "message",
- Data: map[string]interface{}{
- "user": "manu",
- "date": time.Now().Unix(),
- "content": "hi!",
- },
- })
-}
-```
-```
-event: message
-data: some data\\nmore data
-
-id: 124
-event: message
-data: {"content":"hi!","date":1431540810,"user":"manu"}
-
-```
-
-## Content-Type
-
-```go
-fmt.Println(sse.ContentType)
-```
-```
-text/event-stream
-```
-
-## Decoding support
-
-There is a client-side implementation of SSE coming soon.
diff --git a/vendor/github.com/gin-contrib/sse/sse-decoder.go b/vendor/github.com/gin-contrib/sse/sse-decoder.go
deleted file mode 100644
index fd49b9c..0000000
--- a/vendor/github.com/gin-contrib/sse/sse-decoder.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
-// Use of this source code is governed by a MIT style
-// license that can be found in the LICENSE file.
-
-package sse
-
-import (
- "bytes"
- "io"
- "io/ioutil"
-)
-
-type decoder struct {
- events []Event
-}
-
-func Decode(r io.Reader) ([]Event, error) {
- var dec decoder
- return dec.decode(r)
-}
-
-func (d *decoder) dispatchEvent(event Event, data string) {
- dataLength := len(data)
- if dataLength > 0 {
- //If the data buffer's last character is a U+000A LINE FEED (LF) character, then remove the last character from the data buffer.
- data = data[:dataLength-1]
- dataLength--
- }
- if dataLength == 0 && event.Event == "" {
- return
- }
- if event.Event == "" {
- event.Event = "message"
- }
- event.Data = data
- d.events = append(d.events, event)
-}
-
-func (d *decoder) decode(r io.Reader) ([]Event, error) {
- buf, err := ioutil.ReadAll(r)
- if err != nil {
- return nil, err
- }
-
- var currentEvent Event
- var dataBuffer *bytes.Buffer = new(bytes.Buffer)
- // TODO (and unit tests)
- // Lines must be separated by either a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair,
- // a single U+000A LINE FEED (LF) character,
- // or a single U+000D CARRIAGE RETURN (CR) character.
- lines := bytes.Split(buf, []byte{'\n'})
- for _, line := range lines {
- if len(line) == 0 {
- // If the line is empty (a blank line). Dispatch the event.
- d.dispatchEvent(currentEvent, dataBuffer.String())
-
- // reset current event and data buffer
- currentEvent = Event{}
- dataBuffer.Reset()
- continue
- }
- if line[0] == byte(':') {
- // If the line starts with a U+003A COLON character (:), ignore the line.
- continue
- }
-
- var field, value []byte
- colonIndex := bytes.IndexRune(line, ':')
- if colonIndex != -1 {
- // If the line contains a U+003A COLON character character (:)
- // Collect the characters on the line before the first U+003A COLON character (:),
- // and let field be that string.
- field = line[:colonIndex]
- // Collect the characters on the line after the first U+003A COLON character (:),
- // and let value be that string.
- value = line[colonIndex+1:]
- // If value starts with a single U+0020 SPACE character, remove it from value.
- if len(value) > 0 && value[0] == ' ' {
- value = value[1:]
- }
- } else {
- // Otherwise, the string is not empty but does not contain a U+003A COLON character character (:)
- // Use the whole line as the field name, and the empty string as the field value.
- field = line
- value = []byte{}
- }
- // The steps to process the field given a field name and a field value depend on the field name,
- // as given in the following list. Field names must be compared literally,
- // with no case folding performed.
- switch string(field) {
- case "event":
- // Set the event name buffer to field value.
- currentEvent.Event = string(value)
- case "id":
- // Set the event stream's last event ID to the field value.
- currentEvent.Id = string(value)
- case "retry":
- // If the field value consists of only characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9),
- // then interpret the field value as an integer in base ten, and set the event stream's reconnection time to that integer.
- // Otherwise, ignore the field.
- currentEvent.Id = string(value)
- case "data":
- // Append the field value to the data buffer,
- dataBuffer.Write(value)
- // then append a single U+000A LINE FEED (LF) character to the data buffer.
- dataBuffer.WriteString("\n")
- default:
- //Otherwise. The field is ignored.
- continue
- }
- }
- // Once the end of the file is reached, the user agent must dispatch the event one final time.
- d.dispatchEvent(currentEvent, dataBuffer.String())
-
- return d.events, nil
-}
diff --git a/vendor/github.com/gin-contrib/sse/sse-encoder.go b/vendor/github.com/gin-contrib/sse/sse-encoder.go
deleted file mode 100644
index f9c8087..0000000
--- a/vendor/github.com/gin-contrib/sse/sse-encoder.go
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2014 Manu Martinez-Almeida. All rights reserved.
-// Use of this source code is governed by a MIT style
-// license that can be found in the LICENSE file.
-
-package sse
-
-import (
- "encoding/json"
- "fmt"
- "io"
- "net/http"
- "reflect"
- "strconv"
- "strings"
-)
-
-// Server-Sent Events
-// W3C Working Draft 29 October 2009
-// http://www.w3.org/TR/2009/WD-eventsource-20091029/
-
-const ContentType = "text/event-stream"
-
-var contentType = []string{ContentType}
-var noCache = []string{"no-cache"}
-
-var fieldReplacer = strings.NewReplacer(
- "\n", "\\n",
- "\r", "\\r")
-
-var dataReplacer = strings.NewReplacer(
- "\n", "\ndata:",
- "\r", "\\r")
-
-type Event struct {
- Event string
- Id string
- Retry uint
- Data interface{}
-}
-
-func Encode(writer io.Writer, event Event) error {
- w := checkWriter(writer)
- writeId(w, event.Id)
- writeEvent(w, event.Event)
- writeRetry(w, event.Retry)
- return writeData(w, event.Data)
-}
-
-func writeId(w stringWriter, id string) {
- if len(id) > 0 {
- w.WriteString("id:")
- fieldReplacer.WriteString(w, id)
- w.WriteString("\n")
- }
-}
-
-func writeEvent(w stringWriter, event string) {
- if len(event) > 0 {
- w.WriteString("event:")
- fieldReplacer.WriteString(w, event)
- w.WriteString("\n")
- }
-}
-
-func writeRetry(w stringWriter, retry uint) {
- if retry > 0 {
- w.WriteString("retry:")
- w.WriteString(strconv.FormatUint(uint64(retry), 10))
- w.WriteString("\n")
- }
-}
-
-func writeData(w stringWriter, data interface{}) error {
- w.WriteString("data:")
- switch kindOfData(data) {
- case reflect.Struct, reflect.Slice, reflect.Map:
- err := json.NewEncoder(w).Encode(data)
- if err != nil {
- return err
- }
- w.WriteString("\n")
- default:
- dataReplacer.WriteString(w, fmt.Sprint(data))
- w.WriteString("\n\n")
- }
- return nil
-}
-
-func (r Event) Render(w http.ResponseWriter) error {
- r.WriteContentType(w)
- return Encode(w, r)
-}
-
-func (r Event) WriteContentType(w http.ResponseWriter) {
- header := w.Header()
- header["Content-Type"] = contentType
-
- if _, exist := header["Cache-Control"]; !exist {
- header["Cache-Control"] = noCache
- }
-}
-
-func kindOfData(data interface{}) reflect.Kind {
- value := reflect.ValueOf(data)
- valueType := value.Kind()
- if valueType == reflect.Ptr {
- valueType = value.Elem().Kind()
- }
- return valueType
-}
diff --git a/vendor/github.com/gin-contrib/sse/writer.go b/vendor/github.com/gin-contrib/sse/writer.go
deleted file mode 100644
index 6f9806c..0000000
--- a/vendor/github.com/gin-contrib/sse/writer.go
+++ /dev/null
@@ -1,24 +0,0 @@
-package sse
-
-import "io"
-
-type stringWriter interface {
- io.Writer
- WriteString(string) (int, error)
-}
-
-type stringWrapper struct {
- io.Writer
-}
-
-func (w stringWrapper) WriteString(str string) (int, error) {
- return w.Writer.Write([]byte(str))
-}
-
-func checkWriter(writer io.Writer) stringWriter {
- if w, ok := writer.(stringWriter); ok {
- return w
- } else {
- return stringWrapper{writer}
- }
-}
diff --git a/vendor/github.com/gin-gonic/gin/.gitignore b/vendor/github.com/gin-gonic/gin/.gitignore
deleted file mode 100644
index bdd50c9..0000000
--- a/vendor/github.com/gin-gonic/gin/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-vendor/*
-!vendor/vendor.json
-coverage.out
-count.out
-test
-profile.out
-tmp.out
diff --git a/vendor/github.com/gin-gonic/gin/.golangci.yml b/vendor/github.com/gin-gonic/gin/.golangci.yml
deleted file mode 100644
index c5e1de3..0000000
--- a/vendor/github.com/gin-gonic/gin/.golangci.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-run:
- timeout: 5m
-linters:
- enable:
- - asciicheck
- - depguard
- - dogsled
- - durationcheck
- - errcheck
- - errorlint
- - exportloopref
- - gci
- - gofmt
- - goimports
- - gosec
- - misspell
- - nakedret
- - nilerr
- - nolintlint
- - revive
- - wastedassign
-issues:
- exclude-rules:
- - linters:
- - structcheck
- - unused
- text: "`data` is unused"
- - linters:
- - staticcheck
- text: "SA1019:"
- - linters:
- - revive
- text: "var-naming:"
- - linters:
- - revive
- text: "exported:"
- - path: _test\.go
- linters:
- - gosec # security is not make sense in tests
diff --git a/vendor/github.com/gin-gonic/gin/.goreleaser.yaml b/vendor/github.com/gin-gonic/gin/.goreleaser.yaml
deleted file mode 100644
index e435e56..0000000
--- a/vendor/github.com/gin-gonic/gin/.goreleaser.yaml
+++ /dev/null
@@ -1,57 +0,0 @@
-project_name: gin
-
-builds:
- -
- # If true, skip the build.
- # Useful for library projects.
- # Default is false
- skip: true
-
-changelog:
- # Set it to true if you wish to skip the changelog generation.
- # This may result in an empty release notes on GitHub/GitLab/Gitea.
- skip: false
-
- # Changelog generation implementation to use.
- #
- # Valid options are:
- # - `git`: uses `git log`;
- # - `github`: uses the compare GitHub API, appending the author login to the changelog.
- # - `gitlab`: uses the compare GitLab API, appending the author name and email to the changelog.
- # - `github-native`: uses the GitHub release notes generation API, disables the groups feature.
- #
- # Defaults to `git`.
- use: git
-
- # Sorts the changelog by the commit's messages.
- # Could either be asc, desc or empty
- # Default is empty
- sort: asc
-
- # Group commits messages by given regex and title.
- # Order value defines the order of the groups.
- # Proving no regex means all commits will be grouped under the default group.
- # Groups are disabled when using github-native, as it already groups things by itself.
- #
- # Default is no groups.
- groups:
- - title: Features
- regexp: "^.*feat[(\\w)]*:+.*$"
- order: 0
- - title: 'Bug fixes'
- regexp: "^.*fix[(\\w)]*:+.*$"
- order: 1
- - title: 'Enhancements'
- regexp: "^.*chore[(\\w)]*:+.*$"
- order: 2
- - title: Others
- order: 999
-
- filters:
- # Commit messages matching the regexp listed here will be removed from
- # the changelog
- # Default is empty
- exclude:
- - '^docs'
- - 'CICD'
- - typo
diff --git a/vendor/github.com/gin-gonic/gin/AUTHORS.md b/vendor/github.com/gin-gonic/gin/AUTHORS.md
deleted file mode 100644
index b4773ef..0000000
--- a/vendor/github.com/gin-gonic/gin/AUTHORS.md
+++ /dev/null
@@ -1,406 +0,0 @@
-List of all the awesome people working to make Gin the best Web Framework in Go.
-
-## gin 1.x series authors
-
-**Gin Core Team:** Bo-Yi Wu (@appleboy), thinkerou (@thinkerou), Javier Provecho (@javierprovecho)
-
-## gin 0.x series authors
-
-**Maintainers:** Manu Martinez-Almeida (@manucorporat), Javier Provecho (@javierprovecho)
-
-------
-
-People and companies, who have contributed, in alphabetical order.
-
-- 178inaba <178inaba@users.noreply.github.com>
-- A. F
-- ABHISHEK SONI
-- Abhishek Chanda
-- Abner Chen
-- AcoNCodes
-- Adam Dratwinski
-- Adam Mckaig
-- Adam Zielinski
-- Adonis
-- Alan Wang
-- Albin Gilles
-- Aleksandr Didenko
-- Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
-- Alex
-- Alexander
-- Alexander Lokhman
-- Alexander Melentyev <55826637+alexander-melentyev@users.noreply.github.com>
-- Alexander Nyquist
-- Allen Ren
-- AllinGo
-- Ammar Bandukwala
-- An Xiao (Luffy)
-- Andre Dublin <81dublin@gmail.com>
-- Andrew Szeto
-- Andrey Abramov
-- Andrey Nering
-- Andrey Smirnov
-- Andrii Bubis
-- André Bazaglia
-- Andy Pan
-- Antoine GIRARD
-- Anup Kumar Panwar <1anuppanwar@gmail.com>
-- Aravinth Sundaram
-- Artem
-- Ashwani
-- Aurelien Regat-Barrel
-- Austin Heap
-- Barnabus
-- Bo-Yi Wu
-- Boris Borshevsky
-- Boyi Wu
-- BradyBromley <51128276+BradyBromley@users.noreply.github.com>
-- Brendan Fosberry
-- Brian Wigginton
-- Carlos Eduardo
-- Chad Russell
-- Charles
-- Christian Muehlhaeuser
-- Christian Persson
-- Christopher Harrington
-- Damon Zhao
-- Dan Markham
-- Dang Nguyen
-- Daniel Krom
-- Daniel M. Lambea
-- Danieliu
-- David Irvine
-- David Zhang
-- Davor Kapsa
-- DeathKing
-- Dennis Cho <47404603+forest747@users.noreply.github.com>
-- Dmitry Dorogin
-- Dmitry Kutakov
-- Dmitry Sedykh
-- Don2Quixote <35610661+Don2Quixote@users.noreply.github.com>
-- Donn Pebe
-- Dustin Decker
-- Eason Lin
-- Edward Betts
-- Egor Seredin <4819888+agmt@users.noreply.github.com>
-- Emmanuel Goh
-- Equim
-- Eren A. Akyol
-- Eric_Lee
-- Erik Bender
-- Ethan Kan
-- Evgeny Persienko
-- Faisal Alam
-- Fareed Dudhia
-- Filip Figiel
-- Florian Polster
-- Frank Bille
-- Franz Bettag
-- Ganlv
-- Gaozhen Ying
-- George Gabolaev
-- George Kirilenko
-- Georges Varouchas
-- Gordon Tyler
-- Harindu Perera
-- Helios <674876158@qq.com>
-- Henry Kwan
-- Henry Yee
-- Himanshu Mishra
-- Hiroyuki Tanaka
-- Ibraheem Ahmed
-- Ignacio Galindo
-- Igor H. Vieira
-- Ildar1111 <54001462+Ildar1111@users.noreply.github.com>
-- Iskander (Alex) Sharipov
-- Ismail Gjevori
-- Ivan Chen
-- JINNOUCHI Yasushi
-- James Pettyjohn
-- Jamie Stackhouse
-- Jason Lee
-- Javier Provecho
-- Javier Provecho
-- Javier Provecho
-- Javier Provecho Fernandez
-- Javier Provecho Fernandez
-- Jean-Christophe Lebreton
-- Jeff
-- Jeremy Loy
-- Jim Filippou
-- Jimmy Pettersson
-- John Bampton
-- Johnny Dallas
-- Johnny Dallas
-- Jonathan (JC) Chen
-- Josep Jesus Bigorra Algaba <42377845+averageflow@users.noreply.github.com>
-- Josh Horowitz
-- Joshua Loper
-- Julien Schmidt
-- Jun Kimura
-- Justin Beckwith
-- Justin Israel
-- Justin Mayhew
-- Jérôme Laforge
-- Kacper Bąk <56700396+53jk1@users.noreply.github.com>
-- Kamron Batman
-- Kane Rogers
-- Kaushik Neelichetty
-- Keiji Yoshida
-- Kel Cecil
-- Kevin Mulvey
-- Kevin Zhu
-- Kirill Motkov
-- Klemen Sever
-- Kristoffer A. Iversen
-- Krzysztof Szafrański
-- Kumar McMillan
-- Kyle Mcgill
-- Lanco <35420416+lancoLiu@users.noreply.github.com>
-- Levi Olson
-- Lin Kao-Yuan
-- Linus Unnebäck
-- Lucas Clemente
-- Ludwig Valda Vasquez
-- Luis GG
-- MW Lim
-- Maksimov Sergey
-- Manjusaka
-- Manu MA
-- Manu MA
-- Manu Mtz-Almeida
-- Manu Mtz.-Almeida
-- Manuel Alonso
-- Mara Kim
-- Mario Kostelac
-- Martin Karlsch
-- Matt Newberry
-- Matt Williams
-- Matthieu MOREL
-- Max Hilbrunner
-- Maxime Soulé
-- MetalBreaker
-- Michael Puncel
-- MichaelDeSteven <51652084+MichaelDeSteven@users.noreply.github.com>
-- Mike <38686456+icy4ever@users.noreply.github.com>
-- Mike Stipicevic
-- Miki Tebeka
-- Miles
-- Mirza Ceric
-- Mykyta Semenistyi
-- Naoki Takano
-- Ngalim Siregar
-- Ni Hao
-- Nick Gerakines
-- Nikifor Seryakov
-- Notealot <714804968@qq.com>
-- Olivier Mengué
-- Olivier Robardet
-- Pablo Moncada
-- Pablo Moncada
-- Panmax <967168@qq.com>
-- Peperoncino <2wua4nlyi@gmail.com>
-- Philipp Meinen
-- Pierre Massat
-- Qt
-- Quentin ROYER
-- README Bot <35302948+codetriage-readme-bot@users.noreply.github.com>
-- Rafal Zajac
-- Rahul Datta Roy
-- Rajiv Kilaparti
-- Raphael Gavache
-- Ray Rodriguez
-- Regner Blok-Andersen
-- Remco
-- Rex Lee(李俊)
-- Richard Lee
-- Riverside
-- Robert Wilkinson
-- Rogier Lommers
-- Rohan Pai
-- Romain Beuque
-- Roman Belyakovsky
-- Roman Zaynetdinov <627197+zaynetro@users.noreply.github.com>
-- Roman Zaynetdinov
-- Ronald Petty
-- Ross Wolf <31489089+rw-access@users.noreply.github.com>
-- Roy Lou
-- Rubi <14269809+codenoid@users.noreply.github.com>
-- Ryan <46182144+ryanker@users.noreply.github.com>
-- Ryan J. Yoder
-- SRK.Lyu
-- Sai
-- Samuel Abreu
-- Santhosh Kumar
-- Sasha Melentyev
-- Sasha Myasoedov
-- Segev Finer
-- Sergey Egorov
-- Sergey Fedchenko
-- Sergey Gonimar
-- Sergey Ponomarev
-- Serica <943914044@qq.com>
-- Shamus Taylor
-- Shilin Wang
-- Shuo
-- Skuli Oskarsson
-- Snawoot
-- Sridhar Ratnakumar
-- Steeve Chailloux
-- Sudhir Mishra
-- Suhas Karanth
-- TaeJun Park
-- Tatsuya Hoshino
-- Tevic
-- Tevin Jeffrey
-- The Gitter Badger
-- Thibault Jamet
-- Thomas Boerger
-- Thomas Schaffer
-- Tommy Chu
-- Tudor Roman
-- Uwe Dauernheim
-- Valentine Oragbakosi
-- Vas N
-- Vasilyuk Vasiliy
-- Victor Castell
-- Vince Yuan
-- Vyacheslav Dubinin
-- Waynerv
-- Weilin Shi <934587911@qq.com>
-- Xudong Cai
-- Yasuhiro Matsumoto
-- Yehezkiel Syamsuhadi
-- Yoshiki Nakagawa
-- Yoshiyuki Kinjo
-- Yue Yang
-- ZYunH
-- Zach Newburgh
-- Zasda Yusuf Mikail
-- ZhangYunHao
-- ZhiFeng Hu
-- Zhu Xi
-- a2tt
-- ahuigo <1781999+ahuigo@users.noreply.github.com>
-- ali
-- aljun
-- andrea
-- andriikushch
-- anoty
-- awkj
-- axiaoxin <254606826@qq.com>
-- bbiao
-- bestgopher <84328409@qq.com>
-- betahu
-- bigwheel
-- bn4t <17193640+bn4t@users.noreply.github.com>
-- bullgare
-- chainhelen