diff --git a/go.mod b/go.mod index 5b63ad31fa2..ea6f0b971db 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/RoaringBitmap/roaring v0.4.23 // indirect github.com/armon/go-metrics v0.3.3 // indirect github.com/avct/uasurfer v0.0.0-20191028135549-26b5daa857f1 - github.com/beevik/etree v1.1.0 // indirect github.com/blang/semver v3.5.1+incompatible github.com/blevesearch/bleve v1.0.9 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect @@ -53,7 +52,6 @@ require ( github.com/jaytaylor/html2text v0.0.0-20200412013138-3577fbdbcff7 github.com/jmhodges/levigo v1.0.0 // indirect github.com/jmoiron/sqlx v1.2.0 - github.com/jonboulle/clockwork v0.1.0 // indirect github.com/lib/pq v1.7.0 github.com/magiconair/properties v1.8.1 // indirect github.com/mailru/easyjson v0.7.1 // indirect @@ -84,11 +82,10 @@ require ( github.com/pkg/errors v0.9.1 github.com/poy/onpar v1.0.0 // indirect github.com/prometheus/client_golang v1.7.1 - github.com/prometheus/client_model v0.2.0 // indirect github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 // indirect github.com/rs/cors v1.7.0 github.com/rudderlabs/analytics-go v3.2.1+incompatible - github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 + github.com/russellhaering/goxmldsig v1.1.1 // indirect github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd github.com/segmentio/backo-go v0.0.0-20200129164019-23eae7c10bd3 // indirect github.com/sirupsen/logrus v1.6.0 @@ -104,7 +101,6 @@ require ( github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/throttled/throttled v2.2.4+incompatible github.com/tinylib/msgp v1.1.2 - github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 // indirect github.com/tylerb/graceful v1.2.15 github.com/uber/jaeger-client-go v2.24.0+incompatible github.com/uber/jaeger-lib v2.2.0+incompatible @@ -132,7 +128,6 @@ require ( gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/olivere/elastic.v6 v6.2.33 gopkg.in/yaml.v2 v2.3.0 - gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect honnef.co/go/tools v0.0.1-2020.1.3 // indirect willnorris.com/go/imageproxy v0.10.0 ) diff --git a/go.sum b/go.sum index 56b05899fb7..f884f0fbd76 100644 --- a/go.sum +++ b/go.sum @@ -29,7 +29,6 @@ github.com/NYTimes/gziphandler v1.1.1 h1:ZUDjpQae29j0ryrS0u/B8HZfJBtBQHjqw2rQ2cq github.com/NYTimes/gziphandler v1.1.1/go.mod h1:n/CVRwUEOgIxrgPvAQhUUr9oeUtvrhMomdKFjzJNB0c= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PaulARoy/azurestoragecache v0.0.0-20170906084534-3c249a3ba788/go.mod h1:lY1dZd8HBzJ10eqKERHn3CU59tfhzcAVb2c0ZhIWSOk= -github.com/RoaringBitmap/roaring v0.4.21 h1:WJ/zIlNX4wQZ9x8Ey33O1UaD9TCTakYsdLFSBcTwH+8= github.com/RoaringBitmap/roaring v0.4.21/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= github.com/RoaringBitmap/roaring v0.4.23 h1:gpyfd12QohbqhFO4NVDUdoPOCXsyahYRQhINmlHxKeo= github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo= @@ -45,7 +44,6 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da h1:8GUt8eRujhVEGZFFEjBj46YV4rDjvGrNxb0KMWYkL2I= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.3.3 h1:a9F4rlj7EWWrbj7BYw8J8+x+ZZkJeqzNyRk8hdPF+ro= github.com/armon/go-metrics v0.3.3/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= @@ -56,9 +54,7 @@ github.com/aws/aws-sdk-go v1.19.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= -github.com/beorn7/perks v1.0.0 h1:HWo1m869IqiPhD389kmkxeTalrjNbbJTC8LXupb+sl0= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -118,6 +114,7 @@ github.com/couchbase/vellum v1.0.1 h1:qrj9ohvZedvc51S5KzPfJ6P6z0Vqzv7Lx7k3mVc2WO github.com/couchbase/vellum v1.0.1/go.mod h1:FcwrEivFpNi24R3jLOs3n+fs5RnuQnQqCLBJ1uAg1W4= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d h1:SwD98825d6bdB+pEuTxWOXiSjBrHdOl/UVp75eI7JT8= github.com/cznic/b v0.0.0-20181122101859-a26611c4d92d/go.mod h1:URriBxXwVq5ijiJ12C7iIZqlA69nTlI+LgI6/pwftG8= github.com/cznic/mathutil v0.0.0-20181122101859-297441e03548 h1:iwZdTE0PVqJCos1vaoKsclOGD3ADKpshg3SRtYBbwso= @@ -134,7 +131,6 @@ github.com/dgryski/dgoogauth v0.0.0-20190221195224-5a805980a5f3/go.mod h1:hEfFau github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/die-net/lrucache v0.0.0-20181227122439-19a39ef22a11/go.mod h1:ew0MSjCVDdtGMjF3kzLK9hwdgF5mOE8SbYVF3Rc7mkU= -github.com/disintegration/imaging v1.6.0 h1:nVPXRUUQ36Z7MNf0O77UzgnOb1mkMMor7lmJMJXc/mA= github.com/disintegration/imaging v1.6.0/go.mod h1:xuIt+sRxDFrHS0drzXUlCJthkJ8k7lkkUojDSR247MQ= github.com/disintegration/imaging v1.6.2 h1:w1LecBlG2Lnp8B3jk5zSuNqd7b4DXhcjwek1ei82L+c= github.com/disintegration/imaging v1.6.2/go.mod h1:44/5580QXChDfwIclfc/PCwrr44amcmDAg8hxG0Ewe4= @@ -147,10 +143,8 @@ github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473 h1:4cmBvAEBNJaGARUEs3/suWRyfyBfhf7I60WBZq+bv2w= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= @@ -160,7 +154,6 @@ github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqL github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0 h1:8xPHl4/q1VyqGIPif1F+1V3Y3lSmrq01EabUW3CoW5s= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= @@ -171,7 +164,6 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= @@ -183,13 +175,11 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2 h1:Ujru1hufTHVb++eG6OuNDKMxZnGIvF6o/u8q/8h2+I4= github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a h1:FQqoVvjbiUioBBFUL5up+h+GdCa/AnJsL/1bIs/veSI= github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31 h1:gclg6gY70GLy3PbkQ1AERPfmLMMagS60DKF78eWwLn8= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= -github.com/go-asn1-ber/asn1-ber v1.3.2-0.20191121212151-29be175fc3a3 h1:QW2p25fGTu/S0MvEftCo3wV7aEFHBt2m1DTg1HUwh+o= github.com/go-asn1-ber/asn1-ber v1.3.2-0.20191121212151-29be175fc3a3/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= github.com/go-asn1-ber/asn1-ber v1.5.1 h1:pDbRAunXzIUXfx4CB2QJFv5IuPiuoW+sWvr/Us009o8= github.com/go-asn1-ber/asn1-ber v1.5.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0= @@ -215,17 +205,13 @@ github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= @@ -233,7 +219,6 @@ github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0 h1:oOuy+ugB+P/kBdUnG5QaMXSIyJ1q38wWSojYCb3z5VQ= github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= @@ -250,7 +235,6 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= @@ -281,7 +265,6 @@ github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoA github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc h1:f8eY6cV/x1x+HLjOp4r72s/31/V2aTUtg5oKRRPf8/Q= github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA= github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= @@ -301,15 +284,12 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.14.1 h1:nQcJDQwIAGnmoUWp8ubocEX40cCml/17YkF6csQLReU= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= -github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.2.0 h1:l6UW37iCXwZkZoAbEYnptSHVE/cQ5bOTPYG5W3vf9+8= github.com/hashicorp/go-immutable-radix v1.2.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3 h1:zKjpN5BK/P5lMYrLmBHdBULWbJ0XpYR+7NGzqkZzoD4= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-msgpack v1.1.5 h1:9byZdVjKTe5mce63pRVNP1L7UAmdHOTEMGehn6KvJWs= github.com/hashicorp/go-msgpack v1.1.5/go.mod h1:gWVc3sv/wbDmR3rQsj1CAktEZzoz1YNK9NfGLXJ69/4= -github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= @@ -319,14 +299,11 @@ github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= github.com/hashicorp/go-sockaddr v1.0.2 h1:ztczhD1jLxIRjVejw8gFomI1BQZOe2WoVOu0SyteCQc= github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/golang-lru v0.5.0 h1:CL2msUPvZTLb5O648aiLNJw3hnBxN2+1Jq8rCOH9wdo= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.4 h1:YDjusn29QI/Das2iO9M0BHnIbxPeyuCHsjMW+lJfyTc= github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= @@ -359,10 +336,10 @@ github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= -github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -383,35 +360,34 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= -github.com/klauspost/cpuid v1.2.3 h1:CCtW0xUnWGVINKvE/WWOYKdsPV6mawAtvQuSl8guwQs= github.com/klauspost/cpuid v1.2.3/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid v1.3.1 h1:5JNjFYYQrZeKRJ0734q51WCEEn2huer72Dc7K+R/b6s= github.com/klauspost/cpuid v1.3.1/go.mod h1:bYW4mA6ZgKPob1/Dlai2LviZJO7KGI3uoWLd42rAQw4= github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw= -github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 h1:SOEGU9fKiNWd/HOJuq6+3iTQz8KNCLtVX6idSoTLdUw= github.com/lann/builder v0.0.0-20180802200727-47ae307949d0/go.mod h1:dXGbAdH5GtBTC4WfIxhKZfyBF/HBFgRZSWwZ9g/He9o= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 h1:P6pPBnrTSX3DEVR4fDembhRWSsG5rVo6hYhAB/ADZrk= github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0/go.mod h1:vmVJ0l/dxyfGW6FmdpVm2joNMFikkuWg0EoCKLGUMNw= -github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.7.0 h1:h93mCPfUSkaul3Ka/VG8uZdmW1uMHDGxzu0NWHuJmHY= github.com/lib/pq v1.7.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/lunixbochs/vtclean v1.0.0/go.mod h1:pHhQNgMf3btfWnGBVipUOjRYhoOsdGqdm/+2c2E2WMI= -github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= @@ -435,7 +411,6 @@ github.com/mattermost/viper v1.0.4 h1:cMYOz4PhguscGSPxrSokUtib5HrG4gCpiUh27wyA3d github.com/mattermost/viper v1.0.4/go.mod h1:uc5hKG9lv4/KRwPOt2c1omOyirS/UnuA2TytiZQSFHM= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= -github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= @@ -443,7 +418,6 @@ github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNx github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= -github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= @@ -477,7 +451,6 @@ github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go. github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.3.2 h1:mRS76wmkOn3KkKAyXDu42V+6ebnXWIztFSYGN7GeoRg= github.com/mitchellh/mapstructure v1.3.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -488,11 +461,9 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae h1:VeRdUYdCw49yizlSbMEn2SZ+gT+3IUKx8BqxyQdz+BY= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM= github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw= -github.com/muesli/smartcrop v0.2.1-0.20181030220600-548bbf0c0965 h1:BdOnvj+P+06ZFwYd07iFWXHPfRyrJd5sAXpX9+E8bxM= github.com/muesli/smartcrop v0.2.1-0.20181030220600-548bbf0c0965/go.mod h1:i2fCI/UorTfgEpPPLWiFBv4pye+YAG78RwcQLUkocpI= github.com/muesli/smartcrop v0.3.0 h1:JTlSkmxWg/oQ1TcLDoypuirdE8Y/jzNirQeLkxpA6Oc= github.com/muesli/smartcrop v0.3.0/go.mod h1:i2fCI/UorTfgEpPPLWiFBv4pye+YAG78RwcQLUkocpI= @@ -507,7 +478,6 @@ github.com/nelsam/hel/v2 v2.3.2/go.mod h1:1ZTGfU2PFTOd5mx22i5O0Lc2GY933lQ2wb/ggy github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/ngdinhtoan/glide-cleanup v0.2.0/go.mod h1:UQzsmiDOb8YV3nOsCxK/c9zPpCZVNoHScRE3EO9pVMM= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= @@ -517,15 +487,11 @@ github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FW github.com/olivere/elastic v6.2.33+incompatible h1:SRPB2w2OhJ7iULftDEHsNPRoL2GLREqPMRalVmbZaEw= github.com/olivere/elastic v6.2.33+incompatible/go.mod h1:J+q1zQJTgAz9woqsbVRqGeB5G1iqDKVBWLNSYW8yfJ8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs= github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.3 h1:OoxbjfXVZyod1fmWYhI7SEyaD8B00ynP3T+D5GiyHOY= github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= -github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= @@ -536,13 +502,11 @@ github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFSt github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c h1:Lgl0gzECD8GnQ5QCWA8o6BtfL6mDH5rQgM4/fX3avOs= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pborman/uuid v1.2.0 h1:J7Q5mO4ysT1dv8hyrUGHb9+ooztCXu1D8MY8DZYsu3g= github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= -github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= github.com/pelletier/go-toml v1.8.0 h1:Keo9qb7iRJs2voHvunFtuuYFsbWeOBh8/P9v/kVMFtw= github.com/pelletier/go-toml v1.8.0/go.mod h1:D6yutnOGMveHEPV7VQOuvI/gXY61bv+9bAOTRnLElKs= @@ -552,8 +516,8 @@ github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -566,41 +530,32 @@ github.com/poy/onpar v1.0.0 h1:MfdQ9bnas+J1si8vUHAABXKxqOqDVaH4T3LRDYYv5Lo= github.com/poy/onpar v1.0.0/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829 h1:D+CiwcpGTW6pL6bv6KI3KbyEyCKyS+1JWS2h8PNDnGA= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= -github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1 h1:NTGy1Ja9pByO+xAeH/qiWnLrKtr3hJPNjaVUwnjpdpA= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f h1:BVwpUVJDADN2ufcGik7W992pyps0wZ888b/y9GXcLTU= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90 h1:S/YWwWx/RA8rT8tKFRuGUZhuA90OyIBpPCXkcbwU8DE= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.0.0-20180801064454-c7de2306084e/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= -github.com/prometheus/common v0.2.0 h1:kUZDBDTdBVBYBj5Tmh2NZLlF60mfjA27rM34b+cVwNU= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0 h1:RyRA7RzGXQZiW+tGMr7sxa85G1z0yOpM1qq5c8lNawc= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/procfs v0.0.0-20180725123919-05ee40e3a273/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1 h1:/K3IL0Z1quvmJ7X0A1AwNEK7CRkVK3YwfOU/QAL4WGg= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= -github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= @@ -611,14 +566,17 @@ github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237 h1:HQagqIiBm github.com/remyoudompheng/bigfft v0.0.0-20190728182440-6a916e37a237/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rs/cors v1.7.0 h1:+88SsELBHx5r+hZ8TCkggzSstaWNbDvThkVK8H6f9ik= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1 h1:mhH9Nq+C1fY2l1XIpgxIiUOfNpRBYH1kKcr+qfKgjRc= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rudderlabs/analytics-go v3.2.1+incompatible h1:XDocL6elYIi8WhLXLklDahq+Ws3FAYVOvJSsMuYWaKk= github.com/rudderlabs/analytics-go v3.2.1+incompatible/go.mod h1:LF8/ty9kUX4PTY3l5c97K3nZZaX5Hwsvt+NBaRL/f30= -github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 h1:J4AOUcOh/t1XbQcJfkEqhzgvMJ2tDxdCVvmHxW5QXao= -github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7/go.mod h1:Oz4y6ImuOQZxynhbSXk7btjEfNBtGlj2dcaOvXl2FSM= +github.com/russellhaering/goxmldsig v1.1.1 h1:vI0r2osGF1A9PLvsGdPUAGwEIrKa4Pj5sesSBsebIxM= +github.com/russellhaering/goxmldsig v1.1.1/go.mod h1:gM4MDENBQf7M+V824SGfyIUVFWydB7n0KkEubVJl+Tw= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/rwcarlsen/goexif v0.0.0-20190401172101-9e8deecbddbd h1:CmH9+J6ZSsIjUK3dcGsnCnO41eRBOnY12zwkn5qVwgc= @@ -654,7 +612,6 @@ github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeV github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4= github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -671,7 +628,6 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= github.com/spf13/afero v1.3.1 h1:GPTpEAuNr98px18yNQ66JllNil98wfRZ/5Ukny8FeQA= github.com/spf13/afero v1.3.1/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= -github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -679,11 +635,9 @@ github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tL github.com/spf13/cobra v0.0.6/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= -github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -694,16 +648,12 @@ github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02n github.com/steveyen/gtreap v0.1.0 h1:CjhzTa274PyJLJuMZwIzCO1PfC00oRa8d1Kc78bFXJM= github.com/steveyen/gtreap v0.1.0/go.mod h1:kl/5J7XbrOmlIbYIXdRHDDE5QxHqpk0cmkT7Z4dM9/Y= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= @@ -714,13 +664,10 @@ github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzH github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c/go.mod h1:ahpPrc7HpcfEWDQRZEmnXMzHY03mLDYMCxeDzy46i+8= github.com/throttled/throttled v2.2.4+incompatible h1:aVKdoH/qT5Mo1Lm/678OkX2pFg7aRpHlTn1tfgaSKxs= github.com/throttled/throttled v2.2.4+incompatible/go.mod h1:0BjlrEGQmvxps+HuXLsyRdqpSRvJpq0PNIsOtqP9Nos= -github.com/tinylib/msgp v1.1.0 h1:9fQd+ICuRIu/ue4vxJZu6/LzxN0HwMds2nq/0cFvxHU= github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tinylib/msgp v1.1.2 h1:gWmO7n0Ys2RBEb7GPYB9Ujq8Mk5p2U08lRnmMcGy6BQ= github.com/tinylib/msgp v1.1.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 h1:OXcKh35JaYsGMRzpvFkLv/MEyPuL49CThT1pZ8aSml4= -github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= github.com/tylerb/graceful v1.2.15 h1:B0x01Y8fsJpogzZTkDg6BDi6eMf03s01lEKGdrv83oA= github.com/tylerb/graceful v1.2.15/go.mod h1:LPYTbOYmUTdabwRt0TGhLllQ0MUNbs0Y5q1WXJOI9II= @@ -729,10 +676,8 @@ github.com/uber/jaeger-client-go v2.24.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw= github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= @@ -770,7 +715,6 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.etcd.io/bbolt v1.3.4 h1:hi1bXHMVrlQh6WwxAy+qZCV/SYIlqo+Ushwdpa4tAKg= go.etcd.io/bbolt v1.3.4/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= go.etcd.io/bbolt v1.3.5 h1:XAzx9gjCb0Rxj7EoqcClPD1d5ZBxZJk0jbuoPHenBt0= go.etcd.io/bbolt v1.3.5/go.mod h1:G5EMThwa9y8QZGBClrRx5EY+Yw9kAhnjy3bSjsnlVTQ= @@ -794,7 +738,6 @@ golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5a golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -802,15 +745,12 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899 h1:DZhuSZLsGlFL4CmhA8BcRA0mnthyA/nZ00AqCUo7vHg= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de h1:ikNHVSjEfnvz6sxdSPCaPt572qowuyMDMJLLm3Db3ig= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f h1:FO4MZ3N56GnxbqxGKqh+YTzUWQ2sDwtFQEZgLOxh9Jc= golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/image v0.0.0-20200618115811-c13761719519 h1:1e2ufUJNM3lCHEY5jIgac/7UTjd6cgJNdatjPdFWf34= @@ -821,14 +761,11 @@ golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= -golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -866,11 +803,8 @@ golang.org/x/oauth2 v0.0.0-20190319182350-c85d3e98c914/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -885,7 +819,6 @@ golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190316082340-a2f829d7f35f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -906,15 +839,11 @@ golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo= golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200805065543-0cf7623e9dbd h1:wefLe/3g5tC0FcXw3NneLA5tHgbyouyZlfcSjNfOdgk= golang.org/x/sys v0.0.0-20200805065543-0cf7623e9dbd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -958,11 +887,8 @@ google.golang.org/api v0.2.0/go.mod h1:IfRCZScioGtypHNTlz3gFk67J8uePVW7uDTBzXuIk google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0 h1:KxkO13IPW4Lslp2bz+KHP2E3gtFlrIGNThxkZQ3g+4c= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.6.5 h1:tycE03LOZYQNhDpS27tcQdAzLCVMaj7QT2SXxebnpCM= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= @@ -974,7 +900,6 @@ google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk google.golang.org/genproto v0.0.0-20181219182458-5a97ab628bfb/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190306203927-b5d61aea6440/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190321212433-e79c0c59cdb5 h1:VchCZUJA1Lkjn3FxAtLPl4GotxoGt/E8ZIm9nVqbhQ8= google.golang.org/genproto v0.0.0-20190321212433-e79c0c59cdb5/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= @@ -985,7 +910,6 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= @@ -998,10 +922,8 @@ google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLY google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0 h1:qdOKuR/EIArgaWNjetjgTzgVTAZ+S/WXVrq9HW9zimw= google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= @@ -1011,10 +933,10 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -1035,24 +957,21 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 h1:tQIYjPdBoyREyB9XMu+nnTclpTYkz2zFM+lzLJFO4gQ= -gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776/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= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= diff --git a/vendor/github.com/jonboulle/clockwork/.editorconfig b/vendor/github.com/jonboulle/clockwork/.editorconfig new file mode 100644 index 00000000000..4492e9f9fe1 --- /dev/null +++ b/vendor/github.com/jonboulle/clockwork/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.go] +indent_style = tab diff --git a/vendor/github.com/jonboulle/clockwork/.gitignore b/vendor/github.com/jonboulle/clockwork/.gitignore index 010c242bd8a..00852bd9424 100644 --- a/vendor/github.com/jonboulle/clockwork/.gitignore +++ b/vendor/github.com/jonboulle/clockwork/.gitignore @@ -1,3 +1,5 @@ +/.idea/ + # Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a diff --git a/vendor/github.com/jonboulle/clockwork/.travis.yml b/vendor/github.com/jonboulle/clockwork/.travis.yml deleted file mode 100644 index aefda90bfa8..00000000000 --- a/vendor/github.com/jonboulle/clockwork/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: go -go: - - 1.3 - -sudo: false diff --git a/vendor/github.com/jonboulle/clockwork/README.md b/vendor/github.com/jonboulle/clockwork/README.md index d43a6c799a0..cad60835720 100644 --- a/vendor/github.com/jonboulle/clockwork/README.md +++ b/vendor/github.com/jonboulle/clockwork/README.md @@ -1,61 +1,80 @@ -clockwork -========= +# clockwork -[![Build Status](https://travis-ci.org/jonboulle/clockwork.png?branch=master)](https://travis-ci.org/jonboulle/clockwork) -[![godoc](https://godoc.org/github.com/jonboulle/clockwork?status.svg)](http://godoc.org/github.com/jonboulle/clockwork) +[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go#utilities) -a simple fake clock for golang +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jonboulle/clockwork/CI?style=flat-square)](https://github.com/jonboulle/clockwork/actions?query=workflow%3ACI) +[![Go Report Card](https://goreportcard.com/badge/github.com/jonboulle/clockwork?style=flat-square)](https://goreportcard.com/report/github.com/jonboulle/clockwork) +![Go Version](https://img.shields.io/badge/go%20version-%3E=1.11-61CFDD.svg?style=flat-square) +[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white&style=flat-square)](https://pkg.go.dev/mod/github.com/jonboulle/clockwork) -# Usage +**A simple fake clock for Go.** + + +## Usage Replace uses of the `time` package with the `clockwork.Clock` interface instead. For example, instead of using `time.Sleep` directly: -``` -func my_func() { +```go +func myFunc() { time.Sleep(3 * time.Second) - do_something() + doSomething() } ``` -inject a clock and use its `Sleep` method instead: +Inject a clock and use its `Sleep` method instead: -``` -func my_func(clock clockwork.Clock) { +```go +func myFunc(clock clockwork.Clock) { clock.Sleep(3 * time.Second) - do_something() + doSomething() } ``` -Now you can easily test `my_func` with a `FakeClock`: +Now you can easily test `myFunc` with a `FakeClock`: -``` +```go func TestMyFunc(t *testing.T) { c := clockwork.NewFakeClock() // Start our sleepy function - my_func(c) - - // Ensure we wait until my_func is sleeping + var wg sync.WaitGroup + wg.Add(1) + go func() { + myFunc(c) + wg.Done() + }() + + // Ensure we wait until myFunc is sleeping c.BlockUntil(1) - assert_state() + assertState() // Advance the FakeClock forward in time - c.Advance(3) + c.Advance(3 * time.Second) + + // Wait until the function completes + wg.Wait() - assert_state() + assertState() } ``` and in production builds, simply inject the real clock instead: -``` -my_func(clockwork.NewRealClock()) + +```go +myFunc(clockwork.NewRealClock()) ``` See [example_test.go](example_test.go) for a full example. + # Credits -clockwork is inspired by @wickman's [threaded fake clock](https://gist.github.com/wickman/3840816), and the [Golang playground](http://blog.golang.org/playground#Faking time) +clockwork is inspired by @wickman's [threaded fake clock](https://gist.github.com/wickman/3840816), and the [Golang playground](https://blog.golang.org/playground#TOC_3.1.) + + +## License + +Apache License, Version 2.0. Please see [License File](LICENSE) for more information. diff --git a/vendor/github.com/jonboulle/clockwork/clockwork.go b/vendor/github.com/jonboulle/clockwork/clockwork.go index 9ec96ed2968..1018051f4af 100644 --- a/vendor/github.com/jonboulle/clockwork/clockwork.go +++ b/vendor/github.com/jonboulle/clockwork/clockwork.go @@ -11,6 +11,8 @@ type Clock interface { After(d time.Duration) <-chan time.Time Sleep(d time.Duration) Now() time.Time + Since(t time.Time) time.Duration + NewTicker(d time.Duration) Ticker } // FakeClock provides an interface for a clock which can be @@ -60,6 +62,14 @@ func (rc *realClock) Now() time.Time { return time.Now() } +func (rc *realClock) Since(t time.Time) time.Duration { + return rc.Now().Sub(t) +} + +func (rc *realClock) NewTicker(d time.Duration) Ticker { + return &realTicker{time.NewTicker(d)} +} + type fakeClock struct { sleepers []*sleeper blockers []*blocker @@ -87,7 +97,7 @@ func (fc *fakeClock) After(d time.Duration) <-chan time.Time { defer fc.l.Unlock() now := fc.time done := make(chan time.Time, 1) - if d.Nanoseconds() == 0 { + if d.Nanoseconds() <= 0 { // special case - trigger immediately done <- now } else { @@ -130,6 +140,22 @@ func (fc *fakeClock) Now() time.Time { return t } +// Since returns the duration that has passed since the given time on the fakeClock +func (fc *fakeClock) Since(t time.Time) time.Duration { + return fc.Now().Sub(t) +} + +func (fc *fakeClock) NewTicker(d time.Duration) Ticker { + ft := &fakeTicker{ + c: make(chan time.Time, 1), + stop: make(chan bool, 1), + clock: fc, + period: d, + } + ft.runTickThread() + return ft +} + // Advance advances fakeClock to a new point in time, ensuring channels from any // previous invocations of After are notified appropriately before returning func (fc *fakeClock) Advance(d time.Duration) { diff --git a/vendor/github.com/jonboulle/clockwork/go.mod b/vendor/github.com/jonboulle/clockwork/go.mod new file mode 100644 index 00000000000..4f4bb165875 --- /dev/null +++ b/vendor/github.com/jonboulle/clockwork/go.mod @@ -0,0 +1,3 @@ +module github.com/jonboulle/clockwork + +go 1.13 diff --git a/vendor/github.com/jonboulle/clockwork/ticker.go b/vendor/github.com/jonboulle/clockwork/ticker.go new file mode 100644 index 00000000000..32b5d01e754 --- /dev/null +++ b/vendor/github.com/jonboulle/clockwork/ticker.go @@ -0,0 +1,72 @@ +package clockwork + +import ( + "time" +) + +// Ticker provides an interface which can be used instead of directly +// using the ticker within the time module. The real-time ticker t +// provides ticks through t.C which becomes now t.Chan() to make +// this channel requirement definable in this interface. +type Ticker interface { + Chan() <-chan time.Time + Stop() +} + +type realTicker struct{ *time.Ticker } + +func (rt *realTicker) Chan() <-chan time.Time { + return rt.C +} + +type fakeTicker struct { + c chan time.Time + stop chan bool + clock FakeClock + period time.Duration +} + +func (ft *fakeTicker) Chan() <-chan time.Time { + return ft.c +} + +func (ft *fakeTicker) Stop() { + ft.stop <- true +} + +// runTickThread initializes a background goroutine to send the tick time to the ticker channel +// after every period. Tick events are discarded if the underlying ticker channel does not have +// enough capacity. +func (ft *fakeTicker) runTickThread() { + nextTick := ft.clock.Now().Add(ft.period) + next := ft.clock.After(ft.period) + go func() { + for { + select { + case <-ft.stop: + return + case <-next: + // We send the time that the tick was supposed to occur at. + tick := nextTick + // Before sending the tick, we'll compute the next tick time and star the clock.After call. + now := ft.clock.Now() + // First, figure out how many periods there have been between "now" and the time we were + // supposed to have trigged, then advance over all of those. + skipTicks := (now.Sub(tick) + ft.period - 1) / ft.period + nextTick = nextTick.Add(skipTicks * ft.period) + // Now, keep advancing until we are past now. This should happen at most once. + for !nextTick.After(now) { + nextTick = nextTick.Add(ft.period) + } + // Figure out how long between now and the next scheduled tick, then wait that long. + remaining := nextTick.Sub(now) + next = ft.clock.After(remaining) + // Finally, we can actually send the tick. + select { + case ft.c <- tick: + default: + } + } + } + }() +} diff --git a/vendor/github.com/russellhaering/goxmldsig/.travis.yml b/vendor/github.com/russellhaering/goxmldsig/.travis.yml index 689db992214..8ad33f7db4f 100644 --- a/vendor/github.com/russellhaering/goxmldsig/.travis.yml +++ b/vendor/github.com/russellhaering/goxmldsig/.travis.yml @@ -1,9 +1,11 @@ +arch: + - amd64 + - ppc64le + language: go go: - - "1.6.x" - - "1.7.x" - - "1.8.x" - - "1.9.x" - - "1.10.x" + - "1.14.x" + - "1.15.x" + - "1.17.x" - master diff --git a/vendor/github.com/russellhaering/goxmldsig/README.md b/vendor/github.com/russellhaering/goxmldsig/README.md index 5fc3bdbceb2..9464e61ecff 100644 --- a/vendor/github.com/russellhaering/goxmldsig/README.md +++ b/vendor/github.com/russellhaering/goxmldsig/README.md @@ -7,7 +7,7 @@ XML Digital Signatures implemented in pure Go. ## Installation -Install `goxmldsig` into your `$GOPATH` using `go get`: +Install `goxmldsig` using `go get`: ``` $ go get github.com/russellhaering/goxmldsig diff --git a/vendor/github.com/russellhaering/goxmldsig/canonicalize.go b/vendor/github.com/russellhaering/goxmldsig/canonicalize.go index 5510191926e..05655ebc4b8 100644 --- a/vendor/github.com/russellhaering/goxmldsig/canonicalize.go +++ b/vendor/github.com/russellhaering/goxmldsig/canonicalize.go @@ -13,6 +13,22 @@ type Canonicalizer interface { Algorithm() AlgorithmID } +type NullCanonicalizer struct { +} + +func MakeNullCanonicalizer() Canonicalizer { + return &NullCanonicalizer{} +} + +func (c *NullCanonicalizer) Algorithm() AlgorithmID { + return AlgorithmID("NULL") +} + +func (c *NullCanonicalizer) Canonicalize(el *etree.Element) ([]byte, error) { + scope := make(map[string]struct{}) + return canonicalSerialize(canonicalPrep(el, scope, false)) +} + type c14N10ExclusiveCanonicalizer struct { prefixList string } @@ -49,7 +65,7 @@ func MakeC14N11Canonicalizer() Canonicalizer { // Canonicalize transforms the input Element into a serialized XML document in canonical form. func (c *c14N11Canonicalizer) Canonicalize(el *etree.Element) ([]byte, error) { scope := make(map[string]struct{}) - return canonicalSerialize(canonicalPrep(el, scope)) + return canonicalSerialize(canonicalPrep(el, scope, true)) } func (c *c14N11Canonicalizer) Algorithm() AlgorithmID { @@ -66,7 +82,7 @@ func MakeC14N10RecCanonicalizer() Canonicalizer { // Canonicalize transforms the input Element into a serialized XML document in canonical form. func (c *c14N10RecCanonicalizer) Canonicalize(el *etree.Element) ([]byte, error) { scope := make(map[string]struct{}) - return canonicalSerialize(canonicalPrep(el, scope)) + return canonicalSerialize(canonicalPrep(el, scope, true)) } func (c *c14N10RecCanonicalizer) Algorithm() AlgorithmID { @@ -83,7 +99,7 @@ func MakeC14N10CommentCanonicalizer() Canonicalizer { // Canonicalize transforms the input Element into a serialized XML document in canonical form. func (c *c14N10CommentCanonicalizer) Canonicalize(el *etree.Element) ([]byte, error) { scope := make(map[string]struct{}) - return canonicalSerialize(canonicalPrep(el, scope)) + return canonicalSerialize(canonicalPrep(el, scope, true)) } func (c *c14N10CommentCanonicalizer) Algorithm() AlgorithmID { @@ -116,7 +132,7 @@ const nsSpace = "xmlns" // // TODO(russell_h): This is very similar to excCanonicalPrep - perhaps they should // be unified into one parameterized function? -func canonicalPrep(el *etree.Element, seenSoFar map[string]struct{}) *etree.Element { +func canonicalPrep(el *etree.Element, seenSoFar map[string]struct{}, strip bool) *etree.Element { _seenSoFar := make(map[string]struct{}) for k, v := range seenSoFar { _seenSoFar[k] = v @@ -141,7 +157,7 @@ func canonicalPrep(el *etree.Element, seenSoFar map[string]struct{}) *etree.Elem for i, token := range ne.Child { childElement, ok := token.(*etree.Element) if ok { - ne.Child[i] = canonicalPrep(childElement, _seenSoFar) + ne.Child[i] = canonicalPrep(childElement, _seenSoFar, strip) } } diff --git a/vendor/github.com/russellhaering/goxmldsig/go.mod b/vendor/github.com/russellhaering/goxmldsig/go.mod new file mode 100644 index 00000000000..0203efdc8b4 --- /dev/null +++ b/vendor/github.com/russellhaering/goxmldsig/go.mod @@ -0,0 +1,13 @@ +module github.com/russellhaering/goxmldsig + +go 1.15 + +require ( + github.com/beevik/etree v1.1.0 + github.com/jonboulle/clockwork v0.2.2 + github.com/kr/pretty v0.3.0 // indirect + github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/stretchr/testify v1.6.1 + gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect +) diff --git a/vendor/github.com/russellhaering/goxmldsig/go.sum b/vendor/github.com/russellhaering/goxmldsig/go.sum new file mode 100644 index 00000000000..d806ab87bf0 --- /dev/null +++ b/vendor/github.com/russellhaering/goxmldsig/go.sum @@ -0,0 +1,34 @@ +github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= +github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jonboulle/clockwork v0.2.0 h1:J2SLSdy7HgElq8ekSl2Mxh6vrRNFxqbXGenYH2I02Vs= +github.com/jonboulle/clockwork v0.2.0/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/jonboulle/clockwork v0.2.2 h1:UOGuzwb1PwsrDAObMuhUnj0p5ULPj8V/xJ7Kx9qUBdQ= +github.com/jonboulle/clockwork v0.2.2/go.mod h1:Pkfl5aHPm1nk2H9h0bjmnJD/BcgbGXUBGnn1kMkgxc8= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= +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/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +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= diff --git a/vendor/github.com/russellhaering/goxmldsig/sign.go b/vendor/github.com/russellhaering/goxmldsig/sign.go index e2c2852e43d..2be34b7f63a 100644 --- a/vendor/github.com/russellhaering/goxmldsig/sign.go +++ b/vendor/github.com/russellhaering/goxmldsig/sign.go @@ -92,10 +92,11 @@ func (ctx *SigningContext) constructSignedInfo(el *etree.Element, enveloped bool dataId := el.SelectAttrValue(ctx.IdAttribute, "") if dataId == "" { - return nil, errors.New("Missing data ID") + reference.CreateAttr(URIAttr, "") + } else { + reference.CreateAttr(URIAttr, "#"+dataId) } - reference.CreateAttr(URIAttr, "#"+dataId) // /SignedInfo/Reference/Transforms transforms := ctx.createNamespacedElement(reference, TransformsTag) diff --git a/vendor/github.com/russellhaering/goxmldsig/validate.go b/vendor/github.com/russellhaering/goxmldsig/validate.go index 55feb3960bb..840458588a5 100644 --- a/vendor/github.com/russellhaering/goxmldsig/validate.go +++ b/vendor/github.com/russellhaering/goxmldsig/validate.go @@ -21,6 +21,7 @@ var ( // ErrMissingSignature indicates that no enveloped signature was found referencing // the top level element passed for signature verification. ErrMissingSignature = errors.New("Missing signature referencing the top-level element") + ErrInvalidSignature = errors.New( "Invalid Signature") ) type ValidationContext struct { @@ -110,10 +111,6 @@ func (ctx *ValidationContext) transform( ref *types.Reference) (*etree.Element, Canonicalizer, error) { transforms := ref.Transforms.Transforms - if len(transforms) != 2 { - return nil, nil, errors.New("Expected Enveloped and C14N transforms") - } - // map the path to the passed signature relative to the passed root, in // order to enable removal of the signature by an enveloped signature // transform @@ -156,7 +153,7 @@ func (ctx *ValidationContext) transform( } if canonicalizer == nil { - return nil, nil, errors.New("Expected canonicalization transform") + canonicalizer = MakeNullCanonicalizer() } return el, canonicalizer, nil @@ -233,16 +230,17 @@ func (ctx *ValidationContext) verifySignedInfo(sig *types.Signature, canonicaliz } func (ctx *ValidationContext) validateSignature(el *etree.Element, sig *types.Signature, cert *x509.Certificate) (*etree.Element, error) { - idAttr := el.SelectAttr(ctx.IdAttribute) - if idAttr == nil || idAttr.Value == "" { - return nil, errors.New("Missing ID attribute") + idAttrEl := el.SelectAttr(ctx.IdAttribute) + idAttr := "" + if idAttrEl != nil { + idAttr = idAttrEl.Value } var ref *types.Reference // Find the first reference which references the top-level element for _, _ref := range sig.SignedInfo.References { - if _ref.URI == "" || _ref.URI[1:] == idAttr.Value { + if _ref.URI == "" || _ref.URI[1:] == idAttr { ref = &_ref } } @@ -270,6 +268,9 @@ func (ctx *ValidationContext) validateSignature(el *etree.Element, sig *types.Si if !bytes.Equal(digest, decodedDigestValue) { return nil, errors.New("Signature could not be verified") } + if sig.SignatureValue == nil { + return nil, errors.New("Signature could not be verified") + } // Decode the 'SignatureValue' so we can compare against it decodedSignature, err := base64.StdEncoding.DecodeString(sig.SignatureValue.Data) @@ -296,20 +297,43 @@ func contains(roots []*x509.Certificate, cert *x509.Certificate) bool { return false } +// In most places, we use etree Elements, but while deserializing the Signature, we use +// encoding/xml unmarshal directly to convert to a convenient go struct. This presents a problem in some cases because +// when an xml element repeats under the parent, the last element will win and/or be appended. We need to assert that +// the Signature object matches the expected shape of a Signature object. +func validateShape(signatureEl *etree.Element) error { + children := signatureEl.ChildElements() + + childCounts := map[string]int{} + for _, child := range children { + childCounts[child.Tag]++ + } + + validateCount := childCounts[SignedInfoTag] == 1 && childCounts[KeyInfoTag] <= 1 && childCounts[SignatureValueTag] == 1 + if !validateCount { + return ErrInvalidSignature + } + return nil +} + // findSignature searches for a Signature element referencing the passed root element. -func (ctx *ValidationContext) findSignature(el *etree.Element) (*types.Signature, error) { - idAttr := el.SelectAttr(ctx.IdAttribute) - if idAttr == nil || idAttr.Value == "" { - return nil, errors.New("Missing ID attribute") +func (ctx *ValidationContext) findSignature(root *etree.Element) (*types.Signature, error) { + idAttrEl := root.SelectAttr(ctx.IdAttribute) + idAttr := "" + if idAttrEl != nil { + idAttr = idAttrEl.Value } var sig *types.Signature // Traverse the tree looking for a Signature element - err := etreeutils.NSFindIterate(el, Namespace, SignatureTag, func(ctx etreeutils.NSContext, el *etree.Element) error { - + err := etreeutils.NSFindIterate(root, Namespace, SignatureTag, func(ctx etreeutils.NSContext, signatureEl *etree.Element) error { + err := validateShape(signatureEl) + if err != nil { + return err + } found := false - err := etreeutils.NSFindChildrenIterateCtx(ctx, el, Namespace, SignedInfoTag, + err = etreeutils.NSFindChildrenIterateCtx(ctx, signatureEl, Namespace, SignedInfoTag, func(ctx etreeutils.NSContext, signedInfo *etree.Element) error { detachedSignedInfo, err := etreeutils.NSDetatch(ctx, signedInfo) if err != nil { @@ -343,20 +367,20 @@ func (ctx *ValidationContext) findSignature(el *etree.Element) (*types.Signature canonicalSignedInfo = detachedSignedInfo case CanonicalXML11AlgorithmId: - canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}) + canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}, true) case CanonicalXML10RecAlgorithmId: - canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}) + canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}, true) case CanonicalXML10CommentAlgorithmId: - canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}) + canonicalSignedInfo = canonicalPrep(detachedSignedInfo, map[string]struct{}{}, true) default: return fmt.Errorf("invalid CanonicalizationMethod on Signature: %s", c14NAlgorithm) } - el.RemoveChild(signedInfo) - el.AddChild(canonicalSignedInfo) + signatureEl.RemoveChild(signedInfo) + signatureEl.AddChild(canonicalSignedInfo) found = true @@ -372,7 +396,7 @@ func (ctx *ValidationContext) findSignature(el *etree.Element) (*types.Signature // Unmarshal the signature into a structured Signature type _sig := &types.Signature{} - err = etreeutils.NSUnmarshalElement(ctx, el, _sig) + err = etreeutils.NSUnmarshalElement(ctx, signatureEl, _sig) if err != nil { return err } @@ -380,7 +404,7 @@ func (ctx *ValidationContext) findSignature(el *etree.Element) (*types.Signature // Traverse references in the signature to determine whether it has at least // one reference to the top level element. If so, conclude the search. for _, ref := range _sig.SignedInfo.References { - if ref.URI == "" || ref.URI[1:] == idAttr.Value { + if ref.URI == "" || ref.URI[1:] == idAttr { sig = _sig return etreeutils.ErrTraversalHalted } diff --git a/vendor/github.com/tinylib/msgp/.gitignore b/vendor/github.com/tinylib/msgp/.gitignore deleted file mode 100644 index 1acaf6cdd5a..00000000000 --- a/vendor/github.com/tinylib/msgp/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -_generated/generated.go -_generated/generated_test.go -_generated/*_gen.go -_generated/*_gen_test.go -_generated/embeddedStruct/*_gen.go -_generated/embeddedStruct/*_gen_test.go -msgp/defgen_test.go -msgp/cover.out -*~ -*.coverprofile diff --git a/vendor/github.com/tinylib/msgp/.travis.yml b/vendor/github.com/tinylib/msgp/.travis.yml deleted file mode 100644 index 5f574c093b1..00000000000 --- a/vendor/github.com/tinylib/msgp/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: go - -go: - - 1.12.x - - tip - -env: - - GIMME_ARCH=amd64 - - GIMME_ARCH=386 - -script: "make travis" diff --git a/vendor/github.com/tinylib/msgp/Makefile b/vendor/github.com/tinylib/msgp/Makefile deleted file mode 100644 index 4cc2dd281de..00000000000 --- a/vendor/github.com/tinylib/msgp/Makefile +++ /dev/null @@ -1,52 +0,0 @@ - -# NOTE: This Makefile is only necessary if you -# plan on developing the msgp tool and library. -# Installation can still be performed with a -# normal `go install`. - -# generated integration test files -GGEN = ./_generated/generated.go ./_generated/generated_test.go -# generated unit test files -MGEN = ./msgp/defgen_test.go - -SHELL := /bin/bash - -BIN = $(GOBIN)/msgp - -.PHONY: clean wipe install get-deps bench all - -$(BIN): */*.go - @go install ./... - -install: $(BIN) - -$(GGEN): ./_generated/def.go - go generate ./_generated - -$(MGEN): ./msgp/defs_test.go - go generate ./msgp - -test: all - go test ./... ./_generated - -bench: all - go test -bench ./... - -clean: - $(RM) $(GGEN) $(MGEN) - -wipe: clean - $(RM) $(BIN) - -get-deps: - go get -d -t ./... - -all: install $(GGEN) $(MGEN) - -# travis CI enters here -travis: - go get -d -t ./... - go build -o "$${GOPATH%%:*}/bin/msgp" . - go generate ./msgp - go generate ./_generated - go test -v ./... ./_generated diff --git a/vendor/github.com/tinylib/msgp/README.md b/vendor/github.com/tinylib/msgp/README.md deleted file mode 100644 index 1328ccafe4f..00000000000 --- a/vendor/github.com/tinylib/msgp/README.md +++ /dev/null @@ -1,102 +0,0 @@ -MessagePack Code Generator [![Build Status](https://travis-ci.org/tinylib/msgp.svg?branch=master)](https://travis-ci.org/tinylib/msgp) -======= - -This is a code generation tool and serialization library for [MessagePack](http://msgpack.org). You can read more about MessagePack [in the wiki](http://github.com/tinylib/msgp/wiki), or at [msgpack.org](http://msgpack.org). - -### Why? - -- Use Go as your schema language -- Performance -- [JSON interop](http://godoc.org/github.com/tinylib/msgp/msgp#CopyToJSON) -- [User-defined extensions](http://github.com/tinylib/msgp/wiki/Using-Extensions) -- Type safety -- Encoding flexibility - -### Quickstart - -In a source file, include the following directive: - -```go -//go:generate msgp -``` - -The `msgp` command will generate serialization methods for all exported type declarations in the file. - -You can [read more about the code generation options here](http://github.com/tinylib/msgp/wiki/Using-the-Code-Generator). - -### Use - -Field names can be set in much the same way as the `encoding/json` package. For example: - -```go -type Person struct { - Name string `msg:"name"` - Address string `msg:"address"` - Age int `msg:"age"` - Hidden string `msg:"-"` // this field is ignored - unexported bool // this field is also ignored -} -``` - -By default, the code generator will satisfy `msgp.Sizer`, `msgp.Encodable`, `msgp.Decodable`, -`msgp.Marshaler`, and `msgp.Unmarshaler`. Carefully-designed applications can use these methods to do -marshalling/unmarshalling with zero heap allocations. - -While `msgp.Marshaler` and `msgp.Unmarshaler` are quite similar to the standard library's -`json.Marshaler` and `json.Unmarshaler`, `msgp.Encodable` and `msgp.Decodable` are useful for -stream serialization. (`*msgp.Writer` and `*msgp.Reader` are essentially protocol-aware versions -of `*bufio.Writer` and `*bufio.Reader`, respectively.) - -### Features - - - Extremely fast generated code - - Test and benchmark generation - - JSON interoperability (see `msgp.CopyToJSON() and msgp.UnmarshalAsJSON()`) - - Support for complex type declarations - - Native support for Go's `time.Time`, `complex64`, and `complex128` types - - Generation of both `[]byte`-oriented and `io.Reader/io.Writer`-oriented methods - - Support for arbitrary type system extensions - - [Preprocessor directives](http://github.com/tinylib/msgp/wiki/Preprocessor-Directives) - - File-based dependency model means fast codegen regardless of source tree size. - -Consider the following: -```go -const Eight = 8 -type MyInt int -type Data []byte - -type Struct struct { - Which map[string]*MyInt `msg:"which"` - Other Data `msg:"other"` - Nums [Eight]float64 `msg:"nums"` -} -``` -As long as the declarations of `MyInt` and `Data` are in the same file as `Struct`, the parser will determine that the type information for `MyInt` and `Data` can be passed into the definition of `Struct` before its methods are generated. - -#### Extensions - -MessagePack supports defining your own types through "extensions," which are just a tuple of -the data "type" (`int8`) and the raw binary. You [can see a worked example in the wiki.](http://github.com/tinylib/msgp/wiki/Using-Extensions) - -### Status - -Mostly stable, in that no breaking changes have been made to the `/msgp` library in more than a year. Newer versions -of the code may generate different code than older versions for performance reasons. I (@philhofer) am aware of a -number of stability-critical commercial applications that use this code with good results. But, caveat emptor. - -You can read more about how `msgp` maps MessagePack types onto Go types [in the wiki](http://github.com/tinylib/msgp/wiki). - -Here some of the known limitations/restrictions: - -- Identifiers from outside the processed source file are assumed (optimistically) to satisfy the generator's interfaces. If this isn't the case, your code will fail to compile. -- Like most serializers, `chan` and `func` fields are ignored, as well as non-exported fields. -- Encoding of `interface{}` is limited to built-ins or types that have explicit encoding methods. -- _Maps must have `string` keys._ This is intentional (as it preserves JSON interop.) Although non-string map keys are not forbidden by the MessagePack standard, many serializers impose this restriction. (It also means *any* well-formed `struct` can be de-serialized into a `map[string]interface{}`.) The only exception to this rule is that the deserializers will allow you to read map keys encoded as `bin` types, due to the fact that some legacy encodings permitted this. (However, those values will still be cast to Go `string`s, and they will be converted to `str` types when re-encoded. It is the responsibility of the user to ensure that map keys are UTF-8 safe in this case.) The same rules hold true for JSON translation. - -If the output compiles, then there's a pretty good chance things are fine. (Plus, we generate tests for you.) *Please, please, please* file an issue if you think the generator is writing broken code. - -### Performance - -If you like benchmarks, see [here](http://bravenewgeek.com/so-you-wanna-go-fast/) and [here](https://github.com/alecthomas/go_serialization_benchmarks). - -As one might expect, the generated methods that deal with `[]byte` are faster for small objects, but the `io.Reader/Writer` methods are generally more memory-efficient (and, at some point, faster) for large (> 2KB) objects. diff --git a/vendor/github.com/tinylib/msgp/gen/decode.go b/vendor/github.com/tinylib/msgp/gen/decode.go deleted file mode 100644 index 10f3fd8af5c..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/decode.go +++ /dev/null @@ -1,231 +0,0 @@ -package gen - -import ( - "io" - "strconv" -) - -func decode(w io.Writer) *decodeGen { - return &decodeGen{ - p: printer{w: w}, - hasfield: false, - } -} - -type decodeGen struct { - passes - p printer - hasfield bool - ctx *Context -} - -func (d *decodeGen) Method() Method { return Decode } - -func (d *decodeGen) needsField() { - if d.hasfield { - return - } - d.p.print("\nvar field []byte; _ = field") - d.hasfield = true -} - -func (d *decodeGen) Execute(p Elem) error { - p = d.applyall(p) - if p == nil { - return nil - } - d.hasfield = false - if !d.p.ok() { - return d.p.err - } - - if !IsPrintable(p) { - return nil - } - - d.ctx = &Context{} - - d.p.comment("DecodeMsg implements msgp.Decodable") - - d.p.printf("\nfunc (%s %s) DecodeMsg(dc *msgp.Reader) (err error) {", p.Varname(), methodReceiver(p)) - next(d, p) - d.p.nakedReturn() - unsetReceiver(p) - return d.p.err -} - -func (d *decodeGen) gStruct(s *Struct) { - if !d.p.ok() { - return - } - if s.AsTuple { - d.structAsTuple(s) - } else { - d.structAsMap(s) - } - return -} - -func (d *decodeGen) assignAndCheck(name string, typ string) { - if !d.p.ok() { - return - } - d.p.printf("\n%s, err = dc.Read%s()", name, typ) - d.p.wrapErrCheck(d.ctx.ArgsStr()) -} - -func (d *decodeGen) structAsTuple(s *Struct) { - nfields := len(s.Fields) - - sz := randIdent() - d.p.declare(sz, u32) - d.assignAndCheck(sz, arrayHeader) - d.p.arrayCheck(strconv.Itoa(nfields), sz) - for i := range s.Fields { - if !d.p.ok() { - return - } - d.ctx.PushString(s.Fields[i].FieldName) - next(d, s.Fields[i].FieldElem) - d.ctx.Pop() - } -} - -func (d *decodeGen) structAsMap(s *Struct) { - d.needsField() - sz := randIdent() - d.p.declare(sz, u32) - d.assignAndCheck(sz, mapHeader) - - d.p.printf("\nfor %s > 0 {\n%s--", sz, sz) - d.assignAndCheck("field", mapKey) - d.p.print("\nswitch msgp.UnsafeString(field) {") - for i := range s.Fields { - d.ctx.PushString(s.Fields[i].FieldName) - d.p.printf("\ncase \"%s\":", s.Fields[i].FieldTag) - next(d, s.Fields[i].FieldElem) - d.ctx.Pop() - if !d.p.ok() { - return - } - } - d.p.print("\ndefault:\nerr = dc.Skip()") - d.p.wrapErrCheck(d.ctx.ArgsStr()) - - d.p.closeblock() // close switch - d.p.closeblock() // close for loop -} - -func (d *decodeGen) gBase(b *BaseElem) { - if !d.p.ok() { - return - } - - // open block for 'tmp' - var tmp string - if b.Convert { - tmp = randIdent() - d.p.printf("\n{ var %s %s", tmp, b.BaseType()) - } - - vname := b.Varname() // e.g. "z.FieldOne" - bname := b.BaseName() // e.g. "Float64" - - // handle special cases - // for object type. - switch b.Value { - case Bytes: - if b.Convert { - d.p.printf("\n%s, err = dc.ReadBytes([]byte(%s))", tmp, vname) - } else { - d.p.printf("\n%s, err = dc.ReadBytes(%s)", vname, vname) - } - case IDENT: - d.p.printf("\nerr = %s.DecodeMsg(dc)", vname) - case Ext: - d.p.printf("\nerr = dc.ReadExtension(%s)", vname) - default: - if b.Convert { - d.p.printf("\n%s, err = dc.Read%s()", tmp, bname) - } else { - d.p.printf("\n%s, err = dc.Read%s()", vname, bname) - } - } - d.p.wrapErrCheck(d.ctx.ArgsStr()) - - // close block for 'tmp' - if b.Convert { - if b.ShimMode == Cast { - d.p.printf("\n%s = %s(%s)\n}", vname, b.FromBase(), tmp) - } else { - d.p.printf("\n%s, err = %s(%s)\n}", vname, b.FromBase(), tmp) - d.p.wrapErrCheck(d.ctx.ArgsStr()) - } - } -} - -func (d *decodeGen) gMap(m *Map) { - if !d.p.ok() { - return - } - sz := randIdent() - - // resize or allocate map - d.p.declare(sz, u32) - d.assignAndCheck(sz, mapHeader) - d.p.resizeMap(sz, m) - - // for element in map, read string/value - // pair and assign - d.p.printf("\nfor %s > 0 {\n%s--", sz, sz) - d.p.declare(m.Keyidx, "string") - d.p.declare(m.Validx, m.Value.TypeName()) - d.assignAndCheck(m.Keyidx, stringTyp) - d.ctx.PushVar(m.Keyidx) - next(d, m.Value) - d.p.mapAssign(m) - d.ctx.Pop() - d.p.closeblock() -} - -func (d *decodeGen) gSlice(s *Slice) { - if !d.p.ok() { - return - } - sz := randIdent() - d.p.declare(sz, u32) - d.assignAndCheck(sz, arrayHeader) - d.p.resizeSlice(sz, s) - d.p.rangeBlock(d.ctx, s.Index, s.Varname(), d, s.Els) -} - -func (d *decodeGen) gArray(a *Array) { - if !d.p.ok() { - return - } - - // special case if we have [const]byte - if be, ok := a.Els.(*BaseElem); ok && (be.Value == Byte || be.Value == Uint8) { - d.p.printf("\nerr = dc.ReadExactBytes((%s)[:])", a.Varname()) - d.p.wrapErrCheck(d.ctx.ArgsStr()) - return - } - sz := randIdent() - d.p.declare(sz, u32) - d.assignAndCheck(sz, arrayHeader) - d.p.arrayCheck(coerceArraySize(a.Size), sz) - d.p.rangeBlock(d.ctx, a.Index, a.Varname(), d, a.Els) -} - -func (d *decodeGen) gPtr(p *Ptr) { - if !d.p.ok() { - return - } - d.p.print("\nif dc.IsNil() {") - d.p.print("\nerr = dc.ReadNil()") - d.p.wrapErrCheck(d.ctx.ArgsStr()) - d.p.printf("\n%s = nil\n} else {", p.Varname()) - d.p.initPtr(p) - next(d, p.Value) - d.p.closeblock() -} diff --git a/vendor/github.com/tinylib/msgp/gen/elem.go b/vendor/github.com/tinylib/msgp/gen/elem.go deleted file mode 100644 index 50f07e79e5f..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/elem.go +++ /dev/null @@ -1,739 +0,0 @@ -package gen - -import ( - "fmt" - "strings" -) - -var ( - identNext = 0 - identPrefix = "za" -) - -func resetIdent(prefix string) { - identPrefix = prefix - identNext = 0 -} - -// generate a random identifier name -func randIdent() string { - identNext++ - return fmt.Sprintf("%s%04d", identPrefix, identNext) -} - -// This code defines the type declaration tree. -// -// Consider the following: -// -// type Marshaler struct { -// Thing1 *float64 `msg:"thing1"` -// Body []byte `msg:"body"` -// } -// -// A parser using this generator as a backend -// should parse the above into: -// -// var val Elem = &Ptr{ -// name: "z", -// Value: &Struct{ -// Name: "Marshaler", -// Fields: []StructField{ -// { -// FieldTag: "thing1", -// FieldElem: &Ptr{ -// name: "z.Thing1", -// Value: &BaseElem{ -// name: "*z.Thing1", -// Value: Float64, -// Convert: false, -// }, -// }, -// }, -// { -// FieldTag: "body", -// FieldElem: &BaseElem{ -// name: "z.Body", -// Value: Bytes, -// Convert: false, -// }, -// }, -// }, -// }, -// } - -// Base is one of the -// base types -type Primitive uint8 - -// this is effectively the -// list of currently available -// ReadXxxx / WriteXxxx methods. -const ( - Invalid Primitive = iota - Bytes - String - Float32 - Float64 - Complex64 - Complex128 - Uint - Uint8 - Uint16 - Uint32 - Uint64 - Byte - Int - Int8 - Int16 - Int32 - Int64 - Bool - Intf // interface{} - Time // time.Time - Ext // extension - - IDENT // IDENT means an unrecognized identifier -) - -// all of the recognized identities -// that map to primitive types -var primitives = map[string]Primitive{ - "[]byte": Bytes, - "string": String, - "float32": Float32, - "float64": Float64, - "complex64": Complex64, - "complex128": Complex128, - "uint": Uint, - "uint8": Uint8, - "uint16": Uint16, - "uint32": Uint32, - "uint64": Uint64, - "byte": Byte, - "rune": Int32, - "int": Int, - "int8": Int8, - "int16": Int16, - "int32": Int32, - "int64": Int64, - "bool": Bool, - "interface{}": Intf, - "time.Time": Time, - "msgp.Extension": Ext, -} - -// types built into the library -// that satisfy all of the -// interfaces. -var builtins = map[string]struct{}{ - "msgp.Raw": struct{}{}, - "msgp.Number": struct{}{}, -} - -// common data/methods for every Elem -type common struct{ vname, alias string } - -func (c *common) SetVarname(s string) { c.vname = s } -func (c *common) Varname() string { return c.vname } -func (c *common) Alias(typ string) { c.alias = typ } -func (c *common) hidden() {} - -func IsPrintable(e Elem) bool { - if be, ok := e.(*BaseElem); ok && !be.Printable() { - return false - } - return true -} - -// Elem is a go type capable of being -// serialized into MessagePack. It is -// implemented by *Ptr, *Struct, *Array, -// *Slice, *Map, and *BaseElem. -type Elem interface { - // SetVarname sets this nodes - // variable name and recursively - // sets the names of all its children. - // In general, this should only be - // called on the parent of the tree. - SetVarname(s string) - - // Varname returns the variable - // name of the element. - Varname() string - - // TypeName is the canonical - // go type name of the node - // e.g. "string", "int", "map[string]float64" - // OR the alias name, if it has been set. - TypeName() string - - // Alias sets a type (alias) name - Alias(typ string) - - // Copy should perform a deep copy of the object - Copy() Elem - - // Complexity returns a measure of the - // complexity of element (greater than - // or equal to 1.) - Complexity() int - - // ZeroExpr returns the expression for the correct zero/empty - // value. Can be used for assignment. - // Returns "" if zero/empty not supported for this Elem. - ZeroExpr() string - - // IfZeroExpr returns the expression to compare to zero/empty - // for this type. It is meant to be used in an if statement - // and may include the simple statement form followed by - // semicolon and then the expression. - // Returns "" if zero/empty not supported for this Elem. - IfZeroExpr() string - - hidden() -} - -// Ident returns the *BaseElem that corresponds -// to the provided identity. -func Ident(id string) *BaseElem { - p, ok := primitives[id] - if ok { - return &BaseElem{Value: p} - } - be := &BaseElem{Value: IDENT} - be.Alias(id) - return be -} - -type Array struct { - common - Index string // index variable name - Size string // array size - Els Elem // child -} - -func (a *Array) SetVarname(s string) { - a.common.SetVarname(s) -ridx: - a.Index = randIdent() - - // try to avoid using the same - // index as a parent slice - if strings.Contains(a.Varname(), a.Index) { - goto ridx - } - - a.Els.SetVarname(fmt.Sprintf("%s[%s]", a.Varname(), a.Index)) -} - -func (a *Array) TypeName() string { - if a.common.alias != "" { - return a.common.alias - } - a.common.Alias(fmt.Sprintf("[%s]%s", a.Size, a.Els.TypeName())) - return a.common.alias -} - -func (a *Array) Copy() Elem { - b := *a - b.Els = a.Els.Copy() - return &b -} - -func (a *Array) Complexity() int { return 1 + a.Els.Complexity() } - -// ZeroExpr returns the zero/empty expression or empty string if not supported. Unsupported for this case. -func (a *Array) ZeroExpr() string { return "" } - -// IfZeroExpr unsupported -func (a *Array) IfZeroExpr() string { return "" } - -// Map is a map[string]Elem -type Map struct { - common - Keyidx string // key variable name - Validx string // value variable name - Value Elem // value element -} - -func (m *Map) SetVarname(s string) { - m.common.SetVarname(s) -ridx: - m.Keyidx = randIdent() - m.Validx = randIdent() - - // just in case - if m.Keyidx == m.Validx { - goto ridx - } - - m.Value.SetVarname(m.Validx) -} - -func (m *Map) TypeName() string { - if m.common.alias != "" { - return m.common.alias - } - m.common.Alias("map[string]" + m.Value.TypeName()) - return m.common.alias -} - -func (m *Map) Copy() Elem { - g := *m - g.Value = m.Value.Copy() - return &g -} - -func (m *Map) Complexity() int { return 2 + m.Value.Complexity() } - -// ZeroExpr returns the zero/empty expression or empty string if not supported. Always "nil" for this case. -func (m *Map) ZeroExpr() string { return "nil" } - -// IfZeroExpr returns the expression to compare to zero/empty. -func (m *Map) IfZeroExpr() string { return m.Varname() + " == nil" } - -type Slice struct { - common - Index string - Els Elem // The type of each element -} - -func (s *Slice) SetVarname(a string) { - s.common.SetVarname(a) - s.Index = randIdent() - varName := s.Varname() - if varName[0] == '*' { - // Pointer-to-slice requires parenthesis for slicing. - varName = "(" + varName + ")" - } - s.Els.SetVarname(fmt.Sprintf("%s[%s]", varName, s.Index)) -} - -func (s *Slice) TypeName() string { - if s.common.alias != "" { - return s.common.alias - } - s.common.Alias("[]" + s.Els.TypeName()) - return s.common.alias -} - -func (s *Slice) Copy() Elem { - z := *s - z.Els = s.Els.Copy() - return &z -} - -func (s *Slice) Complexity() int { - return 1 + s.Els.Complexity() -} - -// ZeroExpr returns the zero/empty expression or empty string if not supported. Always "nil" for this case. -func (s *Slice) ZeroExpr() string { return "nil" } - -// IfZeroExpr returns the expression to compare to zero/empty. -func (s *Slice) IfZeroExpr() string { return s.Varname() + " == nil" } - -type Ptr struct { - common - Value Elem -} - -func (s *Ptr) SetVarname(a string) { - s.common.SetVarname(a) - - // struct fields are dereferenced - // automatically... - switch x := s.Value.(type) { - case *Struct: - // struct fields are automatically dereferenced - x.SetVarname(a) - return - - case *BaseElem: - // identities have pointer receivers - if x.Value == IDENT { - x.SetVarname(a) - } else { - x.SetVarname("*" + a) - } - return - - default: - s.Value.SetVarname("*" + a) - return - } -} - -func (s *Ptr) TypeName() string { - if s.common.alias != "" { - return s.common.alias - } - s.common.Alias("*" + s.Value.TypeName()) - return s.common.alias -} - -func (s *Ptr) Copy() Elem { - v := *s - v.Value = s.Value.Copy() - return &v -} - -func (s *Ptr) Complexity() int { return 1 + s.Value.Complexity() } - -func (s *Ptr) Needsinit() bool { - if be, ok := s.Value.(*BaseElem); ok && be.needsref { - return false - } - return true -} - -// ZeroExpr returns the zero/empty expression or empty string if not supported. Always "nil" for this case. -func (s *Ptr) ZeroExpr() string { return "nil" } - -// IfZeroExpr returns the expression to compare to zero/empty. -func (s *Ptr) IfZeroExpr() string { return s.Varname() + " == nil" } - -type Struct struct { - common - Fields []StructField // field list - AsTuple bool // write as an array instead of a map -} - -func (s *Struct) TypeName() string { - if s.common.alias != "" { - return s.common.alias - } - str := "struct{\n" - for i := range s.Fields { - str += s.Fields[i].FieldName + - " " + s.Fields[i].FieldElem.TypeName() + - " " + s.Fields[i].RawTag + ";\n" - } - str += "}" - s.common.Alias(str) - return s.common.alias -} - -func (s *Struct) SetVarname(a string) { - s.common.SetVarname(a) - writeStructFields(s.Fields, a) -} - -func (s *Struct) Copy() Elem { - g := *s - g.Fields = make([]StructField, len(s.Fields)) - copy(g.Fields, s.Fields) - for i := range s.Fields { - g.Fields[i].FieldElem = s.Fields[i].FieldElem.Copy() - } - return &g -} - -func (s *Struct) Complexity() int { - c := 1 - for i := range s.Fields { - c += s.Fields[i].FieldElem.Complexity() - } - return c -} - -// ZeroExpr returns the zero/empty expression or empty string if not supported. -func (s *Struct) ZeroExpr() string { - if s.alias == "" { - return "" // structs with no names not supported (for now) - } - return "(" + s.TypeName() + "{})" -} - -// IfZeroExpr returns the expression to compare to zero/empty. -func (s *Struct) IfZeroExpr() string { - if s.alias == "" { - return "" // structs with no names not supported (for now) - } - return s.Varname() + " == " + s.ZeroExpr() -} - -// AnyHasTagPart returns true if HasTagPart(p) is true for any field. -func (s *Struct) AnyHasTagPart(pname string) bool { - for _, sf := range s.Fields { - if sf.HasTagPart(pname) { - return true - } - } - return false -} - -type StructField struct { - FieldTag string // the string inside the `msg:""` tag up to the first comma - FieldTagParts []string // the string inside the `msg:""` tag split by commas - RawTag string // the full struct tag - FieldName string // the name of the struct field - FieldElem Elem // the field type -} - -// HasTagPart returns true if the specified tag part (option) is present. -func (sf *StructField) HasTagPart(pname string) bool { - if len(sf.FieldTagParts) < 2 { - return false - } - for _, p := range sf.FieldTagParts[1:] { - if p == pname { - return true - } - } - return false -} - -type ShimMode int - -const ( - Cast ShimMode = iota - Convert -) - -// BaseElem is an element that -// can be represented by a primitive -// MessagePack type. -type BaseElem struct { - common - ShimMode ShimMode // Method used to shim - ShimToBase string // shim to base type, or empty - ShimFromBase string // shim from base type, or empty - Value Primitive // Type of element - Convert bool // should we do an explicit conversion? - mustinline bool // must inline; not printable - needsref bool // needs reference for shim -} - -func (s *BaseElem) Printable() bool { return !s.mustinline } - -func (s *BaseElem) Alias(typ string) { - s.common.Alias(typ) - if s.Value != IDENT { - s.Convert = true - } - if strings.Contains(typ, ".") { - s.mustinline = true - } -} - -func (s *BaseElem) SetVarname(a string) { - // extensions whose parents - // are not pointers need to - // be explicitly referenced - if s.Value == Ext || s.needsref { - if strings.HasPrefix(a, "*") { - s.common.SetVarname(a[1:]) - return - } - s.common.SetVarname("&" + a) - return - } - - s.common.SetVarname(a) -} - -// TypeName returns the syntactically correct Go -// type name for the base element. -func (s *BaseElem) TypeName() string { - if s.common.alias != "" { - return s.common.alias - } - s.common.Alias(s.BaseType()) - return s.common.alias -} - -// ToBase, used if Convert==true, is used as tmp = {{ToBase}}({{Varname}}) -func (s *BaseElem) ToBase() string { - if s.ShimToBase != "" { - return s.ShimToBase - } - return s.BaseType() -} - -// FromBase, used if Convert==true, is used as {{Varname}} = {{FromBase}}(tmp) -func (s *BaseElem) FromBase() string { - if s.ShimFromBase != "" { - return s.ShimFromBase - } - return s.TypeName() -} - -// BaseName returns the string form of the -// base type (e.g. Float64, Ident, etc) -func (s *BaseElem) BaseName() string { - // time is a special case; - // we strip the package prefix - if s.Value == Time { - return "Time" - } - return s.Value.String() -} - -func (s *BaseElem) BaseType() string { - switch s.Value { - case IDENT: - return s.TypeName() - - // exceptions to the naming/capitalization - // rule: - case Intf: - return "interface{}" - case Bytes: - return "[]byte" - case Time: - return "time.Time" - case Ext: - return "msgp.Extension" - - // everything else is base.String() with - // the first letter as lowercase - default: - return strings.ToLower(s.BaseName()) - } -} - -func (s *BaseElem) Needsref(b bool) { - s.needsref = b -} - -func (s *BaseElem) Copy() Elem { - g := *s - return &g -} - -func (s *BaseElem) Complexity() int { - if s.Convert && !s.mustinline { - return 2 - } - // we need to return 1 if !printable(), - // in order to make sure that stuff gets - // inlined appropriately - return 1 -} - -// Resolved returns whether or not -// the type of the element is -// a primitive or a builtin provided -// by the package. -func (s *BaseElem) Resolved() bool { - if s.Value == IDENT { - _, ok := builtins[s.TypeName()] - return ok - } - return true -} - -// ZeroExpr returns the zero/empty expression or empty string if not supported. -func (s *BaseElem) ZeroExpr() string { - - switch s.Value { - case Bytes: - return "nil" - case String: - return "\"\"" - case Complex64, Complex128: - return "complex(0,0)" - case Float32, - Float64, - Uint, - Uint8, - Uint16, - Uint32, - Uint64, - Byte, - Int, - Int8, - Int16, - Int32, - Int64: - return "0" - case Bool: - return "false" - - case Time: - return "(time.Time{})" - - } - - return "" -} - -// IfZeroExpr returns the expression to compare to zero/empty. -func (s *BaseElem) IfZeroExpr() string { - z := s.ZeroExpr() - if z == "" { - return "" - } - return s.Varname() + " == " + z -} - -func (k Primitive) String() string { - switch k { - case String: - return "String" - case Bytes: - return "Bytes" - case Float32: - return "Float32" - case Float64: - return "Float64" - case Complex64: - return "Complex64" - case Complex128: - return "Complex128" - case Uint: - return "Uint" - case Uint8: - return "Uint8" - case Uint16: - return "Uint16" - case Uint32: - return "Uint32" - case Uint64: - return "Uint64" - case Byte: - return "Byte" - case Int: - return "Int" - case Int8: - return "Int8" - case Int16: - return "Int16" - case Int32: - return "Int32" - case Int64: - return "Int64" - case Bool: - return "Bool" - case Intf: - return "Intf" - case Time: - return "time.Time" - case Ext: - return "Extension" - case IDENT: - return "Ident" - default: - return "INVALID" - } -} - -// writeStructFields is a trampoline for writeBase for -// all of the fields in a struct -func writeStructFields(s []StructField, name string) { - for i := range s { - s[i].FieldElem.SetVarname(fmt.Sprintf("%s.%s", name, s[i].FieldName)) - } -} - -// coerceArraySize ensures we can compare constant array lengths. -// -// msgpack array headers are 32 bit unsigned, which is reflected in the -// ArrayHeader implementation in this library using uint32. On the Go side, we -// can declare array lengths as any constant integer width, which breaks when -// attempting a direct comparison to an array header's uint32. -// -func coerceArraySize(asz string) string { - return fmt.Sprintf("uint32(%s)", asz) -} diff --git a/vendor/github.com/tinylib/msgp/gen/encode.go b/vendor/github.com/tinylib/msgp/gen/encode.go deleted file mode 100644 index a1d0b307399..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/encode.go +++ /dev/null @@ -1,270 +0,0 @@ -package gen - -import ( - "fmt" - "io" - "strings" - - "github.com/tinylib/msgp/msgp" -) - -func encode(w io.Writer) *encodeGen { - return &encodeGen{ - p: printer{w: w}, - } -} - -type encodeGen struct { - passes - p printer - fuse []byte - ctx *Context -} - -func (e *encodeGen) Method() Method { return Encode } - -func (e *encodeGen) Apply(dirs []string) error { - return nil -} - -func (e *encodeGen) writeAndCheck(typ string, argfmt string, arg interface{}) { - e.p.printf("\nerr = en.Write%s(%s)", typ, fmt.Sprintf(argfmt, arg)) - e.p.wrapErrCheck(e.ctx.ArgsStr()) -} - -func (e *encodeGen) fuseHook() { - if len(e.fuse) > 0 { - e.appendraw(e.fuse) - e.fuse = e.fuse[:0] - } -} - -func (e *encodeGen) Fuse(b []byte) { - if len(e.fuse) > 0 { - e.fuse = append(e.fuse, b...) - } else { - e.fuse = b - } -} - -func (e *encodeGen) Execute(p Elem) error { - if !e.p.ok() { - return e.p.err - } - p = e.applyall(p) - if p == nil { - return nil - } - if !IsPrintable(p) { - return nil - } - - e.ctx = &Context{} - - e.p.comment("EncodeMsg implements msgp.Encodable") - - e.p.printf("\nfunc (%s %s) EncodeMsg(en *msgp.Writer) (err error) {", p.Varname(), imutMethodReceiver(p)) - next(e, p) - e.p.nakedReturn() - return e.p.err -} - -func (e *encodeGen) gStruct(s *Struct) { - if !e.p.ok() { - return - } - if s.AsTuple { - e.tuple(s) - } else { - e.structmap(s) - } - return -} - -func (e *encodeGen) tuple(s *Struct) { - nfields := len(s.Fields) - data := msgp.AppendArrayHeader(nil, uint32(nfields)) - e.p.printf("\n// array header, size %d", nfields) - e.Fuse(data) - if len(s.Fields) == 0 { - e.fuseHook() - } - for i := range s.Fields { - if !e.p.ok() { - return - } - e.ctx.PushString(s.Fields[i].FieldName) - next(e, s.Fields[i].FieldElem) - e.ctx.Pop() - } -} - -func (e *encodeGen) appendraw(bts []byte) { - e.p.print("\nerr = en.Append(") - for i, b := range bts { - if i != 0 { - e.p.print(", ") - } - e.p.printf("0x%x", b) - } - e.p.print(")\nif err != nil { return }") -} - -func (e *encodeGen) structmap(s *Struct) { - - oeIdentPrefix := randIdent() - - var data []byte - nfields := len(s.Fields) - bm := bmask{ - bitlen: nfields, - varname: oeIdentPrefix + "Mask", - } - - omitempty := s.AnyHasTagPart("omitempty") - var fieldNVar string - if omitempty { - - fieldNVar = oeIdentPrefix + "Len" - - e.p.printf("\n// omitempty: check for empty values") - e.p.printf("\n%s := uint32(%d)", fieldNVar, nfields) - e.p.printf("\n%s", bm.typeDecl()) - for i, sf := range s.Fields { - if !e.p.ok() { - return - } - if ize := sf.FieldElem.IfZeroExpr(); ize != "" && sf.HasTagPart("omitempty") { - e.p.printf("\nif %s {", ize) - e.p.printf("\n%s--", fieldNVar) - e.p.printf("\n%s", bm.setStmt(i)) - e.p.printf("\n}") - } - } - - e.p.printf("\n// variable map header, size %s", fieldNVar) - e.p.varWriteMapHeader("en", fieldNVar, nfields) - e.p.print("\nif err != nil { return }") - if !e.p.ok() { - return - } - - // quick return for the case where the entire thing is empty, but only at the top level - if !strings.Contains(s.Varname(), ".") { - e.p.printf("\nif %s == 0 { return }", fieldNVar) - } - - } else { - - // non-omitempty version - data = msgp.AppendMapHeader(nil, uint32(nfields)) - e.p.printf("\n// map header, size %d", nfields) - e.Fuse(data) - if len(s.Fields) == 0 { - e.fuseHook() - } - - } - - for i := range s.Fields { - if !e.p.ok() { - return - } - - // if field is omitempty, wrap with if statement based on the emptymask - oeField := s.Fields[i].HasTagPart("omitempty") && s.Fields[i].FieldElem.IfZeroExpr() != "" - if oeField { - e.p.printf("\nif %s == 0 { // if not empty", bm.readExpr(i)) - } - - data = msgp.AppendString(nil, s.Fields[i].FieldTag) - e.p.printf("\n// write %q", s.Fields[i].FieldTag) - e.Fuse(data) - e.fuseHook() - - e.ctx.PushString(s.Fields[i].FieldName) - next(e, s.Fields[i].FieldElem) - e.ctx.Pop() - - if oeField { - e.p.print("\n}") // close if statement - } - - } -} - -func (e *encodeGen) gMap(m *Map) { - if !e.p.ok() { - return - } - e.fuseHook() - vname := m.Varname() - e.writeAndCheck(mapHeader, lenAsUint32, vname) - - e.p.printf("\nfor %s, %s := range %s {", m.Keyidx, m.Validx, vname) - e.writeAndCheck(stringTyp, literalFmt, m.Keyidx) - e.ctx.PushVar(m.Keyidx) - next(e, m.Value) - e.ctx.Pop() - e.p.closeblock() -} - -func (e *encodeGen) gPtr(s *Ptr) { - if !e.p.ok() { - return - } - e.fuseHook() - e.p.printf("\nif %s == nil { err = en.WriteNil(); if err != nil { return; } } else {", s.Varname()) - next(e, s.Value) - e.p.closeblock() -} - -func (e *encodeGen) gSlice(s *Slice) { - if !e.p.ok() { - return - } - e.fuseHook() - e.writeAndCheck(arrayHeader, lenAsUint32, s.Varname()) - e.p.rangeBlock(e.ctx, s.Index, s.Varname(), e, s.Els) -} - -func (e *encodeGen) gArray(a *Array) { - if !e.p.ok() { - return - } - e.fuseHook() - // shortcut for [const]byte - if be, ok := a.Els.(*BaseElem); ok && (be.Value == Byte || be.Value == Uint8) { - e.p.printf("\nerr = en.WriteBytes((%s)[:])", a.Varname()) - e.p.wrapErrCheck(e.ctx.ArgsStr()) - return - } - - e.writeAndCheck(arrayHeader, literalFmt, coerceArraySize(a.Size)) - e.p.rangeBlock(e.ctx, a.Index, a.Varname(), e, a.Els) -} - -func (e *encodeGen) gBase(b *BaseElem) { - if !e.p.ok() { - return - } - e.fuseHook() - vname := b.Varname() - if b.Convert { - if b.ShimMode == Cast { - vname = tobaseConvert(b) - } else { - vname = randIdent() - e.p.printf("\nvar %s %s", vname, b.BaseType()) - e.p.printf("\n%s, err = %s", vname, tobaseConvert(b)) - e.p.wrapErrCheck(e.ctx.ArgsStr()) - } - } - - if b.Value == IDENT { // unknown identity - e.p.printf("\nerr = %s.EncodeMsg(en)", vname) - e.p.wrapErrCheck(e.ctx.ArgsStr()) - } else { // typical case - e.writeAndCheck(b.BaseName(), literalFmt, vname) - } -} diff --git a/vendor/github.com/tinylib/msgp/gen/marshal.go b/vendor/github.com/tinylib/msgp/gen/marshal.go deleted file mode 100644 index 9a969ffeb04..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/marshal.go +++ /dev/null @@ -1,283 +0,0 @@ -package gen - -import ( - "fmt" - "io" - "strings" - - "github.com/tinylib/msgp/msgp" -) - -func marshal(w io.Writer) *marshalGen { - return &marshalGen{ - p: printer{w: w}, - } -} - -type marshalGen struct { - passes - p printer - fuse []byte - ctx *Context -} - -func (m *marshalGen) Method() Method { return Marshal } - -func (m *marshalGen) Apply(dirs []string) error { - return nil -} - -func (m *marshalGen) Execute(p Elem) error { - if !m.p.ok() { - return m.p.err - } - p = m.applyall(p) - if p == nil { - return nil - } - if !IsPrintable(p) { - return nil - } - - m.ctx = &Context{} - - m.p.comment("MarshalMsg implements msgp.Marshaler") - - // save the vname before - // calling methodReceiver so - // that z.Msgsize() is printed correctly - c := p.Varname() - - m.p.printf("\nfunc (%s %s) MarshalMsg(b []byte) (o []byte, err error) {", p.Varname(), imutMethodReceiver(p)) - m.p.printf("\no = msgp.Require(b, %s.Msgsize())", c) - next(m, p) - m.p.nakedReturn() - return m.p.err -} - -func (m *marshalGen) rawAppend(typ string, argfmt string, arg interface{}) { - m.p.printf("\no = msgp.Append%s(o, %s)", typ, fmt.Sprintf(argfmt, arg)) -} - -func (m *marshalGen) fuseHook() { - if len(m.fuse) > 0 { - m.rawbytes(m.fuse) - m.fuse = m.fuse[:0] - } -} - -func (m *marshalGen) Fuse(b []byte) { - if len(m.fuse) == 0 { - m.fuse = b - } else { - m.fuse = append(m.fuse, b...) - } -} - -func (m *marshalGen) gStruct(s *Struct) { - if !m.p.ok() { - return - } - - if s.AsTuple { - m.tuple(s) - } else { - m.mapstruct(s) - } - return -} - -func (m *marshalGen) tuple(s *Struct) { - data := make([]byte, 0, 5) - data = msgp.AppendArrayHeader(data, uint32(len(s.Fields))) - m.p.printf("\n// array header, size %d", len(s.Fields)) - m.Fuse(data) - if len(s.Fields) == 0 { - m.fuseHook() - } - for i := range s.Fields { - if !m.p.ok() { - return - } - m.ctx.PushString(s.Fields[i].FieldName) - next(m, s.Fields[i].FieldElem) - m.ctx.Pop() - } -} - -func (m *marshalGen) mapstruct(s *Struct) { - - oeIdentPrefix := randIdent() - - var data []byte - nfields := len(s.Fields) - bm := bmask{ - bitlen: nfields, - varname: oeIdentPrefix + "Mask", - } - - omitempty := s.AnyHasTagPart("omitempty") - var fieldNVar string - if omitempty { - - fieldNVar = oeIdentPrefix + "Len" - - m.p.printf("\n// omitempty: check for empty values") - m.p.printf("\n%s := uint32(%d)", fieldNVar, nfields) - m.p.printf("\n%s", bm.typeDecl()) - for i, sf := range s.Fields { - if !m.p.ok() { - return - } - if ize := sf.FieldElem.IfZeroExpr(); ize != "" && sf.HasTagPart("omitempty") { - m.p.printf("\nif %s {", ize) - m.p.printf("\n%s--", fieldNVar) - m.p.printf("\n%s", bm.setStmt(i)) - m.p.printf("\n}") - } - } - - m.p.printf("\n// variable map header, size %s", fieldNVar) - m.p.varAppendMapHeader("o", fieldNVar, nfields) - if !m.p.ok() { - return - } - - // quick return for the case where the entire thing is empty, but only at the top level - if !strings.Contains(s.Varname(), ".") { - m.p.printf("\nif %s == 0 { return }", fieldNVar) - } - - } else { - - // non-omitempty version - data = make([]byte, 0, 64) - data = msgp.AppendMapHeader(data, uint32(len(s.Fields))) - m.p.printf("\n// map header, size %d", len(s.Fields)) - m.Fuse(data) - if len(s.Fields) == 0 { - m.fuseHook() - } - - } - - for i := range s.Fields { - if !m.p.ok() { - return - } - - // if field is omitempty, wrap with if statement based on the emptymask - oeField := s.Fields[i].HasTagPart("omitempty") && s.Fields[i].FieldElem.IfZeroExpr() != "" - if oeField { - m.p.printf("\nif %s == 0 { // if not empty", bm.readExpr(i)) - } - - data = msgp.AppendString(nil, s.Fields[i].FieldTag) - - m.p.printf("\n// string %q", s.Fields[i].FieldTag) - m.Fuse(data) - m.fuseHook() - - m.ctx.PushString(s.Fields[i].FieldName) - next(m, s.Fields[i].FieldElem) - m.ctx.Pop() - - if oeField { - m.p.printf("\n}") // close if statement - } - - } -} - -// append raw data -func (m *marshalGen) rawbytes(bts []byte) { - m.p.print("\no = append(o, ") - for _, b := range bts { - m.p.printf("0x%x,", b) - } - m.p.print(")") -} - -func (m *marshalGen) gMap(s *Map) { - if !m.p.ok() { - return - } - m.fuseHook() - vname := s.Varname() - m.rawAppend(mapHeader, lenAsUint32, vname) - m.p.printf("\nfor %s, %s := range %s {", s.Keyidx, s.Validx, vname) - m.rawAppend(stringTyp, literalFmt, s.Keyidx) - m.ctx.PushVar(s.Keyidx) - next(m, s.Value) - m.ctx.Pop() - m.p.closeblock() -} - -func (m *marshalGen) gSlice(s *Slice) { - if !m.p.ok() { - return - } - m.fuseHook() - vname := s.Varname() - m.rawAppend(arrayHeader, lenAsUint32, vname) - m.p.rangeBlock(m.ctx, s.Index, vname, m, s.Els) -} - -func (m *marshalGen) gArray(a *Array) { - if !m.p.ok() { - return - } - m.fuseHook() - if be, ok := a.Els.(*BaseElem); ok && be.Value == Byte { - m.rawAppend("Bytes", "(%s)[:]", a.Varname()) - return - } - - m.rawAppend(arrayHeader, literalFmt, coerceArraySize(a.Size)) - m.p.rangeBlock(m.ctx, a.Index, a.Varname(), m, a.Els) -} - -func (m *marshalGen) gPtr(p *Ptr) { - if !m.p.ok() { - return - } - m.fuseHook() - m.p.printf("\nif %s == nil {\no = msgp.AppendNil(o)\n} else {", p.Varname()) - next(m, p.Value) - m.p.closeblock() -} - -func (m *marshalGen) gBase(b *BaseElem) { - if !m.p.ok() { - return - } - m.fuseHook() - vname := b.Varname() - - if b.Convert { - if b.ShimMode == Cast { - vname = tobaseConvert(b) - } else { - vname = randIdent() - m.p.printf("\nvar %s %s", vname, b.BaseType()) - m.p.printf("\n%s, err = %s", vname, tobaseConvert(b)) - m.p.wrapErrCheck(m.ctx.ArgsStr()) - } - } - - var echeck bool - switch b.Value { - case IDENT: - echeck = true - m.p.printf("\no, err = %s.MarshalMsg(o)", vname) - case Intf, Ext: - echeck = true - m.p.printf("\no, err = msgp.Append%s(o, %s)", b.BaseName(), vname) - default: - m.rawAppend(b.BaseName(), literalFmt, vname) - } - - if echeck { - m.p.wrapErrCheck(m.ctx.ArgsStr()) - } -} diff --git a/vendor/github.com/tinylib/msgp/gen/size.go b/vendor/github.com/tinylib/msgp/gen/size.go deleted file mode 100644 index e96e03198ce..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/size.go +++ /dev/null @@ -1,292 +0,0 @@ -package gen - -import ( - "fmt" - "io" - "strconv" - - "github.com/tinylib/msgp/msgp" -) - -type sizeState uint8 - -const ( - // need to write "s = ..." - assign sizeState = iota - - // need to write "s += ..." - add - - // can just append "+ ..." - expr -) - -func sizes(w io.Writer) *sizeGen { - return &sizeGen{ - p: printer{w: w}, - state: assign, - } -} - -type sizeGen struct { - passes - p printer - state sizeState - ctx *Context -} - -func (s *sizeGen) Method() Method { return Size } - -func (s *sizeGen) Apply(dirs []string) error { - return nil -} - -func builtinSize(typ string) string { - return "msgp." + typ + "Size" -} - -// this lets us chain together addition -// operations where possible -func (s *sizeGen) addConstant(sz string) { - if !s.p.ok() { - return - } - - switch s.state { - case assign: - s.p.print("\ns = " + sz) - s.state = expr - return - case add: - s.p.print("\ns += " + sz) - s.state = expr - return - case expr: - s.p.print(" + " + sz) - return - } - - panic("unknown size state") -} - -func (s *sizeGen) Execute(p Elem) error { - if !s.p.ok() { - return s.p.err - } - p = s.applyall(p) - if p == nil { - return nil - } - if !IsPrintable(p) { - return nil - } - - s.ctx = &Context{} - s.ctx.PushString(p.TypeName()) - - s.p.comment("Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message") - - s.p.printf("\nfunc (%s %s) Msgsize() (s int) {", p.Varname(), imutMethodReceiver(p)) - s.state = assign - next(s, p) - s.p.nakedReturn() - return s.p.err -} - -func (s *sizeGen) gStruct(st *Struct) { - if !s.p.ok() { - return - } - - nfields := uint32(len(st.Fields)) - - if st.AsTuple { - data := msgp.AppendArrayHeader(nil, nfields) - s.addConstant(strconv.Itoa(len(data))) - for i := range st.Fields { - if !s.p.ok() { - return - } - next(s, st.Fields[i].FieldElem) - } - } else { - data := msgp.AppendMapHeader(nil, nfields) - s.addConstant(strconv.Itoa(len(data))) - for i := range st.Fields { - data = data[:0] - data = msgp.AppendString(data, st.Fields[i].FieldTag) - s.addConstant(strconv.Itoa(len(data))) - next(s, st.Fields[i].FieldElem) - } - } -} - -func (s *sizeGen) gPtr(p *Ptr) { - s.state = add // inner must use add - s.p.printf("\nif %s == nil {\ns += msgp.NilSize\n} else {", p.Varname()) - next(s, p.Value) - s.state = add // closing block; reset to add - s.p.closeblock() -} - -func (s *sizeGen) gSlice(sl *Slice) { - if !s.p.ok() { - return - } - - s.addConstant(builtinSize(arrayHeader)) - - // if the slice's element is a fixed size - // (e.g. float64, [32]int, etc.), then - // print the length times the element size directly - if str, ok := fixedsizeExpr(sl.Els); ok { - s.addConstant(fmt.Sprintf("(%s * (%s))", lenExpr(sl), str)) - return - } - - // add inside the range block, and immediately after - s.state = add - s.p.rangeBlock(s.ctx, sl.Index, sl.Varname(), s, sl.Els) - s.state = add -} - -func (s *sizeGen) gArray(a *Array) { - if !s.p.ok() { - return - } - - s.addConstant(builtinSize(arrayHeader)) - - // if the array's children are a fixed - // size, we can compile an expression - // that always represents the array's wire size - if str, ok := fixedsizeExpr(a); ok { - s.addConstant(str) - return - } - - s.state = add - s.p.rangeBlock(s.ctx, a.Index, a.Varname(), s, a.Els) - s.state = add -} - -func (s *sizeGen) gMap(m *Map) { - s.addConstant(builtinSize(mapHeader)) - vn := m.Varname() - s.p.printf("\nif %s != nil {", vn) - s.p.printf("\nfor %s, %s := range %s {", m.Keyidx, m.Validx, vn) - s.p.printf("\n_ = %s", m.Validx) // we may not use the value - s.p.printf("\ns += msgp.StringPrefixSize + len(%s)", m.Keyidx) - s.state = expr - s.ctx.PushVar(m.Keyidx) - next(s, m.Value) - s.ctx.Pop() - s.p.closeblock() - s.p.closeblock() - s.state = add -} - -func (s *sizeGen) gBase(b *BaseElem) { - if !s.p.ok() { - return - } - if b.Convert && b.ShimMode == Convert { - s.state = add - vname := randIdent() - s.p.printf("\nvar %s %s", vname, b.BaseType()) - - // ensure we don't get "unused variable" warnings from outer slice iterations - s.p.printf("\n_ = %s", b.Varname()) - - s.p.printf("\ns += %s", basesizeExpr(b.Value, vname, b.BaseName())) - s.state = expr - - } else { - vname := b.Varname() - if b.Convert { - vname = tobaseConvert(b) - } - s.addConstant(basesizeExpr(b.Value, vname, b.BaseName())) - } -} - -// returns "len(slice)" -func lenExpr(sl *Slice) string { - return "len(" + sl.Varname() + ")" -} - -// is a given primitive always the same (max) -// size on the wire? -func fixedSize(p Primitive) bool { - switch p { - case Intf, Ext, IDENT, Bytes, String: - return false - default: - return true - } -} - -// strip reference from string -func stripRef(s string) string { - if s[0] == '&' { - return s[1:] - } - return s -} - -// return a fixed-size expression, if possible. -// only possible for *BaseElem and *Array. -// returns (expr, ok) -func fixedsizeExpr(e Elem) (string, bool) { - switch e := e.(type) { - case *Array: - if str, ok := fixedsizeExpr(e.Els); ok { - return fmt.Sprintf("(%s * (%s))", e.Size, str), true - } - case *BaseElem: - if fixedSize(e.Value) { - return builtinSize(e.BaseName()), true - } - case *Struct: - var str string - for _, f := range e.Fields { - if fs, ok := fixedsizeExpr(f.FieldElem); ok { - if str == "" { - str = fs - } else { - str += "+" + fs - } - } else { - return "", false - } - } - var hdrlen int - mhdr := msgp.AppendMapHeader(nil, uint32(len(e.Fields))) - hdrlen += len(mhdr) - var strbody []byte - for _, f := range e.Fields { - strbody = msgp.AppendString(strbody[:0], f.FieldTag) - hdrlen += len(strbody) - } - return fmt.Sprintf("%d + %s", hdrlen, str), true - } - return "", false -} - -// print size expression of a variable name -func basesizeExpr(value Primitive, vname, basename string) string { - switch value { - case Ext: - return "msgp.ExtensionPrefixSize + " + stripRef(vname) + ".Len()" - case Intf: - return "msgp.GuessSize(" + vname + ")" - case IDENT: - return vname + ".Msgsize()" - case Bytes: - return "msgp.BytesPrefixSize + len(" + vname + ")" - case String: - return "msgp.StringPrefixSize + len(" + vname + ")" - default: - return builtinSize(basename) - } -} diff --git a/vendor/github.com/tinylib/msgp/gen/spec.go b/vendor/github.com/tinylib/msgp/gen/spec.go deleted file mode 100644 index f3d5818b1d4..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/spec.go +++ /dev/null @@ -1,519 +0,0 @@ -package gen - -import ( - "bytes" - "fmt" - "io" -) - -const ( - lenAsUint32 = "uint32(len(%s))" - literalFmt = "%s" - intFmt = "%d" - quotedFmt = `"%s"` - mapHeader = "MapHeader" - arrayHeader = "ArrayHeader" - mapKey = "MapKeyPtr" - stringTyp = "String" - u32 = "uint32" -) - -// Method is a bitfield representing something that the -// generator knows how to print. -type Method uint8 - -// are the bits in 'f' set in 'm'? -func (m Method) isset(f Method) bool { return (m&f == f) } - -// String implements fmt.Stringer -func (m Method) String() string { - switch m { - case 0, invalidmeth: - return "" - case Decode: - return "decode" - case Encode: - return "encode" - case Marshal: - return "marshal" - case Unmarshal: - return "unmarshal" - case Size: - return "size" - case Test: - return "test" - default: - // return e.g. "decode+encode+test" - modes := [...]Method{Decode, Encode, Marshal, Unmarshal, Size, Test} - any := false - nm := "" - for _, mm := range modes { - if m.isset(mm) { - if any { - nm += "+" + mm.String() - } else { - nm += mm.String() - any = true - } - } - } - return nm - - } -} - -func strtoMeth(s string) Method { - switch s { - case "encode": - return Encode - case "decode": - return Decode - case "marshal": - return Marshal - case "unmarshal": - return Unmarshal - case "size": - return Size - case "test": - return Test - default: - return 0 - } -} - -const ( - Decode Method = 1 << iota // msgp.Decodable - Encode // msgp.Encodable - Marshal // msgp.Marshaler - Unmarshal // msgp.Unmarshaler - Size // msgp.Sizer - Test // generate tests - invalidmeth // this isn't a method - encodetest = Encode | Decode | Test // tests for Encodable and Decodable - marshaltest = Marshal | Unmarshal | Test // tests for Marshaler and Unmarshaler -) - -type Printer struct { - gens []generator -} - -func NewPrinter(m Method, out io.Writer, tests io.Writer) *Printer { - if m.isset(Test) && tests == nil { - panic("cannot print tests with 'nil' tests argument!") - } - gens := make([]generator, 0, 7) - if m.isset(Decode) { - gens = append(gens, decode(out)) - } - if m.isset(Encode) { - gens = append(gens, encode(out)) - } - if m.isset(Marshal) { - gens = append(gens, marshal(out)) - } - if m.isset(Unmarshal) { - gens = append(gens, unmarshal(out)) - } - if m.isset(Size) { - gens = append(gens, sizes(out)) - } - if m.isset(marshaltest) { - gens = append(gens, mtest(tests)) - } - if m.isset(encodetest) { - gens = append(gens, etest(tests)) - } - if len(gens) == 0 { - panic("NewPrinter called with invalid method flags") - } - return &Printer{gens: gens} -} - -// TransformPass is a pass that transforms individual -// elements. (Note that if the returned is different from -// the argument, it should not point to the same objects.) -type TransformPass func(Elem) Elem - -// IgnoreTypename is a pass that just ignores -// types of a given name. -func IgnoreTypename(name string) TransformPass { - return func(e Elem) Elem { - if e.TypeName() == name { - return nil - } - return e - } -} - -// ApplyDirective applies a directive to a named pass -// and all of its dependents. -func (p *Printer) ApplyDirective(pass Method, t TransformPass) { - for _, g := range p.gens { - if g.Method().isset(pass) { - g.Add(t) - } - } -} - -// Print prints an Elem. -func (p *Printer) Print(e Elem) error { - for _, g := range p.gens { - // Elem.SetVarname() is called before the Print() step in parse.FileSet.PrintTo(). - // Elem.SetVarname() generates identifiers as it walks the Elem. This can cause - // collisions between idents created during SetVarname and idents created during Print, - // hence the separate prefixes. - resetIdent("zb") - err := g.Execute(e) - resetIdent("za") - - if err != nil { - return err - } - } - return nil -} - -type contextItem interface { - Arg() string -} - -type contextString string - -func (c contextString) Arg() string { - return fmt.Sprintf("%q", c) -} - -type contextVar string - -func (c contextVar) Arg() string { - return string(c) -} - -type Context struct { - path []contextItem -} - -func (c *Context) PushString(s string) { - c.path = append(c.path, contextString(s)) -} - -func (c *Context) PushVar(s string) { - c.path = append(c.path, contextVar(s)) -} - -func (c *Context) Pop() { - c.path = c.path[:len(c.path)-1] -} - -func (c *Context) ArgsStr() string { - var out string - for idx, p := range c.path { - if idx > 0 { - out += ", " - } - out += p.Arg() - } - return out -} - -// generator is the interface through -// which code is generated. -type generator interface { - Method() Method - Add(p TransformPass) - Execute(Elem) error // execute writes the method for the provided object. -} - -type passes []TransformPass - -func (p *passes) Add(t TransformPass) { - *p = append(*p, t) -} - -func (p *passes) applyall(e Elem) Elem { - for _, t := range *p { - e = t(e) - if e == nil { - return nil - } - } - return e -} - -type traversal interface { - gMap(*Map) - gSlice(*Slice) - gArray(*Array) - gPtr(*Ptr) - gBase(*BaseElem) - gStruct(*Struct) -} - -// type-switch dispatch to the correct -// method given the type of 'e' -func next(t traversal, e Elem) { - switch e := e.(type) { - case *Map: - t.gMap(e) - case *Struct: - t.gStruct(e) - case *Slice: - t.gSlice(e) - case *Array: - t.gArray(e) - case *Ptr: - t.gPtr(e) - case *BaseElem: - t.gBase(e) - default: - panic("bad element type") - } -} - -// possibly-immutable method receiver -func imutMethodReceiver(p Elem) string { - switch e := p.(type) { - case *Struct: - // TODO(HACK): actually do real math here. - if len(e.Fields) <= 3 { - for i := range e.Fields { - if be, ok := e.Fields[i].FieldElem.(*BaseElem); !ok || (be.Value == IDENT || be.Value == Bytes) { - goto nope - } - } - return p.TypeName() - } - nope: - return "*" + p.TypeName() - - // gets dereferenced automatically - case *Array: - return "*" + p.TypeName() - - // everything else can be - // by-value. - default: - return p.TypeName() - } -} - -// if necessary, wraps a type -// so that its method receiver -// is of the write type. -func methodReceiver(p Elem) string { - switch p.(type) { - - // structs and arrays are - // dereferenced automatically, - // so no need to alter varname - case *Struct, *Array: - return "*" + p.TypeName() - // set variable name to - // *varname - default: - p.SetVarname("(*" + p.Varname() + ")") - return "*" + p.TypeName() - } -} - -func unsetReceiver(p Elem) { - switch p.(type) { - case *Struct, *Array: - default: - p.SetVarname("z") - } -} - -// shared utility for generators -type printer struct { - w io.Writer - err error -} - -// writes "var {{name}} {{typ}};" -func (p *printer) declare(name string, typ string) { - p.printf("\nvar %s %s", name, typ) -} - -// does: -// -// if m == nil { -// m = make(type, size) -// } else if len(m) > 0 { -// for key := range m { delete(m, key) } -// } -// -func (p *printer) resizeMap(size string, m *Map) { - vn := m.Varname() - if !p.ok() { - return - } - p.printf("\nif %s == nil {", vn) - p.printf("\n%s = make(%s, %s)", vn, m.TypeName(), size) - p.printf("\n} else if len(%s) > 0 {", vn) - p.clearMap(vn) - p.closeblock() -} - -// assign key to value based on varnames -func (p *printer) mapAssign(m *Map) { - if !p.ok() { - return - } - p.printf("\n%s[%s] = %s", m.Varname(), m.Keyidx, m.Validx) -} - -// clear map keys -func (p *printer) clearMap(name string) { - p.printf("\nfor key := range %[1]s { delete(%[1]s, key) }", name) -} - -func (p *printer) wrapErrCheck(ctx string) { - p.print("\nif err != nil {") - p.printf("\nerr = msgp.WrapError(err, %s)", ctx) - p.printf("\nreturn") - p.print("\n}") -} - -func (p *printer) resizeSlice(size string, s *Slice) { - p.printf("\nif cap(%[1]s) >= int(%[2]s) { %[1]s = (%[1]s)[:%[2]s] } else { %[1]s = make(%[3]s, %[2]s) }", s.Varname(), size, s.TypeName()) -} - -func (p *printer) arrayCheck(want string, got string) { - p.printf("\nif %[1]s != %[2]s { err = msgp.ArrayError{Wanted: %[2]s, Got: %[1]s}; return }", got, want) -} - -func (p *printer) closeblock() { p.print("\n}") } - -// does: -// -// for idx := range iter { -// {{generate inner}} -// } -// -func (p *printer) rangeBlock(ctx *Context, idx string, iter string, t traversal, inner Elem) { - ctx.PushVar(idx) - p.printf("\n for %s := range %s {", idx, iter) - next(t, inner) - p.closeblock() - ctx.Pop() -} - -func (p *printer) nakedReturn() { - if p.ok() { - p.print("\nreturn\n}\n") - } -} - -func (p *printer) comment(s string) { - p.print("\n// " + s) -} - -func (p *printer) printf(format string, args ...interface{}) { - if p.err == nil { - _, p.err = fmt.Fprintf(p.w, format, args...) - } -} - -func (p *printer) print(format string) { - if p.err == nil { - _, p.err = io.WriteString(p.w, format) - } -} - -func (p *printer) initPtr(pt *Ptr) { - if pt.Needsinit() { - vname := pt.Varname() - p.printf("\nif %s == nil { %s = new(%s); }", vname, vname, pt.Value.TypeName()) - } -} - -func (p *printer) ok() bool { return p.err == nil } - -func tobaseConvert(b *BaseElem) string { - return b.ToBase() + "(" + b.Varname() + ")" -} - -func (p *printer) varWriteMapHeader(receiver string, sizeVarname string, maxSize int) { - if maxSize <= 15 { - p.printf("\nerr = %s.Append(0x80 | uint8(%s))", receiver, sizeVarname) - } else { - p.printf("\nerr = %s.WriteMapHeader(%s)", receiver, sizeVarname) - } -} - -func (p *printer) varAppendMapHeader(sliceVarname string, sizeVarname string, maxSize int) { - if maxSize <= 15 { - p.printf("\n%s = append(%s, 0x80 | uint8(%s))", sliceVarname, sliceVarname, sizeVarname) - } else { - p.printf("\n%s = msgp.AppendMapHeader(%s, %s)", sliceVarname, sliceVarname, sizeVarname) - } -} - -// bmask is a bitmask of a the specified number of bits -type bmask struct { - bitlen int - varname string -} - -// typeDecl returns the variable declaration as a var statement -func (b *bmask) typeDecl() string { - return fmt.Sprintf("var %s %s /* %d bits */", b.varname, b.typeName(), b.bitlen) -} - -// typeName returns the type, e.g. "uint8" or "[2]uint64" -func (b *bmask) typeName() string { - - if b.bitlen <= 8 { - return "uint8" - } - if b.bitlen <= 16 { - return "uint16" - } - if b.bitlen <= 32 { - return "uint32" - } - if b.bitlen <= 64 { - return "uint64" - } - - return fmt.Sprintf("[%d]uint64", (b.bitlen+64-1)/64) -} - -// readExpr returns the expression to read from a position in the bitmask. -// Compare ==0 for false or !=0 for true. -func (b *bmask) readExpr(bitoffset int) string { - - if bitoffset < 0 || bitoffset >= b.bitlen { - panic(fmt.Errorf("bitoffset %d out of range for bitlen %d", bitoffset, b.bitlen)) - } - - var buf bytes.Buffer - buf.Grow(len(b.varname) + 16) - buf.WriteByte('(') - buf.WriteString(b.varname) - if b.bitlen > 64 { - fmt.Fprintf(&buf, "[%d]", (bitoffset / 64)) - } - buf.WriteByte('&') - fmt.Fprintf(&buf, "0x%X", (uint64(1) << (uint64(bitoffset) % 64))) - buf.WriteByte(')') - - return buf.String() - -} - -// setStmt returns the statement to set the specified bit in the bitmask. -func (b *bmask) setStmt(bitoffset int) string { - - var buf bytes.Buffer - buf.Grow(len(b.varname) + 16) - buf.WriteString(b.varname) - if b.bitlen > 64 { - fmt.Fprintf(&buf, "[%d]", (bitoffset / 64)) - } - fmt.Fprintf(&buf, " |= 0x%X", (uint64(1) << (uint64(bitoffset) % 64))) - - return buf.String() - -} diff --git a/vendor/github.com/tinylib/msgp/gen/testgen.go b/vendor/github.com/tinylib/msgp/gen/testgen.go deleted file mode 100644 index a80151bc5f1..00000000000 --- a/vendor/github.com/tinylib/msgp/gen/testgen.go +++ /dev/null @@ -1,182 +0,0 @@ -package gen - -import ( - "io" - "text/template" -) - -var ( - marshalTestTempl = template.New("MarshalTest") - encodeTestTempl = template.New("EncodeTest") -) - -// TODO(philhofer): -// for simplicity's sake, right now -// we can only generate tests for types -// that can be initialized with the -// "Type{}" syntax. -// we should support all the types. - -func mtest(w io.Writer) *mtestGen { - return &mtestGen{w: w} -} - -type mtestGen struct { - passes - w io.Writer -} - -func (m *mtestGen) Execute(p Elem) error { - p = m.applyall(p) - if p != nil && IsPrintable(p) { - switch p.(type) { - case *Struct, *Array, *Slice, *Map: - return marshalTestTempl.Execute(m.w, p) - } - } - return nil -} - -func (m *mtestGen) Method() Method { return marshaltest } - -type etestGen struct { - passes - w io.Writer -} - -func etest(w io.Writer) *etestGen { - return &etestGen{w: w} -} - -func (e *etestGen) Execute(p Elem) error { - p = e.applyall(p) - if p != nil && IsPrintable(p) { - switch p.(type) { - case *Struct, *Array, *Slice, *Map: - return encodeTestTempl.Execute(e.w, p) - } - } - return nil -} - -func (e *etestGen) Method() Method { return encodetest } - -func init() { - template.Must(marshalTestTempl.Parse(`func TestMarshalUnmarshal{{.TypeName}}(t *testing.T) { - v := {{.TypeName}}{} - bts, err := v.MarshalMsg(nil) - if err != nil { - t.Fatal(err) - } - left, err := v.UnmarshalMsg(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after UnmarshalMsg(): %q", len(left), left) - } - - left, err = msgp.Skip(bts) - if err != nil { - t.Fatal(err) - } - if len(left) > 0 { - t.Errorf("%d bytes left over after Skip(): %q", len(left), left) - } -} - -func BenchmarkMarshalMsg{{.TypeName}}(b *testing.B) { - v := {{.TypeName}}{} - b.ReportAllocs() - b.ResetTimer() - for i:=0; i m { - t.Log("WARNING: TestEncodeDecode{{.TypeName}} Msgsize() is inaccurate") - } - - vn := {{.TypeName}}{} - err := msgp.Decode(&buf, &vn) - if err != nil { - t.Error(err) - } - - buf.Reset() - msgp.Encode(&buf, &v) - err = msgp.NewReader(&buf).Skip() - if err != nil { - t.Error(err) - } -} - -func BenchmarkEncode{{.TypeName}}(b *testing.B) { - v := {{.TypeName}}{} - var buf bytes.Buffer - msgp.Encode(&buf, &v) - b.SetBytes(int64(buf.Len())) - en := msgp.NewWriter(msgp.Nowhere) - b.ReportAllocs() - b.ResetTimer() - for i:=0; i 0 {", sz) - u.p.printf("\n%s--; field, bts, err = msgp.ReadMapKeyZC(bts)", sz) - u.p.wrapErrCheck(u.ctx.ArgsStr()) - u.p.print("\nswitch msgp.UnsafeString(field) {") - for i := range s.Fields { - if !u.p.ok() { - return - } - u.p.printf("\ncase \"%s\":", s.Fields[i].FieldTag) - u.ctx.PushString(s.Fields[i].FieldName) - next(u, s.Fields[i].FieldElem) - u.ctx.Pop() - } - u.p.print("\ndefault:\nbts, err = msgp.Skip(bts)") - u.p.wrapErrCheck(u.ctx.ArgsStr()) - u.p.print("\n}\n}") // close switch and for loop -} - -func (u *unmarshalGen) gBase(b *BaseElem) { - if !u.p.ok() { - return - } - - refname := b.Varname() // assigned to - lowered := b.Varname() // passed as argument - if b.Convert { - // begin 'tmp' block - refname = randIdent() - lowered = b.ToBase() + "(" + lowered + ")" - u.p.printf("\n{\nvar %s %s", refname, b.BaseType()) - } - - switch b.Value { - case Bytes: - u.p.printf("\n%s, bts, err = msgp.ReadBytesBytes(bts, %s)", refname, lowered) - case Ext: - u.p.printf("\nbts, err = msgp.ReadExtensionBytes(bts, %s)", lowered) - case IDENT: - u.p.printf("\nbts, err = %s.UnmarshalMsg(bts)", lowered) - default: - u.p.printf("\n%s, bts, err = msgp.Read%sBytes(bts)", refname, b.BaseName()) - } - u.p.wrapErrCheck(u.ctx.ArgsStr()) - - if b.Convert { - // close 'tmp' block - if b.ShimMode == Cast { - u.p.printf("\n%s = %s(%s)\n", b.Varname(), b.FromBase(), refname) - } else { - u.p.printf("\n%s, err = %s(%s)", b.Varname(), b.FromBase(), refname) - u.p.wrapErrCheck(u.ctx.ArgsStr()) - } - u.p.printf("}") - } -} - -func (u *unmarshalGen) gArray(a *Array) { - if !u.p.ok() { - return - } - - // special case for [const]byte objects - // see decode.go for symmetry - if be, ok := a.Els.(*BaseElem); ok && be.Value == Byte { - u.p.printf("\nbts, err = msgp.ReadExactBytes(bts, (%s)[:])", a.Varname()) - u.p.wrapErrCheck(u.ctx.ArgsStr()) - return - } - - sz := randIdent() - u.p.declare(sz, u32) - u.assignAndCheck(sz, arrayHeader) - u.p.arrayCheck(coerceArraySize(a.Size), sz) - u.p.rangeBlock(u.ctx, a.Index, a.Varname(), u, a.Els) -} - -func (u *unmarshalGen) gSlice(s *Slice) { - if !u.p.ok() { - return - } - sz := randIdent() - u.p.declare(sz, u32) - u.assignAndCheck(sz, arrayHeader) - u.p.resizeSlice(sz, s) - u.p.rangeBlock(u.ctx, s.Index, s.Varname(), u, s.Els) -} - -func (u *unmarshalGen) gMap(m *Map) { - if !u.p.ok() { - return - } - sz := randIdent() - u.p.declare(sz, u32) - u.assignAndCheck(sz, mapHeader) - - // allocate or clear map - u.p.resizeMap(sz, m) - - // loop and get key,value - u.p.printf("\nfor %s > 0 {", sz) - u.p.printf("\nvar %s string; var %s %s; %s--", m.Keyidx, m.Validx, m.Value.TypeName(), sz) - u.assignAndCheck(m.Keyidx, stringTyp) - u.ctx.PushVar(m.Keyidx) - next(u, m.Value) - u.ctx.Pop() - u.p.mapAssign(m) - u.p.closeblock() -} - -func (u *unmarshalGen) gPtr(p *Ptr) { - u.p.printf("\nif msgp.IsNil(bts) { bts, err = msgp.ReadNilBytes(bts); if err != nil { return }; %s = nil; } else { ", p.Varname()) - u.p.initPtr(p) - next(u, p.Value) - u.p.closeblock() -} diff --git a/vendor/github.com/tinylib/msgp/main.go b/vendor/github.com/tinylib/msgp/main.go deleted file mode 100644 index 4369d739a27..00000000000 --- a/vendor/github.com/tinylib/msgp/main.go +++ /dev/null @@ -1,119 +0,0 @@ -// msgp is a code generation tool for -// creating methods to serialize and de-serialize -// Go data structures to and from MessagePack. -// -// This package is targeted at the `go generate` tool. -// To use it, include the following directive in a -// go source file with types requiring source generation: -// -// //go:generate msgp -// -// The go generate tool should set the proper environment variables for -// the generator to execute without any command-line flags. However, the -// following options are supported, if you need them: -// -// -o = output file name (default is {input}_gen.go) -// -file = input file name (or directory; default is $GOFILE, which is set by the `go generate` command) -// -io = satisfy the `msgp.Decodable` and `msgp.Encodable` interfaces (default is true) -// -marshal = satisfy the `msgp.Marshaler` and `msgp.Unmarshaler` interfaces (default is true) -// -tests = generate tests and benchmarks (default is true) -// -// For more information, please read README.md, and the wiki at github.com/tinylib/msgp -// -package main - -import ( - "flag" - "fmt" - "os" - "path/filepath" - "strings" - - "github.com/tinylib/msgp/gen" - "github.com/tinylib/msgp/parse" - "github.com/tinylib/msgp/printer" - "github.com/ttacon/chalk" -) - -var ( - out = flag.String("o", "", "output file") - file = flag.String("file", "", "input file") - encode = flag.Bool("io", true, "create Encode and Decode methods") - marshal = flag.Bool("marshal", true, "create Marshal and Unmarshal methods") - tests = flag.Bool("tests", true, "create tests and benchmarks") - unexported = flag.Bool("unexported", false, "also process unexported types") -) - -func main() { - flag.Parse() - - // GOFILE is set by go generate - if *file == "" { - *file = os.Getenv("GOFILE") - if *file == "" { - fmt.Println(chalk.Red.Color("No file to parse.")) - os.Exit(1) - } - } - - var mode gen.Method - if *encode { - mode |= (gen.Encode | gen.Decode | gen.Size) - } - if *marshal { - mode |= (gen.Marshal | gen.Unmarshal | gen.Size) - } - if *tests { - mode |= gen.Test - } - - if mode&^gen.Test == 0 { - fmt.Println(chalk.Red.Color("No methods to generate; -io=false && -marshal=false")) - os.Exit(1) - } - - if err := Run(*file, mode, *unexported); err != nil { - fmt.Println(chalk.Red.Color(err.Error())) - os.Exit(1) - } -} - -// Run writes all methods using the associated file or path, e.g. -// -// err := msgp.Run("path/to/myfile.go", gen.Size|gen.Marshal|gen.Unmarshal|gen.Test, false) -// -func Run(gofile string, mode gen.Method, unexported bool) error { - if mode&^gen.Test == 0 { - return nil - } - fmt.Println(chalk.Magenta.Color("======== MessagePack Code Generator =======")) - fmt.Printf(chalk.Magenta.Color(">>> Input: \"%s\"\n"), gofile) - fs, err := parse.File(gofile, unexported) - if err != nil { - return err - } - - if len(fs.Identities) == 0 { - fmt.Println(chalk.Magenta.Color("No types requiring code generation were found!")) - return nil - } - - return printer.PrintFile(newFilename(gofile, fs.Package), fs, mode) -} - -// picks a new file name based on input flags and input filename(s). -func newFilename(old string, pkg string) string { - if *out != "" { - if pre := strings.TrimPrefix(*out, old); len(pre) > 0 && - !strings.HasSuffix(*out, ".go") { - return filepath.Join(old, *out) - } - return *out - } - - if fi, err := os.Stat(old); err == nil && fi.IsDir() { - old = filepath.Join(old, pkg) - } - // new file name is old file name + _gen.go - return strings.TrimSuffix(old, ".go") + "_gen.go" -} diff --git a/vendor/github.com/tinylib/msgp/parse/directives.go b/vendor/github.com/tinylib/msgp/parse/directives.go deleted file mode 100644 index 73e441eff24..00000000000 --- a/vendor/github.com/tinylib/msgp/parse/directives.go +++ /dev/null @@ -1,130 +0,0 @@ -package parse - -import ( - "fmt" - "go/ast" - "strings" - - "github.com/tinylib/msgp/gen" -) - -const linePrefix = "//msgp:" - -// func(args, fileset) -type directive func([]string, *FileSet) error - -// func(passName, args, printer) -type passDirective func(gen.Method, []string, *gen.Printer) error - -// map of all recognized directives -// -// to add a directive, define a func([]string, *FileSet) error -// and then add it to this list. -var directives = map[string]directive{ - "shim": applyShim, - "ignore": ignore, - "tuple": astuple, -} - -var passDirectives = map[string]passDirective{ - "ignore": passignore, -} - -func passignore(m gen.Method, text []string, p *gen.Printer) error { - pushstate(m.String()) - for _, a := range text { - p.ApplyDirective(m, gen.IgnoreTypename(a)) - infof("ignoring %s\n", a) - } - popstate() - return nil -} - -// find all comment lines that begin with //msgp: -func yieldComments(c []*ast.CommentGroup) []string { - var out []string - for _, cg := range c { - for _, line := range cg.List { - if strings.HasPrefix(line.Text, linePrefix) { - out = append(out, strings.TrimPrefix(line.Text, linePrefix)) - } - } - } - return out -} - -//msgp:shim {Type} as:{Newtype} using:{toFunc/fromFunc} mode:{Mode} -func applyShim(text []string, f *FileSet) error { - if len(text) < 4 || len(text) > 5 { - return fmt.Errorf("shim directive should have 3 or 4 arguments; found %d", len(text)-1) - } - - name := text[1] - be := gen.Ident(strings.TrimPrefix(strings.TrimSpace(text[2]), "as:")) // parse as::{base} - if name[0] == '*' { - name = name[1:] - be.Needsref(true) - } - be.Alias(name) - - usestr := strings.TrimPrefix(strings.TrimSpace(text[3]), "using:") // parse using::{method/method} - - methods := strings.Split(usestr, "/") - if len(methods) != 2 { - return fmt.Errorf("expected 2 using::{} methods; found %d (%q)", len(methods), text[3]) - } - - be.ShimToBase = methods[0] - be.ShimFromBase = methods[1] - - if len(text) == 5 { - modestr := strings.TrimPrefix(strings.TrimSpace(text[4]), "mode:") // parse mode::{mode} - switch modestr { - case "cast": - be.ShimMode = gen.Cast - case "convert": - be.ShimMode = gen.Convert - default: - return fmt.Errorf("invalid shim mode; found %s, expected 'cast' or 'convert", modestr) - } - } - - infof("%s -> %s\n", name, be.Value.String()) - f.findShim(name, be) - - return nil -} - -//msgp:ignore {TypeA} {TypeB}... -func ignore(text []string, f *FileSet) error { - if len(text) < 2 { - return nil - } - for _, item := range text[1:] { - name := strings.TrimSpace(item) - if _, ok := f.Identities[name]; ok { - delete(f.Identities, name) - infof("ignoring %s\n", name) - } - } - return nil -} - -//msgp:tuple {TypeA} {TypeB}... -func astuple(text []string, f *FileSet) error { - if len(text) < 2 { - return nil - } - for _, item := range text[1:] { - name := strings.TrimSpace(item) - if el, ok := f.Identities[name]; ok { - if st, ok := el.(*gen.Struct); ok { - st.AsTuple = true - infoln(name) - } else { - warnf("%s: only structs can be tuples\n", name) - } - } - } - return nil -} diff --git a/vendor/github.com/tinylib/msgp/parse/getast.go b/vendor/github.com/tinylib/msgp/parse/getast.go deleted file mode 100644 index f9e1d039100..00000000000 --- a/vendor/github.com/tinylib/msgp/parse/getast.go +++ /dev/null @@ -1,617 +0,0 @@ -package parse - -import ( - "fmt" - "go/ast" - "go/parser" - "go/token" - "os" - "reflect" - "sort" - "strings" - - "github.com/tinylib/msgp/gen" - "github.com/ttacon/chalk" -) - -// A FileSet is the in-memory representation of a -// parsed file. -type FileSet struct { - Package string // package name - Specs map[string]ast.Expr // type specs in file - Identities map[string]gen.Elem // processed from specs - Directives []string // raw preprocessor directives - Imports []*ast.ImportSpec // imports -} - -// File parses a file at the relative path -// provided and produces a new *FileSet. -// If you pass in a path to a directory, the entire -// directory will be parsed. -// If unexport is false, only exported identifiers are included in the FileSet. -// If the resulting FileSet would be empty, an error is returned. -func File(name string, unexported bool) (*FileSet, error) { - pushstate(name) - defer popstate() - fs := &FileSet{ - Specs: make(map[string]ast.Expr), - Identities: make(map[string]gen.Elem), - } - - fset := token.NewFileSet() - finfo, err := os.Stat(name) - if err != nil { - return nil, err - } - if finfo.IsDir() { - pkgs, err := parser.ParseDir(fset, name, nil, parser.ParseComments) - if err != nil { - return nil, err - } - if len(pkgs) != 1 { - return nil, fmt.Errorf("multiple packages in directory: %s", name) - } - var one *ast.Package - for _, nm := range pkgs { - one = nm - break - } - fs.Package = one.Name - for _, fl := range one.Files { - pushstate(fl.Name.Name) - fs.Directives = append(fs.Directives, yieldComments(fl.Comments)...) - if !unexported { - ast.FileExports(fl) - } - fs.getTypeSpecs(fl) - popstate() - } - } else { - f, err := parser.ParseFile(fset, name, nil, parser.ParseComments) - if err != nil { - return nil, err - } - fs.Package = f.Name.Name - fs.Directives = yieldComments(f.Comments) - if !unexported { - ast.FileExports(f) - } - fs.getTypeSpecs(f) - } - - if len(fs.Specs) == 0 { - return nil, fmt.Errorf("no definitions in %s", name) - } - - fs.process() - fs.applyDirectives() - fs.propInline() - - return fs, nil -} - -// applyDirectives applies all of the directives that -// are known to the parser. additional method-specific -// directives remain in f.Directives -func (f *FileSet) applyDirectives() { - newdirs := make([]string, 0, len(f.Directives)) - for _, d := range f.Directives { - chunks := strings.Split(d, " ") - if len(chunks) > 0 { - if fn, ok := directives[chunks[0]]; ok { - pushstate(chunks[0]) - err := fn(chunks, f) - if err != nil { - warnln(err.Error()) - } - popstate() - } else { - newdirs = append(newdirs, d) - } - } - } - f.Directives = newdirs -} - -// A linkset is a graph of unresolved -// identities. -// -// Since gen.Ident can only represent -// one level of type indirection (e.g. Foo -> uint8), -// type declarations like `type Foo Bar` -// aren't resolve-able until we've processed -// everything else. -// -// The goal of this dependency resolution -// is to distill the type declaration -// into just one level of indirection. -// In other words, if we have: -// -// type A uint64 -// type B A -// type C B -// type D C -// -// ... then we want to end up -// figuring out that D is just a uint64. -type linkset map[string]*gen.BaseElem - -func (f *FileSet) resolve(ls linkset) { - progress := true - for progress && len(ls) > 0 { - progress = false - for name, elem := range ls { - real, ok := f.Identities[elem.TypeName()] - if ok { - // copy the old type descriptor, - // alias it to the new value, - // and insert it into the resolved - // identities list - progress = true - nt := real.Copy() - nt.Alias(name) - f.Identities[name] = nt - delete(ls, name) - } - } - } - - // what's left can't be resolved - for name, elem := range ls { - warnf("couldn't resolve type %s (%s)\n", name, elem.TypeName()) - } -} - -// process takes the contents of f.Specs and -// uses them to populate f.Identities -func (f *FileSet) process() { - - deferred := make(linkset) -parse: - for name, def := range f.Specs { - pushstate(name) - el := f.parseExpr(def) - if el == nil { - warnln("failed to parse") - popstate() - continue parse - } - // push unresolved identities into - // the graph of links and resolve after - // we've handled every possible named type. - if be, ok := el.(*gen.BaseElem); ok && be.Value == gen.IDENT { - deferred[name] = be - popstate() - continue parse - } - el.Alias(name) - f.Identities[name] = el - popstate() - } - - if len(deferred) > 0 { - f.resolve(deferred) - } -} - -func strToMethod(s string) gen.Method { - switch s { - case "encode": - return gen.Encode - case "decode": - return gen.Decode - case "test": - return gen.Test - case "size": - return gen.Size - case "marshal": - return gen.Marshal - case "unmarshal": - return gen.Unmarshal - default: - return 0 - } -} - -func (f *FileSet) applyDirs(p *gen.Printer) { - // apply directives of the form - // - // //msgp:encode ignore {{TypeName}} - // -loop: - for _, d := range f.Directives { - chunks := strings.Split(d, " ") - if len(chunks) > 1 { - for i := range chunks { - chunks[i] = strings.TrimSpace(chunks[i]) - } - m := strToMethod(chunks[0]) - if m == 0 { - warnf("unknown pass name: %q\n", chunks[0]) - continue loop - } - if fn, ok := passDirectives[chunks[1]]; ok { - pushstate(chunks[1]) - err := fn(m, chunks[2:], p) - if err != nil { - warnf("error applying directive: %s\n", err) - } - popstate() - } else { - warnf("unrecognized directive %q\n", chunks[1]) - } - } else { - warnf("empty directive: %q\n", d) - } - } -} - -func (f *FileSet) PrintTo(p *gen.Printer) error { - f.applyDirs(p) - names := make([]string, 0, len(f.Identities)) - for name := range f.Identities { - names = append(names, name) - } - sort.Strings(names) - for _, name := range names { - el := f.Identities[name] - el.SetVarname("z") - pushstate(el.TypeName()) - err := p.Print(el) - popstate() - if err != nil { - return err - } - } - return nil -} - -// getTypeSpecs extracts all of the *ast.TypeSpecs in the file -// into fs.Identities, but does not set the actual element -func (fs *FileSet) getTypeSpecs(f *ast.File) { - - // collect all imports... - fs.Imports = append(fs.Imports, f.Imports...) - - // check all declarations... - for i := range f.Decls { - - // for GenDecls... - if g, ok := f.Decls[i].(*ast.GenDecl); ok { - - // and check the specs... - for _, s := range g.Specs { - - // for ast.TypeSpecs.... - if ts, ok := s.(*ast.TypeSpec); ok { - switch ts.Type.(type) { - - // this is the list of parse-able - // type specs - case *ast.StructType, - *ast.ArrayType, - *ast.StarExpr, - *ast.MapType, - *ast.Ident: - fs.Specs[ts.Name.Name] = ts.Type - - } - } - } - } - } -} - -func fieldName(f *ast.Field) string { - switch len(f.Names) { - case 0: - return stringify(f.Type) - case 1: - return f.Names[0].Name - default: - return f.Names[0].Name + " (and others)" - } -} - -func (fs *FileSet) parseFieldList(fl *ast.FieldList) []gen.StructField { - if fl == nil || fl.NumFields() == 0 { - return nil - } - out := make([]gen.StructField, 0, fl.NumFields()) - for _, field := range fl.List { - pushstate(fieldName(field)) - fds := fs.getField(field) - if len(fds) > 0 { - out = append(out, fds...) - } else { - warnln("ignored.") - } - popstate() - } - return out -} - -// translate *ast.Field into []gen.StructField -func (fs *FileSet) getField(f *ast.Field) []gen.StructField { - sf := make([]gen.StructField, 1) - var extension, flatten bool - // parse tag; otherwise field name is field tag - if f.Tag != nil { - body := reflect.StructTag(strings.Trim(f.Tag.Value, "`")).Get("msg") - if body == "" { - body = reflect.StructTag(strings.Trim(f.Tag.Value, "`")).Get("msgpack") - } - tags := strings.Split(body, ",") - if len(tags) >= 2 { - switch tags[1] { - case "extension": - extension = true - case "flatten": - flatten = true - } - } - // ignore "-" fields - if tags[0] == "-" { - return nil - } - sf[0].FieldTag = tags[0] - sf[0].FieldTagParts = tags - sf[0].RawTag = f.Tag.Value - } - - ex := fs.parseExpr(f.Type) - if ex == nil { - return nil - } - - // parse field name - switch len(f.Names) { - case 0: - if flatten { - return fs.getFieldsFromEmbeddedStruct(f.Type) - } else { - sf[0].FieldName = embedded(f.Type) - } - case 1: - sf[0].FieldName = f.Names[0].Name - default: - // this is for a multiple in-line declaration, - // e.g. type A struct { One, Two int } - sf = sf[0:0] - for _, nm := range f.Names { - sf = append(sf, gen.StructField{ - FieldTag: nm.Name, - FieldName: nm.Name, - FieldElem: ex.Copy(), - }) - } - return sf - } - sf[0].FieldElem = ex - if sf[0].FieldTag == "" { - sf[0].FieldTag = sf[0].FieldName - sf[0].FieldTagParts = []string{sf[0].FieldName} - } - - // validate extension - if extension { - switch ex := ex.(type) { - case *gen.Ptr: - if b, ok := ex.Value.(*gen.BaseElem); ok { - b.Value = gen.Ext - } else { - warnln("couldn't cast to extension.") - return nil - } - case *gen.BaseElem: - ex.Value = gen.Ext - default: - warnln("couldn't cast to extension.") - return nil - } - } - return sf -} - -func (fs *FileSet) getFieldsFromEmbeddedStruct(f ast.Expr) []gen.StructField { - switch f := f.(type) { - case *ast.Ident: - s := fs.Specs[f.Name] - switch s := s.(type) { - case *ast.StructType: - return fs.parseFieldList(s.Fields) - default: - return nil - } - default: - // other possibilities are disallowed - return nil - } -} - -// extract embedded field name -// -// so, for a struct like -// -// type A struct { -// io.Writer -// } -// -// we want "Writer" -func embedded(f ast.Expr) string { - switch f := f.(type) { - case *ast.Ident: - return f.Name - case *ast.StarExpr: - return embedded(f.X) - case *ast.SelectorExpr: - return f.Sel.Name - default: - // other possibilities are disallowed - return "" - } -} - -// stringify a field type name -func stringify(e ast.Expr) string { - switch e := e.(type) { - case *ast.Ident: - return e.Name - case *ast.StarExpr: - return "*" + stringify(e.X) - case *ast.SelectorExpr: - return stringify(e.X) + "." + e.Sel.Name - case *ast.ArrayType: - if e.Len == nil { - return "[]" + stringify(e.Elt) - } - return fmt.Sprintf("[%s]%s", stringify(e.Len), stringify(e.Elt)) - case *ast.InterfaceType: - if e.Methods == nil || e.Methods.NumFields() == 0 { - return "interface{}" - } - } - return "" -} - -// recursively translate ast.Expr to gen.Elem; nil means type not supported -// expected input types: -// - *ast.MapType (map[T]J) -// - *ast.Ident (name) -// - *ast.ArrayType ([(sz)]T) -// - *ast.StarExpr (*T) -// - *ast.StructType (struct {}) -// - *ast.SelectorExpr (a.B) -// - *ast.InterfaceType (interface {}) -func (fs *FileSet) parseExpr(e ast.Expr) gen.Elem { - switch e := e.(type) { - - case *ast.MapType: - if k, ok := e.Key.(*ast.Ident); ok && k.Name == "string" { - if in := fs.parseExpr(e.Value); in != nil { - return &gen.Map{Value: in} - } - } - return nil - - case *ast.Ident: - b := gen.Ident(e.Name) - - // work to resove this expression - // can be done later, once we've resolved - // everything else. - if b.Value == gen.IDENT { - if _, ok := fs.Specs[e.Name]; !ok { - warnf("non-local identifier: %s\n", e.Name) - } - } - return b - - case *ast.ArrayType: - - // special case for []byte - if e.Len == nil { - if i, ok := e.Elt.(*ast.Ident); ok && i.Name == "byte" { - return &gen.BaseElem{Value: gen.Bytes} - } - } - - // return early if we don't know - // what the slice element type is - els := fs.parseExpr(e.Elt) - if els == nil { - return nil - } - - // array and not a slice - if e.Len != nil { - switch s := e.Len.(type) { - case *ast.BasicLit: - return &gen.Array{ - Size: s.Value, - Els: els, - } - - case *ast.Ident: - return &gen.Array{ - Size: s.String(), - Els: els, - } - - case *ast.SelectorExpr: - return &gen.Array{ - Size: stringify(s), - Els: els, - } - - default: - return nil - } - } - return &gen.Slice{Els: els} - - case *ast.StarExpr: - if v := fs.parseExpr(e.X); v != nil { - return &gen.Ptr{Value: v} - } - return nil - - case *ast.StructType: - return &gen.Struct{Fields: fs.parseFieldList(e.Fields)} - - case *ast.SelectorExpr: - return gen.Ident(stringify(e)) - - case *ast.InterfaceType: - // support `interface{}` - if len(e.Methods.List) == 0 { - return &gen.BaseElem{Value: gen.Intf} - } - return nil - - default: // other types not supported - return nil - } -} - -func infof(s string, v ...interface{}) { - pushstate(s) - fmt.Printf(chalk.Green.Color(strings.Join(logctx, ": ")), v...) - popstate() -} - -func infoln(s string) { - pushstate(s) - fmt.Println(chalk.Green.Color(strings.Join(logctx, ": "))) - popstate() -} - -func warnf(s string, v ...interface{}) { - pushstate(s) - fmt.Printf(chalk.Yellow.Color(strings.Join(logctx, ": ")), v...) - popstate() -} - -func warnln(s string) { - pushstate(s) - fmt.Println(chalk.Yellow.Color(strings.Join(logctx, ": "))) - popstate() -} - -func fatalf(s string, v ...interface{}) { - pushstate(s) - fmt.Printf(chalk.Red.Color(strings.Join(logctx, ": ")), v...) - popstate() -} - -var logctx []string - -// push logging state -func pushstate(s string) { - logctx = append(logctx, s) -} - -// pop logging state -func popstate() { - logctx = logctx[:len(logctx)-1] -} diff --git a/vendor/github.com/tinylib/msgp/parse/inline.go b/vendor/github.com/tinylib/msgp/parse/inline.go deleted file mode 100644 index 469793be3e8..00000000000 --- a/vendor/github.com/tinylib/msgp/parse/inline.go +++ /dev/null @@ -1,169 +0,0 @@ -package parse - -import ( - "sort" - - "github.com/tinylib/msgp/gen" -) - -// This file defines when and how we -// propagate type information from -// one type declaration to another. -// After the processing pass, every -// non-primitive type is marshalled/unmarshalled/etc. -// through a function call. Here, we propagate -// the type information into the caller's type -// tree *if* the child type is simple enough. -// -// For example, types like -// -// type A [4]int -// -// will get pushed into parent methods, -// whereas types like -// -// type B [3]map[string]struct{A, B [4]string} -// -// will not. - -// this is an approximate measure -// of the number of children in a node -const maxComplex = 5 - -// begin recursive search for identities with the -// given name and replace them with be -func (f *FileSet) findShim(id string, be *gen.BaseElem) { - for name, el := range f.Identities { - pushstate(name) - switch el := el.(type) { - case *gen.Struct: - for i := range el.Fields { - f.nextShim(&el.Fields[i].FieldElem, id, be) - } - case *gen.Array: - f.nextShim(&el.Els, id, be) - case *gen.Slice: - f.nextShim(&el.Els, id, be) - case *gen.Map: - f.nextShim(&el.Value, id, be) - case *gen.Ptr: - f.nextShim(&el.Value, id, be) - } - popstate() - } - // we'll need this at the top level as well - f.Identities[id] = be -} - -func (f *FileSet) nextShim(ref *gen.Elem, id string, be *gen.BaseElem) { - if (*ref).TypeName() == id { - vn := (*ref).Varname() - *ref = be.Copy() - (*ref).SetVarname(vn) - } else { - switch el := (*ref).(type) { - case *gen.Struct: - for i := range el.Fields { - f.nextShim(&el.Fields[i].FieldElem, id, be) - } - case *gen.Array: - f.nextShim(&el.Els, id, be) - case *gen.Slice: - f.nextShim(&el.Els, id, be) - case *gen.Map: - f.nextShim(&el.Value, id, be) - case *gen.Ptr: - f.nextShim(&el.Value, id, be) - } - } -} - -// propInline identifies and inlines candidates -func (f *FileSet) propInline() { - type gelem struct { - name string - el gen.Elem - } - - all := make([]gelem, 0, len(f.Identities)) - - for name, el := range f.Identities { - all = append(all, gelem{name: name, el: el}) - } - - // make sure we process inlining determinstically: - // start with the least-complex elems; - // use identifier names as a tie-breaker - sort.Slice(all, func(i, j int) bool { - ig, jg := &all[i], &all[j] - ic, jc := ig.el.Complexity(), jg.el.Complexity() - return ic < jc || (ic == jc && ig.name < jg.name) - }) - - for i := range all { - name := all[i].name - pushstate(name) - switch el := all[i].el.(type) { - case *gen.Struct: - for i := range el.Fields { - f.nextInline(&el.Fields[i].FieldElem, name) - } - case *gen.Array: - f.nextInline(&el.Els, name) - case *gen.Slice: - f.nextInline(&el.Els, name) - case *gen.Map: - f.nextInline(&el.Value, name) - case *gen.Ptr: - f.nextInline(&el.Value, name) - } - popstate() - } -} - -const fatalloop = `detected infinite recursion in inlining loop! -Please file a bug at github.com/tinylib/msgp/issues! -Thanks! -` - -func (f *FileSet) nextInline(ref *gen.Elem, root string) { - switch el := (*ref).(type) { - case *gen.BaseElem: - // ensure that we're not inlining - // a type into itself - typ := el.TypeName() - if el.Value == gen.IDENT && typ != root { - if node, ok := f.Identities[typ]; ok && node.Complexity() < maxComplex { - infof("inlining %s\n", typ) - - // This should never happen; it will cause - // infinite recursion. - if node == *ref { - panic(fatalloop) - } - - *ref = node.Copy() - f.nextInline(ref, node.TypeName()) - } else if !ok && !el.Resolved() { - // this is the point at which we're sure that - // we've got a type that isn't a primitive, - // a library builtin, or a processed type - warnf("unresolved identifier: %s\n", typ) - } - } - case *gen.Struct: - for i := range el.Fields { - f.nextInline(&el.Fields[i].FieldElem, root) - } - case *gen.Array: - f.nextInline(&el.Els, root) - case *gen.Slice: - f.nextInline(&el.Els, root) - case *gen.Map: - f.nextInline(&el.Value, root) - case *gen.Ptr: - f.nextInline(&el.Value, root) - default: - panic("bad elem type") - } -} diff --git a/vendor/github.com/tinylib/msgp/printer/print.go b/vendor/github.com/tinylib/msgp/printer/print.go deleted file mode 100644 index 9d1dde4a341..00000000000 --- a/vendor/github.com/tinylib/msgp/printer/print.go +++ /dev/null @@ -1,132 +0,0 @@ -package printer - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "strings" - - "github.com/tinylib/msgp/gen" - "github.com/tinylib/msgp/parse" - "github.com/ttacon/chalk" - "golang.org/x/tools/imports" -) - -func infof(s string, v ...interface{}) { - fmt.Printf(chalk.Magenta.Color(s), v...) -} - -// PrintFile prints the methods for the provided list -// of elements to the given file name and canonical -// package path. -func PrintFile(file string, f *parse.FileSet, mode gen.Method) error { - out, tests, err := generate(f, mode) - if err != nil { - return err - } - - // we'll run goimports on the main file - // in another goroutine, and run it here - // for the test file. empirically, this - // takes about the same amount of time as - // doing them in serial when GOMAXPROCS=1, - // and faster otherwise. - res := goformat(file, out.Bytes()) - if tests != nil { - testfile := strings.TrimSuffix(file, ".go") + "_test.go" - err = format(testfile, tests.Bytes()) - if err != nil { - return err - } - infof(">>> Wrote and formatted \"%s\"\n", testfile) - } - err = <-res - if err != nil { - return err - } - return nil -} - -func format(file string, data []byte) error { - out, err := imports.Process(file, data, nil) - if err != nil { - return err - } - return ioutil.WriteFile(file, out, 0600) -} - -func goformat(file string, data []byte) <-chan error { - out := make(chan error, 1) - go func(file string, data []byte, end chan error) { - end <- format(file, data) - infof(">>> Wrote and formatted \"%s\"\n", file) - }(file, data, out) - return out -} - -func dedupImports(imp []string) []string { - m := make(map[string]struct{}) - for i := range imp { - m[imp[i]] = struct{}{} - } - r := []string{} - for k := range m { - r = append(r, k) - } - return r -} - -func generate(f *parse.FileSet, mode gen.Method) (*bytes.Buffer, *bytes.Buffer, error) { - outbuf := bytes.NewBuffer(make([]byte, 0, 4096)) - writePkgHeader(outbuf, f.Package) - - myImports := []string{"github.com/tinylib/msgp/msgp"} - for _, imp := range f.Imports { - if imp.Name != nil { - // have an alias, include it. - myImports = append(myImports, imp.Name.Name+` `+imp.Path.Value) - } else { - myImports = append(myImports, imp.Path.Value) - } - } - dedup := dedupImports(myImports) - writeImportHeader(outbuf, dedup...) - - var testbuf *bytes.Buffer - var testwr io.Writer - if mode&gen.Test == gen.Test { - testbuf = bytes.NewBuffer(make([]byte, 0, 4096)) - writePkgHeader(testbuf, f.Package) - if mode&(gen.Encode|gen.Decode) != 0 { - writeImportHeader(testbuf, "bytes", "github.com/tinylib/msgp/msgp", "testing") - } else { - writeImportHeader(testbuf, "github.com/tinylib/msgp/msgp", "testing") - } - testwr = testbuf - } - return outbuf, testbuf, f.PrintTo(gen.NewPrinter(mode, outbuf, testwr)) -} - -func writePkgHeader(b *bytes.Buffer, name string) { - b.WriteString("package ") - b.WriteString(name) - b.WriteByte('\n') - // write generated code marker - // https://github.com/tinylib/msgp/issues/229 - // https://golang.org/s/generatedcode - b.WriteString("// Code generated by github.com/tinylib/msgp DO NOT EDIT.\n\n") -} - -func writeImportHeader(b *bytes.Buffer, imports ...string) { - b.WriteString("import (\n") - for _, im := range imports { - if im[len(im)-1] == '"' { - // support aliased imports - fmt.Fprintf(b, "\t%s\n", im) - } else { - fmt.Fprintf(b, "\t%q\n", im) - } - } - b.WriteString(")\n\n") -} diff --git a/vendor/github.com/ttacon/chalk/.gitignore b/vendor/github.com/ttacon/chalk/.gitignore deleted file mode 100644 index 836562412fe..00000000000 --- a/vendor/github.com/ttacon/chalk/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test diff --git a/vendor/github.com/ttacon/chalk/LICENSE b/vendor/github.com/ttacon/chalk/LICENSE deleted file mode 100644 index 949ba5de0fb..00000000000 --- a/vendor/github.com/ttacon/chalk/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Trey Tacon - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/vendor/github.com/ttacon/chalk/README.md b/vendor/github.com/ttacon/chalk/README.md deleted file mode 100644 index a85f1d4ae3a..00000000000 --- a/vendor/github.com/ttacon/chalk/README.md +++ /dev/null @@ -1,67 +0,0 @@ -chalk -============= - -Chalk is a go package for styling console/terminal output. - -Check out godoc for some example usage: -http://godoc.org/github.com/ttacon/chalk - -The api is pretty clean, there are default Colors and TextStyles -which can be mixed to create more intense Styles. Styles and Colors -can be printed in normal strings (i.e. ```fmt.Sprintf(chalk.Red)```), but -Styles, Colors and TextStyles are more meant to be used to style specific -text segments (i.e. ```fmt.Println(chalk.Red.Color("this is red")```) or -```fmt.Println(myStyle.Style("this is blue text that is underlined"))```). - -Examples -============= - -There are a few examples in the examples directory if you want to see a very -simplified version of what you can do with chalk. - -The following code: -```go -package main - -import ( - "fmt" - - "github.com/ttacon/chalk" -) - -func main() { - // You can just use colors - fmt.Println(chalk.Red, "Writing in colors", chalk.Cyan, "is so much fun", chalk.Reset) - fmt.Println(chalk.Magenta.Color("You can use colors to color specific phrases")) - - // You can just use text styles - fmt.Println(chalk.Bold.TextStyle("We can have bold text")) - fmt.Println(chalk.Underline.TextStyle("We can have underlined text")) - fmt.Println(chalk.Bold, "But text styles don't work quite like colors :(") - - // Or you can use styles - blueOnWhite := chalk.Blue.NewStyle().WithBackground(chalk.White) - fmt.Printf("%s%s%s\n", blueOnWhite, "And they also have backgrounds!", chalk.Reset) - fmt.Println( - blueOnWhite.Style("You can style strings the same way you can color them!")) - fmt.Println( - blueOnWhite.WithTextStyle(chalk.Bold). - Style("You can mix text styles with colors, too!")) - - // You can also easily make styling functions thanks to go's functional side - lime := chalk.Green.NewStyle(). - WithBackground(chalk.Black). - WithTextStyle(chalk.Bold). - Style - fmt.Println(lime("look at this cool lime text!")) -} - -``` -Outputs -![screenshot](https://raw.githubusercontent.com/ttacon/chalk/master/img/chalk_example.png) - - -WARNING -============= - -This package should be pretty stable (I don't forsee backwards incompatible changes), but I'm not making any promises :) diff --git a/vendor/github.com/ttacon/chalk/chalk.go b/vendor/github.com/ttacon/chalk/chalk.go deleted file mode 100644 index 80036785688..00000000000 --- a/vendor/github.com/ttacon/chalk/chalk.go +++ /dev/null @@ -1,162 +0,0 @@ -package chalk - -import "fmt" - -// Color represents one of the ANSI color escape codes. -// http://en.wikipedia.org/wiki/ANSI_escape_code#Colors -type Color struct { - value int -} - -// Value returns the individual value for this color -// (Actually it's really just its index in the list -// of color escape codes with the list being -// [black, red, green, yellow, blue, magenta, cyan, white]. -func (c Color) Value() int { - return c.value -} - -// Color colors the foreground of the given string -// (whatever the previous background color was, it is -// left alone). -func (c Color) Color(val string) string { - return fmt.Sprintf("%s%s%s", c, val, ResetColor) -} - -func (c Color) String() string { - return fmt.Sprintf("\u001b[%dm", 30+c.value) -} - -// NewStyle creates a style with a foreground of the -// color we're creating the style from. -func (c Color) NewStyle() Style { - return &style{foreground: c} -} - -type textStyleDemarcation int - -func (t textStyleDemarcation) String() string { - return fmt.Sprintf("\u001b[%dm", t) -} - -// A TextStyle represents the ways we can style the text: -// bold, dim, italic, underline, inverse, hidden or strikethrough. -type TextStyle struct { - start, stop textStyleDemarcation -} - -// TextStyle styles the given string using the desired text style. -func (t TextStyle) TextStyle(val string) string { - if t == emptyTextStyle { - return val - } - return fmt.Sprintf("%s%s%s", t.start, val, t.stop) -} - -// NOTE: this function specifically does not work as desired because -// text styles must be wrapped around the text they are meant to style. -// As such, use TextStyle() or Style.Style() instead. -func (t TextStyle) String() string { - return fmt.Sprintf("%s%s", t.start, t.stop) -} - -// NewStyle creates a style starting with the current TextStyle -// as its text style. -func (t TextStyle) NewStyle() Style { - return &style{textStyle: t} -} - -// A Style is how we want our text to look in the console. -// Consequently, we can set the foreground and background -// to specific colors, we can style specific strings and -// can also use this style in a builder pattern should we -// wish (these will be more useful once styles such as -// italics are supported). -type Style interface { - // Foreground sets the foreground of the style to the specific color. - Foreground(Color) - // Background sets the background of the style to the specific color. - Background(Color) - // Style styles the given string with the current style. - Style(string) string - // WithBackground allows us to set the background in a builder - // pattern style. - WithBackground(Color) Style - // WithForeground allows us to set the foreground in a builder - // pattern style. - WithForeground(Color) Style - // WithStyle allows us to set the text style in a builder pattern - // style. - WithTextStyle(TextStyle) Style - String() string -} - -type style struct { - foreground Color - background Color - textStyle TextStyle -} - -func (s *style) WithBackground(col Color) Style { - s.Background(col) - return s -} - -func (s *style) WithForeground(col Color) Style { - s.Foreground(col) - return s -} - -func (s *style) String() string { - var toReturn string - toReturn = fmt.Sprintf("\u001b[%dm", 40+s.background.Value()) - return toReturn + fmt.Sprintf("\u001b[%dm", 30+s.foreground.Value()) -} - -func (s *style) Style(val string) string { - return fmt.Sprintf("%s%s%s", s, s.textStyle.TextStyle(val), Reset) -} - -func (s *style) Foreground(col Color) { - s.foreground = col -} - -func (s *style) Background(col Color) { - s.background = col -} - -func (s *style) WithTextStyle(textStyle TextStyle) Style { - s.textStyle = textStyle - return s -} - -var ( - // Colors - - Black = Color{0} - Red = Color{1} - Green = Color{2} - Yellow = Color{3} - Blue = Color{4} - Magenta = Color{5} - Cyan = Color{6} - White = Color{7} - ResetColor = Color{9} - - // Text Styles - - Bold = TextStyle{1, 22} - Dim = TextStyle{2, 22} - Italic = TextStyle{3, 23} - Underline = TextStyle{4, 24} - Inverse = TextStyle{7, 27} - Hidden = TextStyle{8, 28} - Strikethrough = TextStyle{9, 29} - - Reset = &style{ - foreground: ResetColor, - background: ResetColor, - } - - emptyTextStyle = TextStyle{} -) diff --git a/vendor/github.com/ttacon/chalk/doc.go b/vendor/github.com/ttacon/chalk/doc.go deleted file mode 100644 index d5e4e091d85..00000000000 --- a/vendor/github.com/ttacon/chalk/doc.go +++ /dev/null @@ -1,59 +0,0 @@ -// Package chalk is a package for styling terminal/console output. -// There are three main components: -// -// -// Colors -// -// There are eight default colors: black, red, green, yellow, blue, -// magenta, cyan and white. You can use them in two main ways -// (note the need for the reset color if you don't use Color()): -// -// fmt.Println(chalk.Red, "this is red text", chalk.ResetColor) -// fmt.Println(chalk.Red.Color("this is red text") -// -// -// TextStyles -// -// There are seven default text styles: bold, dim, italic, underline, -// inverse, hidden and strikethrough. Unlike colors, you should only -// really use TextStyles in the following manner: -// -// fmt.Println(chalk.Bold.TextStyle("this is bold text")) -// -// -// Styles -// -// Styles are where all the business really is. Styles can have a -// foreground color, a background color and a text style (sweet!). -// They're also pretty simply to make, you just need a starting point: -// -// blue := chalk.Blue.NewStyle() -// bold := chalk.Bold.NewStyle() -// -// When a color is your starting point for a style, it will be the -// foreground color, when a style is your starting point, well, yeah, -// it's your style's text style. You can also alter a style's foreground, -// background or text style in a builder-esque pattern. -// -// blueOnWhite := blue.WithBackground(chalk.White) -// awesomeness := blueOnWhite.WithTextStyle(chalk.Underline).WithForeground(chalk.Green) -// -// Like both Colors and TextStyles you can style specific segments of text -// with: -// -// fmt.Println(awesomeness.Style("this is so pretty!")) -// -// Like Colors, you can also print styles explicitly, but you'll need to -// reset your console's colors with chalk.Reset if you use them this way: -// -// fmt.Println(awesomeness, "this is so pretty", chalk.Reset) -// -// Be aware though, that this (second) way of using styles will not add the -// text style (as text styles require more specific end codes). So if you want -// to fully utilize styles, use myStyle.Style() (unless you only care about -// print your text with a specific foreground and background, then printing -// the style is awesome too!). -// -// Have fun! -// -package chalk diff --git a/vendor/gopkg.in/yaml.v3/.travis.yml b/vendor/gopkg.in/yaml.v3/.travis.yml deleted file mode 100644 index a130fe883ce..00000000000 --- a/vendor/gopkg.in/yaml.v3/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: go - -go: - - "1.4.x" - - "1.5.x" - - "1.6.x" - - "1.7.x" - - "1.8.x" - - "1.9.x" - - "1.10.x" - - "1.11.x" - - "1.12.x" - - "1.13.x" - - "1.14.x" - - "tip" - -go_import_path: gopkg.in/yaml.v3 diff --git a/vendor/gopkg.in/yaml.v3/decode.go b/vendor/gopkg.in/yaml.v3/decode.go index 21c0dacfdff..df36e3a30f5 100644 --- a/vendor/gopkg.in/yaml.v3/decode.go +++ b/vendor/gopkg.in/yaml.v3/decode.go @@ -399,7 +399,7 @@ func (d *decoder) callObsoleteUnmarshaler(n *Node, u obsoleteUnmarshaler) (good // // If n holds a null value, prepare returns before doing anything. func (d *decoder) prepare(n *Node, out reflect.Value) (newout reflect.Value, unmarshaled, good bool) { - if n.ShortTag() == nullTag || n.Kind == 0 && n.IsZero() { + if n.ShortTag() == nullTag { return out, false, false } again := true @@ -808,8 +808,10 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { } } + mapIsNew := false if out.IsNil() { out.Set(reflect.MakeMap(outt)) + mapIsNew = true } for i := 0; i < l; i += 2 { if isMerge(n.Content[i]) { @@ -826,7 +828,7 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { failf("invalid map key: %#v", k.Interface()) } e := reflect.New(et).Elem() - if d.unmarshal(n.Content[i+1], e) { + if d.unmarshal(n.Content[i+1], e) || n.Content[i+1].ShortTag() == nullTag && (mapIsNew || !out.MapIndex(k).IsValid()) { out.SetMapIndex(k, e) } } diff --git a/vendor/gopkg.in/yaml.v3/emitterc.go b/vendor/gopkg.in/yaml.v3/emitterc.go index c29217ef54b..0f47c9ca8ad 100644 --- a/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/vendor/gopkg.in/yaml.v3/emitterc.go @@ -814,26 +814,24 @@ func yaml_emitter_emit_block_mapping_value(emitter *yaml_emitter_t, event *yaml_ } } if len(emitter.key_line_comment) > 0 { - // [Go] A line comment was previously provided for the key. Handle it before - // the value so the inline comments are placed correctly. - if yaml_emitter_silent_nil_event(emitter, event) && len(emitter.line_comment) == 0 { - // Nothing other than the line comment will be written on the line. - emitter.line_comment = emitter.key_line_comment - emitter.key_line_comment = nil - } else { - // An actual value is coming, so emit the comment line. + // [Go] Line comments are generally associated with the value, but when there's + // no value on the same line as a mapping key they end up attached to the + // key itself. + if event.typ == yaml_SCALAR_EVENT { + if len(emitter.line_comment) == 0 { + // A scalar is coming and it has no line comments by itself yet, + // so just let it handle the line comment as usual. If it has a + // line comment, we can't have both so the one from the key is lost. + emitter.line_comment = emitter.key_line_comment + emitter.key_line_comment = nil + } + } else if event.sequence_style() != yaml_FLOW_SEQUENCE_STYLE && (event.typ == yaml_MAPPING_START_EVENT || event.typ == yaml_SEQUENCE_START_EVENT) { + // An indented block follows, so write the comment right now. emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment if !yaml_emitter_process_line_comment(emitter) { return false } emitter.line_comment, emitter.key_line_comment = emitter.key_line_comment, emitter.line_comment - // Indent in unless it's a block that will reindent anyway. - if event.sequence_style() == yaml_FLOW_SEQUENCE_STYLE || (event.typ != yaml_MAPPING_START_EVENT && event.typ != yaml_SEQUENCE_START_EVENT) { - emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) - if !yaml_emitter_write_indent(emitter) { - return false - } - } } } emitter.states = append(emitter.states, yaml_EMIT_BLOCK_MAPPING_KEY_STATE) @@ -1896,7 +1894,7 @@ func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - if !put_break(emitter) { + if !yaml_emitter_process_line_comment(emitter) { return false } //emitter.indention = true @@ -1933,10 +1931,10 @@ func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) boo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - - if !put_break(emitter) { + if !yaml_emitter_process_line_comment(emitter) { return false } + //emitter.indention = true emitter.whitespace = true diff --git a/vendor/gopkg.in/yaml.v3/encode.go b/vendor/gopkg.in/yaml.v3/encode.go index 45e8d1e1b9f..de9e72a3e63 100644 --- a/vendor/gopkg.in/yaml.v3/encode.go +++ b/vendor/gopkg.in/yaml.v3/encode.go @@ -120,6 +120,11 @@ func (e *encoder) marshal(tag string, in reflect.Value) { e.nodev(in) return case Node: + if !in.CanAddr() { + var n = reflect.New(in.Type()).Elem() + n.Set(in) + in = n + } e.nodev(in.Addr()) return case time.Time: diff --git a/vendor/gopkg.in/yaml.v3/scannerc.go b/vendor/gopkg.in/yaml.v3/scannerc.go index d9a539c39ae..ca0070108f4 100644 --- a/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/vendor/gopkg.in/yaml.v3/scannerc.go @@ -2260,10 +2260,9 @@ func yaml_parser_scan_block_scalar(parser *yaml_parser_t, token *yaml_token_t, l } } if parser.buffer[parser.buffer_pos] == '#' { - // TODO Test this and then re-enable it. - //if !yaml_parser_scan_line_comment(parser, start_mark) { - // return false - //} + if !yaml_parser_scan_line_comment(parser, start_mark) { + return false + } for !is_breakz(parser.buffer, parser.buffer_pos) { skip(parser) if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -2892,6 +2891,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo var token_mark = token.start_mark var start_mark yaml_mark_t + var next_indent = parser.indent + if next_indent < 0 { + next_indent = 0 + } var recent_empty = false var first_empty = parser.newlines <= 1 @@ -2923,15 +2926,18 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo continue } c := parser.buffer[parser.buffer_pos+peek] - if is_breakz(parser.buffer, parser.buffer_pos+peek) || parser.flow_level > 0 && (c == ']' || c == '}') { + var close_flow = parser.flow_level > 0 && (c == ']' || c == '}') + if close_flow || is_breakz(parser.buffer, parser.buffer_pos+peek) { // Got line break or terminator. - if !recent_empty { - if first_empty && (start_mark.line == foot_line || start_mark.column-1 < parser.indent) { + if close_flow || !recent_empty { + if close_flow || first_empty && (start_mark.line == foot_line && token.typ != yaml_VALUE_TOKEN || start_mark.column-1 < next_indent) { // This is the first empty line and there were no empty lines before, // so this initial part of the comment is a foot of the prior token // instead of being a head for the following one. Split it up. + // Alternatively, this might also be the last comment inside a flow + // scope, so it must be a footer. if len(text) > 0 { - if start_mark.column-1 < parser.indent { + if start_mark.column-1 < next_indent { // If dedented it's unrelated to the prior token. token_mark = start_mark } @@ -2962,7 +2968,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo continue } - if len(text) > 0 && column < parser.indent+1 && column != start_mark.column { + if len(text) > 0 && (close_flow || column-1 < next_indent && column != start_mark.column) { // The comment at the different indentation is a foot of the // preceding data rather than a head of the upcoming one. parser.comments = append(parser.comments, yaml_comment_t{ @@ -3013,6 +3019,10 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo peek = 0 column = 0 line = parser.mark.line + next_indent = parser.indent + if next_indent < 0 { + next_indent = 0 + } } if len(text) > 0 { diff --git a/vendor/gopkg.in/yaml.v3/yaml.go b/vendor/gopkg.in/yaml.v3/yaml.go index 56e8a849031..8cec6da48d3 100644 --- a/vendor/gopkg.in/yaml.v3/yaml.go +++ b/vendor/gopkg.in/yaml.v3/yaml.go @@ -449,6 +449,11 @@ func (n *Node) ShortTag() string { case ScalarNode: tag, _ := resolve("", n.Value) return tag + case 0: + // Special case to make the zero value convenient. + if n.IsZero() { + return nullTag + } } return "" } diff --git a/vendor/modules.txt b/vendor/modules.txt index db82d766958..024685482b4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,7 +14,6 @@ github.com/armon/go-metrics ## explicit github.com/avct/uasurfer # github.com/beevik/etree v1.1.0 -## explicit github.com/beevik/etree # github.com/beorn7/perks v1.0.1 github.com/beorn7/perks/quantile @@ -239,8 +238,7 @@ github.com/jaytaylor/html2text ## explicit github.com/jmoiron/sqlx github.com/jmoiron/sqlx/reflectx -# github.com/jonboulle/clockwork v0.1.0 -## explicit +# github.com/jonboulle/clockwork v0.2.2 github.com/jonboulle/clockwork # github.com/json-iterator/go v1.1.10 github.com/json-iterator/go @@ -394,7 +392,6 @@ github.com/prometheus/client_golang/prometheus github.com/prometheus/client_golang/prometheus/internal github.com/prometheus/client_golang/prometheus/promhttp # github.com/prometheus/client_model v0.2.0 -## explicit github.com/prometheus/client_model/go # github.com/prometheus/common v0.10.0 github.com/prometheus/common/expfmt @@ -414,7 +411,7 @@ github.com/rs/xid # github.com/rudderlabs/analytics-go v3.2.1+incompatible ## explicit github.com/rudderlabs/analytics-go -# github.com/russellhaering/goxmldsig v0.0.0-20180430223755-7acd5e4a6ef7 +# github.com/russellhaering/goxmldsig v1.1.1 ## explicit github.com/russellhaering/goxmldsig github.com/russellhaering/goxmldsig/etreeutils @@ -471,14 +468,7 @@ github.com/throttled/throttled github.com/throttled/throttled/store/memstore # github.com/tinylib/msgp v1.1.2 ## explicit -github.com/tinylib/msgp -github.com/tinylib/msgp/gen github.com/tinylib/msgp/msgp -github.com/tinylib/msgp/parse -github.com/tinylib/msgp/printer -# github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31 -## explicit -github.com/ttacon/chalk # github.com/tylerb/graceful v1.2.15 ## explicit github.com/tylerb/graceful @@ -762,8 +752,7 @@ gopkg.in/olivere/elastic.v6 # gopkg.in/yaml.v2 v2.3.0 ## explicit gopkg.in/yaml.v2 -# gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 -## explicit +# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b gopkg.in/yaml.v3 # honnef.co/go/tools v0.0.1-2020.1.3 ## explicit