Compare commits
No commits in common. "master" and "1.1.1" have entirely different histories.
157
.drone.yml
157
.drone.yml
@ -1,74 +1,89 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: build-linux
|
name: cleanup-before
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-linux-amd64
|
- name: clean
|
||||||
image: golang
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
|
- rm -rf /build/*
|
||||||
environment:
|
volumes:
|
||||||
GOOS: linux
|
- name: build
|
||||||
GOARCH: amd64
|
path: /build
|
||||||
GOOPTIONS: -mod=vendor
|
|
||||||
SRCFILES: cmd/coronafana/*.go
|
|
||||||
PROJECTNAME: coronafana
|
|
||||||
when:
|
when:
|
||||||
event:
|
event: tag
|
||||||
exclude:
|
|
||||||
- tag
|
volumes:
|
||||||
- name: build-linux-arm64
|
- name: build
|
||||||
image: golang
|
host:
|
||||||
commands:
|
path: /tmp/coronafana/build
|
||||||
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
|
|
||||||
environment:
|
|
||||||
GOOS: linux
|
|
||||||
GOARCH: arm64
|
|
||||||
GOOPTIONS: -mod=vendor
|
|
||||||
SRCFILES: cmd/coronafana/*.go
|
|
||||||
PROJECTNAME: coronafana
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
exclude:
|
|
||||||
- tag
|
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: gitea-release-linux
|
name: default-linux-amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-linux-amd64
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
commands:
|
commands:
|
||||||
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
|
- ./ci-build.sh build
|
||||||
- tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME
|
|
||||||
- echo $PROJECTNAME $DRONE_TAG > VERSION
|
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: amd64
|
GOARCH: amd64
|
||||||
GOOPTIONS: -mod=vendor
|
volumes:
|
||||||
SRCFILES: cmd/coronafana/*.go
|
- name: build
|
||||||
PROJECTNAME: coronafana
|
path: /build
|
||||||
when:
|
|
||||||
event:
|
volumes:
|
||||||
- tag
|
- name: build
|
||||||
- name: build-linux-arm64
|
host:
|
||||||
|
path: /tmp/coronafana/build
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- cleanup-before
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: default-linux-arm64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: build
|
||||||
image: golang
|
image: golang
|
||||||
commands:
|
commands:
|
||||||
- go build -o $PROJECTNAME $GOOPTIONS $SRCFILES
|
- ./ci-build.sh build
|
||||||
- tar -czvf $PROJECTNAME-$DRONE_TAG-$GOOS-$GOARCH.tar.gz $PROJECTNAME
|
|
||||||
- echo $PROJECTNAME $DRONE_TAG > VERSION
|
|
||||||
environment:
|
environment:
|
||||||
GOOS: linux
|
GOOS: linux
|
||||||
GOARCH: arm64
|
GOARCH: arm64
|
||||||
GOOPTIONS: -mod=vendor
|
volumes:
|
||||||
SRCFILES: cmd/coronafana/*.go
|
- name: build
|
||||||
PROJECTNAME: coronafana
|
path: /build
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
host:
|
||||||
|
path: /tmp/coronafana/build
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- cleanup-before
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: gitea-release
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: move
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- mv build/* ./
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
path: /drone/src/build
|
||||||
when:
|
when:
|
||||||
event:
|
event: tag
|
||||||
- tag
|
|
||||||
- name: release
|
- name: release
|
||||||
image: plugins/gitea-release
|
image: plugins/gitea-release
|
||||||
settings:
|
settings:
|
||||||
@ -80,6 +95,50 @@ steps:
|
|||||||
- sha256
|
- sha256
|
||||||
- sha512
|
- sha512
|
||||||
title: VERSION
|
title: VERSION
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
path: /drone/src/build
|
||||||
when:
|
when:
|
||||||
event:
|
event: tag
|
||||||
- tag
|
- name: ls
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- find .
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
path: /drone/src/build
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
host:
|
||||||
|
path: /tmp/coronafana/build
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- default-linux-amd64
|
||||||
|
- default-linux-arm64
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: cleanup-after
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: clean
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- rm -rf /build/*
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
path: /build
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: build
|
||||||
|
host:
|
||||||
|
path: /tmp/coronafana/build
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- gitea-release
|
||||||
|
19
Makefile
Normal file
19
Makefile
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# coronafana Makefile
|
||||||
|
|
||||||
|
GOCMD=go
|
||||||
|
GOBUILDCMD=${GOCMD} build
|
||||||
|
GOOPTIONS=-mod=vendor -ldflags="-s -w"
|
||||||
|
PACKRCMD=${GOPATH}/bin/packr2
|
||||||
|
|
||||||
|
RMCMD=rm
|
||||||
|
BINNAME=coronafana
|
||||||
|
|
||||||
|
SRCFILES=cmd/coronafana/*.go
|
||||||
|
|
||||||
|
all: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
${GOBUILDCMD} ${GOOPTIONS} ${SRCFILES}
|
||||||
|
|
||||||
|
clean:
|
||||||
|
${RMCMD} -f ${BINNAME}
|
60
ci-build.sh
Executable file
60
ci-build.sh
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
PROJECTNAME=coronafana
|
||||||
|
RELEASENAME=${PROJECTNAME}
|
||||||
|
VERSION="0"
|
||||||
|
|
||||||
|
GOOPTIONS="-mod=vendor"
|
||||||
|
SRCFILES=cmd/coronafana/*.go
|
||||||
|
|
||||||
|
build() {
|
||||||
|
echo "Begin of build"
|
||||||
|
if [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
|
echo "Drone tag set, let's do a release"
|
||||||
|
VERSION=$DRONE_TAG
|
||||||
|
echo "${PROJECTNAME} ${VERSION}" > /build/VERSION
|
||||||
|
elif [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
|
echo "Drone not set, let's only do a build"
|
||||||
|
VERSION=$DRONE_COMMIT
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -z $VERSION && ! -z $GOOS && ! -z $GOARCH ]]
|
||||||
|
then
|
||||||
|
echo "Let's set a release name"
|
||||||
|
RELEASENAME=${PROJECTNAME}-${VERSION}-${GOOS}-${GOARCH}
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Building project"
|
||||||
|
go build -o ${PROJECTNAME} ${GOOPTIONS} ${SRCFILES}
|
||||||
|
|
||||||
|
if [[ ! -z $DRONE_TAG ]]
|
||||||
|
then
|
||||||
|
echo "Let's make archives"
|
||||||
|
mkdir -p /build
|
||||||
|
tar -czvf /build/${RELEASENAME}.tar.gz ${PROJECTNAME}
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Removing binary file"
|
||||||
|
rm ${PROJECTNAME}
|
||||||
|
|
||||||
|
echo "End of build"
|
||||||
|
}
|
||||||
|
|
||||||
|
clean() {
|
||||||
|
rm -rf $RELEASEDIR
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"build")
|
||||||
|
build
|
||||||
|
;;
|
||||||
|
"clean")
|
||||||
|
clean
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "No options choosen"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
@ -45,13 +45,12 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tr, dialer, dialerctx, err := network.InitTorSession()
|
tr, dialer, dialerctx, err := network.InitTorSession()
|
||||||
defer dialerctx()
|
|
||||||
defer tr.Close()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
defer dialerctx()
|
||||||
|
defer tr.Close()
|
||||||
|
|
||||||
cr, err = coronafana.GetData(cfg, dialer)
|
cr, err = coronafana.GetData(cfg, dialer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
30
go.mod
30
go.mod
@ -1,22 +1,24 @@
|
|||||||
module git.paulbsd.com/paulbsd/coronafana
|
module git.paulbsd.com/paulbsd/coronafana
|
||||||
|
|
||||||
go 1.21
|
go 1.16
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/cretz/bine v0.2.0
|
github.com/cretz/bine v0.1.0
|
||||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||||
github.com/denisenkom/go-mssqldb v0.12.3 // indirect
|
github.com/denisenkom/go-mssqldb v0.9.0 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.7.1
|
github.com/go-sql-driver/mysql v1.6.0
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20210406100015-1e088ea4ee04 // indirect
|
||||||
github.com/jinzhu/gorm v1.9.16
|
github.com/jinzhu/gorm v1.9.16
|
||||||
github.com/jinzhu/now v1.1.5 // indirect
|
github.com/jinzhu/now v1.1.2 // indirect
|
||||||
github.com/jmoiron/sqlx v1.3.5
|
github.com/jmoiron/sqlx v1.3.1
|
||||||
github.com/lib/pq v1.10.7 // indirect
|
github.com/lib/pq v1.10.0 // indirect
|
||||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
github.com/mattn/go-sqlite3 v2.0.3+incompatible // indirect
|
||||||
golang.org/x/crypto v0.13.0 // indirect
|
github.com/smartystreets/assertions v1.2.0 // indirect
|
||||||
golang.org/x/net v0.15.0 // indirect
|
github.com/smartystreets/goconvey v1.6.4 // indirect
|
||||||
golang.org/x/sys v0.12.0 // indirect
|
github.com/stretchr/testify v1.7.0 // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0
|
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
|
||||||
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
|
||||||
|
gopkg.in/ini.v1 v1.62.0
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require github.com/jinzhu/inflection v1.0.0 // indirect
|
|
||||||
|
87
go.sum
87
go.sum
@ -1,103 +1,80 @@
|
|||||||
github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw=
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.11.0/go.mod h1:HcM1YX14R7CJcghJGOYCgdezslRSVzqwLf/q+4Y2r/0=
|
|
||||||
github.com/Azure/azure-sdk-for-go/sdk/internal v0.7.0/go.mod h1:yqy467j36fJxcRV2TzfVZ1pCb5vxm4BtZPUdYWe/Xo8=
|
|
||||||
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||||
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||||
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
|
github.com/cretz/bine v0.1.0 h1:1/fvhLE+fk0bPzjdO5Ci+0ComYxEMuB1JhM4X5skT3g=
|
||||||
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=
|
github.com/cretz/bine v0.1.0/go.mod h1:6PF6fWAvYtwjRGkAuDEJeWNOv3a2hUouSP/yRYXmvHw=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||||
github.com/denisenkom/go-mssqldb v0.12.3 h1:pBSGx9Tq67pBOTLmxNuirNTeB8Vjmf886Kx+8Y+8shw=
|
github.com/denisenkom/go-mssqldb v0.9.0 h1:RSohk2RsiZqLZ0zCjtfn3S4Gp4exhpBWHyQ7D0yGjAk=
|
||||||
github.com/denisenkom/go-mssqldb v0.12.3/go.mod h1:k0mtMFOnU+AihqFxPMiF05rtiDrorD1Vrm1KEz5hxDo=
|
github.com/denisenkom/go-mssqldb v0.9.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||||
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
|
|
||||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
||||||
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
||||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
|
||||||
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
|
||||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
|
||||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
|
||||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
|
||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
||||||
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||||
github.com/golang-sql/sqlexp v0.1.0 h1:ZCD6MBpcuOVfGVqsEmY5/4FtYiKz6tSyUv9LPEDei6A=
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
github.com/golang-sql/sqlexp v0.1.0/go.mod h1:J4ad9Vo8ZCWQ2GMrC4UCQy1JpCbwU9m3EOqtpKwwwHI=
|
github.com/gopherjs/gopherjs v0.0.0-20210406100015-1e088ea4ee04 h1:Enykqupm0u6qiUZAc+SiFkMJVqt4o8knNcKJu8NdlJ0=
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20210406100015-1e088ea4ee04/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
|
github.com/jinzhu/gorm v1.9.16 h1:+IyIjPEABKRpsu/F8OvDPy9fyQlgsg2luMV2ZIH5i5o=
|
||||||
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
|
github.com/jinzhu/gorm v1.9.16/go.mod h1:G3LB3wezTOWM2ITLzPxEXgSkOXAntiLHS7UdBefADcs=
|
||||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
github.com/jinzhu/now v1.1.2 h1:eVKgfIdy9b6zbWBMgFpfDPoAMifwSZagU9HmEU6zgiI=
|
||||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
github.com/jmoiron/sqlx v1.3.5 h1:vFFPA71p1o5gAeqtEAwLU4dnX2napprKtHr7PYIcN3g=
|
github.com/jmoiron/sqlx v1.3.1 h1:aLN7YINNZ7cYOPK3QC83dbM6KT0NMqVMw961TqrejlE=
|
||||||
github.com/jmoiron/sqlx v1.3.5/go.mod h1:nRVWtLre0KfCLJvgxzCsLVMogSvQ1zNJtpYr2Ccp0mQ=
|
github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ=
|
||||||
|
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
|
||||||
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
|
github.com/lib/pq v1.10.0 h1:Zx5DJFEYQXio93kgXnQ09fXNiUKsqv4OUEu2UtGcB1E=
|
||||||
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
|
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
|
||||||
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
||||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
|
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
|
||||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
|
|
||||||
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA=
|
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
|
github.com/smartystreets/assertions v1.2.0 h1:42S6lae5dvLc7BrLu/0ugRtcFVjoJNMC/N3yZFZkDFs=
|
||||||
|
github.com/smartystreets/assertions v1.2.0/go.mod h1:tcbTF8ujkAEcZ8TElKY+i30BzYlVhC/LOxJk7iOWnoo=
|
||||||
|
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
|
||||||
|
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 h1:It14KIkyBFYkHkwZ7k45minvA9aorojkyjGk9KJ5B/w=
|
||||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
|
||||||
golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU=
|
|
||||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
|
||||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
|
||||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
|
||||||
golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck=
|
|
||||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
|
||||||
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
|
||||||
golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
|
||||||
golang.org/x/net v0.1.0 h1:hZ/3BUoy5aId7sCpA/Tc5lt8DkFgdVS2onTpJsZ/fl0=
|
|
||||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
|
||||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
|
||||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
|
||||||
golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8=
|
|
||||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 h1:F5Gozwx4I1xtr/sr/8CFbb57iKi3297KFs0QDbGN60A=
|
||||||
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
|
||||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
|
||||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
|
gopkg.in/ini.v1 v1.62.0 h1:duBzk771uxoUuOlyRLkHsygud9+5lrlGjdFBb4mSKDU=
|
||||||
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
|
||||||
|
@ -3,7 +3,7 @@ package coronafana
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
@ -31,7 +31,7 @@ func GetData(cfg config.Config, d *tor.Dialer) (cr Coronafana, err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
body, err := ioutil.ReadAll(resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -72,7 +72,7 @@ func (cr Coronafana) InsertGlobalData(cfg config.Config, db sqlx.DB) (err error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
log.Println(fmt.Sprintf("%d global entries to insert", i))
|
log.Println(fmt.Sprintf("%d global entries to inserted", i))
|
||||||
} else {
|
} else {
|
||||||
log.Println("No entry inserted")
|
log.Println("No entry inserted")
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ func (cr Coronafana) InsertPaysData(cfg config.Config, db sqlx.DB) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
log.Println(fmt.Sprintf("%d global entries to insert", i))
|
log.Println(fmt.Sprintf("%d global entries to inserted", i))
|
||||||
} else {
|
} else {
|
||||||
log.Println("No entry inserted")
|
log.Println("No entry inserted")
|
||||||
}
|
}
|
||||||
|
19
vendor/github.com/cretz/bine/process/process.go
generated
vendored
19
vendor/github.com/cretz/bine/process/process.go
generated
vendored
@ -40,26 +40,25 @@ type Creator interface {
|
|||||||
New(ctx context.Context, args ...string) (Process, error)
|
New(ctx context.Context, args ...string) (Process, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type CmdCreatorFunc func(ctx context.Context, args ...string) (*exec.Cmd, error)
|
type exeProcessCreator struct {
|
||||||
|
exePath string
|
||||||
|
}
|
||||||
|
|
||||||
// NewCreator creates a Creator for external Tor process execution based on the
|
// NewCreator creates a Creator for external Tor process execution based on the
|
||||||
// given exe path.
|
// given exe path.
|
||||||
func NewCreator(exePath string) Creator {
|
func NewCreator(exePath string) Creator {
|
||||||
return CmdCreatorFunc(func(ctx context.Context, args ...string) (*exec.Cmd, error) {
|
return &exeProcessCreator{exePath}
|
||||||
cmd := exec.CommandContext(ctx, exePath, args...)
|
|
||||||
cmd.Stdout = os.Stdout
|
|
||||||
cmd.Stderr = os.Stderr
|
|
||||||
return cmd, nil
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type exeProcess struct {
|
type exeProcess struct {
|
||||||
*exec.Cmd
|
*exec.Cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c CmdCreatorFunc) New(ctx context.Context, args ...string) (Process, error) {
|
func (e *exeProcessCreator) New(ctx context.Context, args ...string) (Process, error) {
|
||||||
cmd, err := c(ctx, args...)
|
cmd := exec.CommandContext(ctx, e.exePath, args...)
|
||||||
return &exeProcess{cmd}, err
|
cmd.Stdout = os.Stdout
|
||||||
|
cmd.Stderr = os.Stderr
|
||||||
|
return &exeProcess{cmd}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrControlConnUnsupported is returned by Process.EmbeddedControlConn when
|
// ErrControlConnUnsupported is returned by Process.EmbeddedControlConn when
|
||||||
|
9
vendor/github.com/go-sql-driver/mysql/AUTHORS
generated
vendored
9
vendor/github.com/go-sql-driver/mysql/AUTHORS
generated
vendored
@ -23,7 +23,6 @@ Asta Xie <xiemengjun at gmail.com>
|
|||||||
Bulat Gaifullin <gaifullinbf at gmail.com>
|
Bulat Gaifullin <gaifullinbf at gmail.com>
|
||||||
Caine Jette <jette at alum.mit.edu>
|
Caine Jette <jette at alum.mit.edu>
|
||||||
Carlos Nieto <jose.carlos at menteslibres.net>
|
Carlos Nieto <jose.carlos at menteslibres.net>
|
||||||
Chris Kirkland <chriskirkland at github.com>
|
|
||||||
Chris Moos <chris at tech9computers.com>
|
Chris Moos <chris at tech9computers.com>
|
||||||
Craig Wilson <craiggwilson at gmail.com>
|
Craig Wilson <craiggwilson at gmail.com>
|
||||||
Daniel Montoya <dsmontoyam at gmail.com>
|
Daniel Montoya <dsmontoyam at gmail.com>
|
||||||
@ -46,7 +45,6 @@ Ilia Cimpoes <ichimpoesh at gmail.com>
|
|||||||
INADA Naoki <songofacandy at gmail.com>
|
INADA Naoki <songofacandy at gmail.com>
|
||||||
Jacek Szwec <szwec.jacek at gmail.com>
|
Jacek Szwec <szwec.jacek at gmail.com>
|
||||||
James Harr <james.harr at gmail.com>
|
James Harr <james.harr at gmail.com>
|
||||||
Janek Vedock <janekvedock at comcast.net>
|
|
||||||
Jeff Hodges <jeff at somethingsimilar.com>
|
Jeff Hodges <jeff at somethingsimilar.com>
|
||||||
Jeffrey Charles <jeffreycharles at gmail.com>
|
Jeffrey Charles <jeffreycharles at gmail.com>
|
||||||
Jerome Meyer <jxmeyer at gmail.com>
|
Jerome Meyer <jxmeyer at gmail.com>
|
||||||
@ -61,14 +59,12 @@ Kamil Dziedzic <kamil at klecza.pl>
|
|||||||
Kei Kamikawa <x00.x7f.x86 at gmail.com>
|
Kei Kamikawa <x00.x7f.x86 at gmail.com>
|
||||||
Kevin Malachowski <kevin at chowski.com>
|
Kevin Malachowski <kevin at chowski.com>
|
||||||
Kieron Woodhouse <kieron.woodhouse at infosum.com>
|
Kieron Woodhouse <kieron.woodhouse at infosum.com>
|
||||||
Lance Tian <lance6716 at gmail.com>
|
|
||||||
Lennart Rudolph <lrudolph at hmc.edu>
|
Lennart Rudolph <lrudolph at hmc.edu>
|
||||||
Leonardo YongUk Kim <dalinaum at gmail.com>
|
Leonardo YongUk Kim <dalinaum at gmail.com>
|
||||||
Linh Tran Tuan <linhduonggnu at gmail.com>
|
Linh Tran Tuan <linhduonggnu at gmail.com>
|
||||||
Lion Yang <lion at aosc.xyz>
|
Lion Yang <lion at aosc.xyz>
|
||||||
Luca Looz <luca.looz92 at gmail.com>
|
Luca Looz <luca.looz92 at gmail.com>
|
||||||
Lucas Liu <extrafliu at gmail.com>
|
Lucas Liu <extrafliu at gmail.com>
|
||||||
Lunny Xiao <xiaolunwen at gmail.com>
|
|
||||||
Luke Scott <luke at webconnex.com>
|
Luke Scott <luke at webconnex.com>
|
||||||
Maciej Zimnoch <maciej.zimnoch at codilime.com>
|
Maciej Zimnoch <maciej.zimnoch at codilime.com>
|
||||||
Michael Woolnough <michael.woolnough at gmail.com>
|
Michael Woolnough <michael.woolnough at gmail.com>
|
||||||
@ -78,14 +74,11 @@ Olivier Mengué <dolmen at cpan.org>
|
|||||||
oscarzhao <oscarzhaosl at gmail.com>
|
oscarzhao <oscarzhaosl at gmail.com>
|
||||||
Paul Bonser <misterpib at gmail.com>
|
Paul Bonser <misterpib at gmail.com>
|
||||||
Peter Schultz <peter.schultz at classmarkets.com>
|
Peter Schultz <peter.schultz at classmarkets.com>
|
||||||
Phil Porada <philporada at gmail.com>
|
|
||||||
Rebecca Chin <rchin at pivotal.io>
|
Rebecca Chin <rchin at pivotal.io>
|
||||||
Reed Allman <rdallman10 at gmail.com>
|
Reed Allman <rdallman10 at gmail.com>
|
||||||
Richard Wilkes <wilkes at me.com>
|
Richard Wilkes <wilkes at me.com>
|
||||||
Robert Russell <robert at rrbrussell.com>
|
Robert Russell <robert at rrbrussell.com>
|
||||||
Runrioter Wung <runrioter at gmail.com>
|
Runrioter Wung <runrioter at gmail.com>
|
||||||
Samantha Frank <hello at entropy.cat>
|
|
||||||
Santhosh Kumar Tekuri <santhosh.tekuri at gmail.com>
|
|
||||||
Sho Iizuka <sho.i518 at gmail.com>
|
Sho Iizuka <sho.i518 at gmail.com>
|
||||||
Sho Ikeda <suicaicoca at gmail.com>
|
Sho Ikeda <suicaicoca at gmail.com>
|
||||||
Shuode Li <elemount at qq.com>
|
Shuode Li <elemount at qq.com>
|
||||||
@ -106,14 +99,12 @@ Xiuming Chen <cc at cxm.cc>
|
|||||||
Xuehong Chan <chanxuehong at gmail.com>
|
Xuehong Chan <chanxuehong at gmail.com>
|
||||||
Zhenye Xie <xiezhenye at gmail.com>
|
Zhenye Xie <xiezhenye at gmail.com>
|
||||||
Zhixin Wen <john.wenzhixin at gmail.com>
|
Zhixin Wen <john.wenzhixin at gmail.com>
|
||||||
Ziheng Lyu <zihenglv at gmail.com>
|
|
||||||
|
|
||||||
# Organizations
|
# Organizations
|
||||||
|
|
||||||
Barracuda Networks, Inc.
|
Barracuda Networks, Inc.
|
||||||
Counting Ltd.
|
Counting Ltd.
|
||||||
DigitalOcean Inc.
|
DigitalOcean Inc.
|
||||||
dyves labs AG
|
|
||||||
Facebook Inc.
|
Facebook Inc.
|
||||||
GitHub Inc.
|
GitHub Inc.
|
||||||
Google Inc.
|
Google Inc.
|
||||||
|
34
vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
generated
vendored
34
vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
generated
vendored
@ -1,37 +1,3 @@
|
|||||||
## Version 1.7.1 (2023-04-25)
|
|
||||||
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
- bump actions/checkout@v3 and actions/setup-go@v3 (#1375)
|
|
||||||
- Add go1.20 and mariadb10.11 to the testing matrix (#1403)
|
|
||||||
- Increase default maxAllowedPacket size. (#1411)
|
|
||||||
|
|
||||||
Bugfixes:
|
|
||||||
|
|
||||||
- Use SET syntax as specified in the MySQL documentation (#1402)
|
|
||||||
|
|
||||||
|
|
||||||
## Version 1.7 (2022-11-29)
|
|
||||||
|
|
||||||
Changes:
|
|
||||||
|
|
||||||
- Drop support of Go 1.12 (#1211)
|
|
||||||
- Refactoring `(*textRows).readRow` in a more clear way (#1230)
|
|
||||||
- util: Reduce boundary check in escape functions. (#1316)
|
|
||||||
- enhancement for mysqlConn handleAuthResult (#1250)
|
|
||||||
|
|
||||||
New Features:
|
|
||||||
|
|
||||||
- support Is comparison on MySQLError (#1210)
|
|
||||||
- return unsigned in database type name when necessary (#1238)
|
|
||||||
- Add API to express like a --ssl-mode=PREFERRED MySQL client (#1370)
|
|
||||||
- Add SQLState to MySQLError (#1321)
|
|
||||||
|
|
||||||
Bugfixes:
|
|
||||||
|
|
||||||
- Fix parsing 0 year. (#1257)
|
|
||||||
|
|
||||||
|
|
||||||
## Version 1.6 (2021-04-01)
|
## Version 1.6 (2021-04-01)
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
21
vendor/github.com/go-sql-driver/mysql/README.md
generated
vendored
21
vendor/github.com/go-sql-driver/mysql/README.md
generated
vendored
@ -40,7 +40,7 @@ A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) pac
|
|||||||
* Optional placeholder interpolation
|
* Optional placeholder interpolation
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
* Go 1.13 or higher. We aim to support the 3 latest versions of Go.
|
* Go 1.10 or higher. We aim to support the 3 latest versions of Go.
|
||||||
* MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
|
* MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
|
||||||
|
|
||||||
---------------------------------------
|
---------------------------------------
|
||||||
@ -85,7 +85,7 @@ db.SetMaxIdleConns(10)
|
|||||||
|
|
||||||
`db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server.
|
`db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server.
|
||||||
|
|
||||||
`db.SetMaxIdleConns()` is recommended to be set same to `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed much more frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15.
|
`db.SetMaxIdleConns()` is recommended to be set same to (or greater than) `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed very frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15.
|
||||||
|
|
||||||
|
|
||||||
### DSN (Data Source Name)
|
### DSN (Data Source Name)
|
||||||
@ -157,17 +157,6 @@ Default: false
|
|||||||
|
|
||||||
`allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
|
`allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
|
||||||
|
|
||||||
|
|
||||||
##### `allowFallbackToPlaintext`
|
|
||||||
|
|
||||||
```
|
|
||||||
Type: bool
|
|
||||||
Valid Values: true, false
|
|
||||||
Default: false
|
|
||||||
```
|
|
||||||
|
|
||||||
`allowFallbackToPlaintext=true` acts like a `--ssl-mode=PREFERRED` MySQL client as described in [Command Options for Connecting to the Server](https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode)
|
|
||||||
|
|
||||||
##### `allowNativePasswords`
|
##### `allowNativePasswords`
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -282,10 +271,10 @@ Please keep in mind, that param values must be [url.QueryEscape](https://golang.
|
|||||||
##### `maxAllowedPacket`
|
##### `maxAllowedPacket`
|
||||||
```
|
```
|
||||||
Type: decimal number
|
Type: decimal number
|
||||||
Default: 64*1024*1024
|
Default: 4194304
|
||||||
```
|
```
|
||||||
|
|
||||||
Max packet size allowed in bytes. The default value is 64 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*.
|
Max packet size allowed in bytes. The default value is 4 MiB and should be adjusted to match the server settings. `maxAllowedPacket=0` can be used to automatically fetch the `max_allowed_packet` variable from server *on every connection*.
|
||||||
|
|
||||||
##### `multiStatements`
|
##### `multiStatements`
|
||||||
|
|
||||||
@ -465,7 +454,7 @@ user:password@/
|
|||||||
The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively.
|
The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively.
|
||||||
|
|
||||||
## `ColumnType` Support
|
## `ColumnType` Support
|
||||||
This driver supports the [`ColumnType` interface](https://golang.org/pkg/database/sql/#ColumnType) introduced in Go 1.8, with the exception of [`ColumnType.Length()`](https://golang.org/pkg/database/sql/#ColumnType.Length), which is currently not supported. All Unsigned database type names will be returned `UNSIGNED ` with `INT`, `TINYINT`, `SMALLINT`, `BIGINT`.
|
This driver supports the [`ColumnType` interface](https://golang.org/pkg/database/sql/#ColumnType) introduced in Go 1.8, with the exception of [`ColumnType.Length()`](https://golang.org/pkg/database/sql/#ColumnType.Length), which is currently not supported.
|
||||||
|
|
||||||
## `context.Context` Support
|
## `context.Context` Support
|
||||||
Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts.
|
Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts.
|
||||||
|
19
vendor/github.com/go-sql-driver/mysql/atomic_bool.go
generated
vendored
19
vendor/github.com/go-sql-driver/mysql/atomic_bool.go
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package.
|
|
||||||
//
|
|
||||||
// Copyright 2022 The Go-MySQL-Driver Authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
//go:build go1.19
|
|
||||||
// +build go1.19
|
|
||||||
|
|
||||||
package mysql
|
|
||||||
|
|
||||||
import "sync/atomic"
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Sync utils *
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
type atomicBool = atomic.Bool
|
|
47
vendor/github.com/go-sql-driver/mysql/atomic_bool_go118.go
generated
vendored
47
vendor/github.com/go-sql-driver/mysql/atomic_bool_go118.go
generated
vendored
@ -1,47 +0,0 @@
|
|||||||
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package.
|
|
||||||
//
|
|
||||||
// Copyright 2022 The Go-MySQL-Driver Authors. All rights reserved.
|
|
||||||
//
|
|
||||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
||||||
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
//go:build !go1.19
|
|
||||||
// +build !go1.19
|
|
||||||
|
|
||||||
package mysql
|
|
||||||
|
|
||||||
import "sync/atomic"
|
|
||||||
|
|
||||||
/******************************************************************************
|
|
||||||
* Sync utils *
|
|
||||||
******************************************************************************/
|
|
||||||
|
|
||||||
// atomicBool is an implementation of atomic.Bool for older version of Go.
|
|
||||||
// it is a wrapper around uint32 for usage as a boolean value with
|
|
||||||
// atomic access.
|
|
||||||
type atomicBool struct {
|
|
||||||
_ noCopy
|
|
||||||
value uint32
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load returns whether the current boolean value is true
|
|
||||||
func (ab *atomicBool) Load() bool {
|
|
||||||
return atomic.LoadUint32(&ab.value) > 0
|
|
||||||
}
|
|
||||||
|
|
||||||
// Store sets the value of the bool regardless of the previous value
|
|
||||||
func (ab *atomicBool) Store(value bool) {
|
|
||||||
if value {
|
|
||||||
atomic.StoreUint32(&ab.value, 1)
|
|
||||||
} else {
|
|
||||||
atomic.StoreUint32(&ab.value, 0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Swap sets the value of the bool and returns the old value.
|
|
||||||
func (ab *atomicBool) Swap(value bool) bool {
|
|
||||||
if value {
|
|
||||||
return atomic.SwapUint32(&ab.value, 1) > 0
|
|
||||||
}
|
|
||||||
return atomic.SwapUint32(&ab.value, 0) > 0
|
|
||||||
}
|
|
22
vendor/github.com/go-sql-driver/mysql/auth.go
generated
vendored
22
vendor/github.com/go-sql-driver/mysql/auth.go
generated
vendored
@ -53,6 +53,7 @@ var (
|
|||||||
// } else {
|
// } else {
|
||||||
// log.Fatal("not a RSA public key")
|
// log.Fatal("not a RSA public key")
|
||||||
// }
|
// }
|
||||||
|
//
|
||||||
func RegisterServerPubKey(name string, pubKey *rsa.PublicKey) {
|
func RegisterServerPubKey(name string, pubKey *rsa.PublicKey) {
|
||||||
serverPubKeyLock.Lock()
|
serverPubKeyLock.Lock()
|
||||||
if serverPubKeyRegistry == nil {
|
if serverPubKeyRegistry == nil {
|
||||||
@ -273,9 +274,7 @@ func (mc *mysqlConn) auth(authData []byte, plugin string) ([]byte, error) {
|
|||||||
if len(mc.cfg.Passwd) == 0 {
|
if len(mc.cfg.Passwd) == 0 {
|
||||||
return []byte{0}, nil
|
return []byte{0}, nil
|
||||||
}
|
}
|
||||||
// unlike caching_sha2_password, sha256_password does not accept
|
if mc.cfg.tls != nil || mc.cfg.Net == "unix" {
|
||||||
// cleartext password on unix transport.
|
|
||||||
if mc.cfg.TLS != nil {
|
|
||||||
// write cleartext auth packet
|
// write cleartext auth packet
|
||||||
return append([]byte(mc.cfg.Passwd), 0), nil
|
return append([]byte(mc.cfg.Passwd), 0), nil
|
||||||
}
|
}
|
||||||
@ -351,7 +350,7 @@ func (mc *mysqlConn) handleAuthResult(oldAuthData []byte, plugin string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case cachingSha2PasswordPerformFullAuthentication:
|
case cachingSha2PasswordPerformFullAuthentication:
|
||||||
if mc.cfg.TLS != nil || mc.cfg.Net == "unix" {
|
if mc.cfg.tls != nil || mc.cfg.Net == "unix" {
|
||||||
// write cleartext auth packet
|
// write cleartext auth packet
|
||||||
err = mc.writeAuthSwitchPacket(append([]byte(mc.cfg.Passwd), 0))
|
err = mc.writeAuthSwitchPacket(append([]byte(mc.cfg.Passwd), 0))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -366,20 +365,13 @@ func (mc *mysqlConn) handleAuthResult(oldAuthData []byte, plugin string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
data[4] = cachingSha2PasswordRequestPublicKey
|
data[4] = cachingSha2PasswordRequestPublicKey
|
||||||
err = mc.writePacket(data)
|
mc.writePacket(data)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// parse public key
|
||||||
if data, err = mc.readPacket(); err != nil {
|
if data, err = mc.readPacket(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if data[0] != iAuthMoreData {
|
|
||||||
return fmt.Errorf("unexpect resp from server for caching_sha2_password perform full authentication")
|
|
||||||
}
|
|
||||||
|
|
||||||
// parse public key
|
|
||||||
block, rest := pem.Decode(data[1:])
|
block, rest := pem.Decode(data[1:])
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return fmt.Errorf("No Pem data found, data: %s", rest)
|
return fmt.Errorf("No Pem data found, data: %s", rest)
|
||||||
@ -412,10 +404,6 @@ func (mc *mysqlConn) handleAuthResult(oldAuthData []byte, plugin string) error {
|
|||||||
return nil // auth successful
|
return nil // auth successful
|
||||||
default:
|
default:
|
||||||
block, _ := pem.Decode(authData)
|
block, _ := pem.Decode(authData)
|
||||||
if block == nil {
|
|
||||||
return fmt.Errorf("no Pem data found, data: %s", authData)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub, err := x509.ParsePKIXPublicKey(block.Bytes)
|
pub, err := x509.ParsePKIXPublicKey(block.Bytes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
1
vendor/github.com/go-sql-driver/mysql/collations.go
generated
vendored
1
vendor/github.com/go-sql-driver/mysql/collations.go
generated
vendored
@ -13,7 +13,6 @@ const binaryCollation = "binary"
|
|||||||
|
|
||||||
// A list of available collations mapped to the internal ID.
|
// A list of available collations mapped to the internal ID.
|
||||||
// To update this map use the following MySQL query:
|
// To update this map use the following MySQL query:
|
||||||
//
|
|
||||||
// SELECT COLLATION_NAME, ID FROM information_schema.COLLATIONS WHERE ID<256 ORDER BY ID
|
// SELECT COLLATION_NAME, ID FROM information_schema.COLLATIONS WHERE ID<256 ORDER BY ID
|
||||||
//
|
//
|
||||||
// Handshake packet have only 1 byte for collation_id. So we can't use collations with ID > 255.
|
// Handshake packet have only 1 byte for collation_id. So we can't use collations with ID > 255.
|
||||||
|
1
vendor/github.com/go-sql-driver/mysql/conncheck.go
generated
vendored
1
vendor/github.com/go-sql-driver/mysql/conncheck.go
generated
vendored
@ -6,7 +6,6 @@
|
|||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos
|
|
||||||
// +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos
|
// +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos
|
||||||
|
|
||||||
package mysql
|
package mysql
|
||||||
|
1
vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go
generated
vendored
1
vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go
generated
vendored
@ -6,7 +6,6 @@
|
|||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
//go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !illumos
|
|
||||||
// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos
|
// +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos
|
||||||
|
|
||||||
package mysql
|
package mysql
|
||||||
|
26
vendor/github.com/go-sql-driver/mysql/connection.go
generated
vendored
26
vendor/github.com/go-sql-driver/mysql/connection.go
generated
vendored
@ -71,10 +71,10 @@ func (mc *mysqlConn) handleParams() (err error) {
|
|||||||
cmdSet.Grow(4 + len(param) + 1 + len(val) + 30*(len(mc.cfg.Params)-1))
|
cmdSet.Grow(4 + len(param) + 1 + len(val) + 30*(len(mc.cfg.Params)-1))
|
||||||
cmdSet.WriteString("SET ")
|
cmdSet.WriteString("SET ")
|
||||||
} else {
|
} else {
|
||||||
cmdSet.WriteString(", ")
|
cmdSet.WriteByte(',')
|
||||||
}
|
}
|
||||||
cmdSet.WriteString(param)
|
cmdSet.WriteString(param)
|
||||||
cmdSet.WriteString(" = ")
|
cmdSet.WriteByte('=')
|
||||||
cmdSet.WriteString(val)
|
cmdSet.WriteString(val)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -104,7 +104,7 @@ func (mc *mysqlConn) Begin() (driver.Tx, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
|
func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
|
|||||||
|
|
||||||
func (mc *mysqlConn) Close() (err error) {
|
func (mc *mysqlConn) Close() (err error) {
|
||||||
// Makes Close idempotent
|
// Makes Close idempotent
|
||||||
if !mc.closed.Load() {
|
if !mc.closed.IsSet() {
|
||||||
err = mc.writeCommandPacket(comQuit)
|
err = mc.writeCommandPacket(comQuit)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ func (mc *mysqlConn) Close() (err error) {
|
|||||||
// is called before auth or on auth failure because MySQL will have already
|
// is called before auth or on auth failure because MySQL will have already
|
||||||
// closed the network connection.
|
// closed the network connection.
|
||||||
func (mc *mysqlConn) cleanup() {
|
func (mc *mysqlConn) cleanup() {
|
||||||
if mc.closed.Swap(true) {
|
if !mc.closed.TrySet(true) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ func (mc *mysqlConn) cleanup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *mysqlConn) error() error {
|
func (mc *mysqlConn) error() error {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
if err := mc.canceled.Value(); err != nil {
|
if err := mc.canceled.Value(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ func (mc *mysqlConn) error() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
|
func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -295,7 +295,7 @@ func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, error) {
|
func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -356,7 +356,7 @@ func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mc *mysqlConn) query(query string, args []driver.Value) (*textRows, error) {
|
func (mc *mysqlConn) query(query string, args []driver.Value) (*textRows, error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -450,7 +450,7 @@ func (mc *mysqlConn) finish() {
|
|||||||
|
|
||||||
// Ping implements driver.Pinger interface
|
// Ping implements driver.Pinger interface
|
||||||
func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
|
func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return driver.ErrBadConn
|
return driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -469,7 +469,7 @@ func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
|
|||||||
|
|
||||||
// BeginTx implements driver.ConnBeginTx interface
|
// BeginTx implements driver.ConnBeginTx interface
|
||||||
func (mc *mysqlConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
|
func (mc *mysqlConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ func (mc *mysqlConn) CheckNamedValue(nv *driver.NamedValue) (err error) {
|
|||||||
// ResetSession implements driver.SessionResetter.
|
// ResetSession implements driver.SessionResetter.
|
||||||
// (From Go 1.10)
|
// (From Go 1.10)
|
||||||
func (mc *mysqlConn) ResetSession(ctx context.Context) error {
|
func (mc *mysqlConn) ResetSession(ctx context.Context) error {
|
||||||
if mc.closed.Load() {
|
if mc.closed.IsSet() {
|
||||||
return driver.ErrBadConn
|
return driver.ErrBadConn
|
||||||
}
|
}
|
||||||
mc.reset = true
|
mc.reset = true
|
||||||
@ -646,5 +646,5 @@ func (mc *mysqlConn) ResetSession(ctx context.Context) error {
|
|||||||
// IsValid implements driver.Validator interface
|
// IsValid implements driver.Validator interface
|
||||||
// (From Go 1.15)
|
// (From Go 1.15)
|
||||||
func (mc *mysqlConn) IsValid() bool {
|
func (mc *mysqlConn) IsValid() bool {
|
||||||
return !mc.closed.Load()
|
return !mc.closed.IsSet()
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/go-sql-driver/mysql/const.go
generated
vendored
2
vendor/github.com/go-sql-driver/mysql/const.go
generated
vendored
@ -10,7 +10,7 @@ package mysql
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
defaultAuthPlugin = "mysql_native_password"
|
defaultAuthPlugin = "mysql_native_password"
|
||||||
defaultMaxAllowedPacket = 64 << 20 // 64 MiB. See https://github.com/go-sql-driver/mysql/issues/1355
|
defaultMaxAllowedPacket = 4 << 20 // 4 MiB
|
||||||
minProtocolVersion = 10
|
minProtocolVersion = 10
|
||||||
maxPacketSize = 1<<24 - 1
|
maxPacketSize = 1<<24 - 1
|
||||||
timeFormat = "2006-01-02 15:04:05.999999"
|
timeFormat = "2006-01-02 15:04:05.999999"
|
||||||
|
39
vendor/github.com/go-sql-driver/mysql/dsn.go
generated
vendored
39
vendor/github.com/go-sql-driver/mysql/dsn.go
generated
vendored
@ -46,14 +46,13 @@ type Config struct {
|
|||||||
ServerPubKey string // Server public key name
|
ServerPubKey string // Server public key name
|
||||||
pubKey *rsa.PublicKey // Server public key
|
pubKey *rsa.PublicKey // Server public key
|
||||||
TLSConfig string // TLS configuration name
|
TLSConfig string // TLS configuration name
|
||||||
TLS *tls.Config // TLS configuration, its priority is higher than TLSConfig
|
tls *tls.Config // TLS configuration
|
||||||
Timeout time.Duration // Dial timeout
|
Timeout time.Duration // Dial timeout
|
||||||
ReadTimeout time.Duration // I/O read timeout
|
ReadTimeout time.Duration // I/O read timeout
|
||||||
WriteTimeout time.Duration // I/O write timeout
|
WriteTimeout time.Duration // I/O write timeout
|
||||||
|
|
||||||
AllowAllFiles bool // Allow all files to be used with LOAD DATA LOCAL INFILE
|
AllowAllFiles bool // Allow all files to be used with LOAD DATA LOCAL INFILE
|
||||||
AllowCleartextPasswords bool // Allows the cleartext client side plugin
|
AllowCleartextPasswords bool // Allows the cleartext client side plugin
|
||||||
AllowFallbackToPlaintext bool // Allows fallback to unencrypted connection if server does not support TLS
|
|
||||||
AllowNativePasswords bool // Allows the native password authentication method
|
AllowNativePasswords bool // Allows the native password authentication method
|
||||||
AllowOldPasswords bool // Allows the old insecure password method
|
AllowOldPasswords bool // Allows the old insecure password method
|
||||||
CheckConnLiveness bool // Check connections for liveness before using them
|
CheckConnLiveness bool // Check connections for liveness before using them
|
||||||
@ -78,8 +77,8 @@ func NewConfig() *Config {
|
|||||||
|
|
||||||
func (cfg *Config) Clone() *Config {
|
func (cfg *Config) Clone() *Config {
|
||||||
cp := *cfg
|
cp := *cfg
|
||||||
if cp.TLS != nil {
|
if cp.tls != nil {
|
||||||
cp.TLS = cfg.TLS.Clone()
|
cp.tls = cfg.tls.Clone()
|
||||||
}
|
}
|
||||||
if len(cp.Params) > 0 {
|
if len(cp.Params) > 0 {
|
||||||
cp.Params = make(map[string]string, len(cfg.Params))
|
cp.Params = make(map[string]string, len(cfg.Params))
|
||||||
@ -120,29 +119,24 @@ func (cfg *Config) normalize() error {
|
|||||||
cfg.Addr = ensureHavePort(cfg.Addr)
|
cfg.Addr = ensureHavePort(cfg.Addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.TLS == nil {
|
|
||||||
switch cfg.TLSConfig {
|
switch cfg.TLSConfig {
|
||||||
case "false", "":
|
case "false", "":
|
||||||
// don't set anything
|
// don't set anything
|
||||||
case "true":
|
case "true":
|
||||||
cfg.TLS = &tls.Config{}
|
cfg.tls = &tls.Config{}
|
||||||
case "skip-verify":
|
case "skip-verify", "preferred":
|
||||||
cfg.TLS = &tls.Config{InsecureSkipVerify: true}
|
cfg.tls = &tls.Config{InsecureSkipVerify: true}
|
||||||
case "preferred":
|
|
||||||
cfg.TLS = &tls.Config{InsecureSkipVerify: true}
|
|
||||||
cfg.AllowFallbackToPlaintext = true
|
|
||||||
default:
|
default:
|
||||||
cfg.TLS = getTLSConfigClone(cfg.TLSConfig)
|
cfg.tls = getTLSConfigClone(cfg.TLSConfig)
|
||||||
if cfg.TLS == nil {
|
if cfg.tls == nil {
|
||||||
return errors.New("invalid value / unknown config name: " + cfg.TLSConfig)
|
return errors.New("invalid value / unknown config name: " + cfg.TLSConfig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if cfg.TLS != nil && cfg.TLS.ServerName == "" && !cfg.TLS.InsecureSkipVerify {
|
if cfg.tls != nil && cfg.tls.ServerName == "" && !cfg.tls.InsecureSkipVerify {
|
||||||
host, _, err := net.SplitHostPort(cfg.Addr)
|
host, _, err := net.SplitHostPort(cfg.Addr)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
cfg.TLS.ServerName = host
|
cfg.tls.ServerName = host
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -210,10 +204,6 @@ func (cfg *Config) FormatDSN() string {
|
|||||||
writeDSNParam(&buf, &hasParam, "allowCleartextPasswords", "true")
|
writeDSNParam(&buf, &hasParam, "allowCleartextPasswords", "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
if cfg.AllowFallbackToPlaintext {
|
|
||||||
writeDSNParam(&buf, &hasParam, "allowFallbackToPlaintext", "true")
|
|
||||||
}
|
|
||||||
|
|
||||||
if !cfg.AllowNativePasswords {
|
if !cfg.AllowNativePasswords {
|
||||||
writeDSNParam(&buf, &hasParam, "allowNativePasswords", "false")
|
writeDSNParam(&buf, &hasParam, "allowNativePasswords", "false")
|
||||||
}
|
}
|
||||||
@ -401,14 +391,6 @@ func parseDSNParams(cfg *Config, params string) (err error) {
|
|||||||
return errors.New("invalid bool value: " + value)
|
return errors.New("invalid bool value: " + value)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Allow fallback to unencrypted connection if server does not support TLS
|
|
||||||
case "allowFallbackToPlaintext":
|
|
||||||
var isBool bool
|
|
||||||
cfg.AllowFallbackToPlaintext, isBool = readBool(value)
|
|
||||||
if !isBool {
|
|
||||||
return errors.New("invalid bool value: " + value)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use native password authentication
|
// Use native password authentication
|
||||||
case "allowNativePasswords":
|
case "allowNativePasswords":
|
||||||
var isBool bool
|
var isBool bool
|
||||||
@ -444,6 +426,7 @@ func parseDSNParams(cfg *Config, params string) (err error) {
|
|||||||
// Collation
|
// Collation
|
||||||
case "collation":
|
case "collation":
|
||||||
cfg.Collation = value
|
cfg.Collation = value
|
||||||
|
break
|
||||||
|
|
||||||
case "columnsWithAlias":
|
case "columnsWithAlias":
|
||||||
var isBool bool
|
var isBool bool
|
||||||
|
14
vendor/github.com/go-sql-driver/mysql/errors.go
generated
vendored
14
vendor/github.com/go-sql-driver/mysql/errors.go
generated
vendored
@ -27,7 +27,7 @@ var (
|
|||||||
ErrOldProtocol = errors.New("MySQL server does not support required protocol 41+")
|
ErrOldProtocol = errors.New("MySQL server does not support required protocol 41+")
|
||||||
ErrPktSync = errors.New("commands out of sync. You can't run this command now")
|
ErrPktSync = errors.New("commands out of sync. You can't run this command now")
|
||||||
ErrPktSyncMul = errors.New("commands out of sync. Did you run multiple statements at once?")
|
ErrPktSyncMul = errors.New("commands out of sync. Did you run multiple statements at once?")
|
||||||
ErrPktTooLarge = errors.New("packet for query is too large. Try adjusting the `Config.MaxAllowedPacket`")
|
ErrPktTooLarge = errors.New("packet for query is too large. Try adjusting the 'max_allowed_packet' variable on the server")
|
||||||
ErrBusyBuffer = errors.New("busy buffer")
|
ErrBusyBuffer = errors.New("busy buffer")
|
||||||
|
|
||||||
// errBadConnNoWrite is used for connection errors where nothing was sent to the database yet.
|
// errBadConnNoWrite is used for connection errors where nothing was sent to the database yet.
|
||||||
@ -57,21 +57,9 @@ func SetLogger(logger Logger) error {
|
|||||||
// MySQLError is an error type which represents a single MySQL error
|
// MySQLError is an error type which represents a single MySQL error
|
||||||
type MySQLError struct {
|
type MySQLError struct {
|
||||||
Number uint16
|
Number uint16
|
||||||
SQLState [5]byte
|
|
||||||
Message string
|
Message string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me *MySQLError) Error() string {
|
func (me *MySQLError) Error() string {
|
||||||
if me.SQLState != [5]byte{} {
|
|
||||||
return fmt.Sprintf("Error %d (%s): %s", me.Number, me.SQLState, me.Message)
|
|
||||||
}
|
|
||||||
|
|
||||||
return fmt.Sprintf("Error %d: %s", me.Number, me.Message)
|
return fmt.Sprintf("Error %d: %s", me.Number, me.Message)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (me *MySQLError) Is(err error) bool {
|
|
||||||
if merr, ok := err.(*MySQLError); ok {
|
|
||||||
return merr.Number == me.Number
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
14
vendor/github.com/go-sql-driver/mysql/fields.go
generated
vendored
14
vendor/github.com/go-sql-driver/mysql/fields.go
generated
vendored
@ -41,9 +41,6 @@ func (mf *mysqlField) typeDatabaseName() string {
|
|||||||
case fieldTypeJSON:
|
case fieldTypeJSON:
|
||||||
return "JSON"
|
return "JSON"
|
||||||
case fieldTypeLong:
|
case fieldTypeLong:
|
||||||
if mf.flags&flagUnsigned != 0 {
|
|
||||||
return "UNSIGNED INT"
|
|
||||||
}
|
|
||||||
return "INT"
|
return "INT"
|
||||||
case fieldTypeLongBLOB:
|
case fieldTypeLongBLOB:
|
||||||
if mf.charSet != collations[binaryCollation] {
|
if mf.charSet != collations[binaryCollation] {
|
||||||
@ -51,9 +48,6 @@ func (mf *mysqlField) typeDatabaseName() string {
|
|||||||
}
|
}
|
||||||
return "LONGBLOB"
|
return "LONGBLOB"
|
||||||
case fieldTypeLongLong:
|
case fieldTypeLongLong:
|
||||||
if mf.flags&flagUnsigned != 0 {
|
|
||||||
return "UNSIGNED BIGINT"
|
|
||||||
}
|
|
||||||
return "BIGINT"
|
return "BIGINT"
|
||||||
case fieldTypeMediumBLOB:
|
case fieldTypeMediumBLOB:
|
||||||
if mf.charSet != collations[binaryCollation] {
|
if mf.charSet != collations[binaryCollation] {
|
||||||
@ -69,9 +63,6 @@ func (mf *mysqlField) typeDatabaseName() string {
|
|||||||
case fieldTypeSet:
|
case fieldTypeSet:
|
||||||
return "SET"
|
return "SET"
|
||||||
case fieldTypeShort:
|
case fieldTypeShort:
|
||||||
if mf.flags&flagUnsigned != 0 {
|
|
||||||
return "UNSIGNED SMALLINT"
|
|
||||||
}
|
|
||||||
return "SMALLINT"
|
return "SMALLINT"
|
||||||
case fieldTypeString:
|
case fieldTypeString:
|
||||||
if mf.charSet == collations[binaryCollation] {
|
if mf.charSet == collations[binaryCollation] {
|
||||||
@ -83,9 +74,6 @@ func (mf *mysqlField) typeDatabaseName() string {
|
|||||||
case fieldTypeTimestamp:
|
case fieldTypeTimestamp:
|
||||||
return "TIMESTAMP"
|
return "TIMESTAMP"
|
||||||
case fieldTypeTiny:
|
case fieldTypeTiny:
|
||||||
if mf.flags&flagUnsigned != 0 {
|
|
||||||
return "UNSIGNED TINYINT"
|
|
||||||
}
|
|
||||||
return "TINYINT"
|
return "TINYINT"
|
||||||
case fieldTypeTinyBLOB:
|
case fieldTypeTinyBLOB:
|
||||||
if mf.charSet != collations[binaryCollation] {
|
if mf.charSet != collations[binaryCollation] {
|
||||||
@ -118,7 +106,7 @@ var (
|
|||||||
scanTypeInt64 = reflect.TypeOf(int64(0))
|
scanTypeInt64 = reflect.TypeOf(int64(0))
|
||||||
scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
|
scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
|
||||||
scanTypeNullInt = reflect.TypeOf(sql.NullInt64{})
|
scanTypeNullInt = reflect.TypeOf(sql.NullInt64{})
|
||||||
scanTypeNullTime = reflect.TypeOf(sql.NullTime{})
|
scanTypeNullTime = reflect.TypeOf(nullTime{})
|
||||||
scanTypeUint8 = reflect.TypeOf(uint8(0))
|
scanTypeUint8 = reflect.TypeOf(uint8(0))
|
||||||
scanTypeUint16 = reflect.TypeOf(uint16(0))
|
scanTypeUint16 = reflect.TypeOf(uint16(0))
|
||||||
scanTypeUint32 = reflect.TypeOf(uint32(0))
|
scanTypeUint32 = reflect.TypeOf(uint32(0))
|
||||||
|
1
vendor/github.com/go-sql-driver/mysql/fuzz.go
generated
vendored
1
vendor/github.com/go-sql-driver/mysql/fuzz.go
generated
vendored
@ -6,7 +6,6 @@
|
|||||||
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
//go:build gofuzz
|
|
||||||
// +build gofuzz
|
// +build gofuzz
|
||||||
|
|
||||||
package mysql
|
package mysql
|
||||||
|
3
vendor/github.com/go-sql-driver/mysql/go.mod
generated
vendored
Normal file
3
vendor/github.com/go-sql-driver/mysql/go.mod
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module github.com/go-sql-driver/mysql
|
||||||
|
|
||||||
|
go 1.10
|
6
vendor/github.com/go-sql-driver/mysql/infile.go
generated
vendored
6
vendor/github.com/go-sql-driver/mysql/infile.go
generated
vendored
@ -33,6 +33,7 @@ var (
|
|||||||
// err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
|
// err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// ...
|
// ...
|
||||||
|
//
|
||||||
func RegisterLocalFile(filePath string) {
|
func RegisterLocalFile(filePath string) {
|
||||||
fileRegisterLock.Lock()
|
fileRegisterLock.Lock()
|
||||||
// lazy map init
|
// lazy map init
|
||||||
@ -65,6 +66,7 @@ func DeregisterLocalFile(filePath string) {
|
|||||||
// err := db.Exec("LOAD DATA LOCAL INFILE 'Reader::data' INTO TABLE foo")
|
// err := db.Exec("LOAD DATA LOCAL INFILE 'Reader::data' INTO TABLE foo")
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// ...
|
// ...
|
||||||
|
//
|
||||||
func RegisterReaderHandler(name string, handler func() io.Reader) {
|
func RegisterReaderHandler(name string, handler func() io.Reader) {
|
||||||
readerRegisterLock.Lock()
|
readerRegisterLock.Lock()
|
||||||
// lazy map init
|
// lazy map init
|
||||||
@ -91,12 +93,10 @@ func deferredClose(err *error, closer io.Closer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultPacketSize = 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP
|
|
||||||
|
|
||||||
func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
|
func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
|
||||||
var rdr io.Reader
|
var rdr io.Reader
|
||||||
var data []byte
|
var data []byte
|
||||||
packetSize := defaultPacketSize
|
packetSize := 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP
|
||||||
if mc.maxWriteSize < packetSize {
|
if mc.maxWriteSize < packetSize {
|
||||||
packetSize = mc.maxWriteSize
|
packetSize = mc.maxWriteSize
|
||||||
}
|
}
|
||||||
|
21
vendor/github.com/go-sql-driver/mysql/nulltime.go
generated
vendored
21
vendor/github.com/go-sql-driver/mysql/nulltime.go
generated
vendored
@ -9,32 +9,11 @@
|
|||||||
package mysql
|
package mysql
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
|
||||||
"database/sql/driver"
|
"database/sql/driver"
|
||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// NullTime represents a time.Time that may be NULL.
|
|
||||||
// NullTime implements the Scanner interface so
|
|
||||||
// it can be used as a scan destination:
|
|
||||||
//
|
|
||||||
// var nt NullTime
|
|
||||||
// err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
|
|
||||||
// ...
|
|
||||||
// if nt.Valid {
|
|
||||||
// // use nt.Time
|
|
||||||
// } else {
|
|
||||||
// // NULL value
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// # This NullTime implementation is not driver-specific
|
|
||||||
//
|
|
||||||
// Deprecated: NullTime doesn't honor the loc DSN parameter.
|
|
||||||
// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
|
|
||||||
// Use sql.NullTime instead.
|
|
||||||
type NullTime sql.NullTime
|
|
||||||
|
|
||||||
// Scan implements the Scanner interface.
|
// Scan implements the Scanner interface.
|
||||||
// The value type must be time.Time or string / []byte (formatted time-string),
|
// The value type must be time.Time or string / []byte (formatted time-string),
|
||||||
// otherwise Scan fails.
|
// otherwise Scan fails.
|
||||||
|
40
vendor/github.com/go-sql-driver/mysql/nulltime_go113.go
generated
vendored
Normal file
40
vendor/github.com/go-sql-driver/mysql/nulltime_go113.go
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
|
||||||
|
//
|
||||||
|
// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
|
||||||
|
//
|
||||||
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
// +build go1.13
|
||||||
|
|
||||||
|
package mysql
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NullTime represents a time.Time that may be NULL.
|
||||||
|
// NullTime implements the Scanner interface so
|
||||||
|
// it can be used as a scan destination:
|
||||||
|
//
|
||||||
|
// var nt NullTime
|
||||||
|
// err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
|
||||||
|
// ...
|
||||||
|
// if nt.Valid {
|
||||||
|
// // use nt.Time
|
||||||
|
// } else {
|
||||||
|
// // NULL value
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// This NullTime implementation is not driver-specific
|
||||||
|
//
|
||||||
|
// Deprecated: NullTime doesn't honor the loc DSN parameter.
|
||||||
|
// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
|
||||||
|
// Use sql.NullTime instead.
|
||||||
|
type NullTime sql.NullTime
|
||||||
|
|
||||||
|
// for internal use.
|
||||||
|
// the mysql package uses sql.NullTime if it is available.
|
||||||
|
// if not, the package uses mysql.NullTime.
|
||||||
|
type nullTime = sql.NullTime // sql.NullTime is available
|
39
vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go
generated
vendored
Normal file
39
vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
|
||||||
|
//
|
||||||
|
// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
|
||||||
|
//
|
||||||
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||||
|
// You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
|
||||||
|
// +build !go1.13
|
||||||
|
|
||||||
|
package mysql
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// NullTime represents a time.Time that may be NULL.
|
||||||
|
// NullTime implements the Scanner interface so
|
||||||
|
// it can be used as a scan destination:
|
||||||
|
//
|
||||||
|
// var nt NullTime
|
||||||
|
// err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
|
||||||
|
// ...
|
||||||
|
// if nt.Valid {
|
||||||
|
// // use nt.Time
|
||||||
|
// } else {
|
||||||
|
// // NULL value
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// This NullTime implementation is not driver-specific
|
||||||
|
type NullTime struct {
|
||||||
|
Time time.Time
|
||||||
|
Valid bool // Valid is true if Time is not NULL
|
||||||
|
}
|
||||||
|
|
||||||
|
// for internal use.
|
||||||
|
// the mysql package uses sql.NullTime if it is available.
|
||||||
|
// if not, the package uses mysql.NullTime.
|
||||||
|
type nullTime = NullTime // sql.NullTime is not available
|
78
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
78
vendor/github.com/go-sql-driver/mysql/packets.go
generated
vendored
@ -110,14 +110,15 @@ func (mc *mysqlConn) writePacket(data []byte) error {
|
|||||||
conn = mc.rawConn
|
conn = mc.rawConn
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
if mc.cfg.CheckConnLiveness {
|
// If this connection has a ReadTimeout which we've been setting on
|
||||||
|
// reads, reset it to its default value before we attempt a non-blocking
|
||||||
|
// read, otherwise the scheduler will just time us out before we can read
|
||||||
if mc.cfg.ReadTimeout != 0 {
|
if mc.cfg.ReadTimeout != 0 {
|
||||||
err = conn.SetReadDeadline(time.Now().Add(mc.cfg.ReadTimeout))
|
err = conn.SetReadDeadline(time.Time{})
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil && mc.cfg.CheckConnLiveness {
|
||||||
err = connCheck(conn)
|
err = connCheck(conn)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errLog.Print("closing bad idle connection: ", err)
|
errLog.Print("closing bad idle connection: ", err)
|
||||||
mc.Close()
|
mc.Close()
|
||||||
@ -222,9 +223,9 @@ func (mc *mysqlConn) readHandshakePacket() (data []byte, plugin string, err erro
|
|||||||
if mc.flags&clientProtocol41 == 0 {
|
if mc.flags&clientProtocol41 == 0 {
|
||||||
return nil, "", ErrOldProtocol
|
return nil, "", ErrOldProtocol
|
||||||
}
|
}
|
||||||
if mc.flags&clientSSL == 0 && mc.cfg.TLS != nil {
|
if mc.flags&clientSSL == 0 && mc.cfg.tls != nil {
|
||||||
if mc.cfg.AllowFallbackToPlaintext {
|
if mc.cfg.TLSConfig == "preferred" {
|
||||||
mc.cfg.TLS = nil
|
mc.cfg.tls = nil
|
||||||
} else {
|
} else {
|
||||||
return nil, "", ErrNoTLS
|
return nil, "", ErrNoTLS
|
||||||
}
|
}
|
||||||
@ -292,7 +293,7 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
|
|||||||
}
|
}
|
||||||
|
|
||||||
// To enable TLS / SSL
|
// To enable TLS / SSL
|
||||||
if mc.cfg.TLS != nil {
|
if mc.cfg.tls != nil {
|
||||||
clientFlags |= clientSSL
|
clientFlags |= clientSSL
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,14 +357,14 @@ func (mc *mysqlConn) writeHandshakeResponsePacket(authResp []byte, plugin string
|
|||||||
|
|
||||||
// SSL Connection Request Packet
|
// SSL Connection Request Packet
|
||||||
// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
|
// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
|
||||||
if mc.cfg.TLS != nil {
|
if mc.cfg.tls != nil {
|
||||||
// Send TLS / SSL request packet
|
// Send TLS / SSL request packet
|
||||||
if err := mc.writePacket(data[:(4+4+1+23)+4]); err != nil {
|
if err := mc.writePacket(data[:(4+4+1+23)+4]); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Switch to TLS
|
// Switch to TLS
|
||||||
tlsConn := tls.Client(mc.netConn, mc.cfg.TLS)
|
tlsConn := tls.Client(mc.netConn, mc.cfg.tls)
|
||||||
if err := tlsConn.Handshake(); err != nil {
|
if err := tlsConn.Handshake(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -587,20 +588,19 @@ func (mc *mysqlConn) handleErrorPacket(data []byte) error {
|
|||||||
return driver.ErrBadConn
|
return driver.ErrBadConn
|
||||||
}
|
}
|
||||||
|
|
||||||
me := &MySQLError{Number: errno}
|
|
||||||
|
|
||||||
pos := 3
|
pos := 3
|
||||||
|
|
||||||
// SQL State [optional: # + 5bytes string]
|
// SQL State [optional: # + 5bytes string]
|
||||||
if data[3] == 0x23 {
|
if data[3] == 0x23 {
|
||||||
copy(me.SQLState[:], data[4:4+5])
|
//sqlstate := string(data[4 : 4+5])
|
||||||
pos = 9
|
pos = 9
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error Message [string]
|
// Error Message [string]
|
||||||
me.Message = string(data[pos:])
|
return &MySQLError{
|
||||||
|
Number: errno,
|
||||||
return me
|
Message: string(data[pos:]),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func readStatus(b []byte) statusFlag {
|
func readStatus(b []byte) statusFlag {
|
||||||
@ -761,40 +761,40 @@ func (rows *textRows) readRow(dest []driver.Value) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// RowSet Packet
|
// RowSet Packet
|
||||||
var (
|
var n int
|
||||||
n int
|
var isNull bool
|
||||||
isNull bool
|
pos := 0
|
||||||
pos int = 0
|
|
||||||
)
|
|
||||||
|
|
||||||
for i := range dest {
|
for i := range dest {
|
||||||
// Read bytes and convert to string
|
// Read bytes and convert to string
|
||||||
dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
|
dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
|
||||||
pos += n
|
pos += n
|
||||||
|
if err == nil {
|
||||||
if err != nil {
|
if !isNull {
|
||||||
return err
|
if !mc.parseTime {
|
||||||
|
continue
|
||||||
|
} else {
|
||||||
|
switch rows.rs.columns[i].fieldType {
|
||||||
|
case fieldTypeTimestamp, fieldTypeDateTime,
|
||||||
|
fieldTypeDate, fieldTypeNewDate:
|
||||||
|
dest[i], err = parseDateTime(
|
||||||
|
dest[i].([]byte),
|
||||||
|
mc.cfg.Loc,
|
||||||
|
)
|
||||||
|
if err == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if isNull {
|
} else {
|
||||||
dest[i] = nil
|
dest[i] = nil
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !mc.parseTime {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse time field
|
|
||||||
switch rows.rs.columns[i].fieldType {
|
|
||||||
case fieldTypeTimestamp,
|
|
||||||
fieldTypeDateTime,
|
|
||||||
fieldTypeDate,
|
|
||||||
fieldTypeNewDate:
|
|
||||||
if dest[i], err = parseDateTime(dest[i].([]byte), mc.cfg.Loc); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return err // err != nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
8
vendor/github.com/go-sql-driver/mysql/statement.go
generated
vendored
8
vendor/github.com/go-sql-driver/mysql/statement.go
generated
vendored
@ -23,7 +23,7 @@ type mysqlStmt struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (stmt *mysqlStmt) Close() error {
|
func (stmt *mysqlStmt) Close() error {
|
||||||
if stmt.mc == nil || stmt.mc.closed.Load() {
|
if stmt.mc == nil || stmt.mc.closed.IsSet() {
|
||||||
// driver.Stmt.Close can be called more than once, thus this function
|
// driver.Stmt.Close can be called more than once, thus this function
|
||||||
// has to be idempotent.
|
// has to be idempotent.
|
||||||
// See also Issue #450 and golang/go#16019.
|
// See also Issue #450 and golang/go#16019.
|
||||||
@ -50,7 +50,7 @@ func (stmt *mysqlStmt) CheckNamedValue(nv *driver.NamedValue) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
|
func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
|
||||||
if stmt.mc.closed.Load() {
|
if stmt.mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -98,7 +98,7 @@ func (stmt *mysqlStmt) Query(args []driver.Value) (driver.Rows, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (stmt *mysqlStmt) query(args []driver.Value) (*binaryRows, error) {
|
func (stmt *mysqlStmt) query(args []driver.Value) (*binaryRows, error) {
|
||||||
if stmt.mc.closed.Load() {
|
if stmt.mc.closed.IsSet() {
|
||||||
errLog.Print(ErrInvalidConn)
|
errLog.Print(ErrInvalidConn)
|
||||||
return nil, driver.ErrBadConn
|
return nil, driver.ErrBadConn
|
||||||
}
|
}
|
||||||
@ -157,7 +157,7 @@ func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
|
|||||||
if driver.IsValue(sv) {
|
if driver.IsValue(sv) {
|
||||||
return sv, nil
|
return sv, nil
|
||||||
}
|
}
|
||||||
// A value returned from the Valuer interface can be "a type handled by
|
// A value returend from the Valuer interface can be "a type handled by
|
||||||
// a database driver's NamedValueChecker interface" so we should accept
|
// a database driver's NamedValueChecker interface" so we should accept
|
||||||
// uint64 here as well.
|
// uint64 here as well.
|
||||||
if u, ok := sv.(uint64); ok {
|
if u, ok := sv.(uint64); ok {
|
||||||
|
4
vendor/github.com/go-sql-driver/mysql/transaction.go
generated
vendored
4
vendor/github.com/go-sql-driver/mysql/transaction.go
generated
vendored
@ -13,7 +13,7 @@ type mysqlTx struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tx *mysqlTx) Commit() (err error) {
|
func (tx *mysqlTx) Commit() (err error) {
|
||||||
if tx.mc == nil || tx.mc.closed.Load() {
|
if tx.mc == nil || tx.mc.closed.IsSet() {
|
||||||
return ErrInvalidConn
|
return ErrInvalidConn
|
||||||
}
|
}
|
||||||
err = tx.mc.exec("COMMIT")
|
err = tx.mc.exec("COMMIT")
|
||||||
@ -22,7 +22,7 @@ func (tx *mysqlTx) Commit() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (tx *mysqlTx) Rollback() (err error) {
|
func (tx *mysqlTx) Rollback() (err error) {
|
||||||
if tx.mc == nil || tx.mc.closed.Load() {
|
if tx.mc == nil || tx.mc.closed.IsSet() {
|
||||||
return ErrInvalidConn
|
return ErrInvalidConn
|
||||||
}
|
}
|
||||||
err = tx.mc.exec("ROLLBACK")
|
err = tx.mc.exec("ROLLBACK")
|
||||||
|
82
vendor/github.com/go-sql-driver/mysql/utils.go
generated
vendored
82
vendor/github.com/go-sql-driver/mysql/utils.go
generated
vendored
@ -54,6 +54,7 @@ var (
|
|||||||
// Certificates: clientCert,
|
// Certificates: clientCert,
|
||||||
// })
|
// })
|
||||||
// db, err := sql.Open("mysql", "user@tcp(localhost:3306)/test?tls=custom")
|
// db, err := sql.Open("mysql", "user@tcp(localhost:3306)/test?tls=custom")
|
||||||
|
//
|
||||||
func RegisterTLSConfig(key string, config *tls.Config) error {
|
func RegisterTLSConfig(key string, config *tls.Config) error {
|
||||||
if _, isBool := readBool(key); isBool || strings.ToLower(key) == "skip-verify" || strings.ToLower(key) == "preferred" {
|
if _, isBool := readBool(key); isBool || strings.ToLower(key) == "skip-verify" || strings.ToLower(key) == "preferred" {
|
||||||
return fmt.Errorf("key '%s' is reserved", key)
|
return fmt.Errorf("key '%s' is reserved", key)
|
||||||
@ -117,6 +118,10 @@ func parseDateTime(b []byte, loc *time.Location) (time.Time, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return time.Time{}, err
|
return time.Time{}, err
|
||||||
}
|
}
|
||||||
|
if year <= 0 {
|
||||||
|
year = 1
|
||||||
|
}
|
||||||
|
|
||||||
if b[4] != '-' {
|
if b[4] != '-' {
|
||||||
return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[4])
|
return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[4])
|
||||||
}
|
}
|
||||||
@ -125,6 +130,9 @@ func parseDateTime(b []byte, loc *time.Location) (time.Time, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return time.Time{}, err
|
return time.Time{}, err
|
||||||
}
|
}
|
||||||
|
if m <= 0 {
|
||||||
|
m = 1
|
||||||
|
}
|
||||||
month := time.Month(m)
|
month := time.Month(m)
|
||||||
|
|
||||||
if b[7] != '-' {
|
if b[7] != '-' {
|
||||||
@ -135,6 +143,9 @@ func parseDateTime(b []byte, loc *time.Location) (time.Time, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return time.Time{}, err
|
return time.Time{}, err
|
||||||
}
|
}
|
||||||
|
if day <= 0 {
|
||||||
|
day = 1
|
||||||
|
}
|
||||||
if len(b) == 10 {
|
if len(b) == 10 {
|
||||||
return time.Date(year, month, day, 0, 0, 0, 0, loc), nil
|
return time.Date(year, month, day, 0, 0, 0, 0, loc), nil
|
||||||
}
|
}
|
||||||
@ -188,7 +199,7 @@ func parseByteYear(b []byte) (int, error) {
|
|||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
year += v * n
|
year += v * n
|
||||||
n /= 10
|
n = n / 10
|
||||||
}
|
}
|
||||||
return year, nil
|
return year, nil
|
||||||
}
|
}
|
||||||
@ -531,7 +542,7 @@ func stringToInt(b []byte) int {
|
|||||||
return val
|
return val
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns the string read as a bytes slice, whether the value is NULL,
|
// returns the string read as a bytes slice, wheter the value is NULL,
|
||||||
// the number of bytes read and an error, in case the string is longer than
|
// the number of bytes read and an error, in case the string is longer than
|
||||||
// the input slice
|
// the input slice
|
||||||
func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
|
func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
|
||||||
@ -641,32 +652,32 @@ func escapeBytesBackslash(buf, v []byte) []byte {
|
|||||||
for _, c := range v {
|
for _, c := range v {
|
||||||
switch c {
|
switch c {
|
||||||
case '\x00':
|
case '\x00':
|
||||||
buf[pos+1] = '0'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '0'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\n':
|
case '\n':
|
||||||
buf[pos+1] = 'n'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'n'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\r':
|
case '\r':
|
||||||
buf[pos+1] = 'r'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'r'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\x1a':
|
case '\x1a':
|
||||||
buf[pos+1] = 'Z'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'Z'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\'':
|
case '\'':
|
||||||
buf[pos+1] = '\''
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '\''
|
||||||
pos += 2
|
pos += 2
|
||||||
case '"':
|
case '"':
|
||||||
buf[pos+1] = '"'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '"'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\\':
|
case '\\':
|
||||||
buf[pos+1] = '\\'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '\\'
|
||||||
pos += 2
|
pos += 2
|
||||||
default:
|
default:
|
||||||
buf[pos] = c
|
buf[pos] = c
|
||||||
@ -686,32 +697,32 @@ func escapeStringBackslash(buf []byte, v string) []byte {
|
|||||||
c := v[i]
|
c := v[i]
|
||||||
switch c {
|
switch c {
|
||||||
case '\x00':
|
case '\x00':
|
||||||
buf[pos+1] = '0'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '0'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\n':
|
case '\n':
|
||||||
buf[pos+1] = 'n'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'n'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\r':
|
case '\r':
|
||||||
buf[pos+1] = 'r'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'r'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\x1a':
|
case '\x1a':
|
||||||
buf[pos+1] = 'Z'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = 'Z'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\'':
|
case '\'':
|
||||||
buf[pos+1] = '\''
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '\''
|
||||||
pos += 2
|
pos += 2
|
||||||
case '"':
|
case '"':
|
||||||
buf[pos+1] = '"'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '"'
|
||||||
pos += 2
|
pos += 2
|
||||||
case '\\':
|
case '\\':
|
||||||
buf[pos+1] = '\\'
|
|
||||||
buf[pos] = '\\'
|
buf[pos] = '\\'
|
||||||
|
buf[pos+1] = '\\'
|
||||||
pos += 2
|
pos += 2
|
||||||
default:
|
default:
|
||||||
buf[pos] = c
|
buf[pos] = c
|
||||||
@ -733,8 +744,8 @@ func escapeBytesQuotes(buf, v []byte) []byte {
|
|||||||
|
|
||||||
for _, c := range v {
|
for _, c := range v {
|
||||||
if c == '\'' {
|
if c == '\'' {
|
||||||
buf[pos+1] = '\''
|
|
||||||
buf[pos] = '\''
|
buf[pos] = '\''
|
||||||
|
buf[pos+1] = '\''
|
||||||
pos += 2
|
pos += 2
|
||||||
} else {
|
} else {
|
||||||
buf[pos] = c
|
buf[pos] = c
|
||||||
@ -753,8 +764,8 @@ func escapeStringQuotes(buf []byte, v string) []byte {
|
|||||||
for i := 0; i < len(v); i++ {
|
for i := 0; i < len(v); i++ {
|
||||||
c := v[i]
|
c := v[i]
|
||||||
if c == '\'' {
|
if c == '\'' {
|
||||||
buf[pos+1] = '\''
|
|
||||||
buf[pos] = '\''
|
buf[pos] = '\''
|
||||||
|
buf[pos+1] = '\''
|
||||||
pos += 2
|
pos += 2
|
||||||
} else {
|
} else {
|
||||||
buf[pos] = c
|
buf[pos] = c
|
||||||
@ -779,15 +790,38 @@ type noCopy struct{}
|
|||||||
// Lock is a no-op used by -copylocks checker from `go vet`.
|
// Lock is a no-op used by -copylocks checker from `go vet`.
|
||||||
func (*noCopy) Lock() {}
|
func (*noCopy) Lock() {}
|
||||||
|
|
||||||
// Unlock is a no-op used by -copylocks checker from `go vet`.
|
// atomicBool is a wrapper around uint32 for usage as a boolean value with
|
||||||
// noCopy should implement sync.Locker from Go 1.11
|
// atomic access.
|
||||||
// https://github.com/golang/go/commit/c2eba53e7f80df21d51285879d51ab81bcfbf6bc
|
type atomicBool struct {
|
||||||
// https://github.com/golang/go/issues/26165
|
_noCopy noCopy
|
||||||
func (*noCopy) Unlock() {}
|
value uint32
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsSet returns whether the current boolean value is true
|
||||||
|
func (ab *atomicBool) IsSet() bool {
|
||||||
|
return atomic.LoadUint32(&ab.value) > 0
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set sets the value of the bool regardless of the previous value
|
||||||
|
func (ab *atomicBool) Set(value bool) {
|
||||||
|
if value {
|
||||||
|
atomic.StoreUint32(&ab.value, 1)
|
||||||
|
} else {
|
||||||
|
atomic.StoreUint32(&ab.value, 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TrySet sets the value of the bool and returns whether the value changed
|
||||||
|
func (ab *atomicBool) TrySet(value bool) bool {
|
||||||
|
if value {
|
||||||
|
return atomic.SwapUint32(&ab.value, 1) == 0
|
||||||
|
}
|
||||||
|
return atomic.SwapUint32(&ab.value, 0) > 0
|
||||||
|
}
|
||||||
|
|
||||||
// atomicError is a wrapper for atomically accessed error values
|
// atomicError is a wrapper for atomically accessed error values
|
||||||
type atomicError struct {
|
type atomicError struct {
|
||||||
_ noCopy
|
_noCopy noCopy
|
||||||
value atomic.Value
|
value atomic.Value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
vendor/github.com/jinzhu/gorm/go.mod
generated
vendored
Normal file
14
vendor/github.com/jinzhu/gorm/go.mod
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
module github.com/jinzhu/gorm
|
||||||
|
|
||||||
|
go 1.12
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd
|
||||||
|
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0
|
||||||
|
github.com/jinzhu/inflection v1.0.0
|
||||||
|
github.com/jinzhu/now v1.0.1
|
||||||
|
github.com/lib/pq v1.1.1
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.0
|
||||||
|
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd // indirect
|
||||||
|
)
|
33
vendor/github.com/jinzhu/gorm/go.sum
generated
vendored
Normal file
33
vendor/github.com/jinzhu/gorm/go.sum
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
|
||||||
|
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
|
||||||
|
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd h1:83Wprp6ROGeiHFAP8WJdI2RoxALQYgdllERc3N5N2DM=
|
||||||
|
github.com/denisenkom/go-mssqldb v0.0.0-20191124224453-732737034ffd/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
|
||||||
|
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
|
||||||
|
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY=
|
||||||
|
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
|
||||||
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
|
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
|
||||||
|
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
|
||||||
|
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
|
||||||
|
github.com/mattn/go-sqlite3 v2.0.1+incompatible h1:xQ15muvnzGBHpIpdrNi1DA5x0+TcBZzsIDwmw9uTHzw=
|
||||||
|
github.com/mattn/go-sqlite3 v2.0.1+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||||
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd h1:GGJVjV8waZKRHrgwvtH66z9ZGVurTD1MT0n1Bb+q4aM=
|
||||||
|
golang.org/x/crypto v0.0.0-20191205180655-e7c4368fe9dd/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
1
vendor/github.com/jinzhu/inflection/go.mod
generated
vendored
Normal file
1
vendor/github.com/jinzhu/inflection/go.mod
generated
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
module github.com/jinzhu/inflection
|
5
vendor/github.com/jmoiron/sqlx/.travis.yml
generated
vendored
5
vendor/github.com/jmoiron/sqlx/.travis.yml
generated
vendored
@ -18,8 +18,9 @@ before_install:
|
|||||||
|
|
||||||
# go versions to test
|
# go versions to test
|
||||||
go:
|
go:
|
||||||
- "1.15.x"
|
- "1.10.x"
|
||||||
- "1.16.x"
|
- "1.11.x"
|
||||||
|
- "1.12.x"
|
||||||
|
|
||||||
# run tests w/ coverage
|
# run tests w/ coverage
|
||||||
script:
|
script:
|
||||||
|
2
vendor/github.com/jmoiron/sqlx/bind.go
generated
vendored
2
vendor/github.com/jmoiron/sqlx/bind.go
generated
vendored
@ -24,7 +24,7 @@ const (
|
|||||||
var defaultBinds = map[int][]string{
|
var defaultBinds = map[int][]string{
|
||||||
DOLLAR: []string{"postgres", "pgx", "pq-timeouts", "cloudsqlpostgres", "ql", "nrpostgres", "cockroach"},
|
DOLLAR: []string{"postgres", "pgx", "pq-timeouts", "cloudsqlpostgres", "ql", "nrpostgres", "cockroach"},
|
||||||
QUESTION: []string{"mysql", "sqlite3", "nrmysql", "nrsqlite3"},
|
QUESTION: []string{"mysql", "sqlite3", "nrmysql", "nrsqlite3"},
|
||||||
NAMED: []string{"oci8", "ora", "goracle", "godror"},
|
NAMED: []string{"oci8", "ora", "goracle"},
|
||||||
AT: []string{"sqlserver"},
|
AT: []string{"sqlserver"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
vendor/github.com/jmoiron/sqlx/go.mod
generated
vendored
Normal file
9
vendor/github.com/jmoiron/sqlx/go.mod
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
module github.com/jmoiron/sqlx
|
||||||
|
|
||||||
|
go 1.10
|
||||||
|
|
||||||
|
require (
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0
|
||||||
|
github.com/lib/pq v1.2.0
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.6
|
||||||
|
)
|
6
vendor/github.com/jmoiron/sqlx/go.sum
generated
vendored
Normal file
6
vendor/github.com/jmoiron/sqlx/go.sum
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||||
|
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
|
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
|
||||||
|
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.6 h1:dNPt6NO46WmLVt2DLNpwczCmdV5boIZ6g/tlDrlRUbg=
|
||||||
|
github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
|
38
vendor/github.com/jmoiron/sqlx/named.go
generated
vendored
38
vendor/github.com/jmoiron/sqlx/named.go
generated
vendored
@ -224,47 +224,21 @@ func bindStruct(bindType int, query string, arg interface{}, m *reflectx.Mapper)
|
|||||||
return bound, arglist, nil
|
return bound, arglist, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var valuesReg = regexp.MustCompile(`\)\s*(?i)VALUES\s*\(`)
|
var valueBracketReg = regexp.MustCompile(`\([^(]*.[^(]\)$`)
|
||||||
|
|
||||||
func findMatchingClosingBracketIndex(s string) int {
|
|
||||||
count := 0
|
|
||||||
for i, ch := range s {
|
|
||||||
if ch == '(' {
|
|
||||||
count++
|
|
||||||
}
|
|
||||||
if ch == ')' {
|
|
||||||
count--
|
|
||||||
if count == 0 {
|
|
||||||
return i
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func fixBound(bound string, loop int) string {
|
func fixBound(bound string, loop int) string {
|
||||||
loc := valuesReg.FindStringIndex(bound)
|
loc := valueBracketReg.FindStringIndex(bound)
|
||||||
// defensive guard when "VALUES (...)" not found
|
if len(loc) != 2 {
|
||||||
if len(loc) < 2 {
|
|
||||||
return bound
|
return bound
|
||||||
}
|
}
|
||||||
|
|
||||||
openingBracketIndex := loc[1] - 1
|
|
||||||
index := findMatchingClosingBracketIndex(bound[openingBracketIndex:])
|
|
||||||
// defensive guard. must have closing bracket
|
|
||||||
if index == 0 {
|
|
||||||
return bound
|
|
||||||
}
|
|
||||||
closingBracketIndex := openingBracketIndex + index + 1
|
|
||||||
|
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
|
|
||||||
buffer.WriteString(bound[0:closingBracketIndex])
|
buffer.WriteString(bound[0:loc[1]])
|
||||||
for i := 0; i < loop-1; i++ {
|
for i := 0; i < loop-1; i++ {
|
||||||
buffer.WriteString(",")
|
buffer.WriteString(",")
|
||||||
buffer.WriteString(bound[openingBracketIndex:closingBracketIndex])
|
buffer.WriteString(bound[loc[0]:loc[1]])
|
||||||
}
|
}
|
||||||
buffer.WriteString(bound[closingBracketIndex:])
|
buffer.WriteString(bound[loc[1]:])
|
||||||
return buffer.String()
|
return buffer.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
8
vendor/github.com/jmoiron/sqlx/sqlx.go
generated
vendored
8
vendor/github.com/jmoiron/sqlx/sqlx.go
generated
vendored
@ -878,10 +878,9 @@ func structOnlyError(t reflect.Type) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// scanAll scans all rows into a destination, which must be a slice of any
|
// scanAll scans all rows into a destination, which must be a slice of any
|
||||||
// type. It resets the slice length to zero before appending each element to
|
// type. If the destination slice type is a Struct, then StructScan will be
|
||||||
// the slice. If the destination slice type is a Struct, then StructScan will
|
// used on each row. If the destination is some other kind of base type, then
|
||||||
// be used on each row. If the destination is some other kind of base type,
|
// each row must only have one column which can scan into that type. This
|
||||||
// then each row must only have one column which can scan into that type. This
|
|
||||||
// allows you to do something like:
|
// allows you to do something like:
|
||||||
//
|
//
|
||||||
// rows, _ := db.Query("select id from people;")
|
// rows, _ := db.Query("select id from people;")
|
||||||
@ -911,7 +910,6 @@ func scanAll(rows rowsi, dest interface{}, structOnly bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
direct.SetLen(0)
|
|
||||||
|
|
||||||
isPtr := slice.Elem().Kind() == reflect.Ptr
|
isPtr := slice.Elem().Kind() == reflect.Ptr
|
||||||
base := reflectx.Deref(slice.Elem())
|
base := reflectx.Deref(slice.Elem())
|
||||||
|
3
vendor/golang.org/x/crypto/AUTHORS
generated
vendored
Normal file
3
vendor/golang.org/x/crypto/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code refers to The Go Authors for copyright purposes.
|
||||||
|
# The master list of authors is in the main Go distribution,
|
||||||
|
# visible at https://tip.golang.org/AUTHORS.
|
3
vendor/golang.org/x/crypto/CONTRIBUTORS
generated
vendored
Normal file
3
vendor/golang.org/x/crypto/CONTRIBUTORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code was written by the Go contributors.
|
||||||
|
# The master list of contributors is in the main Go distribution,
|
||||||
|
# visible at https://tip.golang.org/CONTRIBUTORS.
|
188
vendor/golang.org/x/crypto/ed25519/ed25519.go
generated
vendored
188
vendor/golang.org/x/crypto/ed25519/ed25519.go
generated
vendored
@ -1,7 +1,13 @@
|
|||||||
// Copyright 2019 The Go Authors. All rights reserved.
|
// Copyright 2016 The Go Authors. All rights reserved.
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
// In Go 1.13, the ed25519 package was promoted to the standard library as
|
||||||
|
// crypto/ed25519, and this package became a wrapper for the standard library one.
|
||||||
|
//
|
||||||
|
//go:build !go1.13
|
||||||
|
// +build !go1.13
|
||||||
|
|
||||||
// Package ed25519 implements the Ed25519 signature algorithm. See
|
// Package ed25519 implements the Ed25519 signature algorithm. See
|
||||||
// https://ed25519.cr.yp.to/.
|
// https://ed25519.cr.yp.to/.
|
||||||
//
|
//
|
||||||
@ -10,15 +16,21 @@
|
|||||||
// representation includes a public key suffix to make multiple signing
|
// representation includes a public key suffix to make multiple signing
|
||||||
// operations with the same key more efficient. This package refers to the RFC
|
// operations with the same key more efficient. This package refers to the RFC
|
||||||
// 8032 private key as the “seed”.
|
// 8032 private key as the “seed”.
|
||||||
//
|
|
||||||
// Beginning with Go 1.13, the functionality of this package was moved to the
|
|
||||||
// standard library as crypto/ed25519. This package only acts as a compatibility
|
|
||||||
// wrapper.
|
|
||||||
package ed25519
|
package ed25519
|
||||||
|
|
||||||
|
// This code is a port of the public domain, “ref10” implementation of ed25519
|
||||||
|
// from SUPERCOP.
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ed25519"
|
"bytes"
|
||||||
|
"crypto"
|
||||||
|
cryptorand "crypto/rand"
|
||||||
|
"crypto/sha512"
|
||||||
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"golang.org/x/crypto/ed25519/internal/edwards25519"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -33,21 +45,57 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// PublicKey is the type of Ed25519 public keys.
|
// PublicKey is the type of Ed25519 public keys.
|
||||||
//
|
type PublicKey []byte
|
||||||
// This type is an alias for crypto/ed25519's PublicKey type.
|
|
||||||
// See the crypto/ed25519 package for the methods on this type.
|
|
||||||
type PublicKey = ed25519.PublicKey
|
|
||||||
|
|
||||||
// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
|
// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
|
||||||
//
|
type PrivateKey []byte
|
||||||
// This type is an alias for crypto/ed25519's PrivateKey type.
|
|
||||||
// See the crypto/ed25519 package for the methods on this type.
|
// Public returns the PublicKey corresponding to priv.
|
||||||
type PrivateKey = ed25519.PrivateKey
|
func (priv PrivateKey) Public() crypto.PublicKey {
|
||||||
|
publicKey := make([]byte, PublicKeySize)
|
||||||
|
copy(publicKey, priv[32:])
|
||||||
|
return PublicKey(publicKey)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Seed returns the private key seed corresponding to priv. It is provided for
|
||||||
|
// interoperability with RFC 8032. RFC 8032's private keys correspond to seeds
|
||||||
|
// in this package.
|
||||||
|
func (priv PrivateKey) Seed() []byte {
|
||||||
|
seed := make([]byte, SeedSize)
|
||||||
|
copy(seed, priv[:32])
|
||||||
|
return seed
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sign signs the given message with priv.
|
||||||
|
// Ed25519 performs two passes over messages to be signed and therefore cannot
|
||||||
|
// handle pre-hashed messages. Thus opts.HashFunc() must return zero to
|
||||||
|
// indicate the message hasn't been hashed. This can be achieved by passing
|
||||||
|
// crypto.Hash(0) as the value for opts.
|
||||||
|
func (priv PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) (signature []byte, err error) {
|
||||||
|
if opts.HashFunc() != crypto.Hash(0) {
|
||||||
|
return nil, errors.New("ed25519: cannot sign hashed message")
|
||||||
|
}
|
||||||
|
|
||||||
|
return Sign(priv, message), nil
|
||||||
|
}
|
||||||
|
|
||||||
// GenerateKey generates a public/private key pair using entropy from rand.
|
// GenerateKey generates a public/private key pair using entropy from rand.
|
||||||
// If rand is nil, crypto/rand.Reader will be used.
|
// If rand is nil, crypto/rand.Reader will be used.
|
||||||
func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
|
func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
|
||||||
return ed25519.GenerateKey(rand)
|
if rand == nil {
|
||||||
|
rand = cryptorand.Reader
|
||||||
|
}
|
||||||
|
|
||||||
|
seed := make([]byte, SeedSize)
|
||||||
|
if _, err := io.ReadFull(rand, seed); err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
privateKey := NewKeyFromSeed(seed)
|
||||||
|
publicKey := make([]byte, PublicKeySize)
|
||||||
|
copy(publicKey, privateKey[32:])
|
||||||
|
|
||||||
|
return publicKey, privateKey, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewKeyFromSeed calculates a private key from a seed. It will panic if
|
// NewKeyFromSeed calculates a private key from a seed. It will panic if
|
||||||
@ -55,17 +103,121 @@ func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
|
|||||||
// with RFC 8032. RFC 8032's private keys correspond to seeds in this
|
// with RFC 8032. RFC 8032's private keys correspond to seeds in this
|
||||||
// package.
|
// package.
|
||||||
func NewKeyFromSeed(seed []byte) PrivateKey {
|
func NewKeyFromSeed(seed []byte) PrivateKey {
|
||||||
return ed25519.NewKeyFromSeed(seed)
|
if l := len(seed); l != SeedSize {
|
||||||
|
panic("ed25519: bad seed length: " + strconv.Itoa(l))
|
||||||
|
}
|
||||||
|
|
||||||
|
digest := sha512.Sum512(seed)
|
||||||
|
digest[0] &= 248
|
||||||
|
digest[31] &= 127
|
||||||
|
digest[31] |= 64
|
||||||
|
|
||||||
|
var A edwards25519.ExtendedGroupElement
|
||||||
|
var hBytes [32]byte
|
||||||
|
copy(hBytes[:], digest[:])
|
||||||
|
edwards25519.GeScalarMultBase(&A, &hBytes)
|
||||||
|
var publicKeyBytes [32]byte
|
||||||
|
A.ToBytes(&publicKeyBytes)
|
||||||
|
|
||||||
|
privateKey := make([]byte, PrivateKeySize)
|
||||||
|
copy(privateKey, seed)
|
||||||
|
copy(privateKey[32:], publicKeyBytes[:])
|
||||||
|
|
||||||
|
return privateKey
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sign signs the message with privateKey and returns a signature. It will
|
// Sign signs the message with privateKey and returns a signature. It will
|
||||||
// panic if len(privateKey) is not PrivateKeySize.
|
// panic if len(privateKey) is not PrivateKeySize.
|
||||||
func Sign(privateKey PrivateKey, message []byte) []byte {
|
func Sign(privateKey PrivateKey, message []byte) []byte {
|
||||||
return ed25519.Sign(privateKey, message)
|
if l := len(privateKey); l != PrivateKeySize {
|
||||||
|
panic("ed25519: bad private key length: " + strconv.Itoa(l))
|
||||||
|
}
|
||||||
|
|
||||||
|
h := sha512.New()
|
||||||
|
h.Write(privateKey[:32])
|
||||||
|
|
||||||
|
var digest1, messageDigest, hramDigest [64]byte
|
||||||
|
var expandedSecretKey [32]byte
|
||||||
|
h.Sum(digest1[:0])
|
||||||
|
copy(expandedSecretKey[:], digest1[:])
|
||||||
|
expandedSecretKey[0] &= 248
|
||||||
|
expandedSecretKey[31] &= 63
|
||||||
|
expandedSecretKey[31] |= 64
|
||||||
|
|
||||||
|
h.Reset()
|
||||||
|
h.Write(digest1[32:])
|
||||||
|
h.Write(message)
|
||||||
|
h.Sum(messageDigest[:0])
|
||||||
|
|
||||||
|
var messageDigestReduced [32]byte
|
||||||
|
edwards25519.ScReduce(&messageDigestReduced, &messageDigest)
|
||||||
|
var R edwards25519.ExtendedGroupElement
|
||||||
|
edwards25519.GeScalarMultBase(&R, &messageDigestReduced)
|
||||||
|
|
||||||
|
var encodedR [32]byte
|
||||||
|
R.ToBytes(&encodedR)
|
||||||
|
|
||||||
|
h.Reset()
|
||||||
|
h.Write(encodedR[:])
|
||||||
|
h.Write(privateKey[32:])
|
||||||
|
h.Write(message)
|
||||||
|
h.Sum(hramDigest[:0])
|
||||||
|
var hramDigestReduced [32]byte
|
||||||
|
edwards25519.ScReduce(&hramDigestReduced, &hramDigest)
|
||||||
|
|
||||||
|
var s [32]byte
|
||||||
|
edwards25519.ScMulAdd(&s, &hramDigestReduced, &expandedSecretKey, &messageDigestReduced)
|
||||||
|
|
||||||
|
signature := make([]byte, SignatureSize)
|
||||||
|
copy(signature[:], encodedR[:])
|
||||||
|
copy(signature[32:], s[:])
|
||||||
|
|
||||||
|
return signature
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify reports whether sig is a valid signature of message by publicKey. It
|
// Verify reports whether sig is a valid signature of message by publicKey. It
|
||||||
// will panic if len(publicKey) is not PublicKeySize.
|
// will panic if len(publicKey) is not PublicKeySize.
|
||||||
func Verify(publicKey PublicKey, message, sig []byte) bool {
|
func Verify(publicKey PublicKey, message, sig []byte) bool {
|
||||||
return ed25519.Verify(publicKey, message, sig)
|
if l := len(publicKey); l != PublicKeySize {
|
||||||
|
panic("ed25519: bad public key length: " + strconv.Itoa(l))
|
||||||
|
}
|
||||||
|
|
||||||
|
if len(sig) != SignatureSize || sig[63]&224 != 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
var A edwards25519.ExtendedGroupElement
|
||||||
|
var publicKeyBytes [32]byte
|
||||||
|
copy(publicKeyBytes[:], publicKey)
|
||||||
|
if !A.FromBytes(&publicKeyBytes) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
edwards25519.FeNeg(&A.X, &A.X)
|
||||||
|
edwards25519.FeNeg(&A.T, &A.T)
|
||||||
|
|
||||||
|
h := sha512.New()
|
||||||
|
h.Write(sig[:32])
|
||||||
|
h.Write(publicKey[:])
|
||||||
|
h.Write(message)
|
||||||
|
var digest [64]byte
|
||||||
|
h.Sum(digest[:0])
|
||||||
|
|
||||||
|
var hReduced [32]byte
|
||||||
|
edwards25519.ScReduce(&hReduced, &digest)
|
||||||
|
|
||||||
|
var R edwards25519.ProjectiveGroupElement
|
||||||
|
var s [32]byte
|
||||||
|
copy(s[:], sig[32:])
|
||||||
|
|
||||||
|
// https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in
|
||||||
|
// the range [0, order) in order to prevent signature malleability.
|
||||||
|
if !edwards25519.ScMinimal(&s) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
edwards25519.GeDoubleScalarMultVartime(&R, &hReduced, &A, &s)
|
||||||
|
|
||||||
|
var checkR [32]byte
|
||||||
|
R.ToBytes(&checkR)
|
||||||
|
return bytes.Equal(sig[:32], checkR[:])
|
||||||
}
|
}
|
||||||
|
74
vendor/golang.org/x/crypto/ed25519/ed25519_go113.go
generated
vendored
Normal file
74
vendor/golang.org/x/crypto/ed25519/ed25519_go113.go
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
// Copyright 2019 The Go Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
//go:build go1.13
|
||||||
|
// +build go1.13
|
||||||
|
|
||||||
|
// Package ed25519 implements the Ed25519 signature algorithm. See
|
||||||
|
// https://ed25519.cr.yp.to/.
|
||||||
|
//
|
||||||
|
// These functions are also compatible with the “Ed25519” function defined in
|
||||||
|
// RFC 8032. However, unlike RFC 8032's formulation, this package's private key
|
||||||
|
// representation includes a public key suffix to make multiple signing
|
||||||
|
// operations with the same key more efficient. This package refers to the RFC
|
||||||
|
// 8032 private key as the “seed”.
|
||||||
|
//
|
||||||
|
// Beginning with Go 1.13, the functionality of this package was moved to the
|
||||||
|
// standard library as crypto/ed25519. This package only acts as a compatibility
|
||||||
|
// wrapper.
|
||||||
|
package ed25519
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/ed25519"
|
||||||
|
"io"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// PublicKeySize is the size, in bytes, of public keys as used in this package.
|
||||||
|
PublicKeySize = 32
|
||||||
|
// PrivateKeySize is the size, in bytes, of private keys as used in this package.
|
||||||
|
PrivateKeySize = 64
|
||||||
|
// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
|
||||||
|
SignatureSize = 64
|
||||||
|
// SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
|
||||||
|
SeedSize = 32
|
||||||
|
)
|
||||||
|
|
||||||
|
// PublicKey is the type of Ed25519 public keys.
|
||||||
|
//
|
||||||
|
// This type is an alias for crypto/ed25519's PublicKey type.
|
||||||
|
// See the crypto/ed25519 package for the methods on this type.
|
||||||
|
type PublicKey = ed25519.PublicKey
|
||||||
|
|
||||||
|
// PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
|
||||||
|
//
|
||||||
|
// This type is an alias for crypto/ed25519's PrivateKey type.
|
||||||
|
// See the crypto/ed25519 package for the methods on this type.
|
||||||
|
type PrivateKey = ed25519.PrivateKey
|
||||||
|
|
||||||
|
// GenerateKey generates a public/private key pair using entropy from rand.
|
||||||
|
// If rand is nil, crypto/rand.Reader will be used.
|
||||||
|
func GenerateKey(rand io.Reader) (PublicKey, PrivateKey, error) {
|
||||||
|
return ed25519.GenerateKey(rand)
|
||||||
|
}
|
||||||
|
|
||||||
|
// NewKeyFromSeed calculates a private key from a seed. It will panic if
|
||||||
|
// len(seed) is not SeedSize. This function is provided for interoperability
|
||||||
|
// with RFC 8032. RFC 8032's private keys correspond to seeds in this
|
||||||
|
// package.
|
||||||
|
func NewKeyFromSeed(seed []byte) PrivateKey {
|
||||||
|
return ed25519.NewKeyFromSeed(seed)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sign signs the message with privateKey and returns a signature. It will
|
||||||
|
// panic if len(privateKey) is not PrivateKeySize.
|
||||||
|
func Sign(privateKey PrivateKey, message []byte) []byte {
|
||||||
|
return ed25519.Sign(privateKey, message)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Verify reports whether sig is a valid signature of message by publicKey. It
|
||||||
|
// will panic if len(publicKey) is not PublicKeySize.
|
||||||
|
func Verify(publicKey PublicKey, message, sig []byte) bool {
|
||||||
|
return ed25519.Verify(publicKey, message, sig)
|
||||||
|
}
|
1422
vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go
generated
vendored
Normal file
1422
vendor/golang.org/x/crypto/ed25519/internal/edwards25519/const.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1793
vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go
generated
vendored
Normal file
1793
vendor/golang.org/x/crypto/ed25519/internal/edwards25519/edwards25519.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
12
vendor/golang.org/x/crypto/sha3/doc.go
generated
vendored
12
vendor/golang.org/x/crypto/sha3/doc.go
generated
vendored
@ -8,7 +8,8 @@
|
|||||||
// Both types of hash function use the "sponge" construction and the Keccak
|
// Both types of hash function use the "sponge" construction and the Keccak
|
||||||
// permutation. For a detailed specification see http://keccak.noekeon.org/
|
// permutation. For a detailed specification see http://keccak.noekeon.org/
|
||||||
//
|
//
|
||||||
// # Guidance
|
//
|
||||||
|
// Guidance
|
||||||
//
|
//
|
||||||
// If you aren't sure what function you need, use SHAKE256 with at least 64
|
// If you aren't sure what function you need, use SHAKE256 with at least 64
|
||||||
// bytes of output. The SHAKE instances are faster than the SHA3 instances;
|
// bytes of output. The SHAKE instances are faster than the SHA3 instances;
|
||||||
@ -18,7 +19,8 @@
|
|||||||
// secret key to the input, hash with SHAKE256 and read at least 32 bytes of
|
// secret key to the input, hash with SHAKE256 and read at least 32 bytes of
|
||||||
// output.
|
// output.
|
||||||
//
|
//
|
||||||
// # Security strengths
|
//
|
||||||
|
// Security strengths
|
||||||
//
|
//
|
||||||
// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security
|
// The SHA3-x (x equals 224, 256, 384, or 512) functions have a security
|
||||||
// strength against preimage attacks of x bits. Since they only produce "x"
|
// strength against preimage attacks of x bits. Since they only produce "x"
|
||||||
@ -29,7 +31,8 @@
|
|||||||
// is used. Requesting more than 64 or 32 bytes of output, respectively, does
|
// is used. Requesting more than 64 or 32 bytes of output, respectively, does
|
||||||
// not increase the collision-resistance of the SHAKE functions.
|
// not increase the collision-resistance of the SHAKE functions.
|
||||||
//
|
//
|
||||||
// # The sponge construction
|
//
|
||||||
|
// The sponge construction
|
||||||
//
|
//
|
||||||
// A sponge builds a pseudo-random function from a public pseudo-random
|
// A sponge builds a pseudo-random function from a public pseudo-random
|
||||||
// permutation, by applying the permutation to a state of "rate + capacity"
|
// permutation, by applying the permutation to a state of "rate + capacity"
|
||||||
@ -47,7 +50,8 @@
|
|||||||
// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means
|
// Since the KeccakF-1600 permutation is 1600 bits (200 bytes) wide, this means
|
||||||
// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.
|
// that the security strength of a sponge instance is equal to (1600 - bitrate) / 2.
|
||||||
//
|
//
|
||||||
// # Recommendations
|
//
|
||||||
|
// Recommendations
|
||||||
//
|
//
|
||||||
// The SHAKE functions are recommended for most new uses. They can produce
|
// The SHAKE functions are recommended for most new uses. They can produce
|
||||||
// output of arbitrary length. SHAKE256, with an output length of at least
|
// output of arbitrary length. SHAKE256, with an output length of at least
|
||||||
|
194
vendor/golang.org/x/crypto/sha3/keccakf.go
generated
vendored
194
vendor/golang.org/x/crypto/sha3/keccakf.go
generated
vendored
@ -7,8 +7,6 @@
|
|||||||
|
|
||||||
package sha3
|
package sha3
|
||||||
|
|
||||||
import "math/bits"
|
|
||||||
|
|
||||||
// rc stores the round constants for use in the ι step.
|
// rc stores the round constants for use in the ι step.
|
||||||
var rc = [24]uint64{
|
var rc = [24]uint64{
|
||||||
0x0000000000000001,
|
0x0000000000000001,
|
||||||
@ -62,13 +60,13 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
|
|
||||||
bc0 = a[0] ^ d0
|
bc0 = a[0] ^ d0
|
||||||
t = a[6] ^ d1
|
t = a[6] ^ d1
|
||||||
bc1 = bits.RotateLeft64(t, 44)
|
bc1 = t<<44 | t>>(64-44)
|
||||||
t = a[12] ^ d2
|
t = a[12] ^ d2
|
||||||
bc2 = bits.RotateLeft64(t, 43)
|
bc2 = t<<43 | t>>(64-43)
|
||||||
t = a[18] ^ d3
|
t = a[18] ^ d3
|
||||||
bc3 = bits.RotateLeft64(t, 21)
|
bc3 = t<<21 | t>>(64-21)
|
||||||
t = a[24] ^ d4
|
t = a[24] ^ d4
|
||||||
bc4 = bits.RotateLeft64(t, 14)
|
bc4 = t<<14 | t>>(64-14)
|
||||||
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i]
|
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i]
|
||||||
a[6] = bc1 ^ (bc3 &^ bc2)
|
a[6] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[12] = bc2 ^ (bc4 &^ bc3)
|
a[12] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -76,15 +74,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[24] = bc4 ^ (bc1 &^ bc0)
|
a[24] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[10] ^ d0
|
t = a[10] ^ d0
|
||||||
bc2 = bits.RotateLeft64(t, 3)
|
bc2 = t<<3 | t>>(64-3)
|
||||||
t = a[16] ^ d1
|
t = a[16] ^ d1
|
||||||
bc3 = bits.RotateLeft64(t, 45)
|
bc3 = t<<45 | t>>(64-45)
|
||||||
t = a[22] ^ d2
|
t = a[22] ^ d2
|
||||||
bc4 = bits.RotateLeft64(t, 61)
|
bc4 = t<<61 | t>>(64-61)
|
||||||
t = a[3] ^ d3
|
t = a[3] ^ d3
|
||||||
bc0 = bits.RotateLeft64(t, 28)
|
bc0 = t<<28 | t>>(64-28)
|
||||||
t = a[9] ^ d4
|
t = a[9] ^ d4
|
||||||
bc1 = bits.RotateLeft64(t, 20)
|
bc1 = t<<20 | t>>(64-20)
|
||||||
a[10] = bc0 ^ (bc2 &^ bc1)
|
a[10] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[16] = bc1 ^ (bc3 &^ bc2)
|
a[16] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[22] = bc2 ^ (bc4 &^ bc3)
|
a[22] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -92,15 +90,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[9] = bc4 ^ (bc1 &^ bc0)
|
a[9] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[20] ^ d0
|
t = a[20] ^ d0
|
||||||
bc4 = bits.RotateLeft64(t, 18)
|
bc4 = t<<18 | t>>(64-18)
|
||||||
t = a[1] ^ d1
|
t = a[1] ^ d1
|
||||||
bc0 = bits.RotateLeft64(t, 1)
|
bc0 = t<<1 | t>>(64-1)
|
||||||
t = a[7] ^ d2
|
t = a[7] ^ d2
|
||||||
bc1 = bits.RotateLeft64(t, 6)
|
bc1 = t<<6 | t>>(64-6)
|
||||||
t = a[13] ^ d3
|
t = a[13] ^ d3
|
||||||
bc2 = bits.RotateLeft64(t, 25)
|
bc2 = t<<25 | t>>(64-25)
|
||||||
t = a[19] ^ d4
|
t = a[19] ^ d4
|
||||||
bc3 = bits.RotateLeft64(t, 8)
|
bc3 = t<<8 | t>>(64-8)
|
||||||
a[20] = bc0 ^ (bc2 &^ bc1)
|
a[20] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[1] = bc1 ^ (bc3 &^ bc2)
|
a[1] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[7] = bc2 ^ (bc4 &^ bc3)
|
a[7] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -108,15 +106,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[19] = bc4 ^ (bc1 &^ bc0)
|
a[19] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[5] ^ d0
|
t = a[5] ^ d0
|
||||||
bc1 = bits.RotateLeft64(t, 36)
|
bc1 = t<<36 | t>>(64-36)
|
||||||
t = a[11] ^ d1
|
t = a[11] ^ d1
|
||||||
bc2 = bits.RotateLeft64(t, 10)
|
bc2 = t<<10 | t>>(64-10)
|
||||||
t = a[17] ^ d2
|
t = a[17] ^ d2
|
||||||
bc3 = bits.RotateLeft64(t, 15)
|
bc3 = t<<15 | t>>(64-15)
|
||||||
t = a[23] ^ d3
|
t = a[23] ^ d3
|
||||||
bc4 = bits.RotateLeft64(t, 56)
|
bc4 = t<<56 | t>>(64-56)
|
||||||
t = a[4] ^ d4
|
t = a[4] ^ d4
|
||||||
bc0 = bits.RotateLeft64(t, 27)
|
bc0 = t<<27 | t>>(64-27)
|
||||||
a[5] = bc0 ^ (bc2 &^ bc1)
|
a[5] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[11] = bc1 ^ (bc3 &^ bc2)
|
a[11] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[17] = bc2 ^ (bc4 &^ bc3)
|
a[17] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -124,15 +122,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[4] = bc4 ^ (bc1 &^ bc0)
|
a[4] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[15] ^ d0
|
t = a[15] ^ d0
|
||||||
bc3 = bits.RotateLeft64(t, 41)
|
bc3 = t<<41 | t>>(64-41)
|
||||||
t = a[21] ^ d1
|
t = a[21] ^ d1
|
||||||
bc4 = bits.RotateLeft64(t, 2)
|
bc4 = t<<2 | t>>(64-2)
|
||||||
t = a[2] ^ d2
|
t = a[2] ^ d2
|
||||||
bc0 = bits.RotateLeft64(t, 62)
|
bc0 = t<<62 | t>>(64-62)
|
||||||
t = a[8] ^ d3
|
t = a[8] ^ d3
|
||||||
bc1 = bits.RotateLeft64(t, 55)
|
bc1 = t<<55 | t>>(64-55)
|
||||||
t = a[14] ^ d4
|
t = a[14] ^ d4
|
||||||
bc2 = bits.RotateLeft64(t, 39)
|
bc2 = t<<39 | t>>(64-39)
|
||||||
a[15] = bc0 ^ (bc2 &^ bc1)
|
a[15] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[21] = bc1 ^ (bc3 &^ bc2)
|
a[21] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[2] = bc2 ^ (bc4 &^ bc3)
|
a[2] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -153,13 +151,13 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
|
|
||||||
bc0 = a[0] ^ d0
|
bc0 = a[0] ^ d0
|
||||||
t = a[16] ^ d1
|
t = a[16] ^ d1
|
||||||
bc1 = bits.RotateLeft64(t, 44)
|
bc1 = t<<44 | t>>(64-44)
|
||||||
t = a[7] ^ d2
|
t = a[7] ^ d2
|
||||||
bc2 = bits.RotateLeft64(t, 43)
|
bc2 = t<<43 | t>>(64-43)
|
||||||
t = a[23] ^ d3
|
t = a[23] ^ d3
|
||||||
bc3 = bits.RotateLeft64(t, 21)
|
bc3 = t<<21 | t>>(64-21)
|
||||||
t = a[14] ^ d4
|
t = a[14] ^ d4
|
||||||
bc4 = bits.RotateLeft64(t, 14)
|
bc4 = t<<14 | t>>(64-14)
|
||||||
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+1]
|
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+1]
|
||||||
a[16] = bc1 ^ (bc3 &^ bc2)
|
a[16] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[7] = bc2 ^ (bc4 &^ bc3)
|
a[7] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -167,15 +165,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[14] = bc4 ^ (bc1 &^ bc0)
|
a[14] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[20] ^ d0
|
t = a[20] ^ d0
|
||||||
bc2 = bits.RotateLeft64(t, 3)
|
bc2 = t<<3 | t>>(64-3)
|
||||||
t = a[11] ^ d1
|
t = a[11] ^ d1
|
||||||
bc3 = bits.RotateLeft64(t, 45)
|
bc3 = t<<45 | t>>(64-45)
|
||||||
t = a[2] ^ d2
|
t = a[2] ^ d2
|
||||||
bc4 = bits.RotateLeft64(t, 61)
|
bc4 = t<<61 | t>>(64-61)
|
||||||
t = a[18] ^ d3
|
t = a[18] ^ d3
|
||||||
bc0 = bits.RotateLeft64(t, 28)
|
bc0 = t<<28 | t>>(64-28)
|
||||||
t = a[9] ^ d4
|
t = a[9] ^ d4
|
||||||
bc1 = bits.RotateLeft64(t, 20)
|
bc1 = t<<20 | t>>(64-20)
|
||||||
a[20] = bc0 ^ (bc2 &^ bc1)
|
a[20] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[11] = bc1 ^ (bc3 &^ bc2)
|
a[11] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[2] = bc2 ^ (bc4 &^ bc3)
|
a[2] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -183,15 +181,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[9] = bc4 ^ (bc1 &^ bc0)
|
a[9] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[15] ^ d0
|
t = a[15] ^ d0
|
||||||
bc4 = bits.RotateLeft64(t, 18)
|
bc4 = t<<18 | t>>(64-18)
|
||||||
t = a[6] ^ d1
|
t = a[6] ^ d1
|
||||||
bc0 = bits.RotateLeft64(t, 1)
|
bc0 = t<<1 | t>>(64-1)
|
||||||
t = a[22] ^ d2
|
t = a[22] ^ d2
|
||||||
bc1 = bits.RotateLeft64(t, 6)
|
bc1 = t<<6 | t>>(64-6)
|
||||||
t = a[13] ^ d3
|
t = a[13] ^ d3
|
||||||
bc2 = bits.RotateLeft64(t, 25)
|
bc2 = t<<25 | t>>(64-25)
|
||||||
t = a[4] ^ d4
|
t = a[4] ^ d4
|
||||||
bc3 = bits.RotateLeft64(t, 8)
|
bc3 = t<<8 | t>>(64-8)
|
||||||
a[15] = bc0 ^ (bc2 &^ bc1)
|
a[15] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[6] = bc1 ^ (bc3 &^ bc2)
|
a[6] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[22] = bc2 ^ (bc4 &^ bc3)
|
a[22] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -199,15 +197,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[4] = bc4 ^ (bc1 &^ bc0)
|
a[4] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[10] ^ d0
|
t = a[10] ^ d0
|
||||||
bc1 = bits.RotateLeft64(t, 36)
|
bc1 = t<<36 | t>>(64-36)
|
||||||
t = a[1] ^ d1
|
t = a[1] ^ d1
|
||||||
bc2 = bits.RotateLeft64(t, 10)
|
bc2 = t<<10 | t>>(64-10)
|
||||||
t = a[17] ^ d2
|
t = a[17] ^ d2
|
||||||
bc3 = bits.RotateLeft64(t, 15)
|
bc3 = t<<15 | t>>(64-15)
|
||||||
t = a[8] ^ d3
|
t = a[8] ^ d3
|
||||||
bc4 = bits.RotateLeft64(t, 56)
|
bc4 = t<<56 | t>>(64-56)
|
||||||
t = a[24] ^ d4
|
t = a[24] ^ d4
|
||||||
bc0 = bits.RotateLeft64(t, 27)
|
bc0 = t<<27 | t>>(64-27)
|
||||||
a[10] = bc0 ^ (bc2 &^ bc1)
|
a[10] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[1] = bc1 ^ (bc3 &^ bc2)
|
a[1] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[17] = bc2 ^ (bc4 &^ bc3)
|
a[17] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -215,15 +213,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[24] = bc4 ^ (bc1 &^ bc0)
|
a[24] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[5] ^ d0
|
t = a[5] ^ d0
|
||||||
bc3 = bits.RotateLeft64(t, 41)
|
bc3 = t<<41 | t>>(64-41)
|
||||||
t = a[21] ^ d1
|
t = a[21] ^ d1
|
||||||
bc4 = bits.RotateLeft64(t, 2)
|
bc4 = t<<2 | t>>(64-2)
|
||||||
t = a[12] ^ d2
|
t = a[12] ^ d2
|
||||||
bc0 = bits.RotateLeft64(t, 62)
|
bc0 = t<<62 | t>>(64-62)
|
||||||
t = a[3] ^ d3
|
t = a[3] ^ d3
|
||||||
bc1 = bits.RotateLeft64(t, 55)
|
bc1 = t<<55 | t>>(64-55)
|
||||||
t = a[19] ^ d4
|
t = a[19] ^ d4
|
||||||
bc2 = bits.RotateLeft64(t, 39)
|
bc2 = t<<39 | t>>(64-39)
|
||||||
a[5] = bc0 ^ (bc2 &^ bc1)
|
a[5] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[21] = bc1 ^ (bc3 &^ bc2)
|
a[21] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[12] = bc2 ^ (bc4 &^ bc3)
|
a[12] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -244,13 +242,13 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
|
|
||||||
bc0 = a[0] ^ d0
|
bc0 = a[0] ^ d0
|
||||||
t = a[11] ^ d1
|
t = a[11] ^ d1
|
||||||
bc1 = bits.RotateLeft64(t, 44)
|
bc1 = t<<44 | t>>(64-44)
|
||||||
t = a[22] ^ d2
|
t = a[22] ^ d2
|
||||||
bc2 = bits.RotateLeft64(t, 43)
|
bc2 = t<<43 | t>>(64-43)
|
||||||
t = a[8] ^ d3
|
t = a[8] ^ d3
|
||||||
bc3 = bits.RotateLeft64(t, 21)
|
bc3 = t<<21 | t>>(64-21)
|
||||||
t = a[19] ^ d4
|
t = a[19] ^ d4
|
||||||
bc4 = bits.RotateLeft64(t, 14)
|
bc4 = t<<14 | t>>(64-14)
|
||||||
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+2]
|
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+2]
|
||||||
a[11] = bc1 ^ (bc3 &^ bc2)
|
a[11] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[22] = bc2 ^ (bc4 &^ bc3)
|
a[22] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -258,15 +256,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[19] = bc4 ^ (bc1 &^ bc0)
|
a[19] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[15] ^ d0
|
t = a[15] ^ d0
|
||||||
bc2 = bits.RotateLeft64(t, 3)
|
bc2 = t<<3 | t>>(64-3)
|
||||||
t = a[1] ^ d1
|
t = a[1] ^ d1
|
||||||
bc3 = bits.RotateLeft64(t, 45)
|
bc3 = t<<45 | t>>(64-45)
|
||||||
t = a[12] ^ d2
|
t = a[12] ^ d2
|
||||||
bc4 = bits.RotateLeft64(t, 61)
|
bc4 = t<<61 | t>>(64-61)
|
||||||
t = a[23] ^ d3
|
t = a[23] ^ d3
|
||||||
bc0 = bits.RotateLeft64(t, 28)
|
bc0 = t<<28 | t>>(64-28)
|
||||||
t = a[9] ^ d4
|
t = a[9] ^ d4
|
||||||
bc1 = bits.RotateLeft64(t, 20)
|
bc1 = t<<20 | t>>(64-20)
|
||||||
a[15] = bc0 ^ (bc2 &^ bc1)
|
a[15] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[1] = bc1 ^ (bc3 &^ bc2)
|
a[1] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[12] = bc2 ^ (bc4 &^ bc3)
|
a[12] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -274,15 +272,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[9] = bc4 ^ (bc1 &^ bc0)
|
a[9] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[5] ^ d0
|
t = a[5] ^ d0
|
||||||
bc4 = bits.RotateLeft64(t, 18)
|
bc4 = t<<18 | t>>(64-18)
|
||||||
t = a[16] ^ d1
|
t = a[16] ^ d1
|
||||||
bc0 = bits.RotateLeft64(t, 1)
|
bc0 = t<<1 | t>>(64-1)
|
||||||
t = a[2] ^ d2
|
t = a[2] ^ d2
|
||||||
bc1 = bits.RotateLeft64(t, 6)
|
bc1 = t<<6 | t>>(64-6)
|
||||||
t = a[13] ^ d3
|
t = a[13] ^ d3
|
||||||
bc2 = bits.RotateLeft64(t, 25)
|
bc2 = t<<25 | t>>(64-25)
|
||||||
t = a[24] ^ d4
|
t = a[24] ^ d4
|
||||||
bc3 = bits.RotateLeft64(t, 8)
|
bc3 = t<<8 | t>>(64-8)
|
||||||
a[5] = bc0 ^ (bc2 &^ bc1)
|
a[5] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[16] = bc1 ^ (bc3 &^ bc2)
|
a[16] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[2] = bc2 ^ (bc4 &^ bc3)
|
a[2] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -290,15 +288,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[24] = bc4 ^ (bc1 &^ bc0)
|
a[24] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[20] ^ d0
|
t = a[20] ^ d0
|
||||||
bc1 = bits.RotateLeft64(t, 36)
|
bc1 = t<<36 | t>>(64-36)
|
||||||
t = a[6] ^ d1
|
t = a[6] ^ d1
|
||||||
bc2 = bits.RotateLeft64(t, 10)
|
bc2 = t<<10 | t>>(64-10)
|
||||||
t = a[17] ^ d2
|
t = a[17] ^ d2
|
||||||
bc3 = bits.RotateLeft64(t, 15)
|
bc3 = t<<15 | t>>(64-15)
|
||||||
t = a[3] ^ d3
|
t = a[3] ^ d3
|
||||||
bc4 = bits.RotateLeft64(t, 56)
|
bc4 = t<<56 | t>>(64-56)
|
||||||
t = a[14] ^ d4
|
t = a[14] ^ d4
|
||||||
bc0 = bits.RotateLeft64(t, 27)
|
bc0 = t<<27 | t>>(64-27)
|
||||||
a[20] = bc0 ^ (bc2 &^ bc1)
|
a[20] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[6] = bc1 ^ (bc3 &^ bc2)
|
a[6] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[17] = bc2 ^ (bc4 &^ bc3)
|
a[17] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -306,15 +304,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[14] = bc4 ^ (bc1 &^ bc0)
|
a[14] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[10] ^ d0
|
t = a[10] ^ d0
|
||||||
bc3 = bits.RotateLeft64(t, 41)
|
bc3 = t<<41 | t>>(64-41)
|
||||||
t = a[21] ^ d1
|
t = a[21] ^ d1
|
||||||
bc4 = bits.RotateLeft64(t, 2)
|
bc4 = t<<2 | t>>(64-2)
|
||||||
t = a[7] ^ d2
|
t = a[7] ^ d2
|
||||||
bc0 = bits.RotateLeft64(t, 62)
|
bc0 = t<<62 | t>>(64-62)
|
||||||
t = a[18] ^ d3
|
t = a[18] ^ d3
|
||||||
bc1 = bits.RotateLeft64(t, 55)
|
bc1 = t<<55 | t>>(64-55)
|
||||||
t = a[4] ^ d4
|
t = a[4] ^ d4
|
||||||
bc2 = bits.RotateLeft64(t, 39)
|
bc2 = t<<39 | t>>(64-39)
|
||||||
a[10] = bc0 ^ (bc2 &^ bc1)
|
a[10] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[21] = bc1 ^ (bc3 &^ bc2)
|
a[21] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[7] = bc2 ^ (bc4 &^ bc3)
|
a[7] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -335,13 +333,13 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
|
|
||||||
bc0 = a[0] ^ d0
|
bc0 = a[0] ^ d0
|
||||||
t = a[1] ^ d1
|
t = a[1] ^ d1
|
||||||
bc1 = bits.RotateLeft64(t, 44)
|
bc1 = t<<44 | t>>(64-44)
|
||||||
t = a[2] ^ d2
|
t = a[2] ^ d2
|
||||||
bc2 = bits.RotateLeft64(t, 43)
|
bc2 = t<<43 | t>>(64-43)
|
||||||
t = a[3] ^ d3
|
t = a[3] ^ d3
|
||||||
bc3 = bits.RotateLeft64(t, 21)
|
bc3 = t<<21 | t>>(64-21)
|
||||||
t = a[4] ^ d4
|
t = a[4] ^ d4
|
||||||
bc4 = bits.RotateLeft64(t, 14)
|
bc4 = t<<14 | t>>(64-14)
|
||||||
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+3]
|
a[0] = bc0 ^ (bc2 &^ bc1) ^ rc[i+3]
|
||||||
a[1] = bc1 ^ (bc3 &^ bc2)
|
a[1] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[2] = bc2 ^ (bc4 &^ bc3)
|
a[2] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -349,15 +347,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[4] = bc4 ^ (bc1 &^ bc0)
|
a[4] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[5] ^ d0
|
t = a[5] ^ d0
|
||||||
bc2 = bits.RotateLeft64(t, 3)
|
bc2 = t<<3 | t>>(64-3)
|
||||||
t = a[6] ^ d1
|
t = a[6] ^ d1
|
||||||
bc3 = bits.RotateLeft64(t, 45)
|
bc3 = t<<45 | t>>(64-45)
|
||||||
t = a[7] ^ d2
|
t = a[7] ^ d2
|
||||||
bc4 = bits.RotateLeft64(t, 61)
|
bc4 = t<<61 | t>>(64-61)
|
||||||
t = a[8] ^ d3
|
t = a[8] ^ d3
|
||||||
bc0 = bits.RotateLeft64(t, 28)
|
bc0 = t<<28 | t>>(64-28)
|
||||||
t = a[9] ^ d4
|
t = a[9] ^ d4
|
||||||
bc1 = bits.RotateLeft64(t, 20)
|
bc1 = t<<20 | t>>(64-20)
|
||||||
a[5] = bc0 ^ (bc2 &^ bc1)
|
a[5] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[6] = bc1 ^ (bc3 &^ bc2)
|
a[6] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[7] = bc2 ^ (bc4 &^ bc3)
|
a[7] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -365,15 +363,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[9] = bc4 ^ (bc1 &^ bc0)
|
a[9] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[10] ^ d0
|
t = a[10] ^ d0
|
||||||
bc4 = bits.RotateLeft64(t, 18)
|
bc4 = t<<18 | t>>(64-18)
|
||||||
t = a[11] ^ d1
|
t = a[11] ^ d1
|
||||||
bc0 = bits.RotateLeft64(t, 1)
|
bc0 = t<<1 | t>>(64-1)
|
||||||
t = a[12] ^ d2
|
t = a[12] ^ d2
|
||||||
bc1 = bits.RotateLeft64(t, 6)
|
bc1 = t<<6 | t>>(64-6)
|
||||||
t = a[13] ^ d3
|
t = a[13] ^ d3
|
||||||
bc2 = bits.RotateLeft64(t, 25)
|
bc2 = t<<25 | t>>(64-25)
|
||||||
t = a[14] ^ d4
|
t = a[14] ^ d4
|
||||||
bc3 = bits.RotateLeft64(t, 8)
|
bc3 = t<<8 | t>>(64-8)
|
||||||
a[10] = bc0 ^ (bc2 &^ bc1)
|
a[10] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[11] = bc1 ^ (bc3 &^ bc2)
|
a[11] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[12] = bc2 ^ (bc4 &^ bc3)
|
a[12] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -381,15 +379,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[14] = bc4 ^ (bc1 &^ bc0)
|
a[14] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[15] ^ d0
|
t = a[15] ^ d0
|
||||||
bc1 = bits.RotateLeft64(t, 36)
|
bc1 = t<<36 | t>>(64-36)
|
||||||
t = a[16] ^ d1
|
t = a[16] ^ d1
|
||||||
bc2 = bits.RotateLeft64(t, 10)
|
bc2 = t<<10 | t>>(64-10)
|
||||||
t = a[17] ^ d2
|
t = a[17] ^ d2
|
||||||
bc3 = bits.RotateLeft64(t, 15)
|
bc3 = t<<15 | t>>(64-15)
|
||||||
t = a[18] ^ d3
|
t = a[18] ^ d3
|
||||||
bc4 = bits.RotateLeft64(t, 56)
|
bc4 = t<<56 | t>>(64-56)
|
||||||
t = a[19] ^ d4
|
t = a[19] ^ d4
|
||||||
bc0 = bits.RotateLeft64(t, 27)
|
bc0 = t<<27 | t>>(64-27)
|
||||||
a[15] = bc0 ^ (bc2 &^ bc1)
|
a[15] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[16] = bc1 ^ (bc3 &^ bc2)
|
a[16] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[17] = bc2 ^ (bc4 &^ bc3)
|
a[17] = bc2 ^ (bc4 &^ bc3)
|
||||||
@ -397,15 +395,15 @@ func keccakF1600(a *[25]uint64) {
|
|||||||
a[19] = bc4 ^ (bc1 &^ bc0)
|
a[19] = bc4 ^ (bc1 &^ bc0)
|
||||||
|
|
||||||
t = a[20] ^ d0
|
t = a[20] ^ d0
|
||||||
bc3 = bits.RotateLeft64(t, 41)
|
bc3 = t<<41 | t>>(64-41)
|
||||||
t = a[21] ^ d1
|
t = a[21] ^ d1
|
||||||
bc4 = bits.RotateLeft64(t, 2)
|
bc4 = t<<2 | t>>(64-2)
|
||||||
t = a[22] ^ d2
|
t = a[22] ^ d2
|
||||||
bc0 = bits.RotateLeft64(t, 62)
|
bc0 = t<<62 | t>>(64-62)
|
||||||
t = a[23] ^ d3
|
t = a[23] ^ d3
|
||||||
bc1 = bits.RotateLeft64(t, 55)
|
bc1 = t<<55 | t>>(64-55)
|
||||||
t = a[24] ^ d4
|
t = a[24] ^ d4
|
||||||
bc2 = bits.RotateLeft64(t, 39)
|
bc2 = t<<39 | t>>(64-39)
|
||||||
a[20] = bc0 ^ (bc2 &^ bc1)
|
a[20] = bc0 ^ (bc2 &^ bc1)
|
||||||
a[21] = bc1 ^ (bc3 &^ bc2)
|
a[21] = bc1 ^ (bc3 &^ bc2)
|
||||||
a[22] = bc2 ^ (bc4 &^ bc3)
|
a[22] = bc2 ^ (bc4 &^ bc3)
|
||||||
|
1
vendor/golang.org/x/crypto/sha3/keccakf_amd64.s
generated
vendored
1
vendor/golang.org/x/crypto/sha3/keccakf_amd64.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build amd64 && !purego && gc
|
|
||||||
// +build amd64,!purego,gc
|
// +build amd64,!purego,gc
|
||||||
|
|
||||||
// This code was translated into a form compatible with 6a from the public
|
// This code was translated into a form compatible with 6a from the public
|
||||||
|
2
vendor/golang.org/x/crypto/sha3/sha3.go
generated
vendored
2
vendor/golang.org/x/crypto/sha3/sha3.go
generated
vendored
@ -86,7 +86,7 @@ func (d *state) permute() {
|
|||||||
d.buf = d.storage.asBytes()[:0]
|
d.buf = d.storage.asBytes()[:0]
|
||||||
keccakF1600(&d.a)
|
keccakF1600(&d.a)
|
||||||
case spongeSqueezing:
|
case spongeSqueezing:
|
||||||
// If we're squeezing, we need to apply the permutation before
|
// If we're squeezing, we need to apply the permutatin before
|
||||||
// copying more output.
|
// copying more output.
|
||||||
keccakF1600(&d.a)
|
keccakF1600(&d.a)
|
||||||
d.buf = d.storage.asBytes()[:d.rate]
|
d.buf = d.storage.asBytes()[:d.rate]
|
||||||
|
2
vendor/golang.org/x/crypto/sha3/sha3_s390x.go
generated
vendored
2
vendor/golang.org/x/crypto/sha3/sha3_s390x.go
generated
vendored
@ -34,13 +34,11 @@ const (
|
|||||||
|
|
||||||
// kimd is a wrapper for the 'compute intermediate message digest' instruction.
|
// kimd is a wrapper for the 'compute intermediate message digest' instruction.
|
||||||
// src must be a multiple of the rate for the given function code.
|
// src must be a multiple of the rate for the given function code.
|
||||||
//
|
|
||||||
//go:noescape
|
//go:noescape
|
||||||
func kimd(function code, chain *[200]byte, src []byte)
|
func kimd(function code, chain *[200]byte, src []byte)
|
||||||
|
|
||||||
// klmd is a wrapper for the 'compute last message digest' instruction.
|
// klmd is a wrapper for the 'compute last message digest' instruction.
|
||||||
// src padding is handled by the instruction.
|
// src padding is handled by the instruction.
|
||||||
//
|
|
||||||
//go:noescape
|
//go:noescape
|
||||||
func klmd(function code, chain *[200]byte, dst, src []byte)
|
func klmd(function code, chain *[200]byte, dst, src []byte)
|
||||||
|
|
||||||
|
1
vendor/golang.org/x/crypto/sha3/sha3_s390x.s
generated
vendored
1
vendor/golang.org/x/crypto/sha3/sha3_s390x.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc && !purego
|
|
||||||
// +build gc,!purego
|
// +build gc,!purego
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
2
vendor/golang.org/x/crypto/sha3/xor_generic.go
generated
vendored
2
vendor/golang.org/x/crypto/sha3/xor_generic.go
generated
vendored
@ -19,7 +19,7 @@ func xorInGeneric(d *state, buf []byte) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// copyOutGeneric copies uint64s to a byte buffer.
|
// copyOutGeneric copies ulint64s to a byte buffer.
|
||||||
func copyOutGeneric(d *state, b []byte) {
|
func copyOutGeneric(d *state, b []byte) {
|
||||||
for i := 0; len(b) >= 8; i++ {
|
for i := 0; len(b) >= 8; i++ {
|
||||||
binary.LittleEndian.PutUint64(b, d.a[i])
|
binary.LittleEndian.PutUint64(b, d.a[i])
|
||||||
|
3
vendor/golang.org/x/net/AUTHORS
generated
vendored
Normal file
3
vendor/golang.org/x/net/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code refers to The Go Authors for copyright purposes.
|
||||||
|
# The master list of authors is in the main Go distribution,
|
||||||
|
# visible at http://tip.golang.org/AUTHORS.
|
3
vendor/golang.org/x/net/CONTRIBUTORS
generated
vendored
Normal file
3
vendor/golang.org/x/net/CONTRIBUTORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code was written by the Go contributors.
|
||||||
|
# The master list of contributors is in the main Go distribution,
|
||||||
|
# visible at http://tip.golang.org/CONTRIBUTORS.
|
2
vendor/golang.org/x/net/internal/socks/socks.go
generated
vendored
2
vendor/golang.org/x/net/internal/socks/socks.go
generated
vendored
@ -289,7 +289,7 @@ func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter,
|
|||||||
case AuthMethodNotRequired:
|
case AuthMethodNotRequired:
|
||||||
return nil
|
return nil
|
||||||
case AuthMethodUsernamePassword:
|
case AuthMethodUsernamePassword:
|
||||||
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) > 255 {
|
if len(up.Username) == 0 || len(up.Username) > 255 || len(up.Password) == 0 || len(up.Password) > 255 {
|
||||||
return errors.New("invalid username/password")
|
return errors.New("invalid username/password")
|
||||||
}
|
}
|
||||||
b := []byte{authUsernamePasswordVersion}
|
b := []byte{authUsernamePasswordVersion}
|
||||||
|
3
vendor/golang.org/x/sys/AUTHORS
generated
vendored
Normal file
3
vendor/golang.org/x/sys/AUTHORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code refers to The Go Authors for copyright purposes.
|
||||||
|
# The master list of authors is in the main Go distribution,
|
||||||
|
# visible at http://tip.golang.org/AUTHORS.
|
3
vendor/golang.org/x/sys/CONTRIBUTORS
generated
vendored
Normal file
3
vendor/golang.org/x/sys/CONTRIBUTORS
generated
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
# This source code was written by the Go contributors.
|
||||||
|
# The master list of contributors is in the main Go distribution,
|
||||||
|
# visible at http://tip.golang.org/CONTRIBUTORS.
|
1
vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
generated
vendored
1
vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
|
||||||
// +build gc
|
// +build gc
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
1
vendor/golang.org/x/sys/cpu/byteorder.go
generated
vendored
1
vendor/golang.org/x/sys/cpu/byteorder.go
generated
vendored
@ -46,7 +46,6 @@ func hostByteOrder() byteOrder {
|
|||||||
case "386", "amd64", "amd64p32",
|
case "386", "amd64", "amd64p32",
|
||||||
"alpha",
|
"alpha",
|
||||||
"arm", "arm64",
|
"arm", "arm64",
|
||||||
"loong64",
|
|
||||||
"mipsle", "mips64le", "mips64p32le",
|
"mipsle", "mips64le", "mips64p32le",
|
||||||
"nios2",
|
"nios2",
|
||||||
"ppc64le",
|
"ppc64le",
|
||||||
|
11
vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
11
vendor/golang.org/x/sys/cpu/cpu.go
generated
vendored
@ -38,7 +38,7 @@ var X86 struct {
|
|||||||
HasAVX512F bool // Advanced vector extension 512 Foundation Instructions
|
HasAVX512F bool // Advanced vector extension 512 Foundation Instructions
|
||||||
HasAVX512CD bool // Advanced vector extension 512 Conflict Detection Instructions
|
HasAVX512CD bool // Advanced vector extension 512 Conflict Detection Instructions
|
||||||
HasAVX512ER bool // Advanced vector extension 512 Exponential and Reciprocal Instructions
|
HasAVX512ER bool // Advanced vector extension 512 Exponential and Reciprocal Instructions
|
||||||
HasAVX512PF bool // Advanced vector extension 512 Prefetch Instructions
|
HasAVX512PF bool // Advanced vector extension 512 Prefetch Instructions Instructions
|
||||||
HasAVX512VL bool // Advanced vector extension 512 Vector Length Extensions
|
HasAVX512VL bool // Advanced vector extension 512 Vector Length Extensions
|
||||||
HasAVX512BW bool // Advanced vector extension 512 Byte and Word Instructions
|
HasAVX512BW bool // Advanced vector extension 512 Byte and Word Instructions
|
||||||
HasAVX512DQ bool // Advanced vector extension 512 Doubleword and Quadword Instructions
|
HasAVX512DQ bool // Advanced vector extension 512 Doubleword and Quadword Instructions
|
||||||
@ -54,12 +54,8 @@ var X86 struct {
|
|||||||
HasAVX512VBMI2 bool // Advanced vector extension 512 Vector Byte Manipulation Instructions 2
|
HasAVX512VBMI2 bool // Advanced vector extension 512 Vector Byte Manipulation Instructions 2
|
||||||
HasAVX512BITALG bool // Advanced vector extension 512 Bit Algorithms
|
HasAVX512BITALG bool // Advanced vector extension 512 Bit Algorithms
|
||||||
HasAVX512BF16 bool // Advanced vector extension 512 BFloat16 Instructions
|
HasAVX512BF16 bool // Advanced vector extension 512 BFloat16 Instructions
|
||||||
HasAMXTile bool // Advanced Matrix Extension Tile instructions
|
|
||||||
HasAMXInt8 bool // Advanced Matrix Extension Int8 instructions
|
|
||||||
HasAMXBF16 bool // Advanced Matrix Extension BFloat16 instructions
|
|
||||||
HasBMI1 bool // Bit manipulation instruction set 1
|
HasBMI1 bool // Bit manipulation instruction set 1
|
||||||
HasBMI2 bool // Bit manipulation instruction set 2
|
HasBMI2 bool // Bit manipulation instruction set 2
|
||||||
HasCX16 bool // Compare and exchange 16 Bytes
|
|
||||||
HasERMS bool // Enhanced REP for MOVSB and STOSB
|
HasERMS bool // Enhanced REP for MOVSB and STOSB
|
||||||
HasFMA bool // Fused-multiply-add instructions
|
HasFMA bool // Fused-multiply-add instructions
|
||||||
HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
|
HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
|
||||||
@ -158,13 +154,14 @@ var MIPS64X struct {
|
|||||||
// For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00,
|
// For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00,
|
||||||
// since there are no optional categories. There are some exceptions that also
|
// since there are no optional categories. There are some exceptions that also
|
||||||
// require kernel support to work (DARN, SCV), so there are feature bits for
|
// require kernel support to work (DARN, SCV), so there are feature bits for
|
||||||
// those as well. The struct is padded to avoid false sharing.
|
// those as well. The minimum processor requirement is POWER8 (ISA 2.07).
|
||||||
|
// The struct is padded to avoid false sharing.
|
||||||
var PPC64 struct {
|
var PPC64 struct {
|
||||||
_ CacheLinePad
|
_ CacheLinePad
|
||||||
HasDARN bool // Hardware random number generator (requires kernel enablement)
|
HasDARN bool // Hardware random number generator (requires kernel enablement)
|
||||||
HasSCV bool // Syscall vectored (requires kernel enablement)
|
HasSCV bool // Syscall vectored (requires kernel enablement)
|
||||||
IsPOWER8 bool // ISA v2.07 (POWER8)
|
IsPOWER8 bool // ISA v2.07 (POWER8)
|
||||||
IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8
|
IsPOWER9 bool // ISA v3.00 (POWER9)
|
||||||
_ CacheLinePad
|
_ CacheLinePad
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
vendor/golang.org/x/sys/cpu/cpu_aix.go
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu_aix.go
generated
vendored
@ -20,7 +20,6 @@ func archInit() {
|
|||||||
PPC64.IsPOWER8 = true
|
PPC64.IsPOWER8 = true
|
||||||
}
|
}
|
||||||
if impl&_IMPL_POWER9 != 0 {
|
if impl&_IMPL_POWER9 != 0 {
|
||||||
PPC64.IsPOWER8 = true
|
|
||||||
PPC64.IsPOWER9 = true
|
PPC64.IsPOWER9 = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
vendor/golang.org/x/sys/cpu/cpu_arm64.go
generated
vendored
12
vendor/golang.org/x/sys/cpu/cpu_arm64.go
generated
vendored
@ -6,10 +6,7 @@ package cpu
|
|||||||
|
|
||||||
import "runtime"
|
import "runtime"
|
||||||
|
|
||||||
// cacheLineSize is used to prevent false sharing of cache lines.
|
const cacheLineSize = 64
|
||||||
// We choose 128 because Apple Silicon, a.k.a. M1, has 128-byte cache line size.
|
|
||||||
// It doesn't cost much and is much more future-proof.
|
|
||||||
const cacheLineSize = 128
|
|
||||||
|
|
||||||
func initOptions() {
|
func initOptions() {
|
||||||
options = []option{
|
options = []option{
|
||||||
@ -44,10 +41,13 @@ func archInit() {
|
|||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
case "freebsd":
|
case "freebsd":
|
||||||
readARM64Registers()
|
readARM64Registers()
|
||||||
case "linux", "netbsd", "openbsd":
|
case "linux", "netbsd":
|
||||||
doinit()
|
doinit()
|
||||||
default:
|
default:
|
||||||
// Many platforms don't seem to allow reading these registers.
|
// Most platforms don't seem to allow reading these registers.
|
||||||
|
//
|
||||||
|
// OpenBSD:
|
||||||
|
// See https://golang.org/issue/31746
|
||||||
setMinimalFeatures()
|
setMinimalFeatures()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
vendor/golang.org/x/sys/cpu/cpu_arm64.s
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu_arm64.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
|
||||||
// +build gc
|
// +build gc
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
30
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
generated
vendored
30
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
generated
vendored
@ -2,13 +2,11 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (386 || amd64 || amd64p32) && gccgo
|
|
||||||
// +build 386 amd64 amd64p32
|
// +build 386 amd64 amd64p32
|
||||||
// +build gccgo
|
// +build gccgo
|
||||||
|
|
||||||
#include <cpuid.h>
|
#include <cpuid.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <x86intrin.h>
|
|
||||||
|
|
||||||
// Need to wrap __get_cpuid_count because it's declared as static.
|
// Need to wrap __get_cpuid_count because it's declared as static.
|
||||||
int
|
int
|
||||||
@ -19,21 +17,27 @@ gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf,
|
|||||||
return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
|
return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
|
|
||||||
#pragma GCC push_options
|
|
||||||
#pragma GCC target("xsave")
|
|
||||||
#pragma clang attribute push (__attribute__((target("xsave"))), apply_to=function)
|
|
||||||
|
|
||||||
// xgetbv reads the contents of an XCR (Extended Control Register)
|
// xgetbv reads the contents of an XCR (Extended Control Register)
|
||||||
// specified in the ECX register into registers EDX:EAX.
|
// specified in the ECX register into registers EDX:EAX.
|
||||||
// Currently, the only supported value for XCR is 0.
|
// Currently, the only supported value for XCR is 0.
|
||||||
|
//
|
||||||
|
// TODO: Replace with a better alternative:
|
||||||
|
//
|
||||||
|
// #include <xsaveintrin.h>
|
||||||
|
//
|
||||||
|
// #pragma GCC target("xsave")
|
||||||
|
//
|
||||||
|
// void gccgoXgetbv(uint32_t *eax, uint32_t *edx) {
|
||||||
|
// unsigned long long x = _xgetbv(0);
|
||||||
|
// *eax = x & 0xffffffff;
|
||||||
|
// *edx = (x >> 32) & 0xffffffff;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// Note that _xgetbv is defined starting with GCC 8.
|
||||||
void
|
void
|
||||||
gccgoXgetbv(uint32_t *eax, uint32_t *edx)
|
gccgoXgetbv(uint32_t *eax, uint32_t *edx)
|
||||||
{
|
{
|
||||||
uint64_t v = _xgetbv(0);
|
__asm(" xorl %%ecx, %%ecx\n"
|
||||||
*eax = v & 0xffffffff;
|
" xgetbv"
|
||||||
*edx = v >> 32;
|
: "=a"(*eax), "=d"(*edx));
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang attribute pop
|
|
||||||
#pragma GCC pop_options
|
|
||||||
|
6
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
generated
vendored
6
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
generated
vendored
@ -25,9 +25,3 @@ func xgetbv() (eax, edx uint32) {
|
|||||||
gccgoXgetbv(&a, &d)
|
gccgoXgetbv(&a, &d)
|
||||||
return a, d
|
return a, d
|
||||||
}
|
}
|
||||||
|
|
||||||
// gccgo doesn't build on Darwin, per:
|
|
||||||
// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
|
|
||||||
func darwinSupportsAVX512() bool {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
42
vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
generated
vendored
42
vendor/golang.org/x/sys/cpu/cpu_linux_arm64.go
generated
vendored
@ -4,11 +4,6 @@
|
|||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
import (
|
|
||||||
"strings"
|
|
||||||
"syscall"
|
|
||||||
)
|
|
||||||
|
|
||||||
// HWCAP/HWCAP2 bits. These are exposed by Linux.
|
// HWCAP/HWCAP2 bits. These are exposed by Linux.
|
||||||
const (
|
const (
|
||||||
hwcap_FP = 1 << 0
|
hwcap_FP = 1 << 0
|
||||||
@ -37,45 +32,10 @@ const (
|
|||||||
hwcap_ASIMDFHM = 1 << 23
|
hwcap_ASIMDFHM = 1 << 23
|
||||||
)
|
)
|
||||||
|
|
||||||
// linuxKernelCanEmulateCPUID reports whether we're running
|
|
||||||
// on Linux 4.11+. Ideally we'd like to ask the question about
|
|
||||||
// whether the current kernel contains
|
|
||||||
// https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=77c97b4ee21290f5f083173d957843b615abbff2
|
|
||||||
// but the version number will have to do.
|
|
||||||
func linuxKernelCanEmulateCPUID() bool {
|
|
||||||
var un syscall.Utsname
|
|
||||||
syscall.Uname(&un)
|
|
||||||
var sb strings.Builder
|
|
||||||
for _, b := range un.Release[:] {
|
|
||||||
if b == 0 {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
sb.WriteByte(byte(b))
|
|
||||||
}
|
|
||||||
major, minor, _, ok := parseRelease(sb.String())
|
|
||||||
return ok && (major > 4 || major == 4 && minor >= 11)
|
|
||||||
}
|
|
||||||
|
|
||||||
func doinit() {
|
func doinit() {
|
||||||
if err := readHWCAP(); err != nil {
|
if err := readHWCAP(); err != nil {
|
||||||
// We failed to read /proc/self/auxv. This can happen if the binary has
|
// failed to read /proc/self/auxv, try reading registers directly
|
||||||
// been given extra capabilities(7) with /bin/setcap.
|
|
||||||
//
|
|
||||||
// When this happens, we have two options. If the Linux kernel is new
|
|
||||||
// enough (4.11+), we can read the arm64 registers directly which'll
|
|
||||||
// trap into the kernel and then return back to userspace.
|
|
||||||
//
|
|
||||||
// But on older kernels, such as Linux 4.4.180 as used on many Synology
|
|
||||||
// devices, calling readARM64Registers (specifically getisar0) will
|
|
||||||
// cause a SIGILL and we'll die. So for older kernels, parse /proc/cpuinfo
|
|
||||||
// instead.
|
|
||||||
//
|
|
||||||
// See golang/go#57336.
|
|
||||||
if linuxKernelCanEmulateCPUID() {
|
|
||||||
readARM64Registers()
|
readARM64Registers()
|
||||||
} else {
|
|
||||||
readLinuxProcCPUInfo()
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
vendor/golang.org/x/sys/cpu/cpu_loong64.go
generated
vendored
13
vendor/golang.org/x/sys/cpu/cpu_loong64.go
generated
vendored
@ -1,13 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build loong64
|
|
||||||
// +build loong64
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
const cacheLineSize = 64
|
|
||||||
|
|
||||||
func initOptions() {
|
|
||||||
}
|
|
65
vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
generated
vendored
65
vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go
generated
vendored
@ -1,65 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
import (
|
|
||||||
"syscall"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
// Minimal copy of functionality from x/sys/unix so the cpu package can call
|
|
||||||
// sysctl without depending on x/sys/unix.
|
|
||||||
|
|
||||||
const (
|
|
||||||
// From OpenBSD's sys/sysctl.h.
|
|
||||||
_CTL_MACHDEP = 7
|
|
||||||
|
|
||||||
// From OpenBSD's machine/cpu.h.
|
|
||||||
_CPU_ID_AA64ISAR0 = 2
|
|
||||||
_CPU_ID_AA64ISAR1 = 3
|
|
||||||
)
|
|
||||||
|
|
||||||
// Implemented in the runtime package (runtime/sys_openbsd3.go)
|
|
||||||
func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno)
|
|
||||||
|
|
||||||
//go:linkname syscall_syscall6 syscall.syscall6
|
|
||||||
|
|
||||||
func sysctl(mib []uint32, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) {
|
|
||||||
_, _, errno := syscall_syscall6(libc_sysctl_trampoline_addr, uintptr(unsafe.Pointer(&mib[0])), uintptr(len(mib)), uintptr(unsafe.Pointer(old)), uintptr(unsafe.Pointer(oldlen)), uintptr(unsafe.Pointer(new)), uintptr(newlen))
|
|
||||||
if errno != 0 {
|
|
||||||
return errno
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var libc_sysctl_trampoline_addr uintptr
|
|
||||||
|
|
||||||
//go:cgo_import_dynamic libc_sysctl sysctl "libc.so"
|
|
||||||
|
|
||||||
func sysctlUint64(mib []uint32) (uint64, bool) {
|
|
||||||
var out uint64
|
|
||||||
nout := unsafe.Sizeof(out)
|
|
||||||
if err := sysctl(mib, (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); err != nil {
|
|
||||||
return 0, false
|
|
||||||
}
|
|
||||||
return out, true
|
|
||||||
}
|
|
||||||
|
|
||||||
func doinit() {
|
|
||||||
setMinimalFeatures()
|
|
||||||
|
|
||||||
// Get ID_AA64ISAR0 and ID_AA64ISAR1 from sysctl.
|
|
||||||
isar0, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR0})
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
isar1, ok := sysctlUint64([]uint32{_CTL_MACHDEP, _CPU_ID_AA64ISAR1})
|
|
||||||
if !ok {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
parseARM64SystemRegisters(isar0, isar1, 0)
|
|
||||||
|
|
||||||
Initialized = true
|
|
||||||
}
|
|
11
vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s
generated
vendored
11
vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s
generated
vendored
@ -1,11 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
#include "textflag.h"
|
|
||||||
|
|
||||||
TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0
|
|
||||||
JMP libc_sysctl(SB)
|
|
||||||
|
|
||||||
GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8
|
|
||||||
DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB)
|
|
4
vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
generated
vendored
4
vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
generated
vendored
@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build !linux && !netbsd && !openbsd && arm64
|
//go:build !linux && !netbsd && arm64
|
||||||
// +build !linux,!netbsd,!openbsd,arm64
|
// +build !linux,!netbsd,arm64
|
||||||
|
|
||||||
package cpu
|
package cpu
|
||||||
|
|
||||||
|
15
vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go
generated
vendored
15
vendor/golang.org/x/sys/cpu/cpu_other_ppc64x.go
generated
vendored
@ -1,15 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build !aix && !linux && (ppc64 || ppc64le)
|
|
||||||
// +build !aix
|
|
||||||
// +build !linux
|
|
||||||
// +build ppc64 ppc64le
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
func archInit() {
|
|
||||||
PPC64.IsPOWER8 = true
|
|
||||||
Initialized = true
|
|
||||||
}
|
|
12
vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go
generated
vendored
12
vendor/golang.org/x/sys/cpu/cpu_other_riscv64.go
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build !linux && riscv64
|
|
||||||
// +build !linux,riscv64
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
func archInit() {
|
|
||||||
Initialized = true
|
|
||||||
}
|
|
1
vendor/golang.org/x/sys/cpu/cpu_s390x.s
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu_s390x.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build gc
|
|
||||||
// +build gc
|
// +build gc
|
||||||
|
|
||||||
#include "textflag.h"
|
#include "textflag.h"
|
||||||
|
16
vendor/golang.org/x/sys/cpu/cpu_x86.go
generated
vendored
16
vendor/golang.org/x/sys/cpu/cpu_x86.go
generated
vendored
@ -37,12 +37,8 @@ func initOptions() {
|
|||||||
{Name: "avx512vbmi2", Feature: &X86.HasAVX512VBMI2},
|
{Name: "avx512vbmi2", Feature: &X86.HasAVX512VBMI2},
|
||||||
{Name: "avx512bitalg", Feature: &X86.HasAVX512BITALG},
|
{Name: "avx512bitalg", Feature: &X86.HasAVX512BITALG},
|
||||||
{Name: "avx512bf16", Feature: &X86.HasAVX512BF16},
|
{Name: "avx512bf16", Feature: &X86.HasAVX512BF16},
|
||||||
{Name: "amxtile", Feature: &X86.HasAMXTile},
|
|
||||||
{Name: "amxint8", Feature: &X86.HasAMXInt8},
|
|
||||||
{Name: "amxbf16", Feature: &X86.HasAMXBF16},
|
|
||||||
{Name: "bmi1", Feature: &X86.HasBMI1},
|
{Name: "bmi1", Feature: &X86.HasBMI1},
|
||||||
{Name: "bmi2", Feature: &X86.HasBMI2},
|
{Name: "bmi2", Feature: &X86.HasBMI2},
|
||||||
{Name: "cx16", Feature: &X86.HasCX16},
|
|
||||||
{Name: "erms", Feature: &X86.HasERMS},
|
{Name: "erms", Feature: &X86.HasERMS},
|
||||||
{Name: "fma", Feature: &X86.HasFMA},
|
{Name: "fma", Feature: &X86.HasFMA},
|
||||||
{Name: "osxsave", Feature: &X86.HasOSXSAVE},
|
{Name: "osxsave", Feature: &X86.HasOSXSAVE},
|
||||||
@ -77,7 +73,6 @@ func archInit() {
|
|||||||
X86.HasPCLMULQDQ = isSet(1, ecx1)
|
X86.HasPCLMULQDQ = isSet(1, ecx1)
|
||||||
X86.HasSSSE3 = isSet(9, ecx1)
|
X86.HasSSSE3 = isSet(9, ecx1)
|
||||||
X86.HasFMA = isSet(12, ecx1)
|
X86.HasFMA = isSet(12, ecx1)
|
||||||
X86.HasCX16 = isSet(13, ecx1)
|
|
||||||
X86.HasSSE41 = isSet(19, ecx1)
|
X86.HasSSE41 = isSet(19, ecx1)
|
||||||
X86.HasSSE42 = isSet(20, ecx1)
|
X86.HasSSE42 = isSet(20, ecx1)
|
||||||
X86.HasPOPCNT = isSet(23, ecx1)
|
X86.HasPOPCNT = isSet(23, ecx1)
|
||||||
@ -92,16 +87,9 @@ func archInit() {
|
|||||||
// Check if XMM and YMM registers have OS support.
|
// Check if XMM and YMM registers have OS support.
|
||||||
osSupportsAVX = isSet(1, eax) && isSet(2, eax)
|
osSupportsAVX = isSet(1, eax) && isSet(2, eax)
|
||||||
|
|
||||||
if runtime.GOOS == "darwin" {
|
|
||||||
// Darwin doesn't save/restore AVX-512 mask registers correctly across signal handlers.
|
|
||||||
// Since users can't rely on mask register contents, let's not advertise AVX-512 support.
|
|
||||||
// See issue 49233.
|
|
||||||
osSupportsAVX512 = false
|
|
||||||
} else {
|
|
||||||
// Check if OPMASK and ZMM registers have OS support.
|
// Check if OPMASK and ZMM registers have OS support.
|
||||||
osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
|
osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
X86.HasAVX = isSet(28, ecx1) && osSupportsAVX
|
X86.HasAVX = isSet(28, ecx1) && osSupportsAVX
|
||||||
|
|
||||||
@ -141,10 +129,6 @@ func archInit() {
|
|||||||
eax71, _, _, _ := cpuid(7, 1)
|
eax71, _, _, _ := cpuid(7, 1)
|
||||||
X86.HasAVX512BF16 = isSet(5, eax71)
|
X86.HasAVX512BF16 = isSet(5, eax71)
|
||||||
}
|
}
|
||||||
|
|
||||||
X86.HasAMXTile = isSet(24, edx7)
|
|
||||||
X86.HasAMXInt8 = isSet(25, edx7)
|
|
||||||
X86.HasAMXBF16 = isSet(22, edx7)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func isSet(bitpos uint, value uint32) bool {
|
func isSet(bitpos uint, value uint32) bool {
|
||||||
|
1
vendor/golang.org/x/sys/cpu/cpu_x86.s
generated
vendored
1
vendor/golang.org/x/sys/cpu/cpu_x86.s
generated
vendored
@ -2,7 +2,6 @@
|
|||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
//go:build (386 || amd64 || amd64p32) && gc
|
|
||||||
// +build 386 amd64 amd64p32
|
// +build 386 amd64 amd64p32
|
||||||
// +build gc
|
// +build gc
|
||||||
|
|
||||||
|
11
vendor/golang.org/x/sys/cpu/endian_big.go
generated
vendored
11
vendor/golang.org/x/sys/cpu/endian_big.go
generated
vendored
@ -1,11 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
|
|
||||||
// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
// IsBigEndian records whether the GOARCH's byte order is big endian.
|
|
||||||
const IsBigEndian = true
|
|
11
vendor/golang.org/x/sys/cpu/endian_little.go
generated
vendored
11
vendor/golang.org/x/sys/cpu/endian_little.go
generated
vendored
@ -1,11 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm
|
|
||||||
// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh wasm
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
// IsBigEndian records whether the GOARCH's byte order is big endian.
|
|
||||||
const IsBigEndian = false
|
|
15
vendor/golang.org/x/sys/cpu/hwcap_linux.go
generated
vendored
15
vendor/golang.org/x/sys/cpu/hwcap_linux.go
generated
vendored
@ -24,21 +24,6 @@ var hwCap uint
|
|||||||
var hwCap2 uint
|
var hwCap2 uint
|
||||||
|
|
||||||
func readHWCAP() error {
|
func readHWCAP() error {
|
||||||
// For Go 1.21+, get auxv from the Go runtime.
|
|
||||||
if a := getAuxv(); len(a) > 0 {
|
|
||||||
for len(a) >= 2 {
|
|
||||||
tag, val := a[0], uint(a[1])
|
|
||||||
a = a[2:]
|
|
||||||
switch tag {
|
|
||||||
case _AT_HWCAP:
|
|
||||||
hwCap = val
|
|
||||||
case _AT_HWCAP2:
|
|
||||||
hwCap2 = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
buf, err := ioutil.ReadFile(procAuxv)
|
buf, err := ioutil.ReadFile(procAuxv)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// e.g. on android /proc/self/auxv is not accessible, so silently
|
// e.g. on android /proc/self/auxv is not accessible, so silently
|
||||||
|
43
vendor/golang.org/x/sys/cpu/parse.go
generated
vendored
43
vendor/golang.org/x/sys/cpu/parse.go
generated
vendored
@ -1,43 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
import "strconv"
|
|
||||||
|
|
||||||
// parseRelease parses a dot-separated version number. It follows the semver
|
|
||||||
// syntax, but allows the minor and patch versions to be elided.
|
|
||||||
//
|
|
||||||
// This is a copy of the Go runtime's parseRelease from
|
|
||||||
// https://golang.org/cl/209597.
|
|
||||||
func parseRelease(rel string) (major, minor, patch int, ok bool) {
|
|
||||||
// Strip anything after a dash or plus.
|
|
||||||
for i := 0; i < len(rel); i++ {
|
|
||||||
if rel[i] == '-' || rel[i] == '+' {
|
|
||||||
rel = rel[:i]
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
next := func() (int, bool) {
|
|
||||||
for i := 0; i < len(rel); i++ {
|
|
||||||
if rel[i] == '.' {
|
|
||||||
ver, err := strconv.Atoi(rel[:i])
|
|
||||||
rel = rel[i+1:]
|
|
||||||
return ver, err == nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ver, err := strconv.Atoi(rel)
|
|
||||||
rel = ""
|
|
||||||
return ver, err == nil
|
|
||||||
}
|
|
||||||
if major, ok = next(); !ok || rel == "" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if minor, ok = next(); !ok || rel == "" {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
patch, ok = next()
|
|
||||||
return
|
|
||||||
}
|
|
54
vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go
generated
vendored
54
vendor/golang.org/x/sys/cpu/proc_cpuinfo_linux.go
generated
vendored
@ -1,54 +0,0 @@
|
|||||||
// Copyright 2022 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build linux && arm64
|
|
||||||
// +build linux,arm64
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
import (
|
|
||||||
"errors"
|
|
||||||
"io"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func readLinuxProcCPUInfo() error {
|
|
||||||
f, err := os.Open("/proc/cpuinfo")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer f.Close()
|
|
||||||
|
|
||||||
var buf [1 << 10]byte // enough for first CPU
|
|
||||||
n, err := io.ReadFull(f, buf[:])
|
|
||||||
if err != nil && err != io.ErrUnexpectedEOF {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
in := string(buf[:n])
|
|
||||||
const features = "\nFeatures : "
|
|
||||||
i := strings.Index(in, features)
|
|
||||||
if i == -1 {
|
|
||||||
return errors.New("no CPU features found")
|
|
||||||
}
|
|
||||||
in = in[i+len(features):]
|
|
||||||
if i := strings.Index(in, "\n"); i != -1 {
|
|
||||||
in = in[:i]
|
|
||||||
}
|
|
||||||
m := map[string]*bool{}
|
|
||||||
|
|
||||||
initOptions() // need it early here; it's harmless to call twice
|
|
||||||
for _, o := range options {
|
|
||||||
m[o.Name] = o.Feature
|
|
||||||
}
|
|
||||||
// The EVTSTRM field has alias "evstrm" in Go, but Linux calls it "evtstrm".
|
|
||||||
m["evtstrm"] = &ARM64.HasEVTSTRM
|
|
||||||
|
|
||||||
for _, f := range strings.Fields(in) {
|
|
||||||
if p, ok := m[f]; ok {
|
|
||||||
*p = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
16
vendor/golang.org/x/sys/cpu/runtime_auxv.go
generated
vendored
16
vendor/golang.org/x/sys/cpu/runtime_auxv.go
generated
vendored
@ -1,16 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
// getAuxvFn is non-nil on Go 1.21+ (via runtime_auxv_go121.go init)
|
|
||||||
// on platforms that use auxv.
|
|
||||||
var getAuxvFn func() []uintptr
|
|
||||||
|
|
||||||
func getAuxv() []uintptr {
|
|
||||||
if getAuxvFn == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return getAuxvFn()
|
|
||||||
}
|
|
19
vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go
generated
vendored
19
vendor/golang.org/x/sys/cpu/runtime_auxv_go121.go
generated
vendored
@ -1,19 +0,0 @@
|
|||||||
// Copyright 2023 The Go Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
//go:build go1.21
|
|
||||||
// +build go1.21
|
|
||||||
|
|
||||||
package cpu
|
|
||||||
|
|
||||||
import (
|
|
||||||
_ "unsafe" // for linkname
|
|
||||||
)
|
|
||||||
|
|
||||||
//go:linkname runtime_getAuxv runtime.getAuxv
|
|
||||||
func runtime_getAuxv() []uintptr
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
getAuxvFn = runtime_getAuxv
|
|
||||||
}
|
|
2
vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
generated
vendored
2
vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
generated
vendored
@ -5,7 +5,7 @@
|
|||||||
// Recreate a getsystemcfg syscall handler instead of
|
// Recreate a getsystemcfg syscall handler instead of
|
||||||
// using the one provided by x/sys/unix to avoid having
|
// using the one provided by x/sys/unix to avoid having
|
||||||
// the dependency between them. (See golang.org/issue/32102)
|
// the dependency between them. (See golang.org/issue/32102)
|
||||||
// Moreover, this file will be used during the building of
|
// Morever, this file will be used during the building of
|
||||||
// gccgo's libgo and thus must not used a CGo method.
|
// gccgo's libgo and thus must not used a CGo method.
|
||||||
|
|
||||||
//go:build aix && gccgo
|
//go:build aix && gccgo
|
||||||
|
12
vendor/gopkg.in/ini.v1/.editorconfig
generated
vendored
12
vendor/gopkg.in/ini.v1/.editorconfig
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
# http://editorconfig.org
|
|
||||||
|
|
||||||
root = true
|
|
||||||
|
|
||||||
[*]
|
|
||||||
charset = utf-8
|
|
||||||
end_of_line = lf
|
|
||||||
insert_final_newline = true
|
|
||||||
trim_trailing_whitespace = true
|
|
||||||
|
|
||||||
[*_test.go]
|
|
||||||
trim_trailing_whitespace = false
|
|
1
vendor/gopkg.in/ini.v1/.gitignore
generated
vendored
1
vendor/gopkg.in/ini.v1/.gitignore
generated
vendored
@ -4,4 +4,3 @@ ini.sublime-workspace
|
|||||||
testdata/conf_reflect.ini
|
testdata/conf_reflect.ini
|
||||||
.idea
|
.idea
|
||||||
/.vscode
|
/.vscode
|
||||||
.DS_Store
|
|
||||||
|
27
vendor/gopkg.in/ini.v1/.golangci.yml
generated
vendored
27
vendor/gopkg.in/ini.v1/.golangci.yml
generated
vendored
@ -1,27 +0,0 @@
|
|||||||
linters-settings:
|
|
||||||
staticcheck:
|
|
||||||
checks: [
|
|
||||||
"all",
|
|
||||||
"-SA1019" # There are valid use cases of strings.Title
|
|
||||||
]
|
|
||||||
nakedret:
|
|
||||||
max-func-lines: 0 # Disallow any unnamed return statement
|
|
||||||
|
|
||||||
linters:
|
|
||||||
enable:
|
|
||||||
- deadcode
|
|
||||||
- errcheck
|
|
||||||
- gosimple
|
|
||||||
- govet
|
|
||||||
- ineffassign
|
|
||||||
- staticcheck
|
|
||||||
- structcheck
|
|
||||||
- typecheck
|
|
||||||
- unused
|
|
||||||
- varcheck
|
|
||||||
- nakedret
|
|
||||||
- gofmt
|
|
||||||
- rowserrcheck
|
|
||||||
- unconvert
|
|
||||||
- goimports
|
|
||||||
- unparam
|
|
4
vendor/gopkg.in/ini.v1/README.md
generated
vendored
4
vendor/gopkg.in/ini.v1/README.md
generated
vendored
@ -1,6 +1,6 @@
|
|||||||
# INI
|
# INI
|
||||||
|
|
||||||
[![GitHub Workflow Status](https://img.shields.io/github/checks-status/go-ini/ini/main?logo=github&style=for-the-badge)](https://github.com/go-ini/ini/actions?query=branch%3Amain)
|
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/go-ini/ini/Go?logo=github&style=for-the-badge)](https://github.com/go-ini/ini/actions?query=workflow%3AGo)
|
||||||
[![codecov](https://img.shields.io/codecov/c/github/go-ini/ini/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/go-ini/ini)
|
[![codecov](https://img.shields.io/codecov/c/github/go-ini/ini/master?logo=codecov&style=for-the-badge)](https://codecov.io/gh/go-ini/ini)
|
||||||
[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/go-ini/ini?tab=doc)
|
[![GoDoc](https://img.shields.io/badge/GoDoc-Reference-blue?style=for-the-badge&logo=go)](https://pkg.go.dev/github.com/go-ini/ini?tab=doc)
|
||||||
[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/go-ini/ini)
|
[![Sourcegraph](https://img.shields.io/badge/view%20on-Sourcegraph-brightgreen.svg?style=for-the-badge&logo=sourcegraph)](https://sourcegraph.com/github.com/go-ini/ini)
|
||||||
@ -24,7 +24,7 @@ Package ini provides INI file read and write functionality in Go.
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
The minimum requirement of Go is **1.13**.
|
The minimum requirement of Go is **1.6**.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ go get gopkg.in/ini.v1
|
$ go get gopkg.in/ini.v1
|
||||||
|
9
vendor/gopkg.in/ini.v1/codecov.yml
generated
vendored
9
vendor/gopkg.in/ini.v1/codecov.yml
generated
vendored
@ -4,13 +4,6 @@ coverage:
|
|||||||
project:
|
project:
|
||||||
default:
|
default:
|
||||||
threshold: 1%
|
threshold: 1%
|
||||||
informational: true
|
|
||||||
patch:
|
|
||||||
defualt:
|
|
||||||
only_pulls: true
|
|
||||||
informational: true
|
|
||||||
|
|
||||||
comment:
|
comment:
|
||||||
layout: 'diff'
|
layout: 'diff, files'
|
||||||
|
|
||||||
github_checks: false
|
|
||||||
|
5
vendor/gopkg.in/ini.v1/deprecated.go
generated
vendored
5
vendor/gopkg.in/ini.v1/deprecated.go
generated
vendored
@ -14,9 +14,12 @@
|
|||||||
|
|
||||||
package ini
|
package ini
|
||||||
|
|
||||||
var (
|
const (
|
||||||
// Deprecated: Use "DefaultSection" instead.
|
// Deprecated: Use "DefaultSection" instead.
|
||||||
DEFAULT_SECTION = DefaultSection
|
DEFAULT_SECTION = DefaultSection
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
// Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE.
|
// Deprecated: AllCapsUnderscore converts to format ALL_CAPS_UNDERSCORE.
|
||||||
AllCapsUnderscore = SnackCase
|
AllCapsUnderscore = SnackCase
|
||||||
)
|
)
|
||||||
|
15
vendor/gopkg.in/ini.v1/error.go
generated
vendored
15
vendor/gopkg.in/ini.v1/error.go
generated
vendored
@ -32,18 +32,3 @@ func IsErrDelimiterNotFound(err error) bool {
|
|||||||
func (err ErrDelimiterNotFound) Error() string {
|
func (err ErrDelimiterNotFound) Error() string {
|
||||||
return fmt.Sprintf("key-value delimiter not found: %s", err.Line)
|
return fmt.Sprintf("key-value delimiter not found: %s", err.Line)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ErrEmptyKeyName indicates the error type of no key name is found which there should be one.
|
|
||||||
type ErrEmptyKeyName struct {
|
|
||||||
Line string
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsErrEmptyKeyName returns true if the given error is an instance of ErrEmptyKeyName.
|
|
||||||
func IsErrEmptyKeyName(err error) bool {
|
|
||||||
_, ok := err.(ErrEmptyKeyName)
|
|
||||||
return ok
|
|
||||||
}
|
|
||||||
|
|
||||||
func (err ErrEmptyKeyName) Error() string {
|
|
||||||
return fmt.Sprintf("empty key name: %s", err.Line)
|
|
||||||
}
|
|
||||||
|
42
vendor/gopkg.in/ini.v1/file.go
generated
vendored
42
vendor/gopkg.in/ini.v1/file.go
generated
vendored
@ -142,12 +142,6 @@ func (f *File) GetSection(name string) (*Section, error) {
|
|||||||
return secs[0], err
|
return secs[0], err
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasSection returns true if the file contains a section with given name.
|
|
||||||
func (f *File) HasSection(name string) bool {
|
|
||||||
section, _ := f.GetSection(name)
|
|
||||||
return section != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// SectionsByName returns all sections with given name.
|
// SectionsByName returns all sections with given name.
|
||||||
func (f *File) SectionsByName(name string) ([]*Section, error) {
|
func (f *File) SectionsByName(name string) ([]*Section, error) {
|
||||||
if len(name) == 0 {
|
if len(name) == 0 {
|
||||||
@ -174,9 +168,8 @@ func (f *File) SectionsByName(name string) ([]*Section, error) {
|
|||||||
func (f *File) Section(name string) *Section {
|
func (f *File) Section(name string) *Section {
|
||||||
sec, err := f.GetSection(name)
|
sec, err := f.GetSection(name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if name == "" {
|
// Note: It's OK here because the only possible error is empty section name,
|
||||||
name = DefaultSection
|
// but if it's empty, this piece of code won't be executed.
|
||||||
}
|
|
||||||
sec, _ = f.NewSection(name)
|
sec, _ = f.NewSection(name)
|
||||||
return sec
|
return sec
|
||||||
}
|
}
|
||||||
@ -342,7 +335,6 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
|
|||||||
|
|
||||||
// Use buffer to make sure target is safe until finish encoding.
|
// Use buffer to make sure target is safe until finish encoding.
|
||||||
buf := bytes.NewBuffer(nil)
|
buf := bytes.NewBuffer(nil)
|
||||||
lastSectionIdx := len(f.sectionList) - 1
|
|
||||||
for i, sname := range f.sectionList {
|
for i, sname := range f.sectionList {
|
||||||
sec := f.SectionWithIndex(sname, f.sectionIndexes[i])
|
sec := f.SectionWithIndex(sname, f.sectionIndexes[i])
|
||||||
if len(sec.Comment) > 0 {
|
if len(sec.Comment) > 0 {
|
||||||
@ -372,13 +364,12 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isLastSection := i == lastSectionIdx
|
|
||||||
if sec.isRawSection {
|
if sec.isRawSection {
|
||||||
if _, err := buf.WriteString(sec.rawBody); err != nil {
|
if _, err := buf.WriteString(sec.rawBody); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if PrettySection && !isLastSection {
|
if PrettySection {
|
||||||
// Put a line between sections
|
// Put a line between sections
|
||||||
if _, err := buf.WriteString(LineBreak); err != nil {
|
if _, err := buf.WriteString(LineBreak); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -444,14 +435,16 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
|
|||||||
kname = `"""` + kname + `"""`
|
kname = `"""` + kname + `"""`
|
||||||
}
|
}
|
||||||
|
|
||||||
writeKeyValue := func(val string) (bool, error) {
|
for _, val := range key.ValueWithShadows() {
|
||||||
if _, err := buf.WriteString(kname); err != nil {
|
if _, err := buf.WriteString(kname); err != nil {
|
||||||
return false, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if key.isBooleanType {
|
if key.isBooleanType {
|
||||||
|
if kname != sec.keyList[len(sec.keyList)-1] {
|
||||||
buf.WriteString(LineBreak)
|
buf.WriteString(LineBreak)
|
||||||
return true, nil
|
}
|
||||||
|
continue KeyList
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write out alignment spaces before "=" sign
|
// Write out alignment spaces before "=" sign
|
||||||
@ -468,27 +461,10 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
|
|||||||
val = `"` + val + `"`
|
val = `"` + val + `"`
|
||||||
}
|
}
|
||||||
if _, err := buf.WriteString(equalSign + val + LineBreak); err != nil {
|
if _, err := buf.WriteString(equalSign + val + LineBreak); err != nil {
|
||||||
return false, err
|
|
||||||
}
|
|
||||||
return false, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
shadows := key.ValueWithShadows()
|
|
||||||
if len(shadows) == 0 {
|
|
||||||
if _, err := writeKeyValue(""); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, val := range shadows {
|
|
||||||
exitLoop, err := writeKeyValue(val)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
} else if exitLoop {
|
|
||||||
continue KeyList
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, val := range key.nestedValues {
|
for _, val := range key.nestedValues {
|
||||||
if _, err := buf.WriteString(indent + " " + val + LineBreak); err != nil {
|
if _, err := buf.WriteString(indent + " " + val + LineBreak); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -496,7 +472,7 @@ func (f *File) writeToBuffer(indent string) (*bytes.Buffer, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if PrettySection && !isLastSection {
|
if PrettySection {
|
||||||
// Put a line between sections
|
// Put a line between sections
|
||||||
if _, err := buf.WriteString(LineBreak); err != nil {
|
if _, err := buf.WriteString(LineBreak); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
12
vendor/gopkg.in/ini.v1/ini.go
generated
vendored
12
vendor/gopkg.in/ini.v1/ini.go
generated
vendored
@ -1,3 +1,5 @@
|
|||||||
|
// +build go1.6
|
||||||
|
|
||||||
// Copyright 2014 Unknwon
|
// Copyright 2014 Unknwon
|
||||||
//
|
//
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License"): you may
|
// Licensed under the Apache License, Version 2.0 (the "License"): you may
|
||||||
@ -23,15 +25,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
// DefaultSection is the name of default section. You can use this constant or the string literal.
|
||||||
|
// In most of cases, an empty string is all you need to access the section.
|
||||||
|
DefaultSection = "DEFAULT"
|
||||||
|
|
||||||
// Maximum allowed depth when recursively substituing variable names.
|
// Maximum allowed depth when recursively substituing variable names.
|
||||||
depthValues = 99
|
depthValues = 99
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
// DefaultSection is the name of default section. You can use this var or the string literal.
|
|
||||||
// In most of cases, an empty string is all you need to access the section.
|
|
||||||
DefaultSection = "DEFAULT"
|
|
||||||
|
|
||||||
// LineBreak is the delimiter to determine or compose a new line.
|
// LineBreak is the delimiter to determine or compose a new line.
|
||||||
// This variable will be changed to "\r\n" automatically on Windows at package init time.
|
// This variable will be changed to "\r\n" automatically on Windows at package init time.
|
||||||
LineBreak = "\n"
|
LineBreak = "\n"
|
||||||
@ -123,8 +125,6 @@ type LoadOptions struct {
|
|||||||
ReaderBufferSize int
|
ReaderBufferSize int
|
||||||
// AllowNonUniqueSections indicates whether to allow sections with the same name multiple times.
|
// AllowNonUniqueSections indicates whether to allow sections with the same name multiple times.
|
||||||
AllowNonUniqueSections bool
|
AllowNonUniqueSections bool
|
||||||
// AllowDuplicateShadowValues indicates whether values for shadowed keys should be deduplicated.
|
|
||||||
AllowDuplicateShadowValues bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// DebugFunc is the type of function called to log parse events.
|
// DebugFunc is the type of function called to log parse events.
|
||||||
|
24
vendor/gopkg.in/ini.v1/key.go
generated
vendored
24
vendor/gopkg.in/ini.v1/key.go
generated
vendored
@ -54,7 +54,6 @@ func (k *Key) addShadow(val string) error {
|
|||||||
return errors.New("cannot add shadow to auto-increment or boolean key")
|
return errors.New("cannot add shadow to auto-increment or boolean key")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !k.s.f.options.AllowDuplicateShadowValues {
|
|
||||||
// Deduplicate shadows based on their values.
|
// Deduplicate shadows based on their values.
|
||||||
if k.value == val {
|
if k.value == val {
|
||||||
return nil
|
return nil
|
||||||
@ -64,7 +63,6 @@ func (k *Key) addShadow(val string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
shadow := newKey(k.s, k.name, val)
|
shadow := newKey(k.s, k.name, val)
|
||||||
shadow.isShadow = true
|
shadow.isShadow = true
|
||||||
@ -110,24 +108,15 @@ func (k *Key) Value() string {
|
|||||||
return k.value
|
return k.value
|
||||||
}
|
}
|
||||||
|
|
||||||
// ValueWithShadows returns raw values of key and its shadows if any. Shadow
|
// ValueWithShadows returns raw values of key and its shadows if any.
|
||||||
// keys with empty values are ignored from the returned list.
|
|
||||||
func (k *Key) ValueWithShadows() []string {
|
func (k *Key) ValueWithShadows() []string {
|
||||||
if len(k.shadows) == 0 {
|
if len(k.shadows) == 0 {
|
||||||
if k.value == "" {
|
|
||||||
return []string{}
|
|
||||||
}
|
|
||||||
return []string{k.value}
|
return []string{k.value}
|
||||||
}
|
}
|
||||||
|
vals := make([]string, len(k.shadows)+1)
|
||||||
vals := make([]string, 0, len(k.shadows)+1)
|
vals[0] = k.value
|
||||||
if k.value != "" {
|
for i := range k.shadows {
|
||||||
vals = append(vals, k.value)
|
vals[i+1] = k.shadows[i].value
|
||||||
}
|
|
||||||
for _, s := range k.shadows {
|
|
||||||
if s.value != "" {
|
|
||||||
vals = append(vals, s.value)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return vals
|
return vals
|
||||||
}
|
}
|
||||||
@ -792,8 +781,10 @@ func (k *Key) parseUint64s(strs []string, addInvalid, returnOnInvalid bool) ([]u
|
|||||||
return vals, err
|
return vals, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type Parser func(str string) (interface{}, error)
|
type Parser func(str string) (interface{}, error)
|
||||||
|
|
||||||
|
|
||||||
// parseTimesFormat transforms strings to times in given format.
|
// parseTimesFormat transforms strings to times in given format.
|
||||||
func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnOnInvalid bool) ([]time.Time, error) {
|
func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnOnInvalid bool) ([]time.Time, error) {
|
||||||
vals := make([]time.Time, 0, len(strs))
|
vals := make([]time.Time, 0, len(strs))
|
||||||
@ -810,6 +801,7 @@ func (k *Key) parseTimesFormat(format string, strs []string, addInvalid, returnO
|
|||||||
return vals, err
|
return vals, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// doParse transforms strings to different types
|
// doParse transforms strings to different types
|
||||||
func (k *Key) doParse(strs []string, addInvalid, returnOnInvalid bool, parser Parser) ([]interface{}, error) {
|
func (k *Key) doParse(strs []string, addInvalid, returnOnInvalid bool, parser Parser) ([]interface{}, error) {
|
||||||
vals := make([]interface{}, 0, len(strs))
|
vals := make([]interface{}, 0, len(strs))
|
||||||
|
47
vendor/gopkg.in/ini.v1/parser.go
generated
vendored
47
vendor/gopkg.in/ini.v1/parser.go
generated
vendored
@ -131,7 +131,7 @@ func readKeyName(delimiters string, in []byte) (string, int, error) {
|
|||||||
// Check if key name surrounded by quotes.
|
// Check if key name surrounded by quotes.
|
||||||
var keyQuote string
|
var keyQuote string
|
||||||
if line[0] == '"' {
|
if line[0] == '"' {
|
||||||
if len(line) > 6 && line[0:3] == `"""` {
|
if len(line) > 6 && string(line[0:3]) == `"""` {
|
||||||
keyQuote = `"""`
|
keyQuote = `"""`
|
||||||
} else {
|
} else {
|
||||||
keyQuote = `"`
|
keyQuote = `"`
|
||||||
@ -164,10 +164,6 @@ func readKeyName(delimiters string, in []byte) (string, int, error) {
|
|||||||
if endIdx < 0 {
|
if endIdx < 0 {
|
||||||
return "", -1, ErrDelimiterNotFound{line}
|
return "", -1, ErrDelimiterNotFound{line}
|
||||||
}
|
}
|
||||||
if endIdx == 0 {
|
|
||||||
return "", -1, ErrEmptyKeyName{line}
|
|
||||||
}
|
|
||||||
|
|
||||||
return strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil
|
return strings.TrimSpace(line[0:endIdx]), endIdx + 1, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,7 +232,7 @@ func (p *parser) readValue(in []byte, bufferSize int) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var valQuote string
|
var valQuote string
|
||||||
if len(line) > 3 && line[0:3] == `"""` {
|
if len(line) > 3 && string(line[0:3]) == `"""` {
|
||||||
valQuote = `"""`
|
valQuote = `"""`
|
||||||
} else if line[0] == '`' {
|
} else if line[0] == '`' {
|
||||||
valQuote = "`"
|
valQuote = "`"
|
||||||
@ -293,8 +289,12 @@ func (p *parser) readValue(in []byte, bufferSize int) (string, error) {
|
|||||||
hasSurroundedQuote(line, '"')) && !p.options.PreserveSurroundedQuote {
|
hasSurroundedQuote(line, '"')) && !p.options.PreserveSurroundedQuote {
|
||||||
line = line[1 : len(line)-1]
|
line = line[1 : len(line)-1]
|
||||||
} else if len(valQuote) == 0 && p.options.UnescapeValueCommentSymbols {
|
} else if len(valQuote) == 0 && p.options.UnescapeValueCommentSymbols {
|
||||||
line = strings.ReplaceAll(line, `\;`, ";")
|
if strings.Contains(line, `\;`) {
|
||||||
line = strings.ReplaceAll(line, `\#`, "#")
|
line = strings.Replace(line, `\;`, ";", -1)
|
||||||
|
}
|
||||||
|
if strings.Contains(line, `\#`) {
|
||||||
|
line = strings.Replace(line, `\#`, "#", -1)
|
||||||
|
}
|
||||||
} else if p.options.AllowPythonMultilineValues && lastChar == '\n' {
|
} else if p.options.AllowPythonMultilineValues && lastChar == '\n' {
|
||||||
return p.readPythonMultilines(line, bufferSize)
|
return p.readPythonMultilines(line, bufferSize)
|
||||||
}
|
}
|
||||||
@ -306,9 +306,15 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro
|
|||||||
parserBufferPeekResult, _ := p.buf.Peek(bufferSize)
|
parserBufferPeekResult, _ := p.buf.Peek(bufferSize)
|
||||||
peekBuffer := bytes.NewBuffer(parserBufferPeekResult)
|
peekBuffer := bytes.NewBuffer(parserBufferPeekResult)
|
||||||
|
|
||||||
|
indentSize := 0
|
||||||
for {
|
for {
|
||||||
peekData, peekErr := peekBuffer.ReadBytes('\n')
|
peekData, peekErr := peekBuffer.ReadBytes('\n')
|
||||||
if peekErr != nil && peekErr != io.EOF {
|
if peekErr != nil {
|
||||||
|
if peekErr == io.EOF {
|
||||||
|
p.debug("readPythonMultilines: io.EOF, peekData: %q, line: %q", string(peekData), line)
|
||||||
|
return line, nil
|
||||||
|
}
|
||||||
|
|
||||||
p.debug("readPythonMultilines: failed to peek with error: %v", peekErr)
|
p.debug("readPythonMultilines: failed to peek with error: %v", peekErr)
|
||||||
return "", peekErr
|
return "", peekErr
|
||||||
}
|
}
|
||||||
@ -327,6 +333,19 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro
|
|||||||
return line, nil
|
return line, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Determine indent size and line prefix.
|
||||||
|
currentIndentSize := len(peekMatches[1])
|
||||||
|
if indentSize < 1 {
|
||||||
|
indentSize = currentIndentSize
|
||||||
|
p.debug("readPythonMultilines: indent size is %d", indentSize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Make sure each line is indented at least as far as first line.
|
||||||
|
if currentIndentSize < indentSize {
|
||||||
|
p.debug("readPythonMultilines: end of value, current indent: %d, expected indent: %d, line: %q", currentIndentSize, indentSize, line)
|
||||||
|
return line, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Advance the parser reader (buffer) in-sync with the peek buffer.
|
// Advance the parser reader (buffer) in-sync with the peek buffer.
|
||||||
_, err := p.buf.Discard(len(peekData))
|
_, err := p.buf.Discard(len(peekData))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -334,7 +353,8 @@ func (p *parser) readPythonMultilines(line string, bufferSize int) (string, erro
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
line += "\n" + peekMatches[0]
|
// Handle indented empty line.
|
||||||
|
line += "\n" + peekMatches[1][indentSize:] + peekMatches[2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,8 +465,6 @@ func (f *File) parse(reader io.Reader) (err error) {
|
|||||||
// Reset auto-counter and comments
|
// Reset auto-counter and comments
|
||||||
p.comment.Reset()
|
p.comment.Reset()
|
||||||
p.count = 1
|
p.count = 1
|
||||||
// Nested values can't span sections
|
|
||||||
isLastValueEmpty = false
|
|
||||||
|
|
||||||
inUnparseableSection = false
|
inUnparseableSection = false
|
||||||
for i := range f.options.UnparseableSections {
|
for i := range f.options.UnparseableSections {
|
||||||
@ -467,9 +485,8 @@ func (f *File) parse(reader io.Reader) (err error) {
|
|||||||
|
|
||||||
kname, offset, err := readKeyName(f.options.KeyValueDelimiters, line)
|
kname, offset, err := readKeyName(f.options.KeyValueDelimiters, line)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
switch {
|
|
||||||
// Treat as boolean key when desired, and whole line is key name.
|
// Treat as boolean key when desired, and whole line is key name.
|
||||||
case IsErrDelimiterNotFound(err):
|
if IsErrDelimiterNotFound(err) {
|
||||||
switch {
|
switch {
|
||||||
case f.options.AllowBooleanKeys:
|
case f.options.AllowBooleanKeys:
|
||||||
kname, err := p.readValue(line, parserBufferSize)
|
kname, err := p.readValue(line, parserBufferSize)
|
||||||
@ -487,8 +504,6 @@ func (f *File) parse(reader io.Reader) (err error) {
|
|||||||
case f.options.SkipUnrecognizableLines:
|
case f.options.SkipUnrecognizableLines:
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
case IsErrEmptyKeyName(err) && f.options.SkipUnrecognizableLines:
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
2
vendor/gopkg.in/ini.v1/section.go
generated
vendored
2
vendor/gopkg.in/ini.v1/section.go
generated
vendored
@ -217,7 +217,7 @@ func (s *Section) KeysHash() map[string]string {
|
|||||||
defer s.f.lock.RUnlock()
|
defer s.f.lock.RUnlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
hash := make(map[string]string, len(s.keysHash))
|
hash := map[string]string{}
|
||||||
for key, value := range s.keysHash {
|
for key, value := range s.keysHash {
|
||||||
hash[key] = value
|
hash[key] = value
|
||||||
}
|
}
|
||||||
|
52
vendor/modules.txt
vendored
52
vendor/modules.txt
vendored
@ -1,5 +1,5 @@
|
|||||||
# github.com/cretz/bine v0.2.0
|
# github.com/cretz/bine v0.1.0
|
||||||
## explicit; go 1.15
|
## explicit
|
||||||
github.com/cretz/bine/control
|
github.com/cretz/bine/control
|
||||||
github.com/cretz/bine/process
|
github.com/cretz/bine/process
|
||||||
github.com/cretz/bine/tor
|
github.com/cretz/bine/tor
|
||||||
@ -8,40 +8,48 @@ github.com/cretz/bine/torutil/ed25519
|
|||||||
github.com/cretz/bine/torutil/ed25519/internal/edwards25519
|
github.com/cretz/bine/torutil/ed25519/internal/edwards25519
|
||||||
# github.com/davecgh/go-spew v1.1.1
|
# github.com/davecgh/go-spew v1.1.1
|
||||||
## explicit
|
## explicit
|
||||||
# github.com/denisenkom/go-mssqldb v0.12.3
|
# github.com/denisenkom/go-mssqldb v0.9.0
|
||||||
## explicit; go 1.13
|
## explicit
|
||||||
# github.com/go-sql-driver/mysql v1.7.1
|
# github.com/go-sql-driver/mysql v1.6.0
|
||||||
## explicit; go 1.13
|
## explicit
|
||||||
github.com/go-sql-driver/mysql
|
github.com/go-sql-driver/mysql
|
||||||
|
# github.com/gopherjs/gopherjs v0.0.0-20210406100015-1e088ea4ee04
|
||||||
|
## explicit
|
||||||
# github.com/jinzhu/gorm v1.9.16
|
# github.com/jinzhu/gorm v1.9.16
|
||||||
## explicit; go 1.12
|
## explicit
|
||||||
github.com/jinzhu/gorm
|
github.com/jinzhu/gorm
|
||||||
# github.com/jinzhu/inflection v1.0.0
|
# github.com/jinzhu/inflection v1.0.0
|
||||||
## explicit
|
|
||||||
github.com/jinzhu/inflection
|
github.com/jinzhu/inflection
|
||||||
# github.com/jinzhu/now v1.1.5
|
# github.com/jinzhu/now v1.1.2
|
||||||
## explicit; go 1.12
|
## explicit
|
||||||
# github.com/jmoiron/sqlx v1.3.5
|
# github.com/jmoiron/sqlx v1.3.1
|
||||||
## explicit; go 1.10
|
## explicit
|
||||||
github.com/jmoiron/sqlx
|
github.com/jmoiron/sqlx
|
||||||
github.com/jmoiron/sqlx/reflectx
|
github.com/jmoiron/sqlx/reflectx
|
||||||
# github.com/lib/pq v1.10.7
|
# github.com/lib/pq v1.10.0
|
||||||
## explicit; go 1.13
|
## explicit
|
||||||
# github.com/mattn/go-sqlite3 v2.0.3+incompatible
|
# github.com/mattn/go-sqlite3 v2.0.3+incompatible
|
||||||
## explicit
|
## explicit
|
||||||
# golang.org/x/crypto v0.13.0
|
# github.com/smartystreets/assertions v1.2.0
|
||||||
## explicit; go 1.17
|
## explicit
|
||||||
|
# github.com/smartystreets/goconvey v1.6.4
|
||||||
|
## explicit
|
||||||
|
# github.com/stretchr/testify v1.7.0
|
||||||
|
## explicit
|
||||||
|
# golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
|
||||||
|
## explicit
|
||||||
golang.org/x/crypto/ed25519
|
golang.org/x/crypto/ed25519
|
||||||
|
golang.org/x/crypto/ed25519/internal/edwards25519
|
||||||
golang.org/x/crypto/sha3
|
golang.org/x/crypto/sha3
|
||||||
# golang.org/x/net v0.15.0
|
# golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
|
||||||
## explicit; go 1.17
|
## explicit
|
||||||
golang.org/x/net/internal/socks
|
golang.org/x/net/internal/socks
|
||||||
golang.org/x/net/proxy
|
golang.org/x/net/proxy
|
||||||
# golang.org/x/sys v0.12.0
|
# golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57
|
||||||
## explicit; go 1.17
|
## explicit
|
||||||
golang.org/x/sys/cpu
|
golang.org/x/sys/cpu
|
||||||
# gopkg.in/ini.v1 v1.67.0
|
# gopkg.in/ini.v1 v1.62.0
|
||||||
## explicit
|
## explicit
|
||||||
gopkg.in/ini.v1
|
gopkg.in/ini.v1
|
||||||
# gopkg.in/yaml.v3 v3.0.1
|
# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||||
## explicit
|
## explicit
|
||||||
|
Loading…
Reference in New Issue
Block a user