Parcourir la source

Migrate to go modules

Andrea Fazzi il y a 5 ans
Parent
commit
17b11bfdc7
100 fichiers modifiés avec 236 ajouts et 11607 suppressions
  1. 0 170
      Godeps/Godeps.json
  2. 0 5
      Godeps/Readme
  3. 1 0
      client
  4. 3 3
      cron/sync/sync.go
  5. 2 2
      cron/sync/test/sync_test.go
  6. 5 5
      generator/generators/department/department.go
  7. 5 5
      generator/generators/list/list.go
  8. 29 0
      go.mod
  9. 188 0
      go.sum
  10. 1 0
      ldap
  11. 1 1
      template_generator/main.go
  12. 1 0
      util
  13. 0 21
      vendor/github.com/auth0/go-jwt-middleware/LICENSE
  14. 0 207
      vendor/github.com/auth0/go-jwt-middleware/README.md
  15. 0 236
      vendor/github.com/auth0/go-jwt-middleware/jwtmiddleware.go
  16. 0 4
      vendor/github.com/dgrijalva/jwt-go/.gitignore
  17. 0 13
      vendor/github.com/dgrijalva/jwt-go/.travis.yml
  18. 0 8
      vendor/github.com/dgrijalva/jwt-go/LICENSE
  19. 0 97
      vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md
  20. 0 85
      vendor/github.com/dgrijalva/jwt-go/README.md
  21. 0 105
      vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md
  22. 0 134
      vendor/github.com/dgrijalva/jwt-go/claims.go
  23. 0 4
      vendor/github.com/dgrijalva/jwt-go/doc.go
  24. 0 147
      vendor/github.com/dgrijalva/jwt-go/ecdsa.go
  25. 0 67
      vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go
  26. 0 59
      vendor/github.com/dgrijalva/jwt-go/errors.go
  27. 0 94
      vendor/github.com/dgrijalva/jwt-go/hmac.go
  28. 0 94
      vendor/github.com/dgrijalva/jwt-go/map_claims.go
  29. 0 52
      vendor/github.com/dgrijalva/jwt-go/none.go
  30. 0 131
      vendor/github.com/dgrijalva/jwt-go/parser.go
  31. 0 100
      vendor/github.com/dgrijalva/jwt-go/rsa.go
  32. 0 126
      vendor/github.com/dgrijalva/jwt-go/rsa_pss.go
  33. 0 69
      vendor/github.com/dgrijalva/jwt-go/rsa_utils.go
  34. 0 35
      vendor/github.com/dgrijalva/jwt-go/signing_method.go
  35. 0 108
      vendor/github.com/dgrijalva/jwt-go/token.go
  36. 0 8
      vendor/github.com/go-sql-driver/mysql/.gitignore
  37. 0 13
      vendor/github.com/go-sql-driver/mysql/.travis.yml
  38. 0 57
      vendor/github.com/go-sql-driver/mysql/AUTHORS
  39. 0 119
      vendor/github.com/go-sql-driver/mysql/CHANGELOG.md
  40. 0 23
      vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md
  41. 0 373
      vendor/github.com/go-sql-driver/mysql/LICENSE
  42. 0 443
      vendor/github.com/go-sql-driver/mysql/README.md
  43. 0 19
      vendor/github.com/go-sql-driver/mysql/appengine.go
  44. 0 147
      vendor/github.com/go-sql-driver/mysql/buffer.go
  45. 0 250
      vendor/github.com/go-sql-driver/mysql/collations.go
  46. 0 377
      vendor/github.com/go-sql-driver/mysql/connection.go
  47. 0 163
      vendor/github.com/go-sql-driver/mysql/const.go
  48. 0 183
      vendor/github.com/go-sql-driver/mysql/driver.go
  49. 0 548
      vendor/github.com/go-sql-driver/mysql/dsn.go
  50. 0 132
      vendor/github.com/go-sql-driver/mysql/errors.go
  51. 0 182
      vendor/github.com/go-sql-driver/mysql/infile.go
  52. 0 1287
      vendor/github.com/go-sql-driver/mysql/packets.go
  53. 0 22
      vendor/github.com/go-sql-driver/mysql/result.go
  54. 0 112
      vendor/github.com/go-sql-driver/mysql/rows.go
  55. 0 153
      vendor/github.com/go-sql-driver/mysql/statement.go
  56. 0 31
      vendor/github.com/go-sql-driver/mysql/transaction.go
  57. 0 740
      vendor/github.com/go-sql-driver/mysql/utils.go
  58. 0 8
      vendor/github.com/gobwas/glob/.gitignore
  59. 0 15
      vendor/github.com/gobwas/glob/.travis.yml
  60. 0 21
      vendor/github.com/gobwas/glob/LICENSE
  61. 0 26
      vendor/github.com/gobwas/glob/bench.sh
  62. 0 525
      vendor/github.com/gobwas/glob/compiler/compiler.go
  63. 0 80
      vendor/github.com/gobwas/glob/glob.go
  64. 0 45
      vendor/github.com/gobwas/glob/match/any.go
  65. 0 82
      vendor/github.com/gobwas/glob/match/any_of.go
  66. 0 185
      vendor/github.com/gobwas/glob/match/btree.go
  67. 0 58
      vendor/github.com/gobwas/glob/match/contains.go
  68. 0 99
      vendor/github.com/gobwas/glob/match/every_of.go
  69. 0 49
      vendor/github.com/gobwas/glob/match/list.go
  70. 0 81
      vendor/github.com/gobwas/glob/match/match.go
  71. 0 49
      vendor/github.com/gobwas/glob/match/max.go
  72. 0 57
      vendor/github.com/gobwas/glob/match/min.go
  73. 0 27
      vendor/github.com/gobwas/glob/match/nothing.go
  74. 0 50
      vendor/github.com/gobwas/glob/match/prefix.go
  75. 0 55
      vendor/github.com/gobwas/glob/match/prefix_any.go
  76. 0 62
      vendor/github.com/gobwas/glob/match/prefix_suffix.go
  77. 0 48
      vendor/github.com/gobwas/glob/match/range.go
  78. 0 77
      vendor/github.com/gobwas/glob/match/row.go
  79. 0 91
      vendor/github.com/gobwas/glob/match/segments.go
  80. 0 43
      vendor/github.com/gobwas/glob/match/single.go
  81. 0 35
      vendor/github.com/gobwas/glob/match/suffix.go
  82. 0 43
      vendor/github.com/gobwas/glob/match/suffix_any.go
  83. 0 33
      vendor/github.com/gobwas/glob/match/super.go
  84. 0 45
      vendor/github.com/gobwas/glob/match/text.go
  85. 0 148
      vendor/github.com/gobwas/glob/readme.md
  86. 0 122
      vendor/github.com/gobwas/glob/syntax/ast/ast.go
  87. 0 157
      vendor/github.com/gobwas/glob/syntax/ast/parser.go
  88. 0 273
      vendor/github.com/gobwas/glob/syntax/lexer/lexer.go
  89. 0 88
      vendor/github.com/gobwas/glob/syntax/lexer/token.go
  90. 0 14
      vendor/github.com/gobwas/glob/syntax/syntax.go
  91. 0 154
      vendor/github.com/gobwas/glob/util/runes/runes.go
  92. 0 39
      vendor/github.com/gobwas/glob/util/strings/strings.go
  93. 0 1
      vendor/github.com/gocarina/gocsv/.gitignore
  94. 0 1
      vendor/github.com/gocarina/gocsv/.travis.yml
  95. 0 21
      vendor/github.com/gocarina/gocsv/LICENSE
  96. 0 170
      vendor/github.com/gocarina/gocsv/README.md
  97. 0 319
      vendor/github.com/gocarina/gocsv/csv.go
  98. 0 296
      vendor/github.com/gocarina/gocsv/decode.go
  99. 0 139
      vendor/github.com/gocarina/gocsv/encode.go
  100. 0 107
      vendor/github.com/gocarina/gocsv/reflect.go

+ 0 - 170
Godeps/Godeps.json

@@ -1,170 +0,0 @@
-{
-	"ImportPath": "gogs.carducci-dante.gov.it/karmen/core",
-	"GoVersion": "go1.12",
-	"GodepVersion": "v79",
-	"Deps": [
-		{
-			"ImportPath": "github.com/auth0/go-jwt-middleware",
-			"Rev": "5493cabe49f7bfa6e2ec444a09d334d90cd4e2bd"
-		},
-		{
-			"ImportPath": "github.com/dgrijalva/jwt-go",
-			"Comment": "v3.0.0-17-g2268707",
-			"Rev": "2268707a8f0843315e2004ee4f1d021dc08baedf"
-		},
-		{
-			"ImportPath": "github.com/go-sql-driver/mysql",
-			"Comment": "v1.3-2-g2e00b5c",
-			"Rev": "2e00b5cd70399450106cec6431c2e2ce3cae5034"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/compiler",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/match",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/syntax",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/syntax/ast",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/syntax/lexer",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/util/runes",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gobwas/glob/util/strings",
-			"Comment": "v0.2.3-4-ge7a84e9",
-			"Rev": "e7a84e9525fe90abcda167b604e483cc959ad4aa"
-		},
-		{
-			"ImportPath": "github.com/gocarina/gocsv",
-			"Rev": "7099e67763c29f812fa2ed7083f32e38be60125a"
-		},
-		{
-			"ImportPath": "github.com/gorilla/context",
-			"Comment": "v1.1-7-g08b5f42",
-			"Rev": "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
-		},
-		{
-			"ImportPath": "github.com/gorilla/handlers",
-			"Comment": "v1.2.1-1-ga4d79d4",
-			"Rev": "a4d79d4487c2430a17d9dc8a1f74d1a6ed6908ca"
-		},
-		{
-			"ImportPath": "github.com/gorilla/mux",
-			"Comment": "v1.1-27-g757bef9",
-			"Rev": "757bef944d0f21880861c2dd9c871ca543023cba"
-		},
-		{
-			"ImportPath": "github.com/gorilla/schema",
-			"Rev": "0164a00ab4cd01d814d8cd5bf63fd9fcea30e23b"
-		},
-		{
-			"ImportPath": "github.com/gorilla/securecookie",
-			"Comment": "v1.1-5-gfa5329f",
-			"Rev": "fa5329f913702981df43dcb2a380bac429c810b5"
-		},
-		{
-			"ImportPath": "github.com/gorilla/sessions",
-			"Comment": "v1.1",
-			"Rev": "ca9ada44574153444b00d3fd9c8559e4cc95f896"
-		},
-		{
-			"ImportPath": "github.com/jinzhu/gorm",
-			"Comment": "v1.0-250-g48a20a6",
-			"Rev": "48a20a6e9f3f4d26095df82c3337efec6db0a6fc"
-		},
-		{
-			"ImportPath": "github.com/jinzhu/gorm/dialects/mysql",
-			"Comment": "v1.0-250-g48a20a6",
-			"Rev": "48a20a6e9f3f4d26095df82c3337efec6db0a6fc"
-		},
-		{
-			"ImportPath": "github.com/jinzhu/inflection",
-			"Rev": "1c35d901db3da928c72a72d8458480cc9ade058f"
-		},
-		{
-			"ImportPath": "github.com/remogatto/cloud",
-			"Rev": "c69ab0c688a0921fbb4297a04445ecf75f5365fe"
-		},
-		{
-			"ImportPath": "github.com/remogatto/slicediff",
-			"Rev": "d19e1ebfb964929670d755944d08cbabbe3f9c2a"
-		},
-		{
-			"ImportPath": "github.com/robfig/cron",
-			"Comment": "v1-58-g736158d",
-			"Rev": "736158dc09e10f1911ca3a1e1b01f11b566ce5db"
-		},
-		{
-			"ImportPath": "github.com/sethvargo/go-password/password",
-			"Comment": "v0.1.1-2-g669be2f",
-			"Rev": "669be2fd9899edfa540cb081008de6d098461541"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/client",
-			"Rev": "a486e0d6b4427aa2429d9c2314d516abf216d7b0"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/ldap",
-			"Rev": "034d2afa27464b7b5fc304170d521fc63dbefb5c"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/util/fileutil",
-			"Rev": "cdb7cebddc349ce594f7e1578f86f6c49bffac23"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/util/libreoffice",
-			"Rev": "cdb7cebddc349ce594f7e1578f86f6c49bffac23"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/util/pandoc",
-			"Rev": "cdb7cebddc349ce594f7e1578f86f6c49bffac23"
-		},
-		{
-			"ImportPath": "gogs.carducci-dante.gov.it/karmen/util/template",
-			"Rev": "cdb7cebddc349ce594f7e1578f86f6c49bffac23"
-		},
-		{
-			"ImportPath": "gopkg.in/asn1-ber.v1",
-			"Comment": "v1.2",
-			"Rev": "379148ca0225df7a432012b8df0355c2a2063ac0"
-		},
-		{
-			"ImportPath": "gopkg.in/gomail.v2",
-			"Comment": "2.0.0-23-g81ebce5",
-			"Rev": "81ebce5c23dfd25c6c67194b37d3dd3f338c98b1"
-		},
-		{
-			"ImportPath": "gopkg.in/ldap.v2",
-			"Comment": "v2.5.0",
-			"Rev": "8168ee085ee43257585e50c6441aadf54ecb2c9f"
-		},
-		{
-			"ImportPath": "gopkg.in/yaml.v2",
-			"Comment": "v2.2.2",
-			"Rev": "51d6538a90f86fe93ac480b35f37b2be17fef232"
-		}
-	]
-}

+ 0 - 5
Godeps/Readme

@@ -1,5 +0,0 @@
-This directory tree is generated automatically by godep.
-
-Please do not edit.
-
-See https://github.com/tools/godep for more information.

+ 1 - 0
client

@@ -0,0 +1 @@
+Subproject commit 177b1fe49457ede1b5aa7d26d5f6586ccb83d839

+ 3 - 3
cron/sync/sync.go

@@ -15,12 +15,12 @@ import (
 
 	"text/template"
 
-	karmen_client "gogs.carducci-dante.gov.it/karmen/client"
+	karmen_client "gogs.carducci-dante.gov.it/karmen/core/client"
 	"gogs.carducci-dante.gov.it/karmen/core/config"
+	karmen_ldap "gogs.carducci-dante.gov.it/karmen/core/ldap"
 	"gogs.carducci-dante.gov.it/karmen/core/orm"
-	karmen_ldap "gogs.carducci-dante.gov.it/karmen/ldap"
 
-	tpl_util "gogs.carducci-dante.gov.it/karmen/util/template"
+	tpl_util "gogs.carducci-dante.gov.it/karmen/core/util/template"
 )
 
 type entriesToDN []*ldap.Entry

+ 2 - 2
cron/sync/test/sync_test.go

@@ -7,11 +7,11 @@ import (
 	"time"
 
 	"github.com/remogatto/prettytest"
-	karmen_client "gogs.carducci-dante.gov.it/karmen/client"
+	karmen_client "gogs.carducci-dante.gov.it/karmen/core/client"
 	"gogs.carducci-dante.gov.it/karmen/core/config"
 	"gogs.carducci-dante.gov.it/karmen/core/cron/sync"
+	karmen_ldap "gogs.carducci-dante.gov.it/karmen/core/ldap"
 	"gogs.carducci-dante.gov.it/karmen/core/orm"
-	karmen_ldap "gogs.carducci-dante.gov.it/karmen/ldap"
 )
 
 type testSuite struct {

+ 5 - 5
generator/generators/department/department.go

@@ -12,15 +12,15 @@ import (
 
 	"github.com/remogatto/cloud"
 
-	karmen_client "gogs.carducci-dante.gov.it/karmen/client"
+	karmen_client "gogs.carducci-dante.gov.it/karmen/core/client"
 	"gogs.carducci-dante.gov.it/karmen/core/generator"
 	"gogs.carducci-dante.gov.it/karmen/core/generator/funcmap"
 	"gogs.carducci-dante.gov.it/karmen/core/generator/logger"
 	"gogs.carducci-dante.gov.it/karmen/core/orm"
-	"gogs.carducci-dante.gov.it/karmen/util/fileutil"
-	"gogs.carducci-dante.gov.it/karmen/util/libreoffice"
-	"gogs.carducci-dante.gov.it/karmen/util/pandoc"
-	tpl_util "gogs.carducci-dante.gov.it/karmen/util/template"
+	"gogs.carducci-dante.gov.it/karmen/core/util/fileutil"
+	"gogs.carducci-dante.gov.it/karmen/core/util/libreoffice"
+	"gogs.carducci-dante.gov.it/karmen/core/util/pandoc"
+	tpl_util "gogs.carducci-dante.gov.it/karmen/core/util/template"
 )
 
 type Data struct {

+ 5 - 5
generator/generators/list/list.go

@@ -12,14 +12,14 @@ import (
 
 	"github.com/remogatto/cloud"
 
-	karmen_client "gogs.carducci-dante.gov.it/karmen/client"
+	karmen_client "gogs.carducci-dante.gov.it/karmen/core/client"
 	"gogs.carducci-dante.gov.it/karmen/core/config"
 	"gogs.carducci-dante.gov.it/karmen/core/generator/funcmap"
 	"gogs.carducci-dante.gov.it/karmen/core/orm"
-	"gogs.carducci-dante.gov.it/karmen/util/fileutil"
-	"gogs.carducci-dante.gov.it/karmen/util/libreoffice"
-	"gogs.carducci-dante.gov.it/karmen/util/pandoc"
-	tpl_util "gogs.carducci-dante.gov.it/karmen/util/template"
+	"gogs.carducci-dante.gov.it/karmen/core/util/fileutil"
+	"gogs.carducci-dante.gov.it/karmen/core/util/libreoffice"
+	"gogs.carducci-dante.gov.it/karmen/core/util/pandoc"
+	tpl_util "gogs.carducci-dante.gov.it/karmen/core/util/template"
 )
 
 type Data struct {

+ 29 - 0
go.mod

@@ -0,0 +1,29 @@
+module gogs.carducci-dante.gov.it/karmen/core
+
+go 1.13
+
+require (
+	github.com/auth0/go-jwt-middleware v0.0.0-20190805220309-36081240882b
+	github.com/dgrijalva/jwt-go v3.2.0+incompatible
+	github.com/gobwas/glob v0.2.3
+	github.com/gocarina/gocsv v0.0.0-20190927101021-3ecffd272576
+	github.com/gorilla/handlers v1.4.2
+	github.com/gorilla/mux v1.7.3
+	github.com/gorilla/schema v1.1.0
+	github.com/gorilla/sessions v1.2.0
+	github.com/jinzhu/gorm v1.9.11
+	github.com/jinzhu/inflection v1.0.0
+	github.com/kr/pretty v0.1.0 // indirect
+	github.com/remogatto/cloud v0.0.0-20191009090237-dcf2638e6bc7
+	github.com/remogatto/prettytest v0.0.0-20161014102941-8b5d7bfe964e
+	github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964
+	github.com/robfig/cron v1.2.0
+	github.com/sethvargo/go-password v0.1.3
+	github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 // indirect
+	github.com/urfave/negroni v1.0.0 // indirect
+	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
+	gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
+	gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
+	gopkg.in/ldap.v2 v2.5.1
+	gopkg.in/yaml.v2 v2.2.4
+)

+ 188 - 0
go.sum

@@ -0,0 +1,188 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
+cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
+github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
+github.com/auth0/go-jwt-middleware v0.0.0-20190805220309-36081240882b h1:CvoEHGmxWl5kONC5icxwqV899dkf4VjOScbxLpllEnw=
+github.com/auth0/go-jwt-middleware v0.0.0-20190805220309-36081240882b/go.mod h1:LWMyo4iOLWXHGdBki7NIht1kHru/0wM179h+d3g8ATM=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA=
+github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
+github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
+github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
+github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
+github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
+github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y=
+github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8=
+github.com/gocarina/gocsv v0.0.0-20190927101021-3ecffd272576 h1:nDMaZgjBNKhsVJEWN1wAnqUJWwWGxFdDlt8U17KqMQ8=
+github.com/gocarina/gocsv v0.0.0-20190927101021-3ecffd272576/go.mod h1:/oj50ZdPq/cUjA02lMZhijk5kR31SEydKyqah1OgBuo=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+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/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
+github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
+github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg=
+github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ=
+github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
+github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/gorilla/schema v1.1.0 h1:CamqUDOFUBqzrvxuz2vEwo8+SUdwsluFh7IlzJh30LY=
+github.com/gorilla/schema v1.1.0/go.mod h1:kgLaKoK1FELgZqMAVxx/5cbj0kT+57qxUrAlIO2eleU=
+github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
+github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
+github.com/gorilla/sessions v1.2.0 h1:S7P+1Hm5V/AT9cjEcUD5uDaQSX0OE577aCXgoaKpYbQ=
+github.com/gorilla/sessions v1.2.0/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/jinzhu/gorm v1.9.11 h1:gaHGvE+UnWGlbWG4Y3FUwY1EcZ5n6S9WtqBA/uySMLE=
+github.com/jinzhu/gorm v1.9.11/go.mod h1:bu/pK8szGZ2puuErfU0RwyeNdsf3e6nCX/noXaVxkfw=
+github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
+github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
+github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
+github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
+github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
+github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+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/pty v1.1.1/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/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
+github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q=
+github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
+github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+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/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
+github.com/remogatto/cloud v0.0.0-20191009090237-dcf2638e6bc7 h1:0d+RhTaGBAwgRVW/FDCsYTg2dUMvIZtn8KNhZk2crZg=
+github.com/remogatto/cloud v0.0.0-20191009090237-dcf2638e6bc7/go.mod h1:84Ak6wMU0H33hglQdkwyFJob+r0lRiQhtBiekhNrgL8=
+github.com/remogatto/prettytest v0.0.0-20161014102941-8b5d7bfe964e h1:uQy6ob81XHCWTGzVTbVHnMDjc4jRKaIXuaNSsX5thCU=
+github.com/remogatto/prettytest v0.0.0-20161014102941-8b5d7bfe964e/go.mod h1:jOEnp79oIHy5cvQSHeLcgVJk1GHOOHJHQWps/d1N5Yo=
+github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964 h1:nr+J2/lD7hrKuUU37aaW5GMjnTN9SWcPOZm8bOhw7lk=
+github.com/remogatto/slicediff v0.0.0-20190903082355-d19e1ebfb964/go.mod h1:hYhX1i+/93J3gTMZFUL96Mf/45LmfRZTunoLYPwaHTA=
+github.com/robfig/cron v1.2.0 h1:ZjScXvvxeQ63Dbyxy76Fj3AT3Ut0aKsyd2/tl3DTMuQ=
+github.com/robfig/cron v1.2.0/go.mod h1:JGuDeoQd7Z6yL4zQhZ3OPEVHB7fL6Ka6skscFHfmt2k=
+github.com/sethvargo/go-password v0.1.3 h1:18KkbGDkw8SuzeohAbWqBLNSfRQblVwEHOLbPa0PvWM=
+github.com/sethvargo/go-password v0.1.3/go.mod h1:2tyaaoHK/AlXwh5WWQDYjqQbHcq4cjPj5qb/ciYvu/Q=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
+github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
+github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337 h1:WN9BUFbdyOsSH/XohnWpXOlq9NBD5sGAB2FciQMUEe8=
+github.com/smartystreets/goconvey v0.0.0-20190731233626-505e41936337/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=
+github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
+go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
+golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+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/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+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/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+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/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+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=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+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/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d h1:TxyelI5cVkbREznMhfzycHdkp5cLA7DpE+GKjSslYhM=
+gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw=
+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/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df h1:n7WqCuqOuCbNr617RXOY0AWRXxgwEyPp2z+p0+hgMuE=
+gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw=
+gopkg.in/ldap.v2 v2.5.1 h1:wiu0okdNfjlBzg6UWvd1Hn8Y+Ux17/u/4nlk4CQr6tU=
+gopkg.in/ldap.v2 v2.5.1/go.mod h1:oI0cpe/D7HRtBQl8aTg+ZmzFUAvu4lsv3eLXMLGFxWk=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/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=

+ 1 - 0
ldap

@@ -0,0 +1 @@
+Subproject commit 83e2c51c67bc8c5f171ad956e200363b4ca0af00

+ 1 - 1
template_generator/main.go

@@ -10,7 +10,7 @@ import (
 	"text/template"
 
 	"github.com/jinzhu/inflection"
-	tpl_util "gogs.carducci-dante.gov.it/karmen/util/template"
+	tpl_util "gogs.carducci-dante.gov.it/karmen/core/util/template"
 )
 
 var (

+ 1 - 0
util

@@ -0,0 +1 @@
+Subproject commit cdb7cebddc349ce594f7e1578f86f6c49bffac23

+ 0 - 21
vendor/github.com/auth0/go-jwt-middleware/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
- 
-Copyright (c) 2015 Auth0, Inc. <support@auth0.com> (http://auth0.com)
- 
-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.

+ 0 - 207
vendor/github.com/auth0/go-jwt-middleware/README.md

@@ -1,207 +0,0 @@
-# GO JWT Middleware
-
-A middleware that will check that a [JWT](http://jwt.io/) is sent on the `Authorization` header and will then set the content of the JWT into the `user` variable of the request.
-
-This module lets you authenticate HTTP requests using JWT tokens in your Go Programming Language applications. JWTs are typically used to protect API endpoints, and are often issued using OpenID Connect.
-
-## Key Features
-
-* Ability to **check the `Authorization` header for a JWT**
-* **Decode the JWT** and set the content of it to the request context
-
-## Installing
-
-````bash
-go get github.com/auth0/go-jwt-middleware
-````
-
-## Using it
-
-You can use `jwtmiddleware` with default `net/http` as follows.
-
-````go
-// main.go
-package main
-
-import (
-  "fmt"
-  "net/http"
-
-  "github.com/auth0/go-jwt-middleware"
-  "github.com/dgrijalva/jwt-go"
-  "github.com/gorilla/context"
-)
-
-var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-  user := context.Get(r, "user")
-  fmt.Fprintf(w, "This is an authenticated request")
-  fmt.Fprintf(w, "Claim content:\n")
-  for k, v := range user.(*jwt.Token).Claims {
-    fmt.Fprintf(w, "%s :\t%#v\n", k, v)
-  }
-})
-
-func main() {
-  jwtMiddleware := jwtmiddleware.New(jwtmiddleware.Options{
-    ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
-      return []byte("My Secret"), nil
-    },
-    // When set, the middleware verifies that tokens are signed with the specific signing algorithm
-    // If the signing method is not constant the ValidationKeyGetter callback can be used to implement additional checks
-    // Important to avoid security issues described here: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
-    SigningMethod: jwt.SigningMethodHS256,
-  })
-
-  app := jwtMiddleware.Handler(myHandler)
-  http.ListenAndServe("0.0.0.0:3000", app)
-}
-````
-
-You can also use it with Negroni as follows:
-
-````go
-// main.go
-package main
-
-import (
-  "context"
-  "fmt"
-  "net/http"
-
-  "github.com/auth0/go-jwt-middleware"
-  "github.com/codegangsta/negroni"
-  "github.com/dgrijalva/jwt-go"
-  "github.com/gorilla/mux"
-)
-
-var myHandler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-  user := r.Context().Value("user");
-  fmt.Fprintf(w, "This is an authenticated request")
-  fmt.Fprintf(w, "Claim content:\n")
-  for k, v := range user.(*jwt.Token).Claims {
-    fmt.Fprintf(w, "%s :\t%#v\n", k, v)
-  }
-})
-
-func main() {
-  r := mux.NewRouter()
-
-  jwtMiddleware := jwtmiddleware.New(jwtmiddleware.Options{
-    ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) {
-      return []byte("My Secret"), nil
-    },
-    // When set, the middleware verifies that tokens are signed with the specific signing algorithm
-    // If the signing method is not constant the ValidationKeyGetter callback can be used to implement additional checks
-    // Important to avoid security issues described here: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
-    SigningMethod: jwt.SigningMethodHS256,
-  })
-
-  r.Handle("/ping", negroni.New(
-    negroni.HandlerFunc(jwtMiddleware.HandlerWithNext),
-    negroni.Wrap(myHandler),
-  ))
-  http.Handle("/", r)
-  http.ListenAndServe(":3001", nil)
-}
-````
-
-## Options
-
-````go
-type Options struct {
-  // The function that will return the Key to validate the JWT.
-  // It can be either a shared secret or a public key.
-  // Default value: nil
-  ValidationKeyGetter jwt.Keyfunc
-  // The name of the property in the request where the user information
-  // from the JWT will be stored.
-  // Default value: "user"
-  UserProperty string
-  // The function that will be called when there's an error validating the token
-  // Default value: https://github.com/auth0/go-jwt-middleware/blob/master/jwtmiddleware.go#L35
-  ErrorHandler errorHandler
-  // A boolean indicating if the credentials are required or not
-  // Default value: false
-  CredentialsOptional bool
-  // A function that extracts the token from the request
-  // Default: FromAuthHeader (i.e., from Authorization header as bearer token)
-  Extractor TokenExtractor
-  // Debug flag turns on debugging output
-  // Default: false  
-  Debug bool
-  // When set, all requests with the OPTIONS method will use authentication
-  // Default: false
-  EnableAuthOnOptions bool,
-  // When set, the middelware verifies that tokens are signed with the specific signing algorithm
-  // If the signing method is not constant the ValidationKeyGetter callback can be used to implement additional checks
-  // Important to avoid security issues described here: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
-  // Default: nil
-  SigningMethod jwt.SigningMethod
-}
-````
-
-### Token Extraction
-
-The default value for the `Extractor` option is the `FromAuthHeader`
-function which assumes that the JWT will be provided as a bearer token
-in an `Authorization` header, i.e.,
-
-```
-Authorization: bearer {token}
-```
-
-To extract the token from a query string parameter, you can use the
-`FromParameter` function, e.g.,
-
-```go
-jwtmiddleware.New(jwtmiddleware.Options{
-  Extractor: jwtmiddleware.FromParameter("auth_code"),
-})
-```
-
-In this case, the `FromParameter` function will look for a JWT in the
-`auth_code` query parameter.
-
-Or, if you want to allow both, you can use the `FromFirst` function to
-try and extract the token first in one way and then in one or more
-other ways, e.g.,
-
-```go
-jwtmiddleware.New(jwtmiddleware.Options{
-  Extractor: jwtmiddleware.FromFirst(jwtmiddleware.FromAuthHeader,
-                                     jwtmiddleware.FromParameter("auth_code")),
-})
-```
-
-## Examples
-
-You can check out working examples in the [examples folder](https://github.com/auth0/go-jwt-middleware/tree/master/examples)
-
-
-## What is Auth0?
-
-Auth0 helps you to:
-
-* Add authentication with [multiple authentication sources](https://docs.auth0.com/identityproviders), either social like **Google, Facebook, Microsoft Account, LinkedIn, GitHub, Twitter, Box, Salesforce, amont others**, or enterprise identity systems like **Windows Azure AD, Google Apps, Active Directory, ADFS or any SAML Identity Provider**.
-* Add authentication through more traditional **[username/password databases](https://docs.auth0.com/mysql-connection-tutorial)**.
-* Add support for **[linking different user accounts](https://docs.auth0.com/link-accounts)** with the same user.
-* Support for generating signed [Json Web Tokens](https://docs.auth0.com/jwt) to call your APIs and **flow the user identity** securely.
-* Analytics of how, when and where users are logging in.
-* Pull data from other sources and add it to the user profile, through [JavaScript rules](https://docs.auth0.com/rules).
-
-## Create a free Auth0 Account
-
-1. Go to [Auth0](https://auth0.com) and click Sign Up.
-2. Use Google, GitHub or Microsoft Account to login.
-
-## Issue Reporting
-
-If you have found a bug or if you have a feature request, please report them at this repository issues section. Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.
-
-## Author
-
-[Auth0](auth0.com)
-
-## License
-
-This project is licensed under the MIT license. See the [LICENSE](LICENSE.txt) file for more info.

+ 0 - 236
vendor/github.com/auth0/go-jwt-middleware/jwtmiddleware.go

@@ -1,236 +0,0 @@
-package jwtmiddleware
-
-import (
-	"context"
-	"errors"
-	"fmt"
-	"github.com/dgrijalva/jwt-go"
-	"log"
-	"net/http"
-	"strings"
-)
-
-// A function called whenever an error is encountered
-type errorHandler func(w http.ResponseWriter, r *http.Request, err string)
-
-// TokenExtractor is a function that takes a request as input and returns
-// either a token or an error.  An error should only be returned if an attempt
-// to specify a token was found, but the information was somehow incorrectly
-// formed.  In the case where a token is simply not present, this should not
-// be treated as an error.  An empty string should be returned in that case.
-type TokenExtractor func(r *http.Request) (string, error)
-
-// Options is a struct for specifying configuration options for the middleware.
-type Options struct {
-	// The function that will return the Key to validate the JWT.
-	// It can be either a shared secret or a public key.
-	// Default value: nil
-	ValidationKeyGetter jwt.Keyfunc
-	// The name of the property in the request where the user information
-	// from the JWT will be stored.
-	// Default value: "user"
-	UserProperty string
-	// The function that will be called when there's an error validating the token
-	// Default value:
-	ErrorHandler errorHandler
-	// A boolean indicating if the credentials are required or not
-	// Default value: false
-	CredentialsOptional bool
-	// A function that extracts the token from the request
-	// Default: FromAuthHeader (i.e., from Authorization header as bearer token)
-	Extractor TokenExtractor
-	// Debug flag turns on debugging output
-	// Default: false
-	Debug bool
-	// When set, all requests with the OPTIONS method will use authentication
-	// Default: false
-	EnableAuthOnOptions bool
-	// When set, the middelware verifies that tokens are signed with the specific signing algorithm
-	// If the signing method is not constant the ValidationKeyGetter callback can be used to implement additional checks
-	// Important to avoid security issues described here: https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/
-	// Default: nil
-	SigningMethod jwt.SigningMethod
-}
-
-type JWTMiddleware struct {
-	Options Options
-}
-
-func OnError(w http.ResponseWriter, r *http.Request, err string) {
-	http.Error(w, err, http.StatusUnauthorized)
-}
-
-// New constructs a new Secure instance with supplied options.
-func New(options ...Options) *JWTMiddleware {
-
-	var opts Options
-	if len(options) == 0 {
-		opts = Options{}
-	} else {
-		opts = options[0]
-	}
-
-	if opts.UserProperty == "" {
-		opts.UserProperty = "user"
-	}
-
-	if opts.ErrorHandler == nil {
-		opts.ErrorHandler = OnError
-	}
-
-	if opts.Extractor == nil {
-		opts.Extractor = FromAuthHeader
-	}
-
-	return &JWTMiddleware{
-		Options: opts,
-	}
-}
-
-func (m *JWTMiddleware) logf(format string, args ...interface{}) {
-	if m.Options.Debug {
-		log.Printf(format, args...)
-	}
-}
-
-// Special implementation for Negroni, but could be used elsewhere.
-func (m *JWTMiddleware) HandlerWithNext(w http.ResponseWriter, r *http.Request, next http.HandlerFunc) {
-	err := m.CheckJWT(w, r)
-
-	// If there was an error, do not call next.
-	if err == nil && next != nil {
-		next(w, r)
-	}
-}
-
-func (m *JWTMiddleware) Handler(h http.Handler) http.Handler {
-	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		// Let secure process the request. If it returns an error,
-		// that indicates the request should not continue.
-		err := m.CheckJWT(w, r)
-
-		// If there was an error, do not continue.
-		if err != nil {
-			return
-		}
-
-		h.ServeHTTP(w, r)
-	})
-}
-
-// FromAuthHeader is a "TokenExtractor" that takes a give request and extracts
-// the JWT token from the Authorization header.
-func FromAuthHeader(r *http.Request) (string, error) {
-	authHeader := r.Header.Get("Authorization")
-	if authHeader == "" {
-		return "", nil // No error, just no token
-	}
-
-	// TODO: Make this a bit more robust, parsing-wise
-	authHeaderParts := strings.Split(authHeader, " ")
-	if len(authHeaderParts) != 2 || strings.ToLower(authHeaderParts[0]) != "bearer" {
-		return "", errors.New("Authorization header format must be Bearer {token}")
-	}
-
-	return authHeaderParts[1], nil
-}
-
-// FromParameter returns a function that extracts the token from the specified
-// query string parameter
-func FromParameter(param string) TokenExtractor {
-	return func(r *http.Request) (string, error) {
-		return r.URL.Query().Get(param), nil
-	}
-}
-
-// FromFirst returns a function that runs multiple token extractors and takes the
-// first token it finds
-func FromFirst(extractors ...TokenExtractor) TokenExtractor {
-	return func(r *http.Request) (string, error) {
-		for _, ex := range extractors {
-			token, err := ex(r)
-			if err != nil {
-				return "", err
-			}
-			if token != "" {
-				return token, nil
-			}
-		}
-		return "", nil
-	}
-}
-
-func (m *JWTMiddleware) CheckJWT(w http.ResponseWriter, r *http.Request) error {
-	if !m.Options.EnableAuthOnOptions {
-		if r.Method == "OPTIONS" {
-			return nil
-		}
-	}
-
-	// Use the specified token extractor to extract a token from the request
-	token, err := m.Options.Extractor(r)
-
-	// If debugging is turned on, log the outcome
-	if err != nil {
-		m.logf("Error extracting JWT: %v", err)
-	} else {
-		m.logf("Token extracted: %s", token)
-	}
-
-	// If an error occurs, call the error handler and return an error
-	if err != nil {
-		m.Options.ErrorHandler(w, r, err.Error())
-		return fmt.Errorf("Error extracting token: %v", err)
-	}
-
-	// If the token is empty...
-	if token == "" {
-		// Check if it was required
-		if m.Options.CredentialsOptional {
-			m.logf("  No credentials found (CredentialsOptional=true)")
-			// No error, just no token (and that is ok given that CredentialsOptional is true)
-			return nil
-		}
-
-		// If we get here, the required token is missing
-		errorMsg := "Required authorization token not found"
-		m.Options.ErrorHandler(w, r, errorMsg)
-		m.logf("  Error: No credentials found (CredentialsOptional=false)")
-		return fmt.Errorf(errorMsg)
-	}
-
-	// Now parse the token
-	parsedToken, err := jwt.Parse(token, m.Options.ValidationKeyGetter)
-
-	// Check if there was an error in parsing...
-	if err != nil {
-		m.logf("Error parsing token: %v", err)
-		m.Options.ErrorHandler(w, r, err.Error())
-		return fmt.Errorf("Error parsing token: %v", err)
-	}
-
-	if m.Options.SigningMethod != nil && m.Options.SigningMethod.Alg() != parsedToken.Header["alg"] {
-		message := fmt.Sprintf("Expected %s signing method but token specified %s",
-			m.Options.SigningMethod.Alg(),
-			parsedToken.Header["alg"])
-		m.logf("Error validating token algorithm: %s", message)
-		m.Options.ErrorHandler(w, r, errors.New(message).Error())
-		return fmt.Errorf("Error validating token algorithm: %s", message)
-	}
-
-	// Check if the parsed token is valid...
-	if !parsedToken.Valid {
-		m.logf("Token is invalid")
-		m.Options.ErrorHandler(w, r, "The token isn't valid")
-		return errors.New("Token is invalid")
-	}
-
-	m.logf("JWT: %v", parsedToken)
-
-	// If we get here, everything worked and we can set the
-	// user property in context.
-	newRequest := r.WithContext(context.WithValue(r.Context(), m.Options.UserProperty, parsedToken))
-	// Update the current request with the new context information.
-	*r = *newRequest
-	return nil
-}

+ 0 - 4
vendor/github.com/dgrijalva/jwt-go/.gitignore

@@ -1,4 +0,0 @@
-.DS_Store
-bin
-
-

+ 0 - 13
vendor/github.com/dgrijalva/jwt-go/.travis.yml

@@ -1,13 +0,0 @@
-language: go
-
-script:
-    - go vet ./...
-    - go test -v ./...
-
-go:
-  - 1.3
-  - 1.4
-  - 1.5
-  - 1.6
-  - 1.7
-  - tip

+ 0 - 8
vendor/github.com/dgrijalva/jwt-go/LICENSE

@@ -1,8 +0,0 @@
-Copyright (c) 2012 Dave Grijalva
-
-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.
-

+ 0 - 97
vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md

@@ -1,97 +0,0 @@
-## Migration Guide from v2 -> v3
-
-Version 3 adds several new, frequently requested features.  To do so, it introduces a few breaking changes.  We've worked to keep these as minimal as possible.  This guide explains the breaking changes and how you can quickly update your code.
-
-### `Token.Claims` is now an interface type
-
-The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`.  We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`.
-
-`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior.  It is the default claims type when using `Parse`.  The usage is unchanged except you must type cast the claims property.
-
-The old example for parsing a token looked like this..
-
-```go
-	if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil {
-		fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
-	}
-```
-
-is now directly mapped to...
-
-```go
-	if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil {
-		claims := token.Claims.(jwt.MapClaims)
-		fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"])
-	}
-```
-
-`StandardClaims` is designed to be embedded in your custom type.  You can supply a custom claims type with the new `ParseWithClaims` function.  Here's an example of using a custom claims type.
-
-```go
-	type MyCustomClaims struct {
-		User string
-		*StandardClaims
-	}
-	
-	if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil {
-		claims := token.Claims.(*MyCustomClaims)
-		fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt)
-	}
-```
-
-### `ParseFromRequest` has been moved
-
-To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`.  The method signatues have also been augmented to receive a new argument: `Extractor`.
-
-`Extractors` do the work of picking the token string out of a request.  The interface is simple and composable.
-
-This simple parsing example:
-
-```go
-	if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil {
-		fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
-	}
-```
-
-is directly mapped to:
-
-```go
-	if token, err := request.ParseFromRequest(req, request.OAuth2Extractor, keyLookupFunc); err == nil {
-		claims := token.Claims.(jwt.MapClaims)
-		fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"])
-	}
-```
-
-There are several concrete `Extractor` types provided for your convenience:
-
-* `HeaderExtractor` will search a list of headers until one contains content.
-* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content.
-* `MultiExtractor` will try a list of `Extractors` in order until one returns content.
-* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token.
-* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument
-* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed.  A simple example is stripping the `Bearer ` text from a header
-
-
-### RSA signing methods no longer accept `[]byte` keys
-
-Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse.
-
-To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`.  These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types.
-
-```go 
-	func keyLookupFunc(*Token) (interface{}, error) {
-		// Don't forget to validate the alg is what you expect:
-		if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
-			return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
-		}
-		
-		// Look up key 
-		key, err := lookupPublicKey(token.Header["kid"])
-		if err != nil {
-			return nil, err
-		}
-		
-		// Unpack key from PEM encoded PKCS8
-		return jwt.ParseRSAPublicKeyFromPEM(key)
-	}
-```

+ 0 - 85
vendor/github.com/dgrijalva/jwt-go/README.md

@@ -1,85 +0,0 @@
-A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html)
-
-[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go)
-
-**BREAKING CHANGES:*** Version 3.0.0 is here. It includes _a lot_ of changes including a few that break the API.  We've tried to break as few things as possible, so there should just be a few type signature changes.  A full list of breaking changes is available in `VERSION_HISTORY.md`.  See `MIGRATION_GUIDE.md` for more information on updating your code.
-
-**NOTICE:** A vulnerability in JWT was [recently published](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/).  As this library doesn't force users to validate the `alg` is what they expected, it's possible your usage is effected.  There will be an update soon to remedy this, and it will likey require backwards-incompatible changes to the API.  In the short term, please make sure your implementation verifies the `alg` is what you expect.
-
-
-## What the heck is a JWT?
-
-JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens.
-
-In short, it's a signed JSON object that does something useful (for example, authentication).  It's commonly used for `Bearer` tokens in Oauth 2.  A token is made of three parts, separated by `.`'s.  The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded.  The last part is the signature, encoded the same way.
-
-The first part is called the header.  It contains the necessary information for verifying the last part, the signature.  For example, which encryption method was used for signing and what key was used.
-
-The part in the middle is the interesting bit.  It's called the Claims and contains the actual stuff you care about.  Refer to [the RFC](http://self-issued.info/docs/draft-jones-json-web-token.html) for information about reserved keys and the proper way to add your own.
-
-## What's in the box?
-
-This library supports the parsing and verification as well as the generation and signing of JWTs.  Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own.
-
-## Examples
-
-See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage:
-
-* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac)
-* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac)
-* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples)
-
-## Extensions
-
-This library publishes all the necessary components for adding your own signing methods.  Simply implement the `SigningMethod` interface and register a factory method using `RegisterSigningMethod`.  
-
-Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go
-
-## Compliance
-
-This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences: 
-
-* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key.
-
-## Project Status & Versioning
-
-This library is considered production ready.  Feedback and feature requests are appreciated.  The API should be considered stable.  There should be very few backwards-incompatible changes outside of major version updates (and only with good reason).
-
-This project uses [Semantic Versioning 2.0.0](http://semver.org).  Accepted pull requests will land on `master`.  Periodically, versions will be tagged from `master`.  You can find all the releases on [the project releases page](https://github.com/dgrijalva/jwt-go/releases).
-
-While we try to make it obvious when we make breaking changes, there isn't a great mechanism for pushing announcements out to users.  You may want to use this alternative package include: `gopkg.in/dgrijalva/jwt-go.v2`.  It will do the right thing WRT semantic versioning.
-
-## Usage Tips
-
-### Signing vs Encryption
-
-A token is simply a JSON object that is signed by its author. this tells you exactly two things about the data:
-
-* The author of the token was in the possession of the signing secret
-* The data has not been modified since it was signed
-
-It's important to know that JWT does not provide encryption, which means anyone who has access to the token can read its contents. If you need to protect (encrypt) the data, there is a companion spec, `JWE`, that provides this functionality. JWE is currently outside the scope of this library.
-
-### Choosing a Signing Method
-
-There are several signing methods available, and you should probably take the time to learn about the various options before choosing one.  The principal design decision is most likely going to be symmetric vs asymmetric.
-
-Symmetric signing methods, such as HSA, use only a single secret. This is probably the simplest signing method to use since any `[]byte` can be used as a valid secret. They are also slightly computationally faster to use, though this rarely is enough to matter. Symmetric signing methods work the best when both producers and consumers of tokens are trusted, or even the same system. Since the same secret is used to both sign and validate tokens, you can't easily distribute the key for validation.
-
-Asymmetric signing methods, such as RSA, use different keys for signing and verifying tokens. This makes it possible to produce tokens with a private key, and allow any consumer to access the public key for verification.
-
-### JWT and OAuth
-
-It's worth mentioning that OAuth and JWT are not the same thing. A JWT token is simply a signed JSON object. It can be used anywhere such a thing is useful. There is some confusion, though, as JWT is the most common type of bearer token used in OAuth2 authentication.
-
-Without going too far down the rabbit hole, here's a description of the interaction of these technologies:
-
-* OAuth is a protocol for allowing an identity provider to be separate from the service a user is logging in to.  For example, whenever you use Facebook to log into a different service (Yelp, Spotify, etc), you are using OAuth.
-* OAuth defines several options for passing around authentication data. One popular method is called a "bearer token". A bearer token is simply a string that _should_ only be held by an authenticated user. Thus, simply presenting this token proves your identity. You can probably derive from here why a JWT might make a good bearer token.
-* Because bearer tokens are used for authentication, it's important they're kept secret. This is why transactions that use bearer tokens typically happen over SSL.
- 
-## More
-
-Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go).
-
-The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration.  You'll also find several implementation examples in to documentation.

+ 0 - 105
vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md

@@ -1,105 +0,0 @@
-## `jwt-go` Version History
-
-#### 3.0.0
-
-* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code
-	* Dropped support for `[]byte` keys when using RSA signing methods.  This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods.
-	* `ParseFromRequest` has been moved to `request` subpackage and usage has changed
-	* The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`.  The default value is type `MapClaims`, which is an alias to `map[string]interface{}`.  This makes it possible to use a custom type when decoding claims.
-* Other Additions and Changes
-	* Added `Claims` interface type to allow users to decode the claims into a custom type
-	* Added `ParseWithClaims`, which takes a third argument of type `Claims`.  Use this function instead of `Parse` if you have a custom type you'd like to decode into.
-	* Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage
-	* Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims`
-	* Added new interface type `Extractor`, which is used for extracting JWT strings from http requests.  Used with `ParseFromRequest` and `ParseFromRequestWithClaims`.
-	* Added several new, more specific, validation errors to error type bitmask
-	* Moved examples from README to executable example files
-	* Signing method registry is now thread safe
-	* Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser)
-
-#### 2.7.0
-
-This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes.
-
-* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying
-* Error text for expired tokens includes how long it's been expired
-* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM`
-* Documentation updates
-
-#### 2.6.0
-
-* Exposed inner error within ValidationError
-* Fixed validation errors when using UseJSONNumber flag
-* Added several unit tests
-
-#### 2.5.0
-
-* Added support for signing method none.  You shouldn't use this.  The API tries to make this clear.
-* Updated/fixed some documentation
-* Added more helpful error message when trying to parse tokens that begin with `BEARER `
-
-#### 2.4.0
-
-* Added new type, Parser, to allow for configuration of various parsing parameters
-	* You can now specify a list of valid signing methods.  Anything outside this set will be rejected.
-	* You can now opt to use the `json.Number` type instead of `float64` when parsing token JSON
-* Added support for [Travis CI](https://travis-ci.org/dgrijalva/jwt-go)
-* Fixed some bugs with ECDSA parsing
-
-#### 2.3.0
-
-* Added support for ECDSA signing methods
-* Added support for RSA PSS signing methods (requires go v1.4)
-
-#### 2.2.0
-
-* Gracefully handle a `nil` `Keyfunc` being passed to `Parse`.  Result will now be the parsed token and an error, instead of a panic.
-
-#### 2.1.0
-
-Backwards compatible API change that was missed in 2.0.0.
-
-* The `SignedString` method on `Token` now takes `interface{}` instead of `[]byte`
-
-#### 2.0.0
-
-There were two major reasons for breaking backwards compatibility with this update.  The first was a refactor required to expand the width of the RSA and HMAC-SHA signing implementations.  There will likely be no required code changes to support this change.
-
-The second update, while unfortunately requiring a small change in integration, is required to open up this library to other signing methods.  Not all keys used for all signing methods have a single standard on-disk representation.  Requiring `[]byte` as the type for all keys proved too limiting.  Additionally, this implementation allows for pre-parsed tokens to be reused, which might matter in an application that parses a high volume of tokens with a small set of keys.  Backwards compatibilty has been maintained for passing `[]byte` to the RSA signing methods, but they will also accept `*rsa.PublicKey` and `*rsa.PrivateKey`.
-
-It is likely the only integration change required here will be to change `func(t *jwt.Token) ([]byte, error)` to `func(t *jwt.Token) (interface{}, error)` when calling `Parse`.
-
-* **Compatibility Breaking Changes**
-	* `SigningMethodHS256` is now `*SigningMethodHMAC` instead of `type struct`
-	* `SigningMethodRS256` is now `*SigningMethodRSA` instead of `type struct`
-	* `KeyFunc` now returns `interface{}` instead of `[]byte`
-	* `SigningMethod.Sign` now takes `interface{}` instead of `[]byte` for the key
-	* `SigningMethod.Verify` now takes `interface{}` instead of `[]byte` for the key
-* Renamed type `SigningMethodHS256` to `SigningMethodHMAC`.  Specific sizes are now just instances of this type.
-    * Added public package global `SigningMethodHS256`
-    * Added public package global `SigningMethodHS384`
-    * Added public package global `SigningMethodHS512`
-* Renamed type `SigningMethodRS256` to `SigningMethodRSA`.  Specific sizes are now just instances of this type.
-    * Added public package global `SigningMethodRS256`
-    * Added public package global `SigningMethodRS384`
-    * Added public package global `SigningMethodRS512`
-* Moved sample private key for HMAC tests from an inline value to a file on disk.  Value is unchanged.
-* Refactored the RSA implementation to be easier to read
-* Exposed helper methods `ParseRSAPrivateKeyFromPEM` and `ParseRSAPublicKeyFromPEM`
-
-#### 1.0.2
-
-* Fixed bug in parsing public keys from certificates
-* Added more tests around the parsing of keys for RS256
-* Code refactoring in RS256 implementation.  No functional changes
-
-#### 1.0.1
-
-* Fixed panic if RS256 signing method was passed an invalid key
-
-#### 1.0.0
-
-* First versioned release
-* API stabilized
-* Supports creating, signing, parsing, and validating JWT tokens
-* Supports RS256 and HS256 signing methods

+ 0 - 134
vendor/github.com/dgrijalva/jwt-go/claims.go

@@ -1,134 +0,0 @@
-package jwt
-
-import (
-	"crypto/subtle"
-	"fmt"
-	"time"
-)
-
-// For a type to be a Claims object, it must just have a Valid method that determines
-// if the token is invalid for any supported reason
-type Claims interface {
-	Valid() error
-}
-
-// Structured version of Claims Section, as referenced at
-// https://tools.ietf.org/html/rfc7519#section-4.1
-// See examples for how to use this with your own claim types
-type StandardClaims struct {
-	Audience  string `json:"aud,omitempty"`
-	ExpiresAt int64  `json:"exp,omitempty"`
-	Id        string `json:"jti,omitempty"`
-	IssuedAt  int64  `json:"iat,omitempty"`
-	Issuer    string `json:"iss,omitempty"`
-	NotBefore int64  `json:"nbf,omitempty"`
-	Subject   string `json:"sub,omitempty"`
-}
-
-// Validates time based claims "exp, iat, nbf".
-// There is no accounting for clock skew.
-// As well, if any of the above claims are not in the token, it will still
-// be considered a valid claim.
-func (c StandardClaims) Valid() error {
-	vErr := new(ValidationError)
-	now := TimeFunc().Unix()
-
-	// The claims below are optional, by default, so if they are set to the
-	// default value in Go, let's not fail the verification for them.
-	if c.VerifyExpiresAt(now, false) == false {
-		delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0))
-		vErr.Inner = fmt.Errorf("token is expired by %v", delta)
-		vErr.Errors |= ValidationErrorExpired
-	}
-
-	if c.VerifyIssuedAt(now, false) == false {
-		vErr.Inner = fmt.Errorf("Token used before issued")
-		vErr.Errors |= ValidationErrorIssuedAt
-	}
-
-	if c.VerifyNotBefore(now, false) == false {
-		vErr.Inner = fmt.Errorf("token is not valid yet")
-		vErr.Errors |= ValidationErrorNotValidYet
-	}
-
-	if vErr.valid() {
-		return nil
-	}
-
-	return vErr
-}
-
-// Compares the aud claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
-	return verifyAud(c.Audience, cmp, req)
-}
-
-// Compares the exp claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
-	return verifyExp(c.ExpiresAt, cmp, req)
-}
-
-// Compares the iat claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
-	return verifyIat(c.IssuedAt, cmp, req)
-}
-
-// Compares the iss claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
-	return verifyIss(c.Issuer, cmp, req)
-}
-
-// Compares the nbf claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
-	return verifyNbf(c.NotBefore, cmp, req)
-}
-
-// ----- helpers
-
-func verifyAud(aud string, cmp string, required bool) bool {
-	if aud == "" {
-		return !required
-	}
-	if subtle.ConstantTimeCompare([]byte(aud), []byte(cmp)) != 0 {
-		return true
-	} else {
-		return false
-	}
-}
-
-func verifyExp(exp int64, now int64, required bool) bool {
-	if exp == 0 {
-		return !required
-	}
-	return now <= exp
-}
-
-func verifyIat(iat int64, now int64, required bool) bool {
-	if iat == 0 {
-		return !required
-	}
-	return now >= iat
-}
-
-func verifyIss(iss string, cmp string, required bool) bool {
-	if iss == "" {
-		return !required
-	}
-	if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 {
-		return true
-	} else {
-		return false
-	}
-}
-
-func verifyNbf(nbf int64, now int64, required bool) bool {
-	if nbf == 0 {
-		return !required
-	}
-	return now >= nbf
-}

+ 0 - 4
vendor/github.com/dgrijalva/jwt-go/doc.go

@@ -1,4 +0,0 @@
-// Package jwt is a Go implementation of JSON Web Tokens: http://self-issued.info/docs/draft-jones-json-web-token.html
-//
-// See README.md for more info.
-package jwt

+ 0 - 147
vendor/github.com/dgrijalva/jwt-go/ecdsa.go

@@ -1,147 +0,0 @@
-package jwt
-
-import (
-	"crypto"
-	"crypto/ecdsa"
-	"crypto/rand"
-	"errors"
-	"math/big"
-)
-
-var (
-	// Sadly this is missing from crypto/ecdsa compared to crypto/rsa
-	ErrECDSAVerification = errors.New("crypto/ecdsa: verification error")
-)
-
-// Implements the ECDSA family of signing methods signing methods
-type SigningMethodECDSA struct {
-	Name      string
-	Hash      crypto.Hash
-	KeySize   int
-	CurveBits int
-}
-
-// Specific instances for EC256 and company
-var (
-	SigningMethodES256 *SigningMethodECDSA
-	SigningMethodES384 *SigningMethodECDSA
-	SigningMethodES512 *SigningMethodECDSA
-)
-
-func init() {
-	// ES256
-	SigningMethodES256 = &SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256}
-	RegisterSigningMethod(SigningMethodES256.Alg(), func() SigningMethod {
-		return SigningMethodES256
-	})
-
-	// ES384
-	SigningMethodES384 = &SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384}
-	RegisterSigningMethod(SigningMethodES384.Alg(), func() SigningMethod {
-		return SigningMethodES384
-	})
-
-	// ES512
-	SigningMethodES512 = &SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521}
-	RegisterSigningMethod(SigningMethodES512.Alg(), func() SigningMethod {
-		return SigningMethodES512
-	})
-}
-
-func (m *SigningMethodECDSA) Alg() string {
-	return m.Name
-}
-
-// Implements the Verify method from SigningMethod
-// For this verify method, key must be an ecdsa.PublicKey struct
-func (m *SigningMethodECDSA) Verify(signingString, signature string, key interface{}) error {
-	var err error
-
-	// Decode the signature
-	var sig []byte
-	if sig, err = DecodeSegment(signature); err != nil {
-		return err
-	}
-
-	// Get the key
-	var ecdsaKey *ecdsa.PublicKey
-	switch k := key.(type) {
-	case *ecdsa.PublicKey:
-		ecdsaKey = k
-	default:
-		return ErrInvalidKeyType
-	}
-
-	if len(sig) != 2*m.KeySize {
-		return ErrECDSAVerification
-	}
-
-	r := big.NewInt(0).SetBytes(sig[:m.KeySize])
-	s := big.NewInt(0).SetBytes(sig[m.KeySize:])
-
-	// Create hasher
-	if !m.Hash.Available() {
-		return ErrHashUnavailable
-	}
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	// Verify the signature
-	if verifystatus := ecdsa.Verify(ecdsaKey, hasher.Sum(nil), r, s); verifystatus == true {
-		return nil
-	} else {
-		return ErrECDSAVerification
-	}
-}
-
-// Implements the Sign method from SigningMethod
-// For this signing method, key must be an ecdsa.PrivateKey struct
-func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string, error) {
-	// Get the key
-	var ecdsaKey *ecdsa.PrivateKey
-	switch k := key.(type) {
-	case *ecdsa.PrivateKey:
-		ecdsaKey = k
-	default:
-		return "", ErrInvalidKeyType
-	}
-
-	// Create the hasher
-	if !m.Hash.Available() {
-		return "", ErrHashUnavailable
-	}
-
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	// Sign the string and return r, s
-	if r, s, err := ecdsa.Sign(rand.Reader, ecdsaKey, hasher.Sum(nil)); err == nil {
-		curveBits := ecdsaKey.Curve.Params().BitSize
-
-		if m.CurveBits != curveBits {
-			return "", ErrInvalidKey
-		}
-
-		keyBytes := curveBits / 8
-		if curveBits%8 > 0 {
-			keyBytes += 1
-		}
-
-		// We serialize the outpus (r and s) into big-endian byte arrays and pad
-		// them with zeros on the left to make sure the sizes work out. Both arrays
-		// must be keyBytes long, and the output must be 2*keyBytes long.
-		rBytes := r.Bytes()
-		rBytesPadded := make([]byte, keyBytes)
-		copy(rBytesPadded[keyBytes-len(rBytes):], rBytes)
-
-		sBytes := s.Bytes()
-		sBytesPadded := make([]byte, keyBytes)
-		copy(sBytesPadded[keyBytes-len(sBytes):], sBytes)
-
-		out := append(rBytesPadded, sBytesPadded...)
-
-		return EncodeSegment(out), nil
-	} else {
-		return "", err
-	}
-}

+ 0 - 67
vendor/github.com/dgrijalva/jwt-go/ecdsa_utils.go

@@ -1,67 +0,0 @@
-package jwt
-
-import (
-	"crypto/ecdsa"
-	"crypto/x509"
-	"encoding/pem"
-	"errors"
-)
-
-var (
-	ErrNotECPublicKey  = errors.New("Key is not a valid ECDSA public key")
-	ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key")
-)
-
-// Parse PEM encoded Elliptic Curve Private Key Structure
-func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) {
-	var err error
-
-	// Parse PEM block
-	var block *pem.Block
-	if block, _ = pem.Decode(key); block == nil {
-		return nil, ErrKeyMustBePEMEncoded
-	}
-
-	// Parse the key
-	var parsedKey interface{}
-	if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil {
-		return nil, err
-	}
-
-	var pkey *ecdsa.PrivateKey
-	var ok bool
-	if pkey, ok = parsedKey.(*ecdsa.PrivateKey); !ok {
-		return nil, ErrNotECPrivateKey
-	}
-
-	return pkey, nil
-}
-
-// Parse PEM encoded PKCS1 or PKCS8 public key
-func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) {
-	var err error
-
-	// Parse PEM block
-	var block *pem.Block
-	if block, _ = pem.Decode(key); block == nil {
-		return nil, ErrKeyMustBePEMEncoded
-	}
-
-	// Parse the key
-	var parsedKey interface{}
-	if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil {
-		if cert, err := x509.ParseCertificate(block.Bytes); err == nil {
-			parsedKey = cert.PublicKey
-		} else {
-			return nil, err
-		}
-	}
-
-	var pkey *ecdsa.PublicKey
-	var ok bool
-	if pkey, ok = parsedKey.(*ecdsa.PublicKey); !ok {
-		return nil, ErrNotECPublicKey
-	}
-
-	return pkey, nil
-}

+ 0 - 59
vendor/github.com/dgrijalva/jwt-go/errors.go

@@ -1,59 +0,0 @@
-package jwt
-
-import (
-	"errors"
-)
-
-// Error constants
-var (
-	ErrInvalidKey      = errors.New("key is invalid")
-	ErrInvalidKeyType  = errors.New("key is of invalid type")
-	ErrHashUnavailable = errors.New("the requested hash function is unavailable")
-)
-
-// The errors that might occur when parsing and validating a token
-const (
-	ValidationErrorMalformed        uint32 = 1 << iota // Token is malformed
-	ValidationErrorUnverifiable                        // Token could not be verified because of signing problems
-	ValidationErrorSignatureInvalid                    // Signature validation failed
-
-	// Standard Claim validation errors
-	ValidationErrorAudience      // AUD validation failed
-	ValidationErrorExpired       // EXP validation failed
-	ValidationErrorIssuedAt      // IAT validation failed
-	ValidationErrorIssuer        // ISS validation failed
-	ValidationErrorNotValidYet   // NBF validation failed
-	ValidationErrorId            // JTI validation failed
-	ValidationErrorClaimsInvalid // Generic claims validation error
-)
-
-// Helper for constructing a ValidationError with a string error message
-func NewValidationError(errorText string, errorFlags uint32) *ValidationError {
-	return &ValidationError{
-		text:   errorText,
-		Errors: errorFlags,
-	}
-}
-
-// The error from Parse if token is not valid
-type ValidationError struct {
-	Inner  error  // stores the error returned by external dependencies, i.e.: KeyFunc
-	Errors uint32 // bitfield.  see ValidationError... constants
-	text   string // errors that do not have a valid error just have text
-}
-
-// Validation error is an error type
-func (e ValidationError) Error() string {
-	if e.Inner != nil {
-		return e.Inner.Error()
-	} else if e.text != "" {
-		return e.text
-	} else {
-		return "token is invalid"
-	}
-}
-
-// No errors
-func (e *ValidationError) valid() bool {
-	return e.Errors == 0
-}

+ 0 - 94
vendor/github.com/dgrijalva/jwt-go/hmac.go

@@ -1,94 +0,0 @@
-package jwt
-
-import (
-	"crypto"
-	"crypto/hmac"
-	"errors"
-)
-
-// Implements the HMAC-SHA family of signing methods signing methods
-type SigningMethodHMAC struct {
-	Name string
-	Hash crypto.Hash
-}
-
-// Specific instances for HS256 and company
-var (
-	SigningMethodHS256  *SigningMethodHMAC
-	SigningMethodHS384  *SigningMethodHMAC
-	SigningMethodHS512  *SigningMethodHMAC
-	ErrSignatureInvalid = errors.New("signature is invalid")
-)
-
-func init() {
-	// HS256
-	SigningMethodHS256 = &SigningMethodHMAC{"HS256", crypto.SHA256}
-	RegisterSigningMethod(SigningMethodHS256.Alg(), func() SigningMethod {
-		return SigningMethodHS256
-	})
-
-	// HS384
-	SigningMethodHS384 = &SigningMethodHMAC{"HS384", crypto.SHA384}
-	RegisterSigningMethod(SigningMethodHS384.Alg(), func() SigningMethod {
-		return SigningMethodHS384
-	})
-
-	// HS512
-	SigningMethodHS512 = &SigningMethodHMAC{"HS512", crypto.SHA512}
-	RegisterSigningMethod(SigningMethodHS512.Alg(), func() SigningMethod {
-		return SigningMethodHS512
-	})
-}
-
-func (m *SigningMethodHMAC) Alg() string {
-	return m.Name
-}
-
-// Verify the signature of HSXXX tokens.  Returns nil if the signature is valid.
-func (m *SigningMethodHMAC) Verify(signingString, signature string, key interface{}) error {
-	// Verify the key is the right type
-	keyBytes, ok := key.([]byte)
-	if !ok {
-		return ErrInvalidKeyType
-	}
-
-	// Decode signature, for comparison
-	sig, err := DecodeSegment(signature)
-	if err != nil {
-		return err
-	}
-
-	// Can we use the specified hashing method?
-	if !m.Hash.Available() {
-		return ErrHashUnavailable
-	}
-
-	// This signing method is symmetric, so we validate the signature
-	// by reproducing the signature from the signing string and key, then
-	// comparing that against the provided signature.
-	hasher := hmac.New(m.Hash.New, keyBytes)
-	hasher.Write([]byte(signingString))
-	if !hmac.Equal(sig, hasher.Sum(nil)) {
-		return ErrSignatureInvalid
-	}
-
-	// No validation errors.  Signature is good.
-	return nil
-}
-
-// Implements the Sign method from SigningMethod for this signing method.
-// Key must be []byte
-func (m *SigningMethodHMAC) Sign(signingString string, key interface{}) (string, error) {
-	if keyBytes, ok := key.([]byte); ok {
-		if !m.Hash.Available() {
-			return "", ErrHashUnavailable
-		}
-
-		hasher := hmac.New(m.Hash.New, keyBytes)
-		hasher.Write([]byte(signingString))
-
-		return EncodeSegment(hasher.Sum(nil)), nil
-	}
-
-	return "", ErrInvalidKey
-}

+ 0 - 94
vendor/github.com/dgrijalva/jwt-go/map_claims.go

@@ -1,94 +0,0 @@
-package jwt
-
-import (
-	"encoding/json"
-	"errors"
-	// "fmt"
-)
-
-// Claims type that uses the map[string]interface{} for JSON decoding
-// This is the default claims type if you don't supply one
-type MapClaims map[string]interface{}
-
-// Compares the aud claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
-	aud, _ := m["aud"].(string)
-	return verifyAud(aud, cmp, req)
-}
-
-// Compares the exp claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
-	switch exp := m["exp"].(type) {
-	case float64:
-		return verifyExp(int64(exp), cmp, req)
-	case json.Number:
-		v, _ := exp.Int64()
-		return verifyExp(v, cmp, req)
-	}
-	return req == false
-}
-
-// Compares the iat claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
-	switch iat := m["iat"].(type) {
-	case float64:
-		return verifyIat(int64(iat), cmp, req)
-	case json.Number:
-		v, _ := iat.Int64()
-		return verifyIat(v, cmp, req)
-	}
-	return req == false
-}
-
-// Compares the iss claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
-	iss, _ := m["iss"].(string)
-	return verifyIss(iss, cmp, req)
-}
-
-// Compares the nbf claim against cmp.
-// If required is false, this method will return true if the value matches or is unset
-func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
-	switch nbf := m["nbf"].(type) {
-	case float64:
-		return verifyNbf(int64(nbf), cmp, req)
-	case json.Number:
-		v, _ := nbf.Int64()
-		return verifyNbf(v, cmp, req)
-	}
-	return req == false
-}
-
-// Validates time based claims "exp, iat, nbf".
-// There is no accounting for clock skew.
-// As well, if any of the above claims are not in the token, it will still
-// be considered a valid claim.
-func (m MapClaims) Valid() error {
-	vErr := new(ValidationError)
-	now := TimeFunc().Unix()
-
-	if m.VerifyExpiresAt(now, false) == false {
-		vErr.Inner = errors.New("Token is expired")
-		vErr.Errors |= ValidationErrorExpired
-	}
-
-	if m.VerifyIssuedAt(now, false) == false {
-		vErr.Inner = errors.New("Token used before issued")
-		vErr.Errors |= ValidationErrorIssuedAt
-	}
-
-	if m.VerifyNotBefore(now, false) == false {
-		vErr.Inner = errors.New("Token is not valid yet")
-		vErr.Errors |= ValidationErrorNotValidYet
-	}
-
-	if vErr.valid() {
-		return nil
-	}
-
-	return vErr
-}

+ 0 - 52
vendor/github.com/dgrijalva/jwt-go/none.go

@@ -1,52 +0,0 @@
-package jwt
-
-// Implements the none signing method.  This is required by the spec
-// but you probably should never use it.
-var SigningMethodNone *signingMethodNone
-
-const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed"
-
-var NoneSignatureTypeDisallowedError error
-
-type signingMethodNone struct{}
-type unsafeNoneMagicConstant string
-
-func init() {
-	SigningMethodNone = &signingMethodNone{}
-	NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid)
-
-	RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod {
-		return SigningMethodNone
-	})
-}
-
-func (m *signingMethodNone) Alg() string {
-	return "none"
-}
-
-// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key
-func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) {
-	// Key must be UnsafeAllowNoneSignatureType to prevent accidentally
-	// accepting 'none' signing method
-	if _, ok := key.(unsafeNoneMagicConstant); !ok {
-		return NoneSignatureTypeDisallowedError
-	}
-	// If signing method is none, signature must be an empty string
-	if signature != "" {
-		return NewValidationError(
-			"'none' signing method with non-empty signature",
-			ValidationErrorSignatureInvalid,
-		)
-	}
-
-	// Accept 'none' signing method.
-	return nil
-}
-
-// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key
-func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) {
-	if _, ok := key.(unsafeNoneMagicConstant); ok {
-		return "", nil
-	}
-	return "", NoneSignatureTypeDisallowedError
-}

+ 0 - 131
vendor/github.com/dgrijalva/jwt-go/parser.go

@@ -1,131 +0,0 @@
-package jwt
-
-import (
-	"bytes"
-	"encoding/json"
-	"fmt"
-	"strings"
-)
-
-type Parser struct {
-	ValidMethods         []string // If populated, only these methods will be considered valid
-	UseJSONNumber        bool     // Use JSON Number format in JSON decoder
-	SkipClaimsValidation bool     // Skip claims validation during token parsing
-}
-
-// Parse, validate, and return a token.
-// keyFunc will receive the parsed token and should return the key for validating.
-// If everything is kosher, err will be nil
-func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
-	return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
-}
-
-func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
-	parts := strings.Split(tokenString, ".")
-	if len(parts) != 3 {
-		return nil, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed)
-	}
-
-	var err error
-	token := &Token{Raw: tokenString}
-
-	// parse Header
-	var headerBytes []byte
-	if headerBytes, err = DecodeSegment(parts[0]); err != nil {
-		if strings.HasPrefix(strings.ToLower(tokenString), "bearer ") {
-			return token, NewValidationError("tokenstring should not contain 'bearer '", ValidationErrorMalformed)
-		}
-		return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
-	}
-	if err = json.Unmarshal(headerBytes, &token.Header); err != nil {
-		return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
-	}
-
-	// parse Claims
-	var claimBytes []byte
-	token.Claims = claims
-
-	if claimBytes, err = DecodeSegment(parts[1]); err != nil {
-		return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
-	}
-	dec := json.NewDecoder(bytes.NewBuffer(claimBytes))
-	if p.UseJSONNumber {
-		dec.UseNumber()
-	}
-	// JSON Decode.  Special case for map type to avoid weird pointer behavior
-	if c, ok := token.Claims.(MapClaims); ok {
-		err = dec.Decode(&c)
-	} else {
-		err = dec.Decode(&claims)
-	}
-	// Handle decode error
-	if err != nil {
-		return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
-	}
-
-	// Lookup signature method
-	if method, ok := token.Header["alg"].(string); ok {
-		if token.Method = GetSigningMethod(method); token.Method == nil {
-			return token, NewValidationError("signing method (alg) is unavailable.", ValidationErrorUnverifiable)
-		}
-	} else {
-		return token, NewValidationError("signing method (alg) is unspecified.", ValidationErrorUnverifiable)
-	}
-
-	// Verify signing method is in the required set
-	if p.ValidMethods != nil {
-		var signingMethodValid = false
-		var alg = token.Method.Alg()
-		for _, m := range p.ValidMethods {
-			if m == alg {
-				signingMethodValid = true
-				break
-			}
-		}
-		if !signingMethodValid {
-			// signing method is not in the listed set
-			return token, NewValidationError(fmt.Sprintf("signing method %v is invalid", alg), ValidationErrorSignatureInvalid)
-		}
-	}
-
-	// Lookup key
-	var key interface{}
-	if keyFunc == nil {
-		// keyFunc was not provided.  short circuiting validation
-		return token, NewValidationError("no Keyfunc was provided.", ValidationErrorUnverifiable)
-	}
-	if key, err = keyFunc(token); err != nil {
-		// keyFunc returned an error
-		return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable}
-	}
-
-	vErr := &ValidationError{}
-
-	// Validate Claims
-	if !p.SkipClaimsValidation {
-		if err := token.Claims.Valid(); err != nil {
-
-			// If the Claims Valid returned an error, check if it is a validation error,
-			// If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set
-			if e, ok := err.(*ValidationError); !ok {
-				vErr = &ValidationError{Inner: err, Errors: ValidationErrorClaimsInvalid}
-			} else {
-				vErr = e
-			}
-		}
-	}
-
-	// Perform validation
-	token.Signature = parts[2]
-	if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
-		vErr.Inner = err
-		vErr.Errors |= ValidationErrorSignatureInvalid
-	}
-
-	if vErr.valid() {
-		token.Valid = true
-		return token, nil
-	}
-
-	return token, vErr
-}

+ 0 - 100
vendor/github.com/dgrijalva/jwt-go/rsa.go

@@ -1,100 +0,0 @@
-package jwt
-
-import (
-	"crypto"
-	"crypto/rand"
-	"crypto/rsa"
-)
-
-// Implements the RSA family of signing methods signing methods
-type SigningMethodRSA struct {
-	Name string
-	Hash crypto.Hash
-}
-
-// Specific instances for RS256 and company
-var (
-	SigningMethodRS256 *SigningMethodRSA
-	SigningMethodRS384 *SigningMethodRSA
-	SigningMethodRS512 *SigningMethodRSA
-)
-
-func init() {
-	// RS256
-	SigningMethodRS256 = &SigningMethodRSA{"RS256", crypto.SHA256}
-	RegisterSigningMethod(SigningMethodRS256.Alg(), func() SigningMethod {
-		return SigningMethodRS256
-	})
-
-	// RS384
-	SigningMethodRS384 = &SigningMethodRSA{"RS384", crypto.SHA384}
-	RegisterSigningMethod(SigningMethodRS384.Alg(), func() SigningMethod {
-		return SigningMethodRS384
-	})
-
-	// RS512
-	SigningMethodRS512 = &SigningMethodRSA{"RS512", crypto.SHA512}
-	RegisterSigningMethod(SigningMethodRS512.Alg(), func() SigningMethod {
-		return SigningMethodRS512
-	})
-}
-
-func (m *SigningMethodRSA) Alg() string {
-	return m.Name
-}
-
-// Implements the Verify method from SigningMethod
-// For this signing method, must be an rsa.PublicKey structure.
-func (m *SigningMethodRSA) Verify(signingString, signature string, key interface{}) error {
-	var err error
-
-	// Decode the signature
-	var sig []byte
-	if sig, err = DecodeSegment(signature); err != nil {
-		return err
-	}
-
-	var rsaKey *rsa.PublicKey
-	var ok bool
-
-	if rsaKey, ok = key.(*rsa.PublicKey); !ok {
-		return ErrInvalidKeyType
-	}
-
-	// Create hasher
-	if !m.Hash.Available() {
-		return ErrHashUnavailable
-	}
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	// Verify the signature
-	return rsa.VerifyPKCS1v15(rsaKey, m.Hash, hasher.Sum(nil), sig)
-}
-
-// Implements the Sign method from SigningMethod
-// For this signing method, must be an rsa.PrivateKey structure.
-func (m *SigningMethodRSA) Sign(signingString string, key interface{}) (string, error) {
-	var rsaKey *rsa.PrivateKey
-	var ok bool
-
-	// Validate type of key
-	if rsaKey, ok = key.(*rsa.PrivateKey); !ok {
-		return "", ErrInvalidKey
-	}
-
-	// Create the hasher
-	if !m.Hash.Available() {
-		return "", ErrHashUnavailable
-	}
-
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	// Sign the string and return the encoded bytes
-	if sigBytes, err := rsa.SignPKCS1v15(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil)); err == nil {
-		return EncodeSegment(sigBytes), nil
-	} else {
-		return "", err
-	}
-}

+ 0 - 126
vendor/github.com/dgrijalva/jwt-go/rsa_pss.go

@@ -1,126 +0,0 @@
-// +build go1.4
-
-package jwt
-
-import (
-	"crypto"
-	"crypto/rand"
-	"crypto/rsa"
-)
-
-// Implements the RSAPSS family of signing methods signing methods
-type SigningMethodRSAPSS struct {
-	*SigningMethodRSA
-	Options *rsa.PSSOptions
-}
-
-// Specific instances for RS/PS and company
-var (
-	SigningMethodPS256 *SigningMethodRSAPSS
-	SigningMethodPS384 *SigningMethodRSAPSS
-	SigningMethodPS512 *SigningMethodRSAPSS
-)
-
-func init() {
-	// PS256
-	SigningMethodPS256 = &SigningMethodRSAPSS{
-		&SigningMethodRSA{
-			Name: "PS256",
-			Hash: crypto.SHA256,
-		},
-		&rsa.PSSOptions{
-			SaltLength: rsa.PSSSaltLengthAuto,
-			Hash:       crypto.SHA256,
-		},
-	}
-	RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod {
-		return SigningMethodPS256
-	})
-
-	// PS384
-	SigningMethodPS384 = &SigningMethodRSAPSS{
-		&SigningMethodRSA{
-			Name: "PS384",
-			Hash: crypto.SHA384,
-		},
-		&rsa.PSSOptions{
-			SaltLength: rsa.PSSSaltLengthAuto,
-			Hash:       crypto.SHA384,
-		},
-	}
-	RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod {
-		return SigningMethodPS384
-	})
-
-	// PS512
-	SigningMethodPS512 = &SigningMethodRSAPSS{
-		&SigningMethodRSA{
-			Name: "PS512",
-			Hash: crypto.SHA512,
-		},
-		&rsa.PSSOptions{
-			SaltLength: rsa.PSSSaltLengthAuto,
-			Hash:       crypto.SHA512,
-		},
-	}
-	RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod {
-		return SigningMethodPS512
-	})
-}
-
-// Implements the Verify method from SigningMethod
-// For this verify method, key must be an rsa.PublicKey struct
-func (m *SigningMethodRSAPSS) Verify(signingString, signature string, key interface{}) error {
-	var err error
-
-	// Decode the signature
-	var sig []byte
-	if sig, err = DecodeSegment(signature); err != nil {
-		return err
-	}
-
-	var rsaKey *rsa.PublicKey
-	switch k := key.(type) {
-	case *rsa.PublicKey:
-		rsaKey = k
-	default:
-		return ErrInvalidKey
-	}
-
-	// Create hasher
-	if !m.Hash.Available() {
-		return ErrHashUnavailable
-	}
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	return rsa.VerifyPSS(rsaKey, m.Hash, hasher.Sum(nil), sig, m.Options)
-}
-
-// Implements the Sign method from SigningMethod
-// For this signing method, key must be an rsa.PrivateKey struct
-func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) (string, error) {
-	var rsaKey *rsa.PrivateKey
-
-	switch k := key.(type) {
-	case *rsa.PrivateKey:
-		rsaKey = k
-	default:
-		return "", ErrInvalidKeyType
-	}
-
-	// Create the hasher
-	if !m.Hash.Available() {
-		return "", ErrHashUnavailable
-	}
-
-	hasher := m.Hash.New()
-	hasher.Write([]byte(signingString))
-
-	// Sign the string and return the encoded bytes
-	if sigBytes, err := rsa.SignPSS(rand.Reader, rsaKey, m.Hash, hasher.Sum(nil), m.Options); err == nil {
-		return EncodeSegment(sigBytes), nil
-	} else {
-		return "", err
-	}
-}

+ 0 - 69
vendor/github.com/dgrijalva/jwt-go/rsa_utils.go

@@ -1,69 +0,0 @@
-package jwt
-
-import (
-	"crypto/rsa"
-	"crypto/x509"
-	"encoding/pem"
-	"errors"
-)
-
-var (
-	ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key")
-	ErrNotRSAPrivateKey    = errors.New("Key is not a valid RSA private key")
-	ErrNotRSAPublicKey     = errors.New("Key is not a valid RSA public key")
-)
-
-// Parse PEM encoded PKCS1 or PKCS8 private key
-func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) {
-	var err error
-
-	// Parse PEM block
-	var block *pem.Block
-	if block, _ = pem.Decode(key); block == nil {
-		return nil, ErrKeyMustBePEMEncoded
-	}
-
-	var parsedKey interface{}
-	if parsedKey, err = x509.ParsePKCS1PrivateKey(block.Bytes); err != nil {
-		if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
-			return nil, err
-		}
-	}
-
-	var pkey *rsa.PrivateKey
-	var ok bool
-	if pkey, ok = parsedKey.(*rsa.PrivateKey); !ok {
-		return nil, ErrNotRSAPrivateKey
-	}
-
-	return pkey, nil
-}
-
-// Parse PEM encoded PKCS1 or PKCS8 public key
-func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) {
-	var err error
-
-	// Parse PEM block
-	var block *pem.Block
-	if block, _ = pem.Decode(key); block == nil {
-		return nil, ErrKeyMustBePEMEncoded
-	}
-
-	// Parse the key
-	var parsedKey interface{}
-	if parsedKey, err = x509.ParsePKIXPublicKey(block.Bytes); err != nil {
-		if cert, err := x509.ParseCertificate(block.Bytes); err == nil {
-			parsedKey = cert.PublicKey
-		} else {
-			return nil, err
-		}
-	}
-
-	var pkey *rsa.PublicKey
-	var ok bool
-	if pkey, ok = parsedKey.(*rsa.PublicKey); !ok {
-		return nil, ErrNotRSAPublicKey
-	}
-
-	return pkey, nil
-}

+ 0 - 35
vendor/github.com/dgrijalva/jwt-go/signing_method.go

@@ -1,35 +0,0 @@
-package jwt
-
-import (
-	"sync"
-)
-
-var signingMethods = map[string]func() SigningMethod{}
-var signingMethodLock = new(sync.RWMutex)
-
-// Implement SigningMethod to add new methods for signing or verifying tokens.
-type SigningMethod interface {
-	Verify(signingString, signature string, key interface{}) error // Returns nil if signature is valid
-	Sign(signingString string, key interface{}) (string, error)    // Returns encoded signature or error
-	Alg() string                                                   // returns the alg identifier for this method (example: 'HS256')
-}
-
-// Register the "alg" name and a factory function for signing method.
-// This is typically done during init() in the method's implementation
-func RegisterSigningMethod(alg string, f func() SigningMethod) {
-	signingMethodLock.Lock()
-	defer signingMethodLock.Unlock()
-
-	signingMethods[alg] = f
-}
-
-// Get a signing method from an "alg" string
-func GetSigningMethod(alg string) (method SigningMethod) {
-	signingMethodLock.RLock()
-	defer signingMethodLock.RUnlock()
-
-	if methodF, ok := signingMethods[alg]; ok {
-		method = methodF()
-	}
-	return
-}

+ 0 - 108
vendor/github.com/dgrijalva/jwt-go/token.go

@@ -1,108 +0,0 @@
-package jwt
-
-import (
-	"encoding/base64"
-	"encoding/json"
-	"strings"
-	"time"
-)
-
-// TimeFunc provides the current time when parsing token to validate "exp" claim (expiration time).
-// You can override it to use another time value.  This is useful for testing or if your
-// server uses a different time zone than your tokens.
-var TimeFunc = time.Now
-
-// Parse methods use this callback function to supply
-// the key for verification.  The function receives the parsed,
-// but unverified Token.  This allows you to use properties in the
-// Header of the token (such as `kid`) to identify which key to use.
-type Keyfunc func(*Token) (interface{}, error)
-
-// A JWT Token.  Different fields will be used depending on whether you're
-// creating or parsing/verifying a token.
-type Token struct {
-	Raw       string                 // The raw token.  Populated when you Parse a token
-	Method    SigningMethod          // The signing method used or to be used
-	Header    map[string]interface{} // The first segment of the token
-	Claims    Claims                 // The second segment of the token
-	Signature string                 // The third segment of the token.  Populated when you Parse a token
-	Valid     bool                   // Is the token valid?  Populated when you Parse/Verify a token
-}
-
-// Create a new Token.  Takes a signing method
-func New(method SigningMethod) *Token {
-	return NewWithClaims(method, MapClaims{})
-}
-
-func NewWithClaims(method SigningMethod, claims Claims) *Token {
-	return &Token{
-		Header: map[string]interface{}{
-			"typ": "JWT",
-			"alg": method.Alg(),
-		},
-		Claims: claims,
-		Method: method,
-	}
-}
-
-// Get the complete, signed token
-func (t *Token) SignedString(key interface{}) (string, error) {
-	var sig, sstr string
-	var err error
-	if sstr, err = t.SigningString(); err != nil {
-		return "", err
-	}
-	if sig, err = t.Method.Sign(sstr, key); err != nil {
-		return "", err
-	}
-	return strings.Join([]string{sstr, sig}, "."), nil
-}
-
-// Generate the signing string.  This is the
-// most expensive part of the whole deal.  Unless you
-// need this for something special, just go straight for
-// the SignedString.
-func (t *Token) SigningString() (string, error) {
-	var err error
-	parts := make([]string, 2)
-	for i, _ := range parts {
-		var jsonValue []byte
-		if i == 0 {
-			if jsonValue, err = json.Marshal(t.Header); err != nil {
-				return "", err
-			}
-		} else {
-			if jsonValue, err = json.Marshal(t.Claims); err != nil {
-				return "", err
-			}
-		}
-
-		parts[i] = EncodeSegment(jsonValue)
-	}
-	return strings.Join(parts, "."), nil
-}
-
-// Parse, validate, and return a token.
-// keyFunc will receive the parsed token and should return the key for validating.
-// If everything is kosher, err will be nil
-func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
-	return new(Parser).Parse(tokenString, keyFunc)
-}
-
-func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
-	return new(Parser).ParseWithClaims(tokenString, claims, keyFunc)
-}
-
-// Encode JWT specific base64url encoding with padding stripped
-func EncodeSegment(seg []byte) string {
-	return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=")
-}
-
-// Decode JWT specific base64url encoding with padding stripped
-func DecodeSegment(seg string) ([]byte, error) {
-	if l := len(seg) % 4; l > 0 {
-		seg += strings.Repeat("=", 4-l)
-	}
-
-	return base64.URLEncoding.DecodeString(seg)
-}

+ 0 - 8
vendor/github.com/go-sql-driver/mysql/.gitignore

@@ -1,8 +0,0 @@
-.DS_Store
-.DS_Store?
-._*
-.Spotlight-V100
-.Trashes
-Icon?
-ehthumbs.db
-Thumbs.db

+ 0 - 13
vendor/github.com/go-sql-driver/mysql/.travis.yml

@@ -1,13 +0,0 @@
-sudo: false
-language: go
-go:
-  - 1.2
-  - 1.3
-  - 1.4
-  - 1.5
-  - 1.6
-  - 1.7
-  - tip
-
-before_script:
-  - mysql -e 'create database gotest;'

+ 0 - 57
vendor/github.com/go-sql-driver/mysql/AUTHORS

@@ -1,57 +0,0 @@
-# This is the official list of Go-MySQL-Driver authors for copyright purposes.
-
-# If you are submitting a patch, please add your name or the name of the
-# organization which holds the copyright to this list in alphabetical order.
-
-# Names should be added to this file as
-#	Name <email address>
-# The email address is not required for organizations.
-# Please keep the list sorted.
-
-
-# Individual Persons
-
-Aaron Hopkins <go-sql-driver at die.net>
-Arne Hormann <arnehormann at gmail.com>
-Carlos Nieto <jose.carlos at menteslibres.net>
-Chris Moos <chris at tech9computers.com>
-Daniel Nichter <nil at codenode.com>
-Daniël van Eeden <git at myname.nl>
-DisposaBoy <disposaboy at dby.me>
-Egor Smolyakov <egorsmkv at gmail.com>
-Frederick Mayle <frederickmayle at gmail.com>
-Gustavo Kristic <gkristic at gmail.com>
-Hanno Braun <mail at hannobraun.com>
-Henri Yandell <flamefew at gmail.com>
-Hirotaka Yamamoto <ymmt2005 at gmail.com>
-INADA Naoki <songofacandy at gmail.com>
-James Harr <james.harr at gmail.com>
-Jian Zhen <zhenjl at gmail.com>
-Joshua Prunier <joshua.prunier at gmail.com>
-Julien Lefevre <julien.lefevr at gmail.com>
-Julien Schmidt <go-sql-driver at julienschmidt.com>
-Kamil Dziedzic <kamil at klecza.pl>
-Kevin Malachowski <kevin at chowski.com>
-Lennart Rudolph <lrudolph at hmc.edu>
-Leonardo YongUk Kim <dalinaum at gmail.com>
-Luca Looz <luca.looz92 at gmail.com>
-Lucas Liu <extrafliu at gmail.com>
-Luke Scott <luke at webconnex.com>
-Michael Woolnough <michael.woolnough at gmail.com>
-Nicola Peduzzi <thenikso at gmail.com>
-Olivier Mengué <dolmen at cpan.org>
-Paul Bonser <misterpib at gmail.com>
-Runrioter Wung <runrioter at gmail.com>
-Soroush Pour <me at soroushjp.com>
-Stan Putrya <root.vagner at gmail.com>
-Stanley Gunawan <gunawan.stanley at gmail.com>
-Xiangyu Hu <xiangyu.hu at outlook.com>
-Xiaobing Jiang <s7v7nislands at gmail.com>
-Xiuming Chen <cc at cxm.cc>
-Zhenye Xie <xiezhenye at gmail.com>
-
-# Organizations
-
-Barracuda Networks, Inc.
-Google Inc.
-Stripe Inc.

+ 0 - 119
vendor/github.com/go-sql-driver/mysql/CHANGELOG.md

@@ -1,119 +0,0 @@
-## Version 1.3 (2016-12-01)
-
-Changes:
-
- - Go 1.1 is no longer supported
- - Use decimals fields in MySQL to format time types (#249)
- - Buffer optimizations (#269)
- - TLS ServerName defaults to the host (#283)
- - Refactoring (#400, #410, #437)
- - Adjusted documentation for second generation CloudSQL (#485)
- - Documented DSN system var quoting rules (#502)
- - Made statement.Close() calls idempotent to avoid errors in Go 1.6+ (#512)
-
-New Features:
-
- - Enable microsecond resolution on TIME, DATETIME and TIMESTAMP (#249)
- - Support for returning table alias on Columns() (#289, #359, #382)
- - Placeholder interpolation, can be actived with the DSN parameter `interpolateParams=true` (#309, #318, #490)
- - Support for uint64 parameters with high bit set (#332, #345)
- - Cleartext authentication plugin support (#327)
- - Exported ParseDSN function and the Config struct (#403, #419, #429)
- - Read / Write timeouts (#401)
- - Support for JSON field type (#414)
- - Support for multi-statements and multi-results (#411, #431)
- - DSN parameter to set the driver-side max_allowed_packet value manually (#489)
- - Native password authentication plugin support (#494, #524)
-
-Bugfixes:
-
- - Fixed handling of queries without columns and rows (#255)
- - Fixed a panic when SetKeepAlive() failed (#298)
- - Handle ERR packets while reading rows (#321)
- - Fixed reading NULL length-encoded integers in MySQL 5.6+ (#349)
- - Fixed absolute paths support in LOAD LOCAL DATA INFILE (#356)
- - Actually zero out bytes in handshake response (#378)
- - Fixed race condition in registering LOAD DATA INFILE handler (#383)
- - Fixed tests with MySQL 5.7.9+ (#380)
- - QueryUnescape TLS config names (#397)
- - Fixed "broken pipe" error by writing to closed socket (#390)
- - Fixed LOAD LOCAL DATA INFILE buffering (#424)
- - Fixed parsing of floats into float64 when placeholders are used (#434)
- - Fixed DSN tests with Go 1.7+ (#459)
- - Handle ERR packets while waiting for EOF (#473)
- - Invalidate connection on error while discarding additional results (#513)
- - Allow terminating packets of length 0 (#516)
-
-
-## Version 1.2 (2014-06-03)
-
-Changes:
-
- - We switched back to a "rolling release". `go get` installs the current master branch again
- - Version v1 of the driver will not be maintained anymore. Go 1.0 is no longer supported by this driver
- - Exported errors to allow easy checking from application code
- - Enabled TCP Keepalives on TCP connections
- - Optimized INFILE handling (better buffer size calculation, lazy init, ...)
- - The DSN parser also checks for a missing separating slash
- - Faster binary date / datetime to string formatting
- - Also exported the MySQLWarning type
- - mysqlConn.Close returns the first error encountered instead of ignoring all errors
- - writePacket() automatically writes the packet size to the header
- - readPacket() uses an iterative approach instead of the recursive approach to merge splitted packets
-
-New Features:
-
- - `RegisterDial` allows the usage of a custom dial function to establish the network connection
- - Setting the connection collation is possible with the `collation` DSN parameter. This parameter should be preferred over the `charset` parameter
- - Logging of critical errors is configurable with `SetLogger`
- - Google CloudSQL support
-
-Bugfixes:
-
- - Allow more than 32 parameters in prepared statements
- - Various old_password fixes
- - Fixed TestConcurrent test to pass Go's race detection
- - Fixed appendLengthEncodedInteger for large numbers
- - Renamed readLengthEnodedString to readLengthEncodedString and skipLengthEnodedString to skipLengthEncodedString (fixed typo)
-
-
-## Version 1.1 (2013-11-02)
-
-Changes:
-
-  - Go-MySQL-Driver now requires Go 1.1
-  - Connections now use the collation `utf8_general_ci` by default. Adding `&charset=UTF8` to the DSN should not be necessary anymore
-  - Made closing rows and connections error tolerant. This allows for example deferring rows.Close() without checking for errors
-  - `[]byte(nil)` is now treated as a NULL value. Before, it was treated like an empty string / `[]byte("")`
-  - DSN parameter values must now be url.QueryEscape'ed. This allows text values to contain special characters, such as '&'.
-  - Use the IO buffer also for writing. This results in zero allocations (by the driver) for most queries
-  - Optimized the buffer for reading
-  - stmt.Query now caches column metadata
-  - New Logo
-  - Changed the copyright header to include all contributors
-  - Improved the LOAD INFILE documentation
-  - The driver struct is now exported to make the driver directly accessible
-  - Refactored the driver tests
-  - Added more benchmarks and moved all to a separate file
-  - Other small refactoring
-
-New Features:
-
-  - Added *old_passwords* support: Required in some cases, but must be enabled by adding `allowOldPasswords=true` to the DSN since it is insecure
-  - Added a `clientFoundRows` parameter: Return the number of matching rows instead of the number of rows changed on UPDATEs
-  - Added TLS/SSL support: Use a TLS/SSL encrypted connection to the server. Custom TLS configs can be registered and used
-
-Bugfixes:
-
-  - Fixed MySQL 4.1 support: MySQL 4.1 sends packets with lengths which differ from the specification
-  - Convert to DB timezone when inserting `time.Time`
-  - Splitted packets (more than 16MB) are now merged correctly
-  - Fixed false positive `io.EOF` errors when the data was fully read
-  - Avoid panics on reuse of closed connections
-  - Fixed empty string producing false nil values
-  - Fixed sign byte for positive TIME fields
-
-
-## Version 1.0 (2013-05-14)
-
-Initial Release

+ 0 - 23
vendor/github.com/go-sql-driver/mysql/CONTRIBUTING.md

@@ -1,23 +0,0 @@
-# Contributing Guidelines
-
-## Reporting Issues
-
-Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed).
-
-## Contributing Code
-
-By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file.
-Don't forget to add yourself to the AUTHORS file.
-
-### Code Review
-
-Everyone is invited to review and comment on pull requests.
-If it looks fine to you, comment with "LGTM" (Looks good to me).
-
-If changes are required, notice the reviewers with "PTAL" (Please take another look) after committing the fixes.
-
-Before merging the Pull Request, at least one [team member](https://github.com/go-sql-driver?tab=members) must have commented with "LGTM".
-
-## Development Ideas
-
-If you are looking for ideas for code contributions, please check our [Development Ideas](https://github.com/go-sql-driver/mysql/wiki/Development-Ideas) Wiki page.

+ 0 - 373
vendor/github.com/go-sql-driver/mysql/LICENSE

@@ -1,373 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
-    means each individual or legal entity that creates, contributes to
-    the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
-    means the combination of the Contributions of others (if any) used
-    by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
-    means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
-    means Source Code Form to which the initial Contributor has attached
-    the notice in Exhibit A, the Executable Form of such Source Code
-    Form, and Modifications of such Source Code Form, in each case
-    including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
-    means
-
-    (a) that the initial Contributor has attached the notice described
-        in Exhibit B to the Covered Software; or
-
-    (b) that the Covered Software was made available under the terms of
-        version 1.1 or earlier of the License, but not also under the
-        terms of a Secondary License.
-
-1.6. "Executable Form"
-    means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
-    means a work that combines Covered Software with other material, in 
-    a separate file or files, that is not Covered Software.
-
-1.8. "License"
-    means this document.
-
-1.9. "Licensable"
-    means having the right to grant, to the maximum extent possible,
-    whether at the time of the initial grant or subsequently, any and
-    all of the rights conveyed by this License.
-
-1.10. "Modifications"
-    means any of the following:
-
-    (a) any file in Source Code Form that results from an addition to,
-        deletion from, or modification of the contents of Covered
-        Software; or
-
-    (b) any new file in Source Code Form that contains any Covered
-        Software.
-
-1.11. "Patent Claims" of a Contributor
-    means any patent claim(s), including without limitation, method,
-    process, and apparatus claims, in any patent Licensable by such
-    Contributor that would be infringed, but for the grant of the
-    License, by the making, using, selling, offering for sale, having
-    made, import, or transfer of either its Contributions or its
-    Contributor Version.
-
-1.12. "Secondary License"
-    means either the GNU General Public License, Version 2.0, the GNU
-    Lesser General Public License, Version 2.1, the GNU Affero General
-    Public License, Version 3.0, or any later versions of those
-    licenses.
-
-1.13. "Source Code Form"
-    means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
-    means an individual or a legal entity exercising rights under this
-    License. For legal entities, "You" includes any entity that
-    controls, is controlled by, or is under common control with You. For
-    purposes of this definition, "control" means (a) the power, direct
-    or indirect, to cause the direction or management of such entity,
-    whether by contract or otherwise, or (b) ownership of more than
-    fifty percent (50%) of the outstanding shares or beneficial
-    ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
-    Licensable by such Contributor to use, reproduce, make available,
-    modify, display, perform, distribute, and otherwise exploit its
-    Contributions, either on an unmodified basis, with Modifications, or
-    as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
-    for sale, have made, import, and otherwise transfer either its
-    Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
-    or
-
-(b) for infringements caused by: (i) Your and any other third party's
-    modifications of Covered Software, or (ii) the combination of its
-    Contributions with other software (except as part of its Contributor
-    Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
-    its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
-    Form, as described in Section 3.1, and You must inform recipients of
-    the Executable Form how they can obtain a copy of such Source Code
-    Form by reasonable means in a timely manner, at a charge no more
-    than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
-    License, or sublicense it under different terms, provided that the
-    license for the Executable Form does not attempt to limit or alter
-    the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-*                                                                      *
-*  6. Disclaimer of Warranty                                           *
-*  -------------------------                                           *
-*                                                                      *
-*  Covered Software is provided under this License on an "as is"       *
-*  basis, without warranty of any kind, either expressed, implied, or  *
-*  statutory, including, without limitation, warranties that the       *
-*  Covered Software is free of defects, merchantable, fit for a        *
-*  particular purpose or non-infringing. The entire risk as to the     *
-*  quality and performance of the Covered Software is with You.        *
-*  Should any Covered Software prove defective in any respect, You     *
-*  (not any Contributor) assume the cost of any necessary servicing,   *
-*  repair, or correction. This disclaimer of warranty constitutes an   *
-*  essential part of this License. No use of any Covered Software is   *
-*  authorized under this License except under this disclaimer.         *
-*                                                                      *
-************************************************************************
-
-************************************************************************
-*                                                                      *
-*  7. Limitation of Liability                                          *
-*  --------------------------                                          *
-*                                                                      *
-*  Under no circumstances and under no legal theory, whether tort      *
-*  (including negligence), contract, or otherwise, shall any           *
-*  Contributor, or anyone who distributes Covered Software as          *
-*  permitted above, be liable to You for any direct, indirect,         *
-*  special, incidental, or consequential damages of any character      *
-*  including, without limitation, damages for lost profits, loss of    *
-*  goodwill, work stoppage, computer failure or malfunction, or any    *
-*  and all other commercial damages or losses, even if such party      *
-*  shall have been informed of the possibility of such damages. This   *
-*  limitation of liability shall not apply to liability for death or   *
-*  personal injury resulting from such party's negligence to the       *
-*  extent applicable law prohibits such limitation. Some               *
-*  jurisdictions do not allow the exclusion or limitation of           *
-*  incidental or consequential damages, so this exclusion and          *
-*  limitation may not apply to You.                                    *
-*                                                                      *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
-  This Source Code Form is subject to the terms of the Mozilla Public
-  License, v. 2.0. If a copy of the MPL was not distributed with this
-  file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
-  This Source Code Form is "Incompatible With Secondary Licenses", as
-  defined by the Mozilla Public License, v. 2.0.

+ 0 - 443
vendor/github.com/go-sql-driver/mysql/README.md

@@ -1,443 +0,0 @@
-# Go-MySQL-Driver
-
-A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) package
-
-![Go-MySQL-Driver logo](https://raw.github.com/wiki/go-sql-driver/mysql/gomysql_m.png "Golang Gopher holding the MySQL Dolphin")
-
----------------------------------------
-  * [Features](#features)
-  * [Requirements](#requirements)
-  * [Installation](#installation)
-  * [Usage](#usage)
-    * [DSN (Data Source Name)](#dsn-data-source-name)
-      * [Password](#password)
-      * [Protocol](#protocol)
-      * [Address](#address)
-      * [Parameters](#parameters)
-      * [Examples](#examples)
-    * [LOAD DATA LOCAL INFILE support](#load-data-local-infile-support)
-    * [time.Time support](#timetime-support)
-    * [Unicode support](#unicode-support)
-  * [Testing / Development](#testing--development)
-  * [License](#license)
-
----------------------------------------
-
-## Features
-  * Lightweight and [fast](https://github.com/go-sql-driver/sql-benchmark "golang MySQL-Driver performance")
-  * Native Go implementation. No C-bindings, just pure Go
-  * Connections over TCP/IPv4, TCP/IPv6, Unix domain sockets or [custom protocols](https://godoc.org/github.com/go-sql-driver/mysql#DialFunc)
-  * Automatic handling of broken connections
-  * Automatic Connection Pooling *(by database/sql package)*
-  * Supports queries larger than 16MB
-  * Full [`sql.RawBytes`](https://golang.org/pkg/database/sql/#RawBytes) support.
-  * Intelligent `LONG DATA` handling in prepared statements
-  * Secure `LOAD DATA LOCAL INFILE` support with file Whitelisting and `io.Reader` support
-  * Optional `time.Time` parsing
-  * Optional placeholder interpolation
-
-## Requirements
-  * Go 1.2 or higher
-  * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
-
----------------------------------------
-
-## Installation
-Simple install the package to your [$GOPATH](https://github.com/golang/go/wiki/GOPATH "GOPATH") with the [go tool](https://golang.org/cmd/go/ "go command") from shell:
-```bash
-$ go get github.com/go-sql-driver/mysql
-```
-Make sure [Git is installed](https://git-scm.com/downloads) on your machine and in your system's `PATH`.
-
-## Usage
-_Go MySQL Driver_ is an implementation of Go's `database/sql/driver` interface. You only need to import the driver and can use the full [`database/sql`](https://golang.org/pkg/database/sql/) API then.
-
-Use `mysql` as `driverName` and a valid [DSN](#dsn-data-source-name)  as `dataSourceName`:
-```go
-import "database/sql"
-import _ "github.com/go-sql-driver/mysql"
-
-db, err := sql.Open("mysql", "user:password@/dbname")
-```
-
-[Examples are available in our Wiki](https://github.com/go-sql-driver/mysql/wiki/Examples "Go-MySQL-Driver Examples").
-
-
-### DSN (Data Source Name)
-
-The Data Source Name has a common format, like e.g. [PEAR DB](http://pear.php.net/manual/en/package.database.db.intro-dsn.php) uses it, but without type-prefix (optional parts marked by squared brackets):
-```
-[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...&paramN=valueN]
-```
-
-A DSN in its fullest form:
-```
-username:password@protocol(address)/dbname?param=value
-```
-
-Except for the databasename, all values are optional. So the minimal DSN is:
-```
-/dbname
-```
-
-If you do not want to preselect a database, leave `dbname` empty:
-```
-/
-```
-This has the same effect as an empty DSN string:
-```
-
-```
-
-Alternatively, [Config.FormatDSN](https://godoc.org/github.com/go-sql-driver/mysql#Config.FormatDSN) can be used to create a DSN string by filling a struct.
-
-#### Password
-Passwords can consist of any character. Escaping is **not** necessary.
-
-#### Protocol
-See [net.Dial](https://golang.org/pkg/net/#Dial) for more information which networks are available.
-In general you should use an Unix domain socket if available and TCP otherwise for best performance.
-
-#### Address
-For TCP and UDP networks, addresses have the form `host:port`.
-If `host` is a literal IPv6 address, it must be enclosed in square brackets.
-The functions [net.JoinHostPort](https://golang.org/pkg/net/#JoinHostPort) and [net.SplitHostPort](https://golang.org/pkg/net/#SplitHostPort) manipulate addresses in this form.
-
-For Unix domain sockets the address is the absolute path to the MySQL-Server-socket, e.g. `/var/run/mysqld/mysqld.sock` or `/tmp/mysql.sock`.
-
-#### Parameters
-*Parameters are case-sensitive!*
-
-Notice that any of `true`, `TRUE`, `True` or `1` is accepted to stand for a true boolean value. Not surprisingly, false can be specified as any of: `false`, `FALSE`, `False` or `0`.
-
-##### `allowAllFiles`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-`allowAllFiles=true` disables the file Whitelist for `LOAD DATA LOCAL INFILE` and allows *all* files.
-[*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)
-
-##### `allowCleartextPasswords`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-`allowCleartextPasswords=true` allows using the [cleartext client side plugin](http://dev.mysql.com/doc/en/cleartext-authentication-plugin.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
-
-##### `allowNativePasswords`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-`allowNativePasswords=true` allows the usage of the mysql native password method.
-
-##### `allowOldPasswords`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-`allowOldPasswords=true` allows the usage of the insecure old password method. This should be avoided, but is necessary in some cases. See also [the old_passwords wiki page](https://github.com/go-sql-driver/mysql/wiki/old_passwords).
-
-##### `charset`
-
-```
-Type:           string
-Valid Values:   <name>
-Default:        none
-```
-
-Sets the charset used for client-server interaction (`"SET NAMES <value>"`). If multiple charsets are set (separated by a comma), the following charset is used if setting the charset failes. This enables for example support for `utf8mb4` ([introduced in MySQL 5.5.3](http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html)) with fallback to `utf8` for older servers (`charset=utf8mb4,utf8`).
-
-Usage of the `charset` parameter is discouraged because it issues additional queries to the server.
-Unless you need the fallback behavior, please use `collation` instead.
-
-##### `collation`
-
-```
-Type:           string
-Valid Values:   <name>
-Default:        utf8_general_ci
-```
-
-Sets the collation used for client-server interaction on connection. In contrast to `charset`, `collation` does not issue additional queries. If the specified collation is unavailable on the target server, the connection will fail.
-
-A list of valid charsets for a server is retrievable with `SHOW COLLATION`.
-
-##### `clientFoundRows`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-`clientFoundRows=true` causes an UPDATE to return the number of matching rows instead of the number of rows changed.
-
-##### `columnsWithAlias`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-When `columnsWithAlias` is true, calls to `sql.Rows.Columns()` will return the table alias and the column name separated by a dot. For example:
-
-```
-SELECT u.id FROM users as u
-```
-
-will return `u.id` instead of just `id` if `columnsWithAlias=true`.
-
-##### `interpolateParams`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-If `interpolateParams` is true, placeholders (`?`) in calls to `db.Query()` and `db.Exec()` are interpolated into a single query string with given parameters. This reduces the number of roundtrips, since the driver has to prepare a statement, execute it with given parameters and close the statement again with `interpolateParams=false`.
-
-*This can not be used together with the multibyte encodings BIG5, CP932, GB2312, GBK or SJIS. These are blacklisted as they may [introduce a SQL injection vulnerability](http://stackoverflow.com/a/12118602/3430118)!*
-
-##### `loc`
-
-```
-Type:           string
-Valid Values:   <escaped name>
-Default:        UTC
-```
-
-Sets the location for time.Time values (when using `parseTime=true`). *"Local"* sets the system's location. See [time.LoadLocation](https://golang.org/pkg/time/#LoadLocation) for details.
-
-Note that this sets the location for time.Time values but does not change MySQL's [time_zone setting](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html). For that see the [time_zone system variable](#system-variables), which can also be set as a DSN parameter.
-
-Please keep in mind, that param values must be [url.QueryEscape](https://golang.org/pkg/net/url/#QueryEscape)'ed. Alternatively you can manually replace the `/` with `%2F`. For example `US/Pacific` would be `loc=US%2FPacific`.
-
-##### `maxAllowedPacket`
-```
-Type:          decimal number
-Default:       0
-```
-
-Max packet size allowed in bytes. Use `maxAllowedPacket=0` to automatically fetch the `max_allowed_packet` variable from server.
-
-##### `multiStatements`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-Allow multiple statements in one query. While this allows batch queries, it also greatly increases the risk of SQL injections. Only the result of the first query is returned, all other results are silently discarded.
-
-When `multiStatements` is used, `?` parameters must only be used in the first statement.
-
-##### `parseTime`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-`parseTime=true` changes the output type of `DATE` and `DATETIME` values to `time.Time` instead of `[]byte` / `string`
-
-
-##### `readTimeout`
-
-```
-Type:           decimal number
-Default:        0
-```
-
-I/O read timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*.
-
-##### `strict`
-
-```
-Type:           bool
-Valid Values:   true, false
-Default:        false
-```
-
-`strict=true` enables a driver-side strict mode in which MySQL warnings are treated as errors. This mode should not be used in production as it may lead to data corruption in certain situations.
-
-A server-side strict mode, which is safe for production use, can be set via the [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html) system variable.
-
-By default MySQL also treats notes as warnings. Use [`sql_notes=false`](http://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_sql_notes) to ignore notes.
-
-##### `timeout`
-
-```
-Type:           decimal number
-Default:        OS default
-```
-
-*Driver* side connection timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*. To set a server side timeout, use the parameter [`wait_timeout`](http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_wait_timeout).
-
-##### `tls`
-
-```
-Type:           bool / string
-Valid Values:   true, false, skip-verify, <name>
-Default:        false
-```
-
-`tls=true` enables TLS / SSL encrypted connection to the server. Use `skip-verify` if you want to use a self-signed or invalid certificate (server side). Use a custom value registered with [`mysql.RegisterTLSConfig`](https://godoc.org/github.com/go-sql-driver/mysql#RegisterTLSConfig).
-
-##### `writeTimeout`
-
-```
-Type:           decimal number
-Default:        0
-```
-
-I/O write timeout. The value must be a decimal number with an unit suffix ( *"ms"*, *"s"*, *"m"*, *"h"* ), such as *"30s"*, *"0.5m"* or *"1m30s"*.
-
-
-##### System Variables
-
-Any other parameters are interpreted as system variables:
-  * `<boolean_var>=<value>`: `SET <boolean_var>=<value>`
-  * `<enum_var>=<value>`: `SET <enum_var>=<value>`
-  * `<string_var>=%27<value>%27`: `SET <string_var>='<value>'`
-
-Rules:
-* The values for string variables must be quoted with '
-* The values must also be [url.QueryEscape](http://golang.org/pkg/net/url/#QueryEscape)'ed!
- (which implies values of string variables must be wrapped with `%27`)
-
-Examples:
-  * `autocommit=1`: `SET autocommit=1`
-  * [`time_zone=%27Europe%2FParis%27`](https://dev.mysql.com/doc/refman/5.5/en/time-zone-support.html): `SET time_zone='Europe/Paris'`
-  * [`tx_isolation=%27REPEATABLE-READ%27`](https://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html#sysvar_tx_isolation): `SET tx_isolation='REPEATABLE-READ'`
-
-
-#### Examples
-```
-user@unix(/path/to/socket)/dbname
-```
-
-```
-root:pw@unix(/tmp/mysql.sock)/myDatabase?loc=Local
-```
-
-```
-user:password@tcp(localhost:5555)/dbname?tls=skip-verify&autocommit=true
-```
-
-Treat warnings as errors by setting the system variable [`sql_mode`](https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html):
-```
-user:password@/dbname?sql_mode=TRADITIONAL
-```
-
-TCP via IPv6:
-```
-user:password@tcp([de:ad:be:ef::ca:fe]:80)/dbname?timeout=90s&collation=utf8mb4_unicode_ci
-```
-
-TCP on a remote host, e.g. Amazon RDS:
-```
-id:password@tcp(your-amazonaws-uri.com:3306)/dbname
-```
-
-Google Cloud SQL on App Engine (First Generation MySQL Server):
-```
-user@cloudsql(project-id:instance-name)/dbname
-```
-
-Google Cloud SQL on App Engine (Second Generation MySQL Server):
-```
-user@cloudsql(project-id:regionname:instance-name)/dbname
-```
-
-TCP using default port (3306) on localhost:
-```
-user:password@tcp/dbname?charset=utf8mb4,utf8&sys_var=esc%40ped
-```
-
-Use the default protocol (tcp) and host (localhost:3306):
-```
-user:password@/dbname
-```
-
-No Database preselected:
-```
-user:password@/
-```
-
-### `LOAD DATA LOCAL INFILE` support
-For this feature you need direct access to the package. Therefore you must change the import path (no `_`):
-```go
-import "github.com/go-sql-driver/mysql"
-```
-
-Files must be whitelisted by registering them with `mysql.RegisterLocalFile(filepath)` (recommended) or the Whitelist check must be deactivated by using the DSN parameter `allowAllFiles=true` ([*Might be insecure!*](http://dev.mysql.com/doc/refman/5.7/en/load-data-local.html)).
-
-To use a `io.Reader` a handler function must be registered with `mysql.RegisterReaderHandler(name, handler)` which returns a `io.Reader` or `io.ReadCloser`. The Reader is available with the filepath `Reader::<name>` then. Choose different names for different handlers and `DeregisterReaderHandler` when you don't need it anymore.
-
-See the [godoc of Go-MySQL-Driver](https://godoc.org/github.com/go-sql-driver/mysql "golang mysql driver documentation") for details.
-
-
-### `time.Time` support
-The default internal output type of MySQL `DATE` and `DATETIME` values is `[]byte` which allows you to scan the value into a `[]byte`, `string` or `sql.RawBytes` variable in your programm.
-
-However, many want to scan MySQL `DATE` and `DATETIME` values into `time.Time` variables, which is the logical opposite in Go to `DATE` and `DATETIME` in MySQL. You can do that by changing the internal output type from `[]byte` to `time.Time` with the DSN parameter `parseTime=true`. You can set the default [`time.Time` location](https://golang.org/pkg/time/#Location) with the `loc` DSN parameter.
-
-**Caution:** As of Go 1.1, this makes `time.Time` the only variable type you can scan `DATE` and `DATETIME` values into. This breaks for example [`sql.RawBytes` support](https://github.com/go-sql-driver/mysql/wiki/Examples#rawbytes).
-
-Alternatively you can use the [`NullTime`](https://godoc.org/github.com/go-sql-driver/mysql#NullTime) type as the scan destination, which works with both `time.Time` and `string` / `[]byte`.
-
-
-### Unicode support
-Since version 1.1 Go-MySQL-Driver automatically uses the collation `utf8_general_ci` by default.
-
-Other collations / charsets can be set using the [`collation`](#collation) DSN parameter.
-
-Version 1.0 of the driver recommended adding `&charset=utf8` (alias for `SET NAMES utf8`) to the DSN to enable proper UTF-8 support. This is not necessary anymore. The [`collation`](#collation) parameter should be preferred to set another collation / charset than the default.
-
-See http://dev.mysql.com/doc/refman/5.7/en/charset-unicode.html for more details on MySQL's Unicode support.
-
-
-## Testing / Development
-To run the driver tests you may need to adjust the configuration. See the [Testing Wiki-Page](https://github.com/go-sql-driver/mysql/wiki/Testing "Testing") for details.
-
-Go-MySQL-Driver is not feature-complete yet. Your help is very appreciated.
-If you want to contribute, you can work on an [open issue](https://github.com/go-sql-driver/mysql/issues?state=open) or review a [pull request](https://github.com/go-sql-driver/mysql/pulls).
-
-See the [Contribution Guidelines](https://github.com/go-sql-driver/mysql/blob/master/CONTRIBUTING.md) for details.
-
----------------------------------------
-
-## License
-Go-MySQL-Driver is licensed under the [Mozilla Public License Version 2.0](https://raw.github.com/go-sql-driver/mysql/master/LICENSE)
-
-Mozilla summarizes the license scope as follows:
-> MPL: The copyleft applies to any files containing MPLed code.
-
-
-That means:
-  * You can **use** the **unchanged** source code both in private and commercially
-  * When distributing, you **must publish** the source code of any **changed files** licensed under the MPL 2.0 under a) the MPL 2.0 itself or b) a compatible license (e.g. GPL 3.0 or Apache License 2.0)
-  * You **needn't publish** the source code of your library as long as the files licensed under the MPL 2.0 are **unchanged**
-
-Please read the [MPL 2.0 FAQ](https://www.mozilla.org/en-US/MPL/2.0/FAQ/) if you have further questions regarding the license.
-
-You can read the full terms here: [LICENSE](https://raw.github.com/go-sql-driver/mysql/master/LICENSE)
-
-![Go Gopher and MySQL Dolphin](https://raw.github.com/wiki/go-sql-driver/mysql/go-mysql-driver_m.jpg "Golang Gopher transporting the MySQL Dolphin in a wheelbarrow")
-

+ 0 - 19
vendor/github.com/go-sql-driver/mysql/appengine.go

@@ -1,19 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// +build appengine
-
-package mysql
-
-import (
-	"appengine/cloudsql"
-)
-
-func init() {
-	RegisterDial("cloudsql", cloudsql.Dial)
-}

+ 0 - 147
vendor/github.com/go-sql-driver/mysql/buffer.go

@@ -1,147 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"io"
-	"net"
-	"time"
-)
-
-const defaultBufSize = 4096
-
-// A buffer which is used for both reading and writing.
-// This is possible since communication on each connection is synchronous.
-// In other words, we can't write and read simultaneously on the same connection.
-// The buffer is similar to bufio.Reader / Writer but zero-copy-ish
-// Also highly optimized for this particular use case.
-type buffer struct {
-	buf     []byte
-	nc      net.Conn
-	idx     int
-	length  int
-	timeout time.Duration
-}
-
-func newBuffer(nc net.Conn) buffer {
-	var b [defaultBufSize]byte
-	return buffer{
-		buf: b[:],
-		nc:  nc,
-	}
-}
-
-// fill reads into the buffer until at least _need_ bytes are in it
-func (b *buffer) fill(need int) error {
-	n := b.length
-
-	// move existing data to the beginning
-	if n > 0 && b.idx > 0 {
-		copy(b.buf[0:n], b.buf[b.idx:])
-	}
-
-	// grow buffer if necessary
-	// TODO: let the buffer shrink again at some point
-	//       Maybe keep the org buf slice and swap back?
-	if need > len(b.buf) {
-		// Round up to the next multiple of the default size
-		newBuf := make([]byte, ((need/defaultBufSize)+1)*defaultBufSize)
-		copy(newBuf, b.buf)
-		b.buf = newBuf
-	}
-
-	b.idx = 0
-
-	for {
-		if b.timeout > 0 {
-			if err := b.nc.SetReadDeadline(time.Now().Add(b.timeout)); err != nil {
-				return err
-			}
-		}
-
-		nn, err := b.nc.Read(b.buf[n:])
-		n += nn
-
-		switch err {
-		case nil:
-			if n < need {
-				continue
-			}
-			b.length = n
-			return nil
-
-		case io.EOF:
-			if n >= need {
-				b.length = n
-				return nil
-			}
-			return io.ErrUnexpectedEOF
-
-		default:
-			return err
-		}
-	}
-}
-
-// returns next N bytes from buffer.
-// The returned slice is only guaranteed to be valid until the next read
-func (b *buffer) readNext(need int) ([]byte, error) {
-	if b.length < need {
-		// refill
-		if err := b.fill(need); err != nil {
-			return nil, err
-		}
-	}
-
-	offset := b.idx
-	b.idx += need
-	b.length -= need
-	return b.buf[offset:b.idx], nil
-}
-
-// returns a buffer with the requested size.
-// If possible, a slice from the existing buffer is returned.
-// Otherwise a bigger buffer is made.
-// Only one buffer (total) can be used at a time.
-func (b *buffer) takeBuffer(length int) []byte {
-	if b.length > 0 {
-		return nil
-	}
-
-	// test (cheap) general case first
-	if length <= defaultBufSize || length <= cap(b.buf) {
-		return b.buf[:length]
-	}
-
-	if length < maxPacketSize {
-		b.buf = make([]byte, length)
-		return b.buf
-	}
-	return make([]byte, length)
-}
-
-// shortcut which can be used if the requested buffer is guaranteed to be
-// smaller than defaultBufSize
-// Only one buffer (total) can be used at a time.
-func (b *buffer) takeSmallBuffer(length int) []byte {
-	if b.length == 0 {
-		return b.buf[:length]
-	}
-	return nil
-}
-
-// takeCompleteBuffer returns the complete existing buffer.
-// This can be used if the necessary buffer size is unknown.
-// Only one buffer (total) can be used at a time.
-func (b *buffer) takeCompleteBuffer() []byte {
-	if b.length == 0 {
-		return b.buf
-	}
-	return nil
-}

+ 0 - 250
vendor/github.com/go-sql-driver/mysql/collations.go

@@ -1,250 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2014 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-const defaultCollation = "utf8_general_ci"
-
-// A list of available collations mapped to the internal ID.
-// To update this map use the following MySQL query:
-//     SELECT COLLATION_NAME, ID FROM information_schema.COLLATIONS
-var collations = map[string]byte{
-	"big5_chinese_ci":          1,
-	"latin2_czech_cs":          2,
-	"dec8_swedish_ci":          3,
-	"cp850_general_ci":         4,
-	"latin1_german1_ci":        5,
-	"hp8_english_ci":           6,
-	"koi8r_general_ci":         7,
-	"latin1_swedish_ci":        8,
-	"latin2_general_ci":        9,
-	"swe7_swedish_ci":          10,
-	"ascii_general_ci":         11,
-	"ujis_japanese_ci":         12,
-	"sjis_japanese_ci":         13,
-	"cp1251_bulgarian_ci":      14,
-	"latin1_danish_ci":         15,
-	"hebrew_general_ci":        16,
-	"tis620_thai_ci":           18,
-	"euckr_korean_ci":          19,
-	"latin7_estonian_cs":       20,
-	"latin2_hungarian_ci":      21,
-	"koi8u_general_ci":         22,
-	"cp1251_ukrainian_ci":      23,
-	"gb2312_chinese_ci":        24,
-	"greek_general_ci":         25,
-	"cp1250_general_ci":        26,
-	"latin2_croatian_ci":       27,
-	"gbk_chinese_ci":           28,
-	"cp1257_lithuanian_ci":     29,
-	"latin5_turkish_ci":        30,
-	"latin1_german2_ci":        31,
-	"armscii8_general_ci":      32,
-	"utf8_general_ci":          33,
-	"cp1250_czech_cs":          34,
-	"ucs2_general_ci":          35,
-	"cp866_general_ci":         36,
-	"keybcs2_general_ci":       37,
-	"macce_general_ci":         38,
-	"macroman_general_ci":      39,
-	"cp852_general_ci":         40,
-	"latin7_general_ci":        41,
-	"latin7_general_cs":        42,
-	"macce_bin":                43,
-	"cp1250_croatian_ci":       44,
-	"utf8mb4_general_ci":       45,
-	"utf8mb4_bin":              46,
-	"latin1_bin":               47,
-	"latin1_general_ci":        48,
-	"latin1_general_cs":        49,
-	"cp1251_bin":               50,
-	"cp1251_general_ci":        51,
-	"cp1251_general_cs":        52,
-	"macroman_bin":             53,
-	"utf16_general_ci":         54,
-	"utf16_bin":                55,
-	"utf16le_general_ci":       56,
-	"cp1256_general_ci":        57,
-	"cp1257_bin":               58,
-	"cp1257_general_ci":        59,
-	"utf32_general_ci":         60,
-	"utf32_bin":                61,
-	"utf16le_bin":              62,
-	"binary":                   63,
-	"armscii8_bin":             64,
-	"ascii_bin":                65,
-	"cp1250_bin":               66,
-	"cp1256_bin":               67,
-	"cp866_bin":                68,
-	"dec8_bin":                 69,
-	"greek_bin":                70,
-	"hebrew_bin":               71,
-	"hp8_bin":                  72,
-	"keybcs2_bin":              73,
-	"koi8r_bin":                74,
-	"koi8u_bin":                75,
-	"latin2_bin":               77,
-	"latin5_bin":               78,
-	"latin7_bin":               79,
-	"cp850_bin":                80,
-	"cp852_bin":                81,
-	"swe7_bin":                 82,
-	"utf8_bin":                 83,
-	"big5_bin":                 84,
-	"euckr_bin":                85,
-	"gb2312_bin":               86,
-	"gbk_bin":                  87,
-	"sjis_bin":                 88,
-	"tis620_bin":               89,
-	"ucs2_bin":                 90,
-	"ujis_bin":                 91,
-	"geostd8_general_ci":       92,
-	"geostd8_bin":              93,
-	"latin1_spanish_ci":        94,
-	"cp932_japanese_ci":        95,
-	"cp932_bin":                96,
-	"eucjpms_japanese_ci":      97,
-	"eucjpms_bin":              98,
-	"cp1250_polish_ci":         99,
-	"utf16_unicode_ci":         101,
-	"utf16_icelandic_ci":       102,
-	"utf16_latvian_ci":         103,
-	"utf16_romanian_ci":        104,
-	"utf16_slovenian_ci":       105,
-	"utf16_polish_ci":          106,
-	"utf16_estonian_ci":        107,
-	"utf16_spanish_ci":         108,
-	"utf16_swedish_ci":         109,
-	"utf16_turkish_ci":         110,
-	"utf16_czech_ci":           111,
-	"utf16_danish_ci":          112,
-	"utf16_lithuanian_ci":      113,
-	"utf16_slovak_ci":          114,
-	"utf16_spanish2_ci":        115,
-	"utf16_roman_ci":           116,
-	"utf16_persian_ci":         117,
-	"utf16_esperanto_ci":       118,
-	"utf16_hungarian_ci":       119,
-	"utf16_sinhala_ci":         120,
-	"utf16_german2_ci":         121,
-	"utf16_croatian_ci":        122,
-	"utf16_unicode_520_ci":     123,
-	"utf16_vietnamese_ci":      124,
-	"ucs2_unicode_ci":          128,
-	"ucs2_icelandic_ci":        129,
-	"ucs2_latvian_ci":          130,
-	"ucs2_romanian_ci":         131,
-	"ucs2_slovenian_ci":        132,
-	"ucs2_polish_ci":           133,
-	"ucs2_estonian_ci":         134,
-	"ucs2_spanish_ci":          135,
-	"ucs2_swedish_ci":          136,
-	"ucs2_turkish_ci":          137,
-	"ucs2_czech_ci":            138,
-	"ucs2_danish_ci":           139,
-	"ucs2_lithuanian_ci":       140,
-	"ucs2_slovak_ci":           141,
-	"ucs2_spanish2_ci":         142,
-	"ucs2_roman_ci":            143,
-	"ucs2_persian_ci":          144,
-	"ucs2_esperanto_ci":        145,
-	"ucs2_hungarian_ci":        146,
-	"ucs2_sinhala_ci":          147,
-	"ucs2_german2_ci":          148,
-	"ucs2_croatian_ci":         149,
-	"ucs2_unicode_520_ci":      150,
-	"ucs2_vietnamese_ci":       151,
-	"ucs2_general_mysql500_ci": 159,
-	"utf32_unicode_ci":         160,
-	"utf32_icelandic_ci":       161,
-	"utf32_latvian_ci":         162,
-	"utf32_romanian_ci":        163,
-	"utf32_slovenian_ci":       164,
-	"utf32_polish_ci":          165,
-	"utf32_estonian_ci":        166,
-	"utf32_spanish_ci":         167,
-	"utf32_swedish_ci":         168,
-	"utf32_turkish_ci":         169,
-	"utf32_czech_ci":           170,
-	"utf32_danish_ci":          171,
-	"utf32_lithuanian_ci":      172,
-	"utf32_slovak_ci":          173,
-	"utf32_spanish2_ci":        174,
-	"utf32_roman_ci":           175,
-	"utf32_persian_ci":         176,
-	"utf32_esperanto_ci":       177,
-	"utf32_hungarian_ci":       178,
-	"utf32_sinhala_ci":         179,
-	"utf32_german2_ci":         180,
-	"utf32_croatian_ci":        181,
-	"utf32_unicode_520_ci":     182,
-	"utf32_vietnamese_ci":      183,
-	"utf8_unicode_ci":          192,
-	"utf8_icelandic_ci":        193,
-	"utf8_latvian_ci":          194,
-	"utf8_romanian_ci":         195,
-	"utf8_slovenian_ci":        196,
-	"utf8_polish_ci":           197,
-	"utf8_estonian_ci":         198,
-	"utf8_spanish_ci":          199,
-	"utf8_swedish_ci":          200,
-	"utf8_turkish_ci":          201,
-	"utf8_czech_ci":            202,
-	"utf8_danish_ci":           203,
-	"utf8_lithuanian_ci":       204,
-	"utf8_slovak_ci":           205,
-	"utf8_spanish2_ci":         206,
-	"utf8_roman_ci":            207,
-	"utf8_persian_ci":          208,
-	"utf8_esperanto_ci":        209,
-	"utf8_hungarian_ci":        210,
-	"utf8_sinhala_ci":          211,
-	"utf8_german2_ci":          212,
-	"utf8_croatian_ci":         213,
-	"utf8_unicode_520_ci":      214,
-	"utf8_vietnamese_ci":       215,
-	"utf8_general_mysql500_ci": 223,
-	"utf8mb4_unicode_ci":       224,
-	"utf8mb4_icelandic_ci":     225,
-	"utf8mb4_latvian_ci":       226,
-	"utf8mb4_romanian_ci":      227,
-	"utf8mb4_slovenian_ci":     228,
-	"utf8mb4_polish_ci":        229,
-	"utf8mb4_estonian_ci":      230,
-	"utf8mb4_spanish_ci":       231,
-	"utf8mb4_swedish_ci":       232,
-	"utf8mb4_turkish_ci":       233,
-	"utf8mb4_czech_ci":         234,
-	"utf8mb4_danish_ci":        235,
-	"utf8mb4_lithuanian_ci":    236,
-	"utf8mb4_slovak_ci":        237,
-	"utf8mb4_spanish2_ci":      238,
-	"utf8mb4_roman_ci":         239,
-	"utf8mb4_persian_ci":       240,
-	"utf8mb4_esperanto_ci":     241,
-	"utf8mb4_hungarian_ci":     242,
-	"utf8mb4_sinhala_ci":       243,
-	"utf8mb4_german2_ci":       244,
-	"utf8mb4_croatian_ci":      245,
-	"utf8mb4_unicode_520_ci":   246,
-	"utf8mb4_vietnamese_ci":    247,
-}
-
-// A blacklist of collations which is unsafe to interpolate parameters.
-// These multibyte encodings may contains 0x5c (`\`) in their trailing bytes.
-var unsafeCollations = map[string]bool{
-	"big5_chinese_ci":   true,
-	"sjis_japanese_ci":  true,
-	"gbk_chinese_ci":    true,
-	"big5_bin":          true,
-	"gb2312_bin":        true,
-	"gbk_bin":           true,
-	"sjis_bin":          true,
-	"cp932_japanese_ci": true,
-	"cp932_bin":         true,
-}

+ 0 - 377
vendor/github.com/go-sql-driver/mysql/connection.go

@@ -1,377 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"database/sql/driver"
-	"net"
-	"strconv"
-	"strings"
-	"time"
-)
-
-type mysqlConn struct {
-	buf              buffer
-	netConn          net.Conn
-	affectedRows     uint64
-	insertId         uint64
-	cfg              *Config
-	maxAllowedPacket int
-	maxWriteSize     int
-	writeTimeout     time.Duration
-	flags            clientFlag
-	status           statusFlag
-	sequence         uint8
-	parseTime        bool
-	strict           bool
-}
-
-// Handles parameters set in DSN after the connection is established
-func (mc *mysqlConn) handleParams() (err error) {
-	for param, val := range mc.cfg.Params {
-		switch param {
-		// Charset
-		case "charset":
-			charsets := strings.Split(val, ",")
-			for i := range charsets {
-				// ignore errors here - a charset may not exist
-				err = mc.exec("SET NAMES " + charsets[i])
-				if err == nil {
-					break
-				}
-			}
-			if err != nil {
-				return
-			}
-
-		// System Vars
-		default:
-			err = mc.exec("SET " + param + "=" + val + "")
-			if err != nil {
-				return
-			}
-		}
-	}
-
-	return
-}
-
-func (mc *mysqlConn) Begin() (driver.Tx, error) {
-	if mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	err := mc.exec("START TRANSACTION")
-	if err == nil {
-		return &mysqlTx{mc}, err
-	}
-
-	return nil, err
-}
-
-func (mc *mysqlConn) Close() (err error) {
-	// Makes Close idempotent
-	if mc.netConn != nil {
-		err = mc.writeCommandPacket(comQuit)
-	}
-
-	mc.cleanup()
-
-	return
-}
-
-// Closes the network connection and unsets internal variables. Do not call this
-// function after successfully authentication, call Close instead. This function
-// is called before auth or on auth failure because MySQL will have already
-// closed the network connection.
-func (mc *mysqlConn) cleanup() {
-	// Makes cleanup idempotent
-	if mc.netConn != nil {
-		if err := mc.netConn.Close(); err != nil {
-			errLog.Print(err)
-		}
-		mc.netConn = nil
-	}
-	mc.cfg = nil
-	mc.buf.nc = nil
-}
-
-func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
-	if mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	// Send command
-	err := mc.writeCommandPacketStr(comStmtPrepare, query)
-	if err != nil {
-		return nil, err
-	}
-
-	stmt := &mysqlStmt{
-		mc: mc,
-	}
-
-	// Read Result
-	columnCount, err := stmt.readPrepareResultPacket()
-	if err == nil {
-		if stmt.paramCount > 0 {
-			if err = mc.readUntilEOF(); err != nil {
-				return nil, err
-			}
-		}
-
-		if columnCount > 0 {
-			err = mc.readUntilEOF()
-		}
-	}
-
-	return stmt, err
-}
-
-func (mc *mysqlConn) interpolateParams(query string, args []driver.Value) (string, error) {
-	// Number of ? should be same to len(args)
-	if strings.Count(query, "?") != len(args) {
-		return "", driver.ErrSkip
-	}
-
-	buf := mc.buf.takeCompleteBuffer()
-	if buf == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return "", driver.ErrBadConn
-	}
-	buf = buf[:0]
-	argPos := 0
-
-	for i := 0; i < len(query); i++ {
-		q := strings.IndexByte(query[i:], '?')
-		if q == -1 {
-			buf = append(buf, query[i:]...)
-			break
-		}
-		buf = append(buf, query[i:i+q]...)
-		i += q
-
-		arg := args[argPos]
-		argPos++
-
-		if arg == nil {
-			buf = append(buf, "NULL"...)
-			continue
-		}
-
-		switch v := arg.(type) {
-		case int64:
-			buf = strconv.AppendInt(buf, v, 10)
-		case float64:
-			buf = strconv.AppendFloat(buf, v, 'g', -1, 64)
-		case bool:
-			if v {
-				buf = append(buf, '1')
-			} else {
-				buf = append(buf, '0')
-			}
-		case time.Time:
-			if v.IsZero() {
-				buf = append(buf, "'0000-00-00'"...)
-			} else {
-				v := v.In(mc.cfg.Loc)
-				v = v.Add(time.Nanosecond * 500) // To round under microsecond
-				year := v.Year()
-				year100 := year / 100
-				year1 := year % 100
-				month := v.Month()
-				day := v.Day()
-				hour := v.Hour()
-				minute := v.Minute()
-				second := v.Second()
-				micro := v.Nanosecond() / 1000
-
-				buf = append(buf, []byte{
-					'\'',
-					digits10[year100], digits01[year100],
-					digits10[year1], digits01[year1],
-					'-',
-					digits10[month], digits01[month],
-					'-',
-					digits10[day], digits01[day],
-					' ',
-					digits10[hour], digits01[hour],
-					':',
-					digits10[minute], digits01[minute],
-					':',
-					digits10[second], digits01[second],
-				}...)
-
-				if micro != 0 {
-					micro10000 := micro / 10000
-					micro100 := micro / 100 % 100
-					micro1 := micro % 100
-					buf = append(buf, []byte{
-						'.',
-						digits10[micro10000], digits01[micro10000],
-						digits10[micro100], digits01[micro100],
-						digits10[micro1], digits01[micro1],
-					}...)
-				}
-				buf = append(buf, '\'')
-			}
-		case []byte:
-			if v == nil {
-				buf = append(buf, "NULL"...)
-			} else {
-				buf = append(buf, "_binary'"...)
-				if mc.status&statusNoBackslashEscapes == 0 {
-					buf = escapeBytesBackslash(buf, v)
-				} else {
-					buf = escapeBytesQuotes(buf, v)
-				}
-				buf = append(buf, '\'')
-			}
-		case string:
-			buf = append(buf, '\'')
-			if mc.status&statusNoBackslashEscapes == 0 {
-				buf = escapeStringBackslash(buf, v)
-			} else {
-				buf = escapeStringQuotes(buf, v)
-			}
-			buf = append(buf, '\'')
-		default:
-			return "", driver.ErrSkip
-		}
-
-		if len(buf)+4 > mc.maxAllowedPacket {
-			return "", driver.ErrSkip
-		}
-	}
-	if argPos != len(args) {
-		return "", driver.ErrSkip
-	}
-	return string(buf), nil
-}
-
-func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, error) {
-	if mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	if len(args) != 0 {
-		if !mc.cfg.InterpolateParams {
-			return nil, driver.ErrSkip
-		}
-		// try to interpolate the parameters to save extra roundtrips for preparing and closing a statement
-		prepared, err := mc.interpolateParams(query, args)
-		if err != nil {
-			return nil, err
-		}
-		query = prepared
-		args = nil
-	}
-	mc.affectedRows = 0
-	mc.insertId = 0
-
-	err := mc.exec(query)
-	if err == nil {
-		return &mysqlResult{
-			affectedRows: int64(mc.affectedRows),
-			insertId:     int64(mc.insertId),
-		}, err
-	}
-	return nil, err
-}
-
-// Internal function to execute commands
-func (mc *mysqlConn) exec(query string) error {
-	// Send command
-	err := mc.writeCommandPacketStr(comQuery, query)
-	if err != nil {
-		return err
-	}
-
-	// Read Result
-	resLen, err := mc.readResultSetHeaderPacket()
-	if err == nil && resLen > 0 {
-		if err = mc.readUntilEOF(); err != nil {
-			return err
-		}
-
-		err = mc.readUntilEOF()
-	}
-
-	return err
-}
-
-func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, error) {
-	if mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	if len(args) != 0 {
-		if !mc.cfg.InterpolateParams {
-			return nil, driver.ErrSkip
-		}
-		// try client-side prepare to reduce roundtrip
-		prepared, err := mc.interpolateParams(query, args)
-		if err != nil {
-			return nil, err
-		}
-		query = prepared
-		args = nil
-	}
-	// Send command
-	err := mc.writeCommandPacketStr(comQuery, query)
-	if err == nil {
-		// Read Result
-		var resLen int
-		resLen, err = mc.readResultSetHeaderPacket()
-		if err == nil {
-			rows := new(textRows)
-			rows.mc = mc
-
-			if resLen == 0 {
-				// no columns, no more data
-				return emptyRows{}, nil
-			}
-			// Columns
-			rows.columns, err = mc.readColumns(resLen)
-			return rows, err
-		}
-	}
-	return nil, err
-}
-
-// Gets the value of the given MySQL System Variable
-// The returned byte slice is only valid until the next read
-func (mc *mysqlConn) getSystemVar(name string) ([]byte, error) {
-	// Send command
-	if err := mc.writeCommandPacketStr(comQuery, "SELECT @@"+name); err != nil {
-		return nil, err
-	}
-
-	// Read Result
-	resLen, err := mc.readResultSetHeaderPacket()
-	if err == nil {
-		rows := new(textRows)
-		rows.mc = mc
-		rows.columns = []mysqlField{{fieldType: fieldTypeVarChar}}
-
-		if resLen > 0 {
-			// Columns
-			if err := mc.readUntilEOF(); err != nil {
-				return nil, err
-			}
-		}
-
-		dest := make([]driver.Value, resLen)
-		if err = rows.readRow(dest); err == nil {
-			return dest[0].([]byte), mc.readUntilEOF()
-		}
-	}
-	return nil, err
-}

+ 0 - 163
vendor/github.com/go-sql-driver/mysql/const.go

@@ -1,163 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-const (
-	minProtocolVersion byte = 10
-	maxPacketSize           = 1<<24 - 1
-	timeFormat              = "2006-01-02 15:04:05.999999"
-)
-
-// MySQL constants documentation:
-// http://dev.mysql.com/doc/internals/en/client-server-protocol.html
-
-const (
-	iOK          byte = 0x00
-	iLocalInFile byte = 0xfb
-	iEOF         byte = 0xfe
-	iERR         byte = 0xff
-)
-
-// https://dev.mysql.com/doc/internals/en/capability-flags.html#packet-Protocol::CapabilityFlags
-type clientFlag uint32
-
-const (
-	clientLongPassword clientFlag = 1 << iota
-	clientFoundRows
-	clientLongFlag
-	clientConnectWithDB
-	clientNoSchema
-	clientCompress
-	clientODBC
-	clientLocalFiles
-	clientIgnoreSpace
-	clientProtocol41
-	clientInteractive
-	clientSSL
-	clientIgnoreSIGPIPE
-	clientTransactions
-	clientReserved
-	clientSecureConn
-	clientMultiStatements
-	clientMultiResults
-	clientPSMultiResults
-	clientPluginAuth
-	clientConnectAttrs
-	clientPluginAuthLenEncClientData
-	clientCanHandleExpiredPasswords
-	clientSessionTrack
-	clientDeprecateEOF
-)
-
-const (
-	comQuit byte = iota + 1
-	comInitDB
-	comQuery
-	comFieldList
-	comCreateDB
-	comDropDB
-	comRefresh
-	comShutdown
-	comStatistics
-	comProcessInfo
-	comConnect
-	comProcessKill
-	comDebug
-	comPing
-	comTime
-	comDelayedInsert
-	comChangeUser
-	comBinlogDump
-	comTableDump
-	comConnectOut
-	comRegisterSlave
-	comStmtPrepare
-	comStmtExecute
-	comStmtSendLongData
-	comStmtClose
-	comStmtReset
-	comSetOption
-	comStmtFetch
-)
-
-// https://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::ColumnType
-const (
-	fieldTypeDecimal byte = iota
-	fieldTypeTiny
-	fieldTypeShort
-	fieldTypeLong
-	fieldTypeFloat
-	fieldTypeDouble
-	fieldTypeNULL
-	fieldTypeTimestamp
-	fieldTypeLongLong
-	fieldTypeInt24
-	fieldTypeDate
-	fieldTypeTime
-	fieldTypeDateTime
-	fieldTypeYear
-	fieldTypeNewDate
-	fieldTypeVarChar
-	fieldTypeBit
-)
-const (
-	fieldTypeJSON byte = iota + 0xf5
-	fieldTypeNewDecimal
-	fieldTypeEnum
-	fieldTypeSet
-	fieldTypeTinyBLOB
-	fieldTypeMediumBLOB
-	fieldTypeLongBLOB
-	fieldTypeBLOB
-	fieldTypeVarString
-	fieldTypeString
-	fieldTypeGeometry
-)
-
-type fieldFlag uint16
-
-const (
-	flagNotNULL fieldFlag = 1 << iota
-	flagPriKey
-	flagUniqueKey
-	flagMultipleKey
-	flagBLOB
-	flagUnsigned
-	flagZeroFill
-	flagBinary
-	flagEnum
-	flagAutoIncrement
-	flagTimestamp
-	flagSet
-	flagUnknown1
-	flagUnknown2
-	flagUnknown3
-	flagUnknown4
-)
-
-// http://dev.mysql.com/doc/internals/en/status-flags.html
-type statusFlag uint16
-
-const (
-	statusInTrans statusFlag = 1 << iota
-	statusInAutocommit
-	statusReserved // Not in documentation
-	statusMoreResultsExists
-	statusNoGoodIndexUsed
-	statusNoIndexUsed
-	statusCursorExists
-	statusLastRowSent
-	statusDbDropped
-	statusNoBackslashEscapes
-	statusMetadataChanged
-	statusQueryWasSlow
-	statusPsOutParams
-	statusInTransReadonly
-	statusSessionStateChanged
-)

+ 0 - 183
vendor/github.com/go-sql-driver/mysql/driver.go

@@ -1,183 +0,0 @@
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// Package mysql provides a MySQL driver for Go's database/sql package
-//
-// The driver should be used via the database/sql package:
-//
-//  import "database/sql"
-//  import _ "github.com/go-sql-driver/mysql"
-//
-//  db, err := sql.Open("mysql", "user:password@/dbname")
-//
-// See https://github.com/go-sql-driver/mysql#usage for details
-package mysql
-
-import (
-	"database/sql"
-	"database/sql/driver"
-	"net"
-)
-
-// MySQLDriver is exported to make the driver directly accessible.
-// In general the driver is used via the database/sql package.
-type MySQLDriver struct{}
-
-// DialFunc is a function which can be used to establish the network connection.
-// Custom dial functions must be registered with RegisterDial
-type DialFunc func(addr string) (net.Conn, error)
-
-var dials map[string]DialFunc
-
-// RegisterDial registers a custom dial function. It can then be used by the
-// network address mynet(addr), where mynet is the registered new network.
-// addr is passed as a parameter to the dial function.
-func RegisterDial(net string, dial DialFunc) {
-	if dials == nil {
-		dials = make(map[string]DialFunc)
-	}
-	dials[net] = dial
-}
-
-// Open new Connection.
-// See https://github.com/go-sql-driver/mysql#dsn-data-source-name for how
-// the DSN string is formated
-func (d MySQLDriver) Open(dsn string) (driver.Conn, error) {
-	var err error
-
-	// New mysqlConn
-	mc := &mysqlConn{
-		maxAllowedPacket: maxPacketSize,
-		maxWriteSize:     maxPacketSize - 1,
-	}
-	mc.cfg, err = ParseDSN(dsn)
-	if err != nil {
-		return nil, err
-	}
-	mc.parseTime = mc.cfg.ParseTime
-	mc.strict = mc.cfg.Strict
-
-	// Connect to Server
-	if dial, ok := dials[mc.cfg.Net]; ok {
-		mc.netConn, err = dial(mc.cfg.Addr)
-	} else {
-		nd := net.Dialer{Timeout: mc.cfg.Timeout}
-		mc.netConn, err = nd.Dial(mc.cfg.Net, mc.cfg.Addr)
-	}
-	if err != nil {
-		return nil, err
-	}
-
-	// Enable TCP Keepalives on TCP connections
-	if tc, ok := mc.netConn.(*net.TCPConn); ok {
-		if err := tc.SetKeepAlive(true); err != nil {
-			// Don't send COM_QUIT before handshake.
-			mc.netConn.Close()
-			mc.netConn = nil
-			return nil, err
-		}
-	}
-
-	mc.buf = newBuffer(mc.netConn)
-
-	// Set I/O timeouts
-	mc.buf.timeout = mc.cfg.ReadTimeout
-	mc.writeTimeout = mc.cfg.WriteTimeout
-
-	// Reading Handshake Initialization Packet
-	cipher, err := mc.readInitPacket()
-	if err != nil {
-		mc.cleanup()
-		return nil, err
-	}
-
-	// Send Client Authentication Packet
-	if err = mc.writeAuthPacket(cipher); err != nil {
-		mc.cleanup()
-		return nil, err
-	}
-
-	// Handle response to auth packet, switch methods if possible
-	if err = handleAuthResult(mc, cipher); err != nil {
-		// Authentication failed and MySQL has already closed the connection
-		// (https://dev.mysql.com/doc/internals/en/authentication-fails.html).
-		// Do not send COM_QUIT, just cleanup and return the error.
-		mc.cleanup()
-		return nil, err
-	}
-
-	if mc.cfg.MaxAllowedPacket > 0 {
-		mc.maxAllowedPacket = mc.cfg.MaxAllowedPacket
-	} else {
-		// Get max allowed packet size
-		maxap, err := mc.getSystemVar("max_allowed_packet")
-		if err != nil {
-			mc.Close()
-			return nil, err
-		}
-		mc.maxAllowedPacket = stringToInt(maxap) - 1
-	}
-	if mc.maxAllowedPacket < maxPacketSize {
-		mc.maxWriteSize = mc.maxAllowedPacket
-	}
-
-	// Handle DSN Params
-	err = mc.handleParams()
-	if err != nil {
-		mc.Close()
-		return nil, err
-	}
-
-	return mc, nil
-}
-
-func handleAuthResult(mc *mysqlConn, oldCipher []byte) error {
-	// Read Result Packet
-	cipher, err := mc.readResultOK()
-	if err == nil {
-		return nil // auth successful
-	}
-
-	if mc.cfg == nil {
-		return err // auth failed and retry not possible
-	}
-
-	// Retry auth if configured to do so.
-	if mc.cfg.AllowOldPasswords && err == ErrOldPassword {
-		// Retry with old authentication method. Note: there are edge cases
-		// where this should work but doesn't; this is currently "wontfix":
-		// https://github.com/go-sql-driver/mysql/issues/184
-
-		// If CLIENT_PLUGIN_AUTH capability is not supported, no new cipher is
-		// sent and we have to keep using the cipher sent in the init packet.
-		if cipher == nil {
-			cipher = oldCipher
-		}
-
-		if err = mc.writeOldAuthPacket(cipher); err != nil {
-			return err
-		}
-		_, err = mc.readResultOK()
-	} else if mc.cfg.AllowCleartextPasswords && err == ErrCleartextPassword {
-		// Retry with clear text password for
-		// http://dev.mysql.com/doc/refman/5.7/en/cleartext-authentication-plugin.html
-		// http://dev.mysql.com/doc/refman/5.7/en/pam-authentication-plugin.html
-		if err = mc.writeClearAuthPacket(); err != nil {
-			return err
-		}
-		_, err = mc.readResultOK()
-	} else if mc.cfg.AllowNativePasswords && err == ErrNativePassword {
-		if err = mc.writeNativeAuthPacket(cipher); err != nil {
-			return err
-		}
-		_, err = mc.readResultOK()
-	}
-	return err
-}
-
-func init() {
-	sql.Register("mysql", &MySQLDriver{})
-}

+ 0 - 548
vendor/github.com/go-sql-driver/mysql/dsn.go

@@ -1,548 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2016 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"bytes"
-	"crypto/tls"
-	"errors"
-	"fmt"
-	"net"
-	"net/url"
-	"strconv"
-	"strings"
-	"time"
-)
-
-var (
-	errInvalidDSNUnescaped       = errors.New("invalid DSN: did you forget to escape a param value?")
-	errInvalidDSNAddr            = errors.New("invalid DSN: network address not terminated (missing closing brace)")
-	errInvalidDSNNoSlash         = errors.New("invalid DSN: missing the slash separating the database name")
-	errInvalidDSNUnsafeCollation = errors.New("invalid DSN: interpolateParams can not be used with unsafe collations")
-)
-
-// Config is a configuration parsed from a DSN string
-type Config struct {
-	User             string            // Username
-	Passwd           string            // Password (requires User)
-	Net              string            // Network type
-	Addr             string            // Network address (requires Net)
-	DBName           string            // Database name
-	Params           map[string]string // Connection parameters
-	Collation        string            // Connection collation
-	Loc              *time.Location    // Location for time.Time values
-	MaxAllowedPacket int               // Max packet size allowed
-	TLSConfig        string            // TLS configuration name
-	tls              *tls.Config       // TLS configuration
-	Timeout          time.Duration     // Dial timeout
-	ReadTimeout      time.Duration     // I/O read timeout
-	WriteTimeout     time.Duration     // I/O write timeout
-
-	AllowAllFiles           bool // Allow all files to be used with LOAD DATA LOCAL INFILE
-	AllowCleartextPasswords bool // Allows the cleartext client side plugin
-	AllowNativePasswords    bool // Allows the native password authentication method
-	AllowOldPasswords       bool // Allows the old insecure password method
-	ClientFoundRows         bool // Return number of matching rows instead of rows changed
-	ColumnsWithAlias        bool // Prepend table alias to column names
-	InterpolateParams       bool // Interpolate placeholders into query string
-	MultiStatements         bool // Allow multiple statements in one query
-	ParseTime               bool // Parse time values to time.Time
-	Strict                  bool // Return warnings as errors
-}
-
-// FormatDSN formats the given Config into a DSN string which can be passed to
-// the driver.
-func (cfg *Config) FormatDSN() string {
-	var buf bytes.Buffer
-
-	// [username[:password]@]
-	if len(cfg.User) > 0 {
-		buf.WriteString(cfg.User)
-		if len(cfg.Passwd) > 0 {
-			buf.WriteByte(':')
-			buf.WriteString(cfg.Passwd)
-		}
-		buf.WriteByte('@')
-	}
-
-	// [protocol[(address)]]
-	if len(cfg.Net) > 0 {
-		buf.WriteString(cfg.Net)
-		if len(cfg.Addr) > 0 {
-			buf.WriteByte('(')
-			buf.WriteString(cfg.Addr)
-			buf.WriteByte(')')
-		}
-	}
-
-	// /dbname
-	buf.WriteByte('/')
-	buf.WriteString(cfg.DBName)
-
-	// [?param1=value1&...&paramN=valueN]
-	hasParam := false
-
-	if cfg.AllowAllFiles {
-		hasParam = true
-		buf.WriteString("?allowAllFiles=true")
-	}
-
-	if cfg.AllowCleartextPasswords {
-		if hasParam {
-			buf.WriteString("&allowCleartextPasswords=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?allowCleartextPasswords=true")
-		}
-	}
-
-	if cfg.AllowNativePasswords {
-		if hasParam {
-			buf.WriteString("&allowNativePasswords=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?allowNativePasswords=true")
-		}
-	}
-
-	if cfg.AllowOldPasswords {
-		if hasParam {
-			buf.WriteString("&allowOldPasswords=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?allowOldPasswords=true")
-		}
-	}
-
-	if cfg.ClientFoundRows {
-		if hasParam {
-			buf.WriteString("&clientFoundRows=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?clientFoundRows=true")
-		}
-	}
-
-	if col := cfg.Collation; col != defaultCollation && len(col) > 0 {
-		if hasParam {
-			buf.WriteString("&collation=")
-		} else {
-			hasParam = true
-			buf.WriteString("?collation=")
-		}
-		buf.WriteString(col)
-	}
-
-	if cfg.ColumnsWithAlias {
-		if hasParam {
-			buf.WriteString("&columnsWithAlias=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?columnsWithAlias=true")
-		}
-	}
-
-	if cfg.InterpolateParams {
-		if hasParam {
-			buf.WriteString("&interpolateParams=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?interpolateParams=true")
-		}
-	}
-
-	if cfg.Loc != time.UTC && cfg.Loc != nil {
-		if hasParam {
-			buf.WriteString("&loc=")
-		} else {
-			hasParam = true
-			buf.WriteString("?loc=")
-		}
-		buf.WriteString(url.QueryEscape(cfg.Loc.String()))
-	}
-
-	if cfg.MultiStatements {
-		if hasParam {
-			buf.WriteString("&multiStatements=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?multiStatements=true")
-		}
-	}
-
-	if cfg.ParseTime {
-		if hasParam {
-			buf.WriteString("&parseTime=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?parseTime=true")
-		}
-	}
-
-	if cfg.ReadTimeout > 0 {
-		if hasParam {
-			buf.WriteString("&readTimeout=")
-		} else {
-			hasParam = true
-			buf.WriteString("?readTimeout=")
-		}
-		buf.WriteString(cfg.ReadTimeout.String())
-	}
-
-	if cfg.Strict {
-		if hasParam {
-			buf.WriteString("&strict=true")
-		} else {
-			hasParam = true
-			buf.WriteString("?strict=true")
-		}
-	}
-
-	if cfg.Timeout > 0 {
-		if hasParam {
-			buf.WriteString("&timeout=")
-		} else {
-			hasParam = true
-			buf.WriteString("?timeout=")
-		}
-		buf.WriteString(cfg.Timeout.String())
-	}
-
-	if len(cfg.TLSConfig) > 0 {
-		if hasParam {
-			buf.WriteString("&tls=")
-		} else {
-			hasParam = true
-			buf.WriteString("?tls=")
-		}
-		buf.WriteString(url.QueryEscape(cfg.TLSConfig))
-	}
-
-	if cfg.WriteTimeout > 0 {
-		if hasParam {
-			buf.WriteString("&writeTimeout=")
-		} else {
-			hasParam = true
-			buf.WriteString("?writeTimeout=")
-		}
-		buf.WriteString(cfg.WriteTimeout.String())
-	}
-
-	if cfg.MaxAllowedPacket > 0 {
-		if hasParam {
-			buf.WriteString("&maxAllowedPacket=")
-		} else {
-			hasParam = true
-			buf.WriteString("?maxAllowedPacket=")
-		}
-		buf.WriteString(strconv.Itoa(cfg.MaxAllowedPacket))
-
-	}
-
-	// other params
-	if cfg.Params != nil {
-		for param, value := range cfg.Params {
-			if hasParam {
-				buf.WriteByte('&')
-			} else {
-				hasParam = true
-				buf.WriteByte('?')
-			}
-
-			buf.WriteString(param)
-			buf.WriteByte('=')
-			buf.WriteString(url.QueryEscape(value))
-		}
-	}
-
-	return buf.String()
-}
-
-// ParseDSN parses the DSN string to a Config
-func ParseDSN(dsn string) (cfg *Config, err error) {
-	// New config with some default values
-	cfg = &Config{
-		Loc:       time.UTC,
-		Collation: defaultCollation,
-	}
-
-	// [user[:password]@][net[(addr)]]/dbname[?param1=value1&paramN=valueN]
-	// Find the last '/' (since the password or the net addr might contain a '/')
-	foundSlash := false
-	for i := len(dsn) - 1; i >= 0; i-- {
-		if dsn[i] == '/' {
-			foundSlash = true
-			var j, k int
-
-			// left part is empty if i <= 0
-			if i > 0 {
-				// [username[:password]@][protocol[(address)]]
-				// Find the last '@' in dsn[:i]
-				for j = i; j >= 0; j-- {
-					if dsn[j] == '@' {
-						// username[:password]
-						// Find the first ':' in dsn[:j]
-						for k = 0; k < j; k++ {
-							if dsn[k] == ':' {
-								cfg.Passwd = dsn[k+1 : j]
-								break
-							}
-						}
-						cfg.User = dsn[:k]
-
-						break
-					}
-				}
-
-				// [protocol[(address)]]
-				// Find the first '(' in dsn[j+1:i]
-				for k = j + 1; k < i; k++ {
-					if dsn[k] == '(' {
-						// dsn[i-1] must be == ')' if an address is specified
-						if dsn[i-1] != ')' {
-							if strings.ContainsRune(dsn[k+1:i], ')') {
-								return nil, errInvalidDSNUnescaped
-							}
-							return nil, errInvalidDSNAddr
-						}
-						cfg.Addr = dsn[k+1 : i-1]
-						break
-					}
-				}
-				cfg.Net = dsn[j+1 : k]
-			}
-
-			// dbname[?param1=value1&...&paramN=valueN]
-			// Find the first '?' in dsn[i+1:]
-			for j = i + 1; j < len(dsn); j++ {
-				if dsn[j] == '?' {
-					if err = parseDSNParams(cfg, dsn[j+1:]); err != nil {
-						return
-					}
-					break
-				}
-			}
-			cfg.DBName = dsn[i+1 : j]
-
-			break
-		}
-	}
-
-	if !foundSlash && len(dsn) > 0 {
-		return nil, errInvalidDSNNoSlash
-	}
-
-	if cfg.InterpolateParams && unsafeCollations[cfg.Collation] {
-		return nil, errInvalidDSNUnsafeCollation
-	}
-
-	// Set default network if empty
-	if cfg.Net == "" {
-		cfg.Net = "tcp"
-	}
-
-	// Set default address if empty
-	if cfg.Addr == "" {
-		switch cfg.Net {
-		case "tcp":
-			cfg.Addr = "127.0.0.1:3306"
-		case "unix":
-			cfg.Addr = "/tmp/mysql.sock"
-		default:
-			return nil, errors.New("default addr for network '" + cfg.Net + "' unknown")
-		}
-
-	}
-
-	return
-}
-
-// parseDSNParams parses the DSN "query string"
-// Values must be url.QueryEscape'ed
-func parseDSNParams(cfg *Config, params string) (err error) {
-	for _, v := range strings.Split(params, "&") {
-		param := strings.SplitN(v, "=", 2)
-		if len(param) != 2 {
-			continue
-		}
-
-		// cfg params
-		switch value := param[1]; param[0] {
-
-		// Disable INFILE whitelist / enable all files
-		case "allowAllFiles":
-			var isBool bool
-			cfg.AllowAllFiles, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Use cleartext authentication mode (MySQL 5.5.10+)
-		case "allowCleartextPasswords":
-			var isBool bool
-			cfg.AllowCleartextPasswords, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Use native password authentication
-		case "allowNativePasswords":
-			var isBool bool
-			cfg.AllowNativePasswords, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Use old authentication mode (pre MySQL 4.1)
-		case "allowOldPasswords":
-			var isBool bool
-			cfg.AllowOldPasswords, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Switch "rowsAffected" mode
-		case "clientFoundRows":
-			var isBool bool
-			cfg.ClientFoundRows, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Collation
-		case "collation":
-			cfg.Collation = value
-			break
-
-		case "columnsWithAlias":
-			var isBool bool
-			cfg.ColumnsWithAlias, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Compression
-		case "compress":
-			return errors.New("compression not implemented yet")
-
-		// Enable client side placeholder substitution
-		case "interpolateParams":
-			var isBool bool
-			cfg.InterpolateParams, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Time Location
-		case "loc":
-			if value, err = url.QueryUnescape(value); err != nil {
-				return
-			}
-			cfg.Loc, err = time.LoadLocation(value)
-			if err != nil {
-				return
-			}
-
-		// multiple statements in one query
-		case "multiStatements":
-			var isBool bool
-			cfg.MultiStatements, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// time.Time parsing
-		case "parseTime":
-			var isBool bool
-			cfg.ParseTime, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// I/O read Timeout
-		case "readTimeout":
-			cfg.ReadTimeout, err = time.ParseDuration(value)
-			if err != nil {
-				return
-			}
-
-		// Strict mode
-		case "strict":
-			var isBool bool
-			cfg.Strict, isBool = readBool(value)
-			if !isBool {
-				return errors.New("invalid bool value: " + value)
-			}
-
-		// Dial Timeout
-		case "timeout":
-			cfg.Timeout, err = time.ParseDuration(value)
-			if err != nil {
-				return
-			}
-
-		// TLS-Encryption
-		case "tls":
-			boolValue, isBool := readBool(value)
-			if isBool {
-				if boolValue {
-					cfg.TLSConfig = "true"
-					cfg.tls = &tls.Config{}
-				} else {
-					cfg.TLSConfig = "false"
-				}
-			} else if vl := strings.ToLower(value); vl == "skip-verify" {
-				cfg.TLSConfig = vl
-				cfg.tls = &tls.Config{InsecureSkipVerify: true}
-			} else {
-				name, err := url.QueryUnescape(value)
-				if err != nil {
-					return fmt.Errorf("invalid value for TLS config name: %v", err)
-				}
-
-				if tlsConfig, ok := tlsConfigRegister[name]; ok {
-					if len(tlsConfig.ServerName) == 0 && !tlsConfig.InsecureSkipVerify {
-						host, _, err := net.SplitHostPort(cfg.Addr)
-						if err == nil {
-							tlsConfig.ServerName = host
-						}
-					}
-
-					cfg.TLSConfig = name
-					cfg.tls = tlsConfig
-				} else {
-					return errors.New("invalid value / unknown config name: " + name)
-				}
-			}
-
-		// I/O write Timeout
-		case "writeTimeout":
-			cfg.WriteTimeout, err = time.ParseDuration(value)
-			if err != nil {
-				return
-			}
-		case "maxAllowedPacket":
-			cfg.MaxAllowedPacket, err = strconv.Atoi(value)
-			if err != nil {
-				return
-			}
-		default:
-			// lazy init
-			if cfg.Params == nil {
-				cfg.Params = make(map[string]string)
-			}
-
-			if cfg.Params[param[0]], err = url.QueryUnescape(value); err != nil {
-				return
-			}
-		}
-	}
-
-	return
-}

+ 0 - 132
vendor/github.com/go-sql-driver/mysql/errors.go

@@ -1,132 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"database/sql/driver"
-	"errors"
-	"fmt"
-	"io"
-	"log"
-	"os"
-)
-
-// Various errors the driver might return. Can change between driver versions.
-var (
-	ErrInvalidConn       = errors.New("invalid connection")
-	ErrMalformPkt        = errors.New("malformed packet")
-	ErrNoTLS             = errors.New("TLS requested but server does not support TLS")
-	ErrCleartextPassword = errors.New("this user requires clear text authentication. If you still want to use it, please add 'allowCleartextPasswords=1' to your DSN")
-	ErrNativePassword    = errors.New("this user requires mysql native password authentication.")
-	ErrOldPassword       = errors.New("this user requires old password authentication. If you still want to use it, please add 'allowOldPasswords=1' to your DSN. See also https://github.com/go-sql-driver/mysql/wiki/old_passwords")
-	ErrUnknownPlugin     = errors.New("this authentication plugin is not supported")
-	ErrOldProtocol       = errors.New("MySQL server does not support required protocol 41+")
-	ErrPktSync           = errors.New("commands out of sync. You can't run this command now")
-	ErrPktSyncMul        = errors.New("commands out of sync. Did you run multiple statements at once?")
-	ErrPktTooLarge       = errors.New("packet for query is too large. Try adjusting the 'max_allowed_packet' variable on the server")
-	ErrBusyBuffer        = errors.New("busy buffer")
-)
-
-var errLog = Logger(log.New(os.Stderr, "[mysql] ", log.Ldate|log.Ltime|log.Lshortfile))
-
-// Logger is used to log critical error messages.
-type Logger interface {
-	Print(v ...interface{})
-}
-
-// SetLogger is used to set the logger for critical errors.
-// The initial logger is os.Stderr.
-func SetLogger(logger Logger) error {
-	if logger == nil {
-		return errors.New("logger is nil")
-	}
-	errLog = logger
-	return nil
-}
-
-// MySQLError is an error type which represents a single MySQL error
-type MySQLError struct {
-	Number  uint16
-	Message string
-}
-
-func (me *MySQLError) Error() string {
-	return fmt.Sprintf("Error %d: %s", me.Number, me.Message)
-}
-
-// MySQLWarnings is an error type which represents a group of one or more MySQL
-// warnings
-type MySQLWarnings []MySQLWarning
-
-func (mws MySQLWarnings) Error() string {
-	var msg string
-	for i, warning := range mws {
-		if i > 0 {
-			msg += "\r\n"
-		}
-		msg += fmt.Sprintf(
-			"%s %s: %s",
-			warning.Level,
-			warning.Code,
-			warning.Message,
-		)
-	}
-	return msg
-}
-
-// MySQLWarning is an error type which represents a single MySQL warning.
-// Warnings are returned in groups only. See MySQLWarnings
-type MySQLWarning struct {
-	Level   string
-	Code    string
-	Message string
-}
-
-func (mc *mysqlConn) getWarnings() (err error) {
-	rows, err := mc.Query("SHOW WARNINGS", nil)
-	if err != nil {
-		return
-	}
-
-	var warnings = MySQLWarnings{}
-	var values = make([]driver.Value, 3)
-
-	for {
-		err = rows.Next(values)
-		switch err {
-		case nil:
-			warning := MySQLWarning{}
-
-			if raw, ok := values[0].([]byte); ok {
-				warning.Level = string(raw)
-			} else {
-				warning.Level = fmt.Sprintf("%s", values[0])
-			}
-			if raw, ok := values[1].([]byte); ok {
-				warning.Code = string(raw)
-			} else {
-				warning.Code = fmt.Sprintf("%s", values[1])
-			}
-			if raw, ok := values[2].([]byte); ok {
-				warning.Message = string(raw)
-			} else {
-				warning.Message = fmt.Sprintf("%s", values[0])
-			}
-
-			warnings = append(warnings, warning)
-
-		case io.EOF:
-			return warnings
-
-		default:
-			rows.Close()
-			return
-		}
-	}
-}

+ 0 - 182
vendor/github.com/go-sql-driver/mysql/infile.go

@@ -1,182 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"fmt"
-	"io"
-	"os"
-	"strings"
-	"sync"
-)
-
-var (
-	fileRegister       map[string]bool
-	fileRegisterLock   sync.RWMutex
-	readerRegister     map[string]func() io.Reader
-	readerRegisterLock sync.RWMutex
-)
-
-// RegisterLocalFile adds the given file to the file whitelist,
-// so that it can be used by "LOAD DATA LOCAL INFILE <filepath>".
-// Alternatively you can allow the use of all local files with
-// the DSN parameter 'allowAllFiles=true'
-//
-//  filePath := "/home/gopher/data.csv"
-//  mysql.RegisterLocalFile(filePath)
-//  err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
-//  if err != nil {
-//  ...
-//
-func RegisterLocalFile(filePath string) {
-	fileRegisterLock.Lock()
-	// lazy map init
-	if fileRegister == nil {
-		fileRegister = make(map[string]bool)
-	}
-
-	fileRegister[strings.Trim(filePath, `"`)] = true
-	fileRegisterLock.Unlock()
-}
-
-// DeregisterLocalFile removes the given filepath from the whitelist.
-func DeregisterLocalFile(filePath string) {
-	fileRegisterLock.Lock()
-	delete(fileRegister, strings.Trim(filePath, `"`))
-	fileRegisterLock.Unlock()
-}
-
-// RegisterReaderHandler registers a handler function which is used
-// to receive a io.Reader.
-// The Reader can be used by "LOAD DATA LOCAL INFILE Reader::<name>".
-// If the handler returns a io.ReadCloser Close() is called when the
-// request is finished.
-//
-//  mysql.RegisterReaderHandler("data", func() io.Reader {
-//  	var csvReader io.Reader // Some Reader that returns CSV data
-//  	... // Open Reader here
-//  	return csvReader
-//  })
-//  err := db.Exec("LOAD DATA LOCAL INFILE 'Reader::data' INTO TABLE foo")
-//  if err != nil {
-//  ...
-//
-func RegisterReaderHandler(name string, handler func() io.Reader) {
-	readerRegisterLock.Lock()
-	// lazy map init
-	if readerRegister == nil {
-		readerRegister = make(map[string]func() io.Reader)
-	}
-
-	readerRegister[name] = handler
-	readerRegisterLock.Unlock()
-}
-
-// DeregisterReaderHandler removes the ReaderHandler function with
-// the given name from the registry.
-func DeregisterReaderHandler(name string) {
-	readerRegisterLock.Lock()
-	delete(readerRegister, name)
-	readerRegisterLock.Unlock()
-}
-
-func deferredClose(err *error, closer io.Closer) {
-	closeErr := closer.Close()
-	if *err == nil {
-		*err = closeErr
-	}
-}
-
-func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
-	var rdr io.Reader
-	var data []byte
-	packetSize := 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP
-	if mc.maxWriteSize < packetSize {
-		packetSize = mc.maxWriteSize
-	}
-
-	if idx := strings.Index(name, "Reader::"); idx == 0 || (idx > 0 && name[idx-1] == '/') { // io.Reader
-		// The server might return an an absolute path. See issue #355.
-		name = name[idx+8:]
-
-		readerRegisterLock.RLock()
-		handler, inMap := readerRegister[name]
-		readerRegisterLock.RUnlock()
-
-		if inMap {
-			rdr = handler()
-			if rdr != nil {
-				if cl, ok := rdr.(io.Closer); ok {
-					defer deferredClose(&err, cl)
-				}
-			} else {
-				err = fmt.Errorf("Reader '%s' is <nil>", name)
-			}
-		} else {
-			err = fmt.Errorf("Reader '%s' is not registered", name)
-		}
-	} else { // File
-		name = strings.Trim(name, `"`)
-		fileRegisterLock.RLock()
-		fr := fileRegister[name]
-		fileRegisterLock.RUnlock()
-		if mc.cfg.AllowAllFiles || fr {
-			var file *os.File
-			var fi os.FileInfo
-
-			if file, err = os.Open(name); err == nil {
-				defer deferredClose(&err, file)
-
-				// get file size
-				if fi, err = file.Stat(); err == nil {
-					rdr = file
-					if fileSize := int(fi.Size()); fileSize < packetSize {
-						packetSize = fileSize
-					}
-				}
-			}
-		} else {
-			err = fmt.Errorf("local file '%s' is not registered", name)
-		}
-	}
-
-	// send content packets
-	if err == nil {
-		data := make([]byte, 4+packetSize)
-		var n int
-		for err == nil {
-			n, err = rdr.Read(data[4:])
-			if n > 0 {
-				if ioErr := mc.writePacket(data[:4+n]); ioErr != nil {
-					return ioErr
-				}
-			}
-		}
-		if err == io.EOF {
-			err = nil
-		}
-	}
-
-	// send empty packet (termination)
-	if data == nil {
-		data = make([]byte, 4)
-	}
-	if ioErr := mc.writePacket(data[:4]); ioErr != nil {
-		return ioErr
-	}
-
-	// read OK packet
-	if err == nil {
-		_, err = mc.readResultOK()
-		return err
-	}
-
-	mc.readPacket()
-	return err
-}

+ 0 - 1287
vendor/github.com/go-sql-driver/mysql/packets.go

@@ -1,1287 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"bytes"
-	"crypto/tls"
-	"database/sql/driver"
-	"encoding/binary"
-	"errors"
-	"fmt"
-	"io"
-	"math"
-	"time"
-)
-
-// Packets documentation:
-// http://dev.mysql.com/doc/internals/en/client-server-protocol.html
-
-// Read packet to buffer 'data'
-func (mc *mysqlConn) readPacket() ([]byte, error) {
-	var prevData []byte
-	for {
-		// read packet header
-		data, err := mc.buf.readNext(4)
-		if err != nil {
-			errLog.Print(err)
-			mc.Close()
-			return nil, driver.ErrBadConn
-		}
-
-		// packet length [24 bit]
-		pktLen := int(uint32(data[0]) | uint32(data[1])<<8 | uint32(data[2])<<16)
-
-		// check packet sync [8 bit]
-		if data[3] != mc.sequence {
-			if data[3] > mc.sequence {
-				return nil, ErrPktSyncMul
-			}
-			return nil, ErrPktSync
-		}
-		mc.sequence++
-
-		// packets with length 0 terminate a previous packet which is a
-		// multiple of (2^24)−1 bytes long
-		if pktLen == 0 {
-			// there was no previous packet
-			if prevData == nil {
-				errLog.Print(ErrMalformPkt)
-				mc.Close()
-				return nil, driver.ErrBadConn
-			}
-
-			return prevData, nil
-		}
-
-		// read packet body [pktLen bytes]
-		data, err = mc.buf.readNext(pktLen)
-		if err != nil {
-			errLog.Print(err)
-			mc.Close()
-			return nil, driver.ErrBadConn
-		}
-
-		// return data if this was the last packet
-		if pktLen < maxPacketSize {
-			// zero allocations for non-split packets
-			if prevData == nil {
-				return data, nil
-			}
-
-			return append(prevData, data...), nil
-		}
-
-		prevData = append(prevData, data...)
-	}
-}
-
-// Write packet buffer 'data'
-func (mc *mysqlConn) writePacket(data []byte) error {
-	pktLen := len(data) - 4
-
-	if pktLen > mc.maxAllowedPacket {
-		return ErrPktTooLarge
-	}
-
-	for {
-		var size int
-		if pktLen >= maxPacketSize {
-			data[0] = 0xff
-			data[1] = 0xff
-			data[2] = 0xff
-			size = maxPacketSize
-		} else {
-			data[0] = byte(pktLen)
-			data[1] = byte(pktLen >> 8)
-			data[2] = byte(pktLen >> 16)
-			size = pktLen
-		}
-		data[3] = mc.sequence
-
-		// Write packet
-		if mc.writeTimeout > 0 {
-			if err := mc.netConn.SetWriteDeadline(time.Now().Add(mc.writeTimeout)); err != nil {
-				return err
-			}
-		}
-
-		n, err := mc.netConn.Write(data[:4+size])
-		if err == nil && n == 4+size {
-			mc.sequence++
-			if size != maxPacketSize {
-				return nil
-			}
-			pktLen -= size
-			data = data[size:]
-			continue
-		}
-
-		// Handle error
-		if err == nil { // n != len(data)
-			errLog.Print(ErrMalformPkt)
-		} else {
-			errLog.Print(err)
-		}
-		return driver.ErrBadConn
-	}
-}
-
-/******************************************************************************
-*                           Initialisation Process                            *
-******************************************************************************/
-
-// Handshake Initialization Packet
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::Handshake
-func (mc *mysqlConn) readInitPacket() ([]byte, error) {
-	data, err := mc.readPacket()
-	if err != nil {
-		return nil, err
-	}
-
-	if data[0] == iERR {
-		return nil, mc.handleErrorPacket(data)
-	}
-
-	// protocol version [1 byte]
-	if data[0] < minProtocolVersion {
-		return nil, fmt.Errorf(
-			"unsupported protocol version %d. Version %d or higher is required",
-			data[0],
-			minProtocolVersion,
-		)
-	}
-
-	// server version [null terminated string]
-	// connection id [4 bytes]
-	pos := 1 + bytes.IndexByte(data[1:], 0x00) + 1 + 4
-
-	// first part of the password cipher [8 bytes]
-	cipher := data[pos : pos+8]
-
-	// (filler) always 0x00 [1 byte]
-	pos += 8 + 1
-
-	// capability flags (lower 2 bytes) [2 bytes]
-	mc.flags = clientFlag(binary.LittleEndian.Uint16(data[pos : pos+2]))
-	if mc.flags&clientProtocol41 == 0 {
-		return nil, ErrOldProtocol
-	}
-	if mc.flags&clientSSL == 0 && mc.cfg.tls != nil {
-		return nil, ErrNoTLS
-	}
-	pos += 2
-
-	if len(data) > pos {
-		// character set [1 byte]
-		// status flags [2 bytes]
-		// capability flags (upper 2 bytes) [2 bytes]
-		// length of auth-plugin-data [1 byte]
-		// reserved (all [00]) [10 bytes]
-		pos += 1 + 2 + 2 + 1 + 10
-
-		// second part of the password cipher [mininum 13 bytes],
-		// where len=MAX(13, length of auth-plugin-data - 8)
-		//
-		// The web documentation is ambiguous about the length. However,
-		// according to mysql-5.7/sql/auth/sql_authentication.cc line 538,
-		// the 13th byte is "\0 byte, terminating the second part of
-		// a scramble". So the second part of the password cipher is
-		// a NULL terminated string that's at least 13 bytes with the
-		// last byte being NULL.
-		//
-		// The official Python library uses the fixed length 12
-		// which seems to work but technically could have a hidden bug.
-		cipher = append(cipher, data[pos:pos+12]...)
-
-		// TODO: Verify string termination
-		// EOF if version (>= 5.5.7 and < 5.5.10) or (>= 5.6.0 and < 5.6.2)
-		// \NUL otherwise
-		//
-		//if data[len(data)-1] == 0 {
-		//	return
-		//}
-		//return ErrMalformPkt
-
-		// make a memory safe copy of the cipher slice
-		var b [20]byte
-		copy(b[:], cipher)
-		return b[:], nil
-	}
-
-	// make a memory safe copy of the cipher slice
-	var b [8]byte
-	copy(b[:], cipher)
-	return b[:], nil
-}
-
-// Client Authentication Packet
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse
-func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
-	// Adjust client flags based on server support
-	clientFlags := clientProtocol41 |
-		clientSecureConn |
-		clientLongPassword |
-		clientTransactions |
-		clientLocalFiles |
-		clientPluginAuth |
-		clientMultiResults |
-		mc.flags&clientLongFlag
-
-	if mc.cfg.ClientFoundRows {
-		clientFlags |= clientFoundRows
-	}
-
-	// To enable TLS / SSL
-	if mc.cfg.tls != nil {
-		clientFlags |= clientSSL
-	}
-
-	if mc.cfg.MultiStatements {
-		clientFlags |= clientMultiStatements
-	}
-
-	// User Password
-	scrambleBuff := scramblePassword(cipher, []byte(mc.cfg.Passwd))
-
-	pktLen := 4 + 4 + 1 + 23 + len(mc.cfg.User) + 1 + 1 + len(scrambleBuff) + 21 + 1
-
-	// To specify a db name
-	if n := len(mc.cfg.DBName); n > 0 {
-		clientFlags |= clientConnectWithDB
-		pktLen += n + 1
-	}
-
-	// Calculate packet length and get buffer with that size
-	data := mc.buf.takeSmallBuffer(pktLen + 4)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// ClientFlags [32 bit]
-	data[4] = byte(clientFlags)
-	data[5] = byte(clientFlags >> 8)
-	data[6] = byte(clientFlags >> 16)
-	data[7] = byte(clientFlags >> 24)
-
-	// MaxPacketSize [32 bit] (none)
-	data[8] = 0x00
-	data[9] = 0x00
-	data[10] = 0x00
-	data[11] = 0x00
-
-	// Charset [1 byte]
-	var found bool
-	data[12], found = collations[mc.cfg.Collation]
-	if !found {
-		// Note possibility for false negatives:
-		// could be triggered  although the collation is valid if the
-		// collations map does not contain entries the server supports.
-		return errors.New("unknown collation")
-	}
-
-	// SSL Connection Request Packet
-	// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
-	if mc.cfg.tls != nil {
-		// Send TLS / SSL request packet
-		if err := mc.writePacket(data[:(4+4+1+23)+4]); err != nil {
-			return err
-		}
-
-		// Switch to TLS
-		tlsConn := tls.Client(mc.netConn, mc.cfg.tls)
-		if err := tlsConn.Handshake(); err != nil {
-			return err
-		}
-		mc.netConn = tlsConn
-		mc.buf.nc = tlsConn
-	}
-
-	// Filler [23 bytes] (all 0x00)
-	pos := 13
-	for ; pos < 13+23; pos++ {
-		data[pos] = 0
-	}
-
-	// User [null terminated string]
-	if len(mc.cfg.User) > 0 {
-		pos += copy(data[pos:], mc.cfg.User)
-	}
-	data[pos] = 0x00
-	pos++
-
-	// ScrambleBuffer [length encoded integer]
-	data[pos] = byte(len(scrambleBuff))
-	pos += 1 + copy(data[pos+1:], scrambleBuff)
-
-	// Databasename [null terminated string]
-	if len(mc.cfg.DBName) > 0 {
-		pos += copy(data[pos:], mc.cfg.DBName)
-		data[pos] = 0x00
-		pos++
-	}
-
-	// Assume native client during response
-	pos += copy(data[pos:], "mysql_native_password")
-	data[pos] = 0x00
-
-	// Send Auth packet
-	return mc.writePacket(data)
-}
-
-//  Client old authentication packet
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
-func (mc *mysqlConn) writeOldAuthPacket(cipher []byte) error {
-	// User password
-	scrambleBuff := scrambleOldPassword(cipher, []byte(mc.cfg.Passwd))
-
-	// Calculate the packet length and add a tailing 0
-	pktLen := len(scrambleBuff) + 1
-	data := mc.buf.takeSmallBuffer(4 + pktLen)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add the scrambled password [null terminated string]
-	copy(data[4:], scrambleBuff)
-	data[4+pktLen-1] = 0x00
-
-	return mc.writePacket(data)
-}
-
-//  Client clear text authentication packet
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
-func (mc *mysqlConn) writeClearAuthPacket() error {
-	// Calculate the packet length and add a tailing 0
-	pktLen := len(mc.cfg.Passwd) + 1
-	data := mc.buf.takeSmallBuffer(4 + pktLen)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add the clear password [null terminated string]
-	copy(data[4:], mc.cfg.Passwd)
-	data[4+pktLen-1] = 0x00
-
-	return mc.writePacket(data)
-}
-
-//  Native password authentication method
-// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::AuthSwitchResponse
-func (mc *mysqlConn) writeNativeAuthPacket(cipher []byte) error {
-	scrambleBuff := scramblePassword(cipher, []byte(mc.cfg.Passwd))
-
-	// Calculate the packet length and add a tailing 0
-	pktLen := len(scrambleBuff)
-	data := mc.buf.takeSmallBuffer(4 + pktLen)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add the scramble
-	copy(data[4:], scrambleBuff)
-
-	return mc.writePacket(data)
-}
-
-/******************************************************************************
-*                             Command Packets                                 *
-******************************************************************************/
-
-func (mc *mysqlConn) writeCommandPacket(command byte) error {
-	// Reset Packet Sequence
-	mc.sequence = 0
-
-	data := mc.buf.takeSmallBuffer(4 + 1)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add command byte
-	data[4] = command
-
-	// Send CMD packet
-	return mc.writePacket(data)
-}
-
-func (mc *mysqlConn) writeCommandPacketStr(command byte, arg string) error {
-	// Reset Packet Sequence
-	mc.sequence = 0
-
-	pktLen := 1 + len(arg)
-	data := mc.buf.takeBuffer(pktLen + 4)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add command byte
-	data[4] = command
-
-	// Add arg
-	copy(data[5:], arg)
-
-	// Send CMD packet
-	return mc.writePacket(data)
-}
-
-func (mc *mysqlConn) writeCommandPacketUint32(command byte, arg uint32) error {
-	// Reset Packet Sequence
-	mc.sequence = 0
-
-	data := mc.buf.takeSmallBuffer(4 + 1 + 4)
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// Add command byte
-	data[4] = command
-
-	// Add arg [32 bit]
-	data[5] = byte(arg)
-	data[6] = byte(arg >> 8)
-	data[7] = byte(arg >> 16)
-	data[8] = byte(arg >> 24)
-
-	// Send CMD packet
-	return mc.writePacket(data)
-}
-
-/******************************************************************************
-*                              Result Packets                                 *
-******************************************************************************/
-
-// Returns error if Packet is not an 'Result OK'-Packet
-func (mc *mysqlConn) readResultOK() ([]byte, error) {
-	data, err := mc.readPacket()
-	if err == nil {
-		// packet indicator
-		switch data[0] {
-
-		case iOK:
-			return nil, mc.handleOkPacket(data)
-
-		case iEOF:
-			if len(data) > 1 {
-				pluginEndIndex := bytes.IndexByte(data, 0x00)
-				plugin := string(data[1:pluginEndIndex])
-				cipher := data[pluginEndIndex+1 : len(data)-1]
-
-				if plugin == "mysql_old_password" {
-					// using old_passwords
-					return cipher, ErrOldPassword
-				} else if plugin == "mysql_clear_password" {
-					// using clear text password
-					return cipher, ErrCleartextPassword
-				} else if plugin == "mysql_native_password" {
-					// using mysql default authentication method
-					return cipher, ErrNativePassword
-				} else {
-					return cipher, ErrUnknownPlugin
-				}
-			} else {
-				// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::OldAuthSwitchRequest
-				return nil, ErrOldPassword
-			}
-
-		default: // Error otherwise
-			return nil, mc.handleErrorPacket(data)
-		}
-	}
-	return nil, err
-}
-
-// Result Set Header Packet
-// http://dev.mysql.com/doc/internals/en/com-query-response.html#packet-ProtocolText::Resultset
-func (mc *mysqlConn) readResultSetHeaderPacket() (int, error) {
-	data, err := mc.readPacket()
-	if err == nil {
-		switch data[0] {
-
-		case iOK:
-			return 0, mc.handleOkPacket(data)
-
-		case iERR:
-			return 0, mc.handleErrorPacket(data)
-
-		case iLocalInFile:
-			return 0, mc.handleInFileRequest(string(data[1:]))
-		}
-
-		// column count
-		num, _, n := readLengthEncodedInteger(data)
-		if n-len(data) == 0 {
-			return int(num), nil
-		}
-
-		return 0, ErrMalformPkt
-	}
-	return 0, err
-}
-
-// Error Packet
-// http://dev.mysql.com/doc/internals/en/generic-response-packets.html#packet-ERR_Packet
-func (mc *mysqlConn) handleErrorPacket(data []byte) error {
-	if data[0] != iERR {
-		return ErrMalformPkt
-	}
-
-	// 0xff [1 byte]
-
-	// Error Number [16 bit uint]
-	errno := binary.LittleEndian.Uint16(data[1:3])
-
-	pos := 3
-
-	// SQL State [optional: # + 5bytes string]
-	if data[3] == 0x23 {
-		//sqlstate := string(data[4 : 4+5])
-		pos = 9
-	}
-
-	// Error Message [string]
-	return &MySQLError{
-		Number:  errno,
-		Message: string(data[pos:]),
-	}
-}
-
-func readStatus(b []byte) statusFlag {
-	return statusFlag(b[0]) | statusFlag(b[1])<<8
-}
-
-// Ok Packet
-// http://dev.mysql.com/doc/internals/en/generic-response-packets.html#packet-OK_Packet
-func (mc *mysqlConn) handleOkPacket(data []byte) error {
-	var n, m int
-
-	// 0x00 [1 byte]
-
-	// Affected rows [Length Coded Binary]
-	mc.affectedRows, _, n = readLengthEncodedInteger(data[1:])
-
-	// Insert id [Length Coded Binary]
-	mc.insertId, _, m = readLengthEncodedInteger(data[1+n:])
-
-	// server_status [2 bytes]
-	mc.status = readStatus(data[1+n+m : 1+n+m+2])
-	if err := mc.discardResults(); err != nil {
-		return err
-	}
-
-	// warning count [2 bytes]
-	if !mc.strict {
-		return nil
-	}
-
-	pos := 1 + n + m + 2
-	if binary.LittleEndian.Uint16(data[pos:pos+2]) > 0 {
-		return mc.getWarnings()
-	}
-	return nil
-}
-
-// Read Packets as Field Packets until EOF-Packet or an Error appears
-// http://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::ColumnDefinition41
-func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
-	columns := make([]mysqlField, count)
-
-	for i := 0; ; i++ {
-		data, err := mc.readPacket()
-		if err != nil {
-			return nil, err
-		}
-
-		// EOF Packet
-		if data[0] == iEOF && (len(data) == 5 || len(data) == 1) {
-			if i == count {
-				return columns, nil
-			}
-			return nil, fmt.Errorf("column count mismatch n:%d len:%d", count, len(columns))
-		}
-
-		// Catalog
-		pos, err := skipLengthEncodedString(data)
-		if err != nil {
-			return nil, err
-		}
-
-		// Database [len coded string]
-		n, err := skipLengthEncodedString(data[pos:])
-		if err != nil {
-			return nil, err
-		}
-		pos += n
-
-		// Table [len coded string]
-		if mc.cfg.ColumnsWithAlias {
-			tableName, _, n, err := readLengthEncodedString(data[pos:])
-			if err != nil {
-				return nil, err
-			}
-			pos += n
-			columns[i].tableName = string(tableName)
-		} else {
-			n, err = skipLengthEncodedString(data[pos:])
-			if err != nil {
-				return nil, err
-			}
-			pos += n
-		}
-
-		// Original table [len coded string]
-		n, err = skipLengthEncodedString(data[pos:])
-		if err != nil {
-			return nil, err
-		}
-		pos += n
-
-		// Name [len coded string]
-		name, _, n, err := readLengthEncodedString(data[pos:])
-		if err != nil {
-			return nil, err
-		}
-		columns[i].name = string(name)
-		pos += n
-
-		// Original name [len coded string]
-		n, err = skipLengthEncodedString(data[pos:])
-		if err != nil {
-			return nil, err
-		}
-
-		// Filler [uint8]
-		// Charset [charset, collation uint8]
-		// Length [uint32]
-		pos += n + 1 + 2 + 4
-
-		// Field type [uint8]
-		columns[i].fieldType = data[pos]
-		pos++
-
-		// Flags [uint16]
-		columns[i].flags = fieldFlag(binary.LittleEndian.Uint16(data[pos : pos+2]))
-		pos += 2
-
-		// Decimals [uint8]
-		columns[i].decimals = data[pos]
-		//pos++
-
-		// Default value [len coded binary]
-		//if pos < len(data) {
-		//	defaultVal, _, err = bytesToLengthCodedBinary(data[pos:])
-		//}
-	}
-}
-
-// Read Packets as Field Packets until EOF-Packet or an Error appears
-// http://dev.mysql.com/doc/internals/en/com-query-response.html#packet-ProtocolText::ResultsetRow
-func (rows *textRows) readRow(dest []driver.Value) error {
-	mc := rows.mc
-
-	data, err := mc.readPacket()
-	if err != nil {
-		return err
-	}
-
-	// EOF Packet
-	if data[0] == iEOF && len(data) == 5 {
-		// server_status [2 bytes]
-		rows.mc.status = readStatus(data[3:])
-		err = rows.mc.discardResults()
-		if err == nil {
-			err = io.EOF
-		} else {
-			// connection unusable
-			rows.mc.Close()
-		}
-		rows.mc = nil
-		return err
-	}
-	if data[0] == iERR {
-		rows.mc = nil
-		return mc.handleErrorPacket(data)
-	}
-
-	// RowSet Packet
-	var n int
-	var isNull bool
-	pos := 0
-
-	for i := range dest {
-		// Read bytes and convert to string
-		dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
-		pos += n
-		if err == nil {
-			if !isNull {
-				if !mc.parseTime {
-					continue
-				} else {
-					switch rows.columns[i].fieldType {
-					case fieldTypeTimestamp, fieldTypeDateTime,
-						fieldTypeDate, fieldTypeNewDate:
-						dest[i], err = parseDateTime(
-							string(dest[i].([]byte)),
-							mc.cfg.Loc,
-						)
-						if err == nil {
-							continue
-						}
-					default:
-						continue
-					}
-				}
-
-			} else {
-				dest[i] = nil
-				continue
-			}
-		}
-		return err // err != nil
-	}
-
-	return nil
-}
-
-// Reads Packets until EOF-Packet or an Error appears. Returns count of Packets read
-func (mc *mysqlConn) readUntilEOF() error {
-	for {
-		data, err := mc.readPacket()
-		if err != nil {
-			return err
-		}
-
-		switch data[0] {
-		case iERR:
-			return mc.handleErrorPacket(data)
-		case iEOF:
-			if len(data) == 5 {
-				mc.status = readStatus(data[3:])
-			}
-			return nil
-		}
-	}
-}
-
-/******************************************************************************
-*                           Prepared Statements                               *
-******************************************************************************/
-
-// Prepare Result Packets
-// http://dev.mysql.com/doc/internals/en/com-stmt-prepare-response.html
-func (stmt *mysqlStmt) readPrepareResultPacket() (uint16, error) {
-	data, err := stmt.mc.readPacket()
-	if err == nil {
-		// packet indicator [1 byte]
-		if data[0] != iOK {
-			return 0, stmt.mc.handleErrorPacket(data)
-		}
-
-		// statement id [4 bytes]
-		stmt.id = binary.LittleEndian.Uint32(data[1:5])
-
-		// Column count [16 bit uint]
-		columnCount := binary.LittleEndian.Uint16(data[5:7])
-
-		// Param count [16 bit uint]
-		stmt.paramCount = int(binary.LittleEndian.Uint16(data[7:9]))
-
-		// Reserved [8 bit]
-
-		// Warning count [16 bit uint]
-		if !stmt.mc.strict {
-			return columnCount, nil
-		}
-
-		// Check for warnings count > 0, only available in MySQL > 4.1
-		if len(data) >= 12 && binary.LittleEndian.Uint16(data[10:12]) > 0 {
-			return columnCount, stmt.mc.getWarnings()
-		}
-		return columnCount, nil
-	}
-	return 0, err
-}
-
-// http://dev.mysql.com/doc/internals/en/com-stmt-send-long-data.html
-func (stmt *mysqlStmt) writeCommandLongData(paramID int, arg []byte) error {
-	maxLen := stmt.mc.maxAllowedPacket - 1
-	pktLen := maxLen
-
-	// After the header (bytes 0-3) follows before the data:
-	// 1 byte command
-	// 4 bytes stmtID
-	// 2 bytes paramID
-	const dataOffset = 1 + 4 + 2
-
-	// Can not use the write buffer since
-	// a) the buffer is too small
-	// b) it is in use
-	data := make([]byte, 4+1+4+2+len(arg))
-
-	copy(data[4+dataOffset:], arg)
-
-	for argLen := len(arg); argLen > 0; argLen -= pktLen - dataOffset {
-		if dataOffset+argLen < maxLen {
-			pktLen = dataOffset + argLen
-		}
-
-		stmt.mc.sequence = 0
-		// Add command byte [1 byte]
-		data[4] = comStmtSendLongData
-
-		// Add stmtID [32 bit]
-		data[5] = byte(stmt.id)
-		data[6] = byte(stmt.id >> 8)
-		data[7] = byte(stmt.id >> 16)
-		data[8] = byte(stmt.id >> 24)
-
-		// Add paramID [16 bit]
-		data[9] = byte(paramID)
-		data[10] = byte(paramID >> 8)
-
-		// Send CMD packet
-		err := stmt.mc.writePacket(data[:4+pktLen])
-		if err == nil {
-			data = data[pktLen-dataOffset:]
-			continue
-		}
-		return err
-
-	}
-
-	// Reset Packet Sequence
-	stmt.mc.sequence = 0
-	return nil
-}
-
-// Execute Prepared Statement
-// http://dev.mysql.com/doc/internals/en/com-stmt-execute.html
-func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error {
-	if len(args) != stmt.paramCount {
-		return fmt.Errorf(
-			"argument count mismatch (got: %d; has: %d)",
-			len(args),
-			stmt.paramCount,
-		)
-	}
-
-	const minPktLen = 4 + 1 + 4 + 1 + 4
-	mc := stmt.mc
-
-	// Reset packet-sequence
-	mc.sequence = 0
-
-	var data []byte
-
-	if len(args) == 0 {
-		data = mc.buf.takeBuffer(minPktLen)
-	} else {
-		data = mc.buf.takeCompleteBuffer()
-	}
-	if data == nil {
-		// can not take the buffer. Something must be wrong with the connection
-		errLog.Print(ErrBusyBuffer)
-		return driver.ErrBadConn
-	}
-
-	// command [1 byte]
-	data[4] = comStmtExecute
-
-	// statement_id [4 bytes]
-	data[5] = byte(stmt.id)
-	data[6] = byte(stmt.id >> 8)
-	data[7] = byte(stmt.id >> 16)
-	data[8] = byte(stmt.id >> 24)
-
-	// flags (0: CURSOR_TYPE_NO_CURSOR) [1 byte]
-	data[9] = 0x00
-
-	// iteration_count (uint32(1)) [4 bytes]
-	data[10] = 0x01
-	data[11] = 0x00
-	data[12] = 0x00
-	data[13] = 0x00
-
-	if len(args) > 0 {
-		pos := minPktLen
-
-		var nullMask []byte
-		if maskLen, typesLen := (len(args)+7)/8, 1+2*len(args); pos+maskLen+typesLen >= len(data) {
-			// buffer has to be extended but we don't know by how much so
-			// we depend on append after all data with known sizes fit.
-			// We stop at that because we deal with a lot of columns here
-			// which makes the required allocation size hard to guess.
-			tmp := make([]byte, pos+maskLen+typesLen)
-			copy(tmp[:pos], data[:pos])
-			data = tmp
-			nullMask = data[pos : pos+maskLen]
-			pos += maskLen
-		} else {
-			nullMask = data[pos : pos+maskLen]
-			for i := 0; i < maskLen; i++ {
-				nullMask[i] = 0
-			}
-			pos += maskLen
-		}
-
-		// newParameterBoundFlag 1 [1 byte]
-		data[pos] = 0x01
-		pos++
-
-		// type of each parameter [len(args)*2 bytes]
-		paramTypes := data[pos:]
-		pos += len(args) * 2
-
-		// value of each parameter [n bytes]
-		paramValues := data[pos:pos]
-		valuesCap := cap(paramValues)
-
-		for i, arg := range args {
-			// build NULL-bitmap
-			if arg == nil {
-				nullMask[i/8] |= 1 << (uint(i) & 7)
-				paramTypes[i+i] = fieldTypeNULL
-				paramTypes[i+i+1] = 0x00
-				continue
-			}
-
-			// cache types and values
-			switch v := arg.(type) {
-			case int64:
-				paramTypes[i+i] = fieldTypeLongLong
-				paramTypes[i+i+1] = 0x00
-
-				if cap(paramValues)-len(paramValues)-8 >= 0 {
-					paramValues = paramValues[:len(paramValues)+8]
-					binary.LittleEndian.PutUint64(
-						paramValues[len(paramValues)-8:],
-						uint64(v),
-					)
-				} else {
-					paramValues = append(paramValues,
-						uint64ToBytes(uint64(v))...,
-					)
-				}
-
-			case float64:
-				paramTypes[i+i] = fieldTypeDouble
-				paramTypes[i+i+1] = 0x00
-
-				if cap(paramValues)-len(paramValues)-8 >= 0 {
-					paramValues = paramValues[:len(paramValues)+8]
-					binary.LittleEndian.PutUint64(
-						paramValues[len(paramValues)-8:],
-						math.Float64bits(v),
-					)
-				} else {
-					paramValues = append(paramValues,
-						uint64ToBytes(math.Float64bits(v))...,
-					)
-				}
-
-			case bool:
-				paramTypes[i+i] = fieldTypeTiny
-				paramTypes[i+i+1] = 0x00
-
-				if v {
-					paramValues = append(paramValues, 0x01)
-				} else {
-					paramValues = append(paramValues, 0x00)
-				}
-
-			case []byte:
-				// Common case (non-nil value) first
-				if v != nil {
-					paramTypes[i+i] = fieldTypeString
-					paramTypes[i+i+1] = 0x00
-
-					if len(v) < mc.maxAllowedPacket-pos-len(paramValues)-(len(args)-(i+1))*64 {
-						paramValues = appendLengthEncodedInteger(paramValues,
-							uint64(len(v)),
-						)
-						paramValues = append(paramValues, v...)
-					} else {
-						if err := stmt.writeCommandLongData(i, v); err != nil {
-							return err
-						}
-					}
-					continue
-				}
-
-				// Handle []byte(nil) as a NULL value
-				nullMask[i/8] |= 1 << (uint(i) & 7)
-				paramTypes[i+i] = fieldTypeNULL
-				paramTypes[i+i+1] = 0x00
-
-			case string:
-				paramTypes[i+i] = fieldTypeString
-				paramTypes[i+i+1] = 0x00
-
-				if len(v) < mc.maxAllowedPacket-pos-len(paramValues)-(len(args)-(i+1))*64 {
-					paramValues = appendLengthEncodedInteger(paramValues,
-						uint64(len(v)),
-					)
-					paramValues = append(paramValues, v...)
-				} else {
-					if err := stmt.writeCommandLongData(i, []byte(v)); err != nil {
-						return err
-					}
-				}
-
-			case time.Time:
-				paramTypes[i+i] = fieldTypeString
-				paramTypes[i+i+1] = 0x00
-
-				var val []byte
-				if v.IsZero() {
-					val = []byte("0000-00-00")
-				} else {
-					val = []byte(v.In(mc.cfg.Loc).Format(timeFormat))
-				}
-
-				paramValues = appendLengthEncodedInteger(paramValues,
-					uint64(len(val)),
-				)
-				paramValues = append(paramValues, val...)
-
-			default:
-				return fmt.Errorf("can not convert type: %T", arg)
-			}
-		}
-
-		// Check if param values exceeded the available buffer
-		// In that case we must build the data packet with the new values buffer
-		if valuesCap != cap(paramValues) {
-			data = append(data[:pos], paramValues...)
-			mc.buf.buf = data
-		}
-
-		pos += len(paramValues)
-		data = data[:pos]
-	}
-
-	return mc.writePacket(data)
-}
-
-func (mc *mysqlConn) discardResults() error {
-	for mc.status&statusMoreResultsExists != 0 {
-		resLen, err := mc.readResultSetHeaderPacket()
-		if err != nil {
-			return err
-		}
-		if resLen > 0 {
-			// columns
-			if err := mc.readUntilEOF(); err != nil {
-				return err
-			}
-			// rows
-			if err := mc.readUntilEOF(); err != nil {
-				return err
-			}
-		} else {
-			mc.status &^= statusMoreResultsExists
-		}
-	}
-	return nil
-}
-
-// http://dev.mysql.com/doc/internals/en/binary-protocol-resultset-row.html
-func (rows *binaryRows) readRow(dest []driver.Value) error {
-	data, err := rows.mc.readPacket()
-	if err != nil {
-		return err
-	}
-
-	// packet indicator [1 byte]
-	if data[0] != iOK {
-		// EOF Packet
-		if data[0] == iEOF && len(data) == 5 {
-			rows.mc.status = readStatus(data[3:])
-			err = rows.mc.discardResults()
-			if err == nil {
-				err = io.EOF
-			} else {
-				// connection unusable
-				rows.mc.Close()
-			}
-			rows.mc = nil
-			return err
-		}
-		rows.mc = nil
-
-		// Error otherwise
-		return rows.mc.handleErrorPacket(data)
-	}
-
-	// NULL-bitmap,  [(column-count + 7 + 2) / 8 bytes]
-	pos := 1 + (len(dest)+7+2)>>3
-	nullMask := data[1:pos]
-
-	for i := range dest {
-		// Field is NULL
-		// (byte >> bit-pos) % 2 == 1
-		if ((nullMask[(i+2)>>3] >> uint((i+2)&7)) & 1) == 1 {
-			dest[i] = nil
-			continue
-		}
-
-		// Convert to byte-coded string
-		switch rows.columns[i].fieldType {
-		case fieldTypeNULL:
-			dest[i] = nil
-			continue
-
-		// Numeric Types
-		case fieldTypeTiny:
-			if rows.columns[i].flags&flagUnsigned != 0 {
-				dest[i] = int64(data[pos])
-			} else {
-				dest[i] = int64(int8(data[pos]))
-			}
-			pos++
-			continue
-
-		case fieldTypeShort, fieldTypeYear:
-			if rows.columns[i].flags&flagUnsigned != 0 {
-				dest[i] = int64(binary.LittleEndian.Uint16(data[pos : pos+2]))
-			} else {
-				dest[i] = int64(int16(binary.LittleEndian.Uint16(data[pos : pos+2])))
-			}
-			pos += 2
-			continue
-
-		case fieldTypeInt24, fieldTypeLong:
-			if rows.columns[i].flags&flagUnsigned != 0 {
-				dest[i] = int64(binary.LittleEndian.Uint32(data[pos : pos+4]))
-			} else {
-				dest[i] = int64(int32(binary.LittleEndian.Uint32(data[pos : pos+4])))
-			}
-			pos += 4
-			continue
-
-		case fieldTypeLongLong:
-			if rows.columns[i].flags&flagUnsigned != 0 {
-				val := binary.LittleEndian.Uint64(data[pos : pos+8])
-				if val > math.MaxInt64 {
-					dest[i] = uint64ToString(val)
-				} else {
-					dest[i] = int64(val)
-				}
-			} else {
-				dest[i] = int64(binary.LittleEndian.Uint64(data[pos : pos+8]))
-			}
-			pos += 8
-			continue
-
-		case fieldTypeFloat:
-			dest[i] = float32(math.Float32frombits(binary.LittleEndian.Uint32(data[pos : pos+4])))
-			pos += 4
-			continue
-
-		case fieldTypeDouble:
-			dest[i] = math.Float64frombits(binary.LittleEndian.Uint64(data[pos : pos+8]))
-			pos += 8
-			continue
-
-		// Length coded Binary Strings
-		case fieldTypeDecimal, fieldTypeNewDecimal, fieldTypeVarChar,
-			fieldTypeBit, fieldTypeEnum, fieldTypeSet, fieldTypeTinyBLOB,
-			fieldTypeMediumBLOB, fieldTypeLongBLOB, fieldTypeBLOB,
-			fieldTypeVarString, fieldTypeString, fieldTypeGeometry, fieldTypeJSON:
-			var isNull bool
-			var n int
-			dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
-			pos += n
-			if err == nil {
-				if !isNull {
-					continue
-				} else {
-					dest[i] = nil
-					continue
-				}
-			}
-			return err
-
-		case
-			fieldTypeDate, fieldTypeNewDate, // Date YYYY-MM-DD
-			fieldTypeTime,                         // Time [-][H]HH:MM:SS[.fractal]
-			fieldTypeTimestamp, fieldTypeDateTime: // Timestamp YYYY-MM-DD HH:MM:SS[.fractal]
-
-			num, isNull, n := readLengthEncodedInteger(data[pos:])
-			pos += n
-
-			switch {
-			case isNull:
-				dest[i] = nil
-				continue
-			case rows.columns[i].fieldType == fieldTypeTime:
-				// database/sql does not support an equivalent to TIME, return a string
-				var dstlen uint8
-				switch decimals := rows.columns[i].decimals; decimals {
-				case 0x00, 0x1f:
-					dstlen = 8
-				case 1, 2, 3, 4, 5, 6:
-					dstlen = 8 + 1 + decimals
-				default:
-					return fmt.Errorf(
-						"protocol error, illegal decimals value %d",
-						rows.columns[i].decimals,
-					)
-				}
-				dest[i], err = formatBinaryDateTime(data[pos:pos+int(num)], dstlen, true)
-			case rows.mc.parseTime:
-				dest[i], err = parseBinaryDateTime(num, data[pos:], rows.mc.cfg.Loc)
-			default:
-				var dstlen uint8
-				if rows.columns[i].fieldType == fieldTypeDate {
-					dstlen = 10
-				} else {
-					switch decimals := rows.columns[i].decimals; decimals {
-					case 0x00, 0x1f:
-						dstlen = 19
-					case 1, 2, 3, 4, 5, 6:
-						dstlen = 19 + 1 + decimals
-					default:
-						return fmt.Errorf(
-							"protocol error, illegal decimals value %d",
-							rows.columns[i].decimals,
-						)
-					}
-				}
-				dest[i], err = formatBinaryDateTime(data[pos:pos+int(num)], dstlen, false)
-			}
-
-			if err == nil {
-				pos += int(num)
-				continue
-			} else {
-				return err
-			}
-
-		// Please report if this happens!
-		default:
-			return fmt.Errorf("unknown field type %d", rows.columns[i].fieldType)
-		}
-	}
-
-	return nil
-}

+ 0 - 22
vendor/github.com/go-sql-driver/mysql/result.go

@@ -1,22 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-type mysqlResult struct {
-	affectedRows int64
-	insertId     int64
-}
-
-func (res *mysqlResult) LastInsertId() (int64, error) {
-	return res.insertId, nil
-}
-
-func (res *mysqlResult) RowsAffected() (int64, error) {
-	return res.affectedRows, nil
-}

+ 0 - 112
vendor/github.com/go-sql-driver/mysql/rows.go

@@ -1,112 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"database/sql/driver"
-	"io"
-)
-
-type mysqlField struct {
-	tableName string
-	name      string
-	flags     fieldFlag
-	fieldType byte
-	decimals  byte
-}
-
-type mysqlRows struct {
-	mc      *mysqlConn
-	columns []mysqlField
-}
-
-type binaryRows struct {
-	mysqlRows
-}
-
-type textRows struct {
-	mysqlRows
-}
-
-type emptyRows struct{}
-
-func (rows *mysqlRows) Columns() []string {
-	columns := make([]string, len(rows.columns))
-	if rows.mc != nil && rows.mc.cfg.ColumnsWithAlias {
-		for i := range columns {
-			if tableName := rows.columns[i].tableName; len(tableName) > 0 {
-				columns[i] = tableName + "." + rows.columns[i].name
-			} else {
-				columns[i] = rows.columns[i].name
-			}
-		}
-	} else {
-		for i := range columns {
-			columns[i] = rows.columns[i].name
-		}
-	}
-	return columns
-}
-
-func (rows *mysqlRows) Close() error {
-	mc := rows.mc
-	if mc == nil {
-		return nil
-	}
-	if mc.netConn == nil {
-		return ErrInvalidConn
-	}
-
-	// Remove unread packets from stream
-	err := mc.readUntilEOF()
-	if err == nil {
-		if err = mc.discardResults(); err != nil {
-			return err
-		}
-	}
-
-	rows.mc = nil
-	return err
-}
-
-func (rows *binaryRows) Next(dest []driver.Value) error {
-	if mc := rows.mc; mc != nil {
-		if mc.netConn == nil {
-			return ErrInvalidConn
-		}
-
-		// Fetch next row from stream
-		return rows.readRow(dest)
-	}
-	return io.EOF
-}
-
-func (rows *textRows) Next(dest []driver.Value) error {
-	if mc := rows.mc; mc != nil {
-		if mc.netConn == nil {
-			return ErrInvalidConn
-		}
-
-		// Fetch next row from stream
-		return rows.readRow(dest)
-	}
-	return io.EOF
-}
-
-func (rows emptyRows) Columns() []string {
-	return nil
-}
-
-func (rows emptyRows) Close() error {
-	return nil
-}
-
-func (rows emptyRows) Next(dest []driver.Value) error {
-	return io.EOF
-}

+ 0 - 153
vendor/github.com/go-sql-driver/mysql/statement.go

@@ -1,153 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"database/sql/driver"
-	"fmt"
-	"reflect"
-	"strconv"
-)
-
-type mysqlStmt struct {
-	mc         *mysqlConn
-	id         uint32
-	paramCount int
-	columns    []mysqlField // cached from the first query
-}
-
-func (stmt *mysqlStmt) Close() error {
-	if stmt.mc == nil || stmt.mc.netConn == nil {
-		// driver.Stmt.Close can be called more than once, thus this function
-		// has to be idempotent.
-		// See also Issue #450 and golang/go#16019.
-		//errLog.Print(ErrInvalidConn)
-		return driver.ErrBadConn
-	}
-
-	err := stmt.mc.writeCommandPacketUint32(comStmtClose, stmt.id)
-	stmt.mc = nil
-	return err
-}
-
-func (stmt *mysqlStmt) NumInput() int {
-	return stmt.paramCount
-}
-
-func (stmt *mysqlStmt) ColumnConverter(idx int) driver.ValueConverter {
-	return converter{}
-}
-
-func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
-	if stmt.mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	// Send command
-	err := stmt.writeExecutePacket(args)
-	if err != nil {
-		return nil, err
-	}
-
-	mc := stmt.mc
-
-	mc.affectedRows = 0
-	mc.insertId = 0
-
-	// Read Result
-	resLen, err := mc.readResultSetHeaderPacket()
-	if err == nil {
-		if resLen > 0 {
-			// Columns
-			err = mc.readUntilEOF()
-			if err != nil {
-				return nil, err
-			}
-
-			// Rows
-			err = mc.readUntilEOF()
-		}
-		if err == nil {
-			return &mysqlResult{
-				affectedRows: int64(mc.affectedRows),
-				insertId:     int64(mc.insertId),
-			}, nil
-		}
-	}
-
-	return nil, err
-}
-
-func (stmt *mysqlStmt) Query(args []driver.Value) (driver.Rows, error) {
-	if stmt.mc.netConn == nil {
-		errLog.Print(ErrInvalidConn)
-		return nil, driver.ErrBadConn
-	}
-	// Send command
-	err := stmt.writeExecutePacket(args)
-	if err != nil {
-		return nil, err
-	}
-
-	mc := stmt.mc
-
-	// Read Result
-	resLen, err := mc.readResultSetHeaderPacket()
-	if err != nil {
-		return nil, err
-	}
-
-	rows := new(binaryRows)
-
-	if resLen > 0 {
-		rows.mc = mc
-		// Columns
-		// If not cached, read them and cache them
-		if stmt.columns == nil {
-			rows.columns, err = mc.readColumns(resLen)
-			stmt.columns = rows.columns
-		} else {
-			rows.columns = stmt.columns
-			err = mc.readUntilEOF()
-		}
-	}
-
-	return rows, err
-}
-
-type converter struct{}
-
-func (c converter) ConvertValue(v interface{}) (driver.Value, error) {
-	if driver.IsValue(v) {
-		return v, nil
-	}
-
-	rv := reflect.ValueOf(v)
-	switch rv.Kind() {
-	case reflect.Ptr:
-		// indirect pointers
-		if rv.IsNil() {
-			return nil, nil
-		}
-		return c.ConvertValue(rv.Elem().Interface())
-	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-		return rv.Int(), nil
-	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32:
-		return int64(rv.Uint()), nil
-	case reflect.Uint64:
-		u64 := rv.Uint()
-		if u64 >= 1<<63 {
-			return strconv.FormatUint(u64, 10), nil
-		}
-		return int64(u64), nil
-	case reflect.Float32, reflect.Float64:
-		return rv.Float(), nil
-	}
-	return nil, fmt.Errorf("unsupported type %T, a %s", v, rv.Kind())
-}

+ 0 - 31
vendor/github.com/go-sql-driver/mysql/transaction.go

@@ -1,31 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-type mysqlTx struct {
-	mc *mysqlConn
-}
-
-func (tx *mysqlTx) Commit() (err error) {
-	if tx.mc == nil || tx.mc.netConn == nil {
-		return ErrInvalidConn
-	}
-	err = tx.mc.exec("COMMIT")
-	tx.mc = nil
-	return
-}
-
-func (tx *mysqlTx) Rollback() (err error) {
-	if tx.mc == nil || tx.mc.netConn == nil {
-		return ErrInvalidConn
-	}
-	err = tx.mc.exec("ROLLBACK")
-	tx.mc = nil
-	return
-}

+ 0 - 740
vendor/github.com/go-sql-driver/mysql/utils.go

@@ -1,740 +0,0 @@
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
-//
-// Copyright 2012 The Go-MySQL-Driver Authors. All rights reserved.
-//
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
-// You can obtain one at http://mozilla.org/MPL/2.0/.
-
-package mysql
-
-import (
-	"crypto/sha1"
-	"crypto/tls"
-	"database/sql/driver"
-	"encoding/binary"
-	"fmt"
-	"io"
-	"strings"
-	"time"
-)
-
-var (
-	tlsConfigRegister map[string]*tls.Config // Register for custom tls.Configs
-)
-
-// RegisterTLSConfig registers a custom tls.Config to be used with sql.Open.
-// Use the key as a value in the DSN where tls=value.
-//
-//  rootCertPool := x509.NewCertPool()
-//  pem, err := ioutil.ReadFile("/path/ca-cert.pem")
-//  if err != nil {
-//      log.Fatal(err)
-//  }
-//  if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {
-//      log.Fatal("Failed to append PEM.")
-//  }
-//  clientCert := make([]tls.Certificate, 0, 1)
-//  certs, err := tls.LoadX509KeyPair("/path/client-cert.pem", "/path/client-key.pem")
-//  if err != nil {
-//      log.Fatal(err)
-//  }
-//  clientCert = append(clientCert, certs)
-//  mysql.RegisterTLSConfig("custom", &tls.Config{
-//      RootCAs: rootCertPool,
-//      Certificates: clientCert,
-//  })
-//  db, err := sql.Open("mysql", "user@tcp(localhost:3306)/test?tls=custom")
-//
-func RegisterTLSConfig(key string, config *tls.Config) error {
-	if _, isBool := readBool(key); isBool || strings.ToLower(key) == "skip-verify" {
-		return fmt.Errorf("key '%s' is reserved", key)
-	}
-
-	if tlsConfigRegister == nil {
-		tlsConfigRegister = make(map[string]*tls.Config)
-	}
-
-	tlsConfigRegister[key] = config
-	return nil
-}
-
-// DeregisterTLSConfig removes the tls.Config associated with key.
-func DeregisterTLSConfig(key string) {
-	if tlsConfigRegister != nil {
-		delete(tlsConfigRegister, key)
-	}
-}
-
-// Returns the bool value of the input.
-// The 2nd return value indicates if the input was a valid bool value
-func readBool(input string) (value bool, valid bool) {
-	switch input {
-	case "1", "true", "TRUE", "True":
-		return true, true
-	case "0", "false", "FALSE", "False":
-		return false, true
-	}
-
-	// Not a valid bool value
-	return
-}
-
-/******************************************************************************
-*                             Authentication                                  *
-******************************************************************************/
-
-// Encrypt password using 4.1+ method
-func scramblePassword(scramble, password []byte) []byte {
-	if len(password) == 0 {
-		return nil
-	}
-
-	// stage1Hash = SHA1(password)
-	crypt := sha1.New()
-	crypt.Write(password)
-	stage1 := crypt.Sum(nil)
-
-	// scrambleHash = SHA1(scramble + SHA1(stage1Hash))
-	// inner Hash
-	crypt.Reset()
-	crypt.Write(stage1)
-	hash := crypt.Sum(nil)
-
-	// outer Hash
-	crypt.Reset()
-	crypt.Write(scramble)
-	crypt.Write(hash)
-	scramble = crypt.Sum(nil)
-
-	// token = scrambleHash XOR stage1Hash
-	for i := range scramble {
-		scramble[i] ^= stage1[i]
-	}
-	return scramble
-}
-
-// Encrypt password using pre 4.1 (old password) method
-// https://github.com/atcurtis/mariadb/blob/master/mysys/my_rnd.c
-type myRnd struct {
-	seed1, seed2 uint32
-}
-
-const myRndMaxVal = 0x3FFFFFFF
-
-// Pseudo random number generator
-func newMyRnd(seed1, seed2 uint32) *myRnd {
-	return &myRnd{
-		seed1: seed1 % myRndMaxVal,
-		seed2: seed2 % myRndMaxVal,
-	}
-}
-
-// Tested to be equivalent to MariaDB's floating point variant
-// http://play.golang.org/p/QHvhd4qved
-// http://play.golang.org/p/RG0q4ElWDx
-func (r *myRnd) NextByte() byte {
-	r.seed1 = (r.seed1*3 + r.seed2) % myRndMaxVal
-	r.seed2 = (r.seed1 + r.seed2 + 33) % myRndMaxVal
-
-	return byte(uint64(r.seed1) * 31 / myRndMaxVal)
-}
-
-// Generate binary hash from byte string using insecure pre 4.1 method
-func pwHash(password []byte) (result [2]uint32) {
-	var add uint32 = 7
-	var tmp uint32
-
-	result[0] = 1345345333
-	result[1] = 0x12345671
-
-	for _, c := range password {
-		// skip spaces and tabs in password
-		if c == ' ' || c == '\t' {
-			continue
-		}
-
-		tmp = uint32(c)
-		result[0] ^= (((result[0] & 63) + add) * tmp) + (result[0] << 8)
-		result[1] += (result[1] << 8) ^ result[0]
-		add += tmp
-	}
-
-	// Remove sign bit (1<<31)-1)
-	result[0] &= 0x7FFFFFFF
-	result[1] &= 0x7FFFFFFF
-
-	return
-}
-
-// Encrypt password using insecure pre 4.1 method
-func scrambleOldPassword(scramble, password []byte) []byte {
-	if len(password) == 0 {
-		return nil
-	}
-
-	scramble = scramble[:8]
-
-	hashPw := pwHash(password)
-	hashSc := pwHash(scramble)
-
-	r := newMyRnd(hashPw[0]^hashSc[0], hashPw[1]^hashSc[1])
-
-	var out [8]byte
-	for i := range out {
-		out[i] = r.NextByte() + 64
-	}
-
-	mask := r.NextByte()
-	for i := range out {
-		out[i] ^= mask
-	}
-
-	return out[:]
-}
-
-/******************************************************************************
-*                           Time related utils                                *
-******************************************************************************/
-
-// NullTime represents a time.Time that may be NULL.
-// NullTime implements the Scanner interface so
-// it can be used as a scan destination:
-//
-//  var nt NullTime
-//  err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
-//  ...
-//  if nt.Valid {
-//     // use nt.Time
-//  } else {
-//     // NULL value
-//  }
-//
-// This NullTime implementation is not driver-specific
-type NullTime struct {
-	Time  time.Time
-	Valid bool // Valid is true if Time is not NULL
-}
-
-// Scan implements the Scanner interface.
-// The value type must be time.Time or string / []byte (formatted time-string),
-// otherwise Scan fails.
-func (nt *NullTime) Scan(value interface{}) (err error) {
-	if value == nil {
-		nt.Time, nt.Valid = time.Time{}, false
-		return
-	}
-
-	switch v := value.(type) {
-	case time.Time:
-		nt.Time, nt.Valid = v, true
-		return
-	case []byte:
-		nt.Time, err = parseDateTime(string(v), time.UTC)
-		nt.Valid = (err == nil)
-		return
-	case string:
-		nt.Time, err = parseDateTime(v, time.UTC)
-		nt.Valid = (err == nil)
-		return
-	}
-
-	nt.Valid = false
-	return fmt.Errorf("Can't convert %T to time.Time", value)
-}
-
-// Value implements the driver Valuer interface.
-func (nt NullTime) Value() (driver.Value, error) {
-	if !nt.Valid {
-		return nil, nil
-	}
-	return nt.Time, nil
-}
-
-func parseDateTime(str string, loc *time.Location) (t time.Time, err error) {
-	base := "0000-00-00 00:00:00.0000000"
-	switch len(str) {
-	case 10, 19, 21, 22, 23, 24, 25, 26: // up to "YYYY-MM-DD HH:MM:SS.MMMMMM"
-		if str == base[:len(str)] {
-			return
-		}
-		t, err = time.Parse(timeFormat[:len(str)], str)
-	default:
-		err = fmt.Errorf("invalid time string: %s", str)
-		return
-	}
-
-	// Adjust location
-	if err == nil && loc != time.UTC {
-		y, mo, d := t.Date()
-		h, mi, s := t.Clock()
-		t, err = time.Date(y, mo, d, h, mi, s, t.Nanosecond(), loc), nil
-	}
-
-	return
-}
-
-func parseBinaryDateTime(num uint64, data []byte, loc *time.Location) (driver.Value, error) {
-	switch num {
-	case 0:
-		return time.Time{}, nil
-	case 4:
-		return time.Date(
-			int(binary.LittleEndian.Uint16(data[:2])), // year
-			time.Month(data[2]),                       // month
-			int(data[3]),                              // day
-			0, 0, 0, 0,
-			loc,
-		), nil
-	case 7:
-		return time.Date(
-			int(binary.LittleEndian.Uint16(data[:2])), // year
-			time.Month(data[2]),                       // month
-			int(data[3]),                              // day
-			int(data[4]),                              // hour
-			int(data[5]),                              // minutes
-			int(data[6]),                              // seconds
-			0,
-			loc,
-		), nil
-	case 11:
-		return time.Date(
-			int(binary.LittleEndian.Uint16(data[:2])), // year
-			time.Month(data[2]),                       // month
-			int(data[3]),                              // day
-			int(data[4]),                              // hour
-			int(data[5]),                              // minutes
-			int(data[6]),                              // seconds
-			int(binary.LittleEndian.Uint32(data[7:11]))*1000, // nanoseconds
-			loc,
-		), nil
-	}
-	return nil, fmt.Errorf("invalid DATETIME packet length %d", num)
-}
-
-// zeroDateTime is used in formatBinaryDateTime to avoid an allocation
-// if the DATE or DATETIME has the zero value.
-// It must never be changed.
-// The current behavior depends on database/sql copying the result.
-var zeroDateTime = []byte("0000-00-00 00:00:00.000000")
-
-const digits01 = "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"
-const digits10 = "0000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999"
-
-func formatBinaryDateTime(src []byte, length uint8, justTime bool) (driver.Value, error) {
-	// length expects the deterministic length of the zero value,
-	// negative time and 100+ hours are automatically added if needed
-	if len(src) == 0 {
-		if justTime {
-			return zeroDateTime[11 : 11+length], nil
-		}
-		return zeroDateTime[:length], nil
-	}
-	var dst []byte          // return value
-	var pt, p1, p2, p3 byte // current digit pair
-	var zOffs byte          // offset of value in zeroDateTime
-	if justTime {
-		switch length {
-		case
-			8,                      // time (can be up to 10 when negative and 100+ hours)
-			10, 11, 12, 13, 14, 15: // time with fractional seconds
-		default:
-			return nil, fmt.Errorf("illegal TIME length %d", length)
-		}
-		switch len(src) {
-		case 8, 12:
-		default:
-			return nil, fmt.Errorf("invalid TIME packet length %d", len(src))
-		}
-		// +2 to enable negative time and 100+ hours
-		dst = make([]byte, 0, length+2)
-		if src[0] == 1 {
-			dst = append(dst, '-')
-		}
-		if src[1] != 0 {
-			hour := uint16(src[1])*24 + uint16(src[5])
-			pt = byte(hour / 100)
-			p1 = byte(hour - 100*uint16(pt))
-			dst = append(dst, digits01[pt])
-		} else {
-			p1 = src[5]
-		}
-		zOffs = 11
-		src = src[6:]
-	} else {
-		switch length {
-		case 10, 19, 21, 22, 23, 24, 25, 26:
-		default:
-			t := "DATE"
-			if length > 10 {
-				t += "TIME"
-			}
-			return nil, fmt.Errorf("illegal %s length %d", t, length)
-		}
-		switch len(src) {
-		case 4, 7, 11:
-		default:
-			t := "DATE"
-			if length > 10 {
-				t += "TIME"
-			}
-			return nil, fmt.Errorf("illegal %s packet length %d", t, len(src))
-		}
-		dst = make([]byte, 0, length)
-		// start with the date
-		year := binary.LittleEndian.Uint16(src[:2])
-		pt = byte(year / 100)
-		p1 = byte(year - 100*uint16(pt))
-		p2, p3 = src[2], src[3]
-		dst = append(dst,
-			digits10[pt], digits01[pt],
-			digits10[p1], digits01[p1], '-',
-			digits10[p2], digits01[p2], '-',
-			digits10[p3], digits01[p3],
-		)
-		if length == 10 {
-			return dst, nil
-		}
-		if len(src) == 4 {
-			return append(dst, zeroDateTime[10:length]...), nil
-		}
-		dst = append(dst, ' ')
-		p1 = src[4] // hour
-		src = src[5:]
-	}
-	// p1 is 2-digit hour, src is after hour
-	p2, p3 = src[0], src[1]
-	dst = append(dst,
-		digits10[p1], digits01[p1], ':',
-		digits10[p2], digits01[p2], ':',
-		digits10[p3], digits01[p3],
-	)
-	if length <= byte(len(dst)) {
-		return dst, nil
-	}
-	src = src[2:]
-	if len(src) == 0 {
-		return append(dst, zeroDateTime[19:zOffs+length]...), nil
-	}
-	microsecs := binary.LittleEndian.Uint32(src[:4])
-	p1 = byte(microsecs / 10000)
-	microsecs -= 10000 * uint32(p1)
-	p2 = byte(microsecs / 100)
-	microsecs -= 100 * uint32(p2)
-	p3 = byte(microsecs)
-	switch decimals := zOffs + length - 20; decimals {
-	default:
-		return append(dst, '.',
-			digits10[p1], digits01[p1],
-			digits10[p2], digits01[p2],
-			digits10[p3], digits01[p3],
-		), nil
-	case 1:
-		return append(dst, '.',
-			digits10[p1],
-		), nil
-	case 2:
-		return append(dst, '.',
-			digits10[p1], digits01[p1],
-		), nil
-	case 3:
-		return append(dst, '.',
-			digits10[p1], digits01[p1],
-			digits10[p2],
-		), nil
-	case 4:
-		return append(dst, '.',
-			digits10[p1], digits01[p1],
-			digits10[p2], digits01[p2],
-		), nil
-	case 5:
-		return append(dst, '.',
-			digits10[p1], digits01[p1],
-			digits10[p2], digits01[p2],
-			digits10[p3],
-		), nil
-	}
-}
-
-/******************************************************************************
-*                       Convert from and to bytes                             *
-******************************************************************************/
-
-func uint64ToBytes(n uint64) []byte {
-	return []byte{
-		byte(n),
-		byte(n >> 8),
-		byte(n >> 16),
-		byte(n >> 24),
-		byte(n >> 32),
-		byte(n >> 40),
-		byte(n >> 48),
-		byte(n >> 56),
-	}
-}
-
-func uint64ToString(n uint64) []byte {
-	var a [20]byte
-	i := 20
-
-	// U+0030 = 0
-	// ...
-	// U+0039 = 9
-
-	var q uint64
-	for n >= 10 {
-		i--
-		q = n / 10
-		a[i] = uint8(n-q*10) + 0x30
-		n = q
-	}
-
-	i--
-	a[i] = uint8(n) + 0x30
-
-	return a[i:]
-}
-
-// treats string value as unsigned integer representation
-func stringToInt(b []byte) int {
-	val := 0
-	for i := range b {
-		val *= 10
-		val += int(b[i] - 0x30)
-	}
-	return val
-}
-
-// returns the string read as a bytes slice, wheter the value is NULL,
-// the number of bytes read and an error, in case the string is longer than
-// the input slice
-func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
-	// Get length
-	num, isNull, n := readLengthEncodedInteger(b)
-	if num < 1 {
-		return b[n:n], isNull, n, nil
-	}
-
-	n += int(num)
-
-	// Check data length
-	if len(b) >= n {
-		return b[n-int(num) : n], false, n, nil
-	}
-	return nil, false, n, io.EOF
-}
-
-// returns the number of bytes skipped and an error, in case the string is
-// longer than the input slice
-func skipLengthEncodedString(b []byte) (int, error) {
-	// Get length
-	num, _, n := readLengthEncodedInteger(b)
-	if num < 1 {
-		return n, nil
-	}
-
-	n += int(num)
-
-	// Check data length
-	if len(b) >= n {
-		return n, nil
-	}
-	return n, io.EOF
-}
-
-// returns the number read, whether the value is NULL and the number of bytes read
-func readLengthEncodedInteger(b []byte) (uint64, bool, int) {
-	// See issue #349
-	if len(b) == 0 {
-		return 0, true, 1
-	}
-	switch b[0] {
-
-	// 251: NULL
-	case 0xfb:
-		return 0, true, 1
-
-	// 252: value of following 2
-	case 0xfc:
-		return uint64(b[1]) | uint64(b[2])<<8, false, 3
-
-	// 253: value of following 3
-	case 0xfd:
-		return uint64(b[1]) | uint64(b[2])<<8 | uint64(b[3])<<16, false, 4
-
-	// 254: value of following 8
-	case 0xfe:
-		return uint64(b[1]) | uint64(b[2])<<8 | uint64(b[3])<<16 |
-				uint64(b[4])<<24 | uint64(b[5])<<32 | uint64(b[6])<<40 |
-				uint64(b[7])<<48 | uint64(b[8])<<56,
-			false, 9
-	}
-
-	// 0-250: value of first byte
-	return uint64(b[0]), false, 1
-}
-
-// encodes a uint64 value and appends it to the given bytes slice
-func appendLengthEncodedInteger(b []byte, n uint64) []byte {
-	switch {
-	case n <= 250:
-		return append(b, byte(n))
-
-	case n <= 0xffff:
-		return append(b, 0xfc, byte(n), byte(n>>8))
-
-	case n <= 0xffffff:
-		return append(b, 0xfd, byte(n), byte(n>>8), byte(n>>16))
-	}
-	return append(b, 0xfe, byte(n), byte(n>>8), byte(n>>16), byte(n>>24),
-		byte(n>>32), byte(n>>40), byte(n>>48), byte(n>>56))
-}
-
-// reserveBuffer checks cap(buf) and expand buffer to len(buf) + appendSize.
-// If cap(buf) is not enough, reallocate new buffer.
-func reserveBuffer(buf []byte, appendSize int) []byte {
-	newSize := len(buf) + appendSize
-	if cap(buf) < newSize {
-		// Grow buffer exponentially
-		newBuf := make([]byte, len(buf)*2+appendSize)
-		copy(newBuf, buf)
-		buf = newBuf
-	}
-	return buf[:newSize]
-}
-
-// escapeBytesBackslash escapes []byte with backslashes (\)
-// This escapes the contents of a string (provided as []byte) by adding backslashes before special
-// characters, and turning others into specific escape sequences, such as
-// turning newlines into \n and null bytes into \0.
-// https://github.com/mysql/mysql-server/blob/mysql-5.7.5/mysys/charset.c#L823-L932
-func escapeBytesBackslash(buf, v []byte) []byte {
-	pos := len(buf)
-	buf = reserveBuffer(buf, len(v)*2)
-
-	for _, c := range v {
-		switch c {
-		case '\x00':
-			buf[pos] = '\\'
-			buf[pos+1] = '0'
-			pos += 2
-		case '\n':
-			buf[pos] = '\\'
-			buf[pos+1] = 'n'
-			pos += 2
-		case '\r':
-			buf[pos] = '\\'
-			buf[pos+1] = 'r'
-			pos += 2
-		case '\x1a':
-			buf[pos] = '\\'
-			buf[pos+1] = 'Z'
-			pos += 2
-		case '\'':
-			buf[pos] = '\\'
-			buf[pos+1] = '\''
-			pos += 2
-		case '"':
-			buf[pos] = '\\'
-			buf[pos+1] = '"'
-			pos += 2
-		case '\\':
-			buf[pos] = '\\'
-			buf[pos+1] = '\\'
-			pos += 2
-		default:
-			buf[pos] = c
-			pos++
-		}
-	}
-
-	return buf[:pos]
-}
-
-// escapeStringBackslash is similar to escapeBytesBackslash but for string.
-func escapeStringBackslash(buf []byte, v string) []byte {
-	pos := len(buf)
-	buf = reserveBuffer(buf, len(v)*2)
-
-	for i := 0; i < len(v); i++ {
-		c := v[i]
-		switch c {
-		case '\x00':
-			buf[pos] = '\\'
-			buf[pos+1] = '0'
-			pos += 2
-		case '\n':
-			buf[pos] = '\\'
-			buf[pos+1] = 'n'
-			pos += 2
-		case '\r':
-			buf[pos] = '\\'
-			buf[pos+1] = 'r'
-			pos += 2
-		case '\x1a':
-			buf[pos] = '\\'
-			buf[pos+1] = 'Z'
-			pos += 2
-		case '\'':
-			buf[pos] = '\\'
-			buf[pos+1] = '\''
-			pos += 2
-		case '"':
-			buf[pos] = '\\'
-			buf[pos+1] = '"'
-			pos += 2
-		case '\\':
-			buf[pos] = '\\'
-			buf[pos+1] = '\\'
-			pos += 2
-		default:
-			buf[pos] = c
-			pos++
-		}
-	}
-
-	return buf[:pos]
-}
-
-// escapeBytesQuotes escapes apostrophes in []byte by doubling them up.
-// This escapes the contents of a string by doubling up any apostrophes that
-// it contains. This is used when the NO_BACKSLASH_ESCAPES SQL_MODE is in
-// effect on the server.
-// https://github.com/mysql/mysql-server/blob/mysql-5.7.5/mysys/charset.c#L963-L1038
-func escapeBytesQuotes(buf, v []byte) []byte {
-	pos := len(buf)
-	buf = reserveBuffer(buf, len(v)*2)
-
-	for _, c := range v {
-		if c == '\'' {
-			buf[pos] = '\''
-			buf[pos+1] = '\''
-			pos += 2
-		} else {
-			buf[pos] = c
-			pos++
-		}
-	}
-
-	return buf[:pos]
-}
-
-// escapeStringQuotes is similar to escapeBytesQuotes but for string.
-func escapeStringQuotes(buf []byte, v string) []byte {
-	pos := len(buf)
-	buf = reserveBuffer(buf, len(v)*2)
-
-	for i := 0; i < len(v); i++ {
-		c := v[i]
-		if c == '\'' {
-			buf[pos] = '\''
-			buf[pos+1] = '\''
-			pos += 2
-		} else {
-			buf[pos] = c
-			pos++
-		}
-	}
-
-	return buf[:pos]
-}

+ 0 - 8
vendor/github.com/gobwas/glob/.gitignore

@@ -1,8 +0,0 @@
-glob.iml
-.idea
-*.cpu
-*.mem
-*.test
-*.dot
-*.png
-*.svg

+ 0 - 15
vendor/github.com/gobwas/glob/.travis.yml

@@ -1,15 +0,0 @@
-language: go
-go:
-  - "1.7.X"
-  - "1.8.X"
-  - "1.9.X"
-  - "1.10.X"
-  - master
-
-matrix:
-  allow_failures:
-    - go: master
-fast_finish: true
-
-script:
-  - go test -v ./...

+ 0 - 21
vendor/github.com/gobwas/glob/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2016 Sergey Kamardin
-
-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.

+ 0 - 26
vendor/github.com/gobwas/glob/bench.sh

@@ -1,26 +0,0 @@
-#! /bin/bash
-
-bench() {
-    filename="/tmp/$1-$2.bench"
-    if test -e "${filename}";
-    then
-        echo "Already exists ${filename}"
-    else
-        backup=`git rev-parse --abbrev-ref HEAD`
-        git checkout $1
-        echo -n "Creating ${filename}... "
-        go test ./... -run=NONE -bench=$2 > "${filename}" -benchmem
-        echo "OK"
-        git checkout ${backup}
-        sleep 5
-    fi
-}
-
-
-to=$1
-current=`git rev-parse --abbrev-ref HEAD`
-
-bench ${to} $2
-bench ${current} $2
-
-benchcmp $3 "/tmp/${to}-$2.bench" "/tmp/${current}-$2.bench"

+ 0 - 525
vendor/github.com/gobwas/glob/compiler/compiler.go

@@ -1,525 +0,0 @@
-package compiler
-
-// TODO use constructor with all matchers, and to their structs private
-// TODO glue multiple Text nodes (like after QuoteMeta)
-
-import (
-	"fmt"
-	"reflect"
-
-	"github.com/gobwas/glob/match"
-	"github.com/gobwas/glob/syntax/ast"
-	"github.com/gobwas/glob/util/runes"
-)
-
-func optimizeMatcher(matcher match.Matcher) match.Matcher {
-	switch m := matcher.(type) {
-
-	case match.Any:
-		if len(m.Separators) == 0 {
-			return match.NewSuper()
-		}
-
-	case match.AnyOf:
-		if len(m.Matchers) == 1 {
-			return m.Matchers[0]
-		}
-
-		return m
-
-	case match.List:
-		if m.Not == false && len(m.List) == 1 {
-			return match.NewText(string(m.List))
-		}
-
-		return m
-
-	case match.BTree:
-		m.Left = optimizeMatcher(m.Left)
-		m.Right = optimizeMatcher(m.Right)
-
-		r, ok := m.Value.(match.Text)
-		if !ok {
-			return m
-		}
-
-		var (
-			leftNil  = m.Left == nil
-			rightNil = m.Right == nil
-		)
-		if leftNil && rightNil {
-			return match.NewText(r.Str)
-		}
-
-		_, leftSuper := m.Left.(match.Super)
-		lp, leftPrefix := m.Left.(match.Prefix)
-		la, leftAny := m.Left.(match.Any)
-
-		_, rightSuper := m.Right.(match.Super)
-		rs, rightSuffix := m.Right.(match.Suffix)
-		ra, rightAny := m.Right.(match.Any)
-
-		switch {
-		case leftSuper && rightSuper:
-			return match.NewContains(r.Str, false)
-
-		case leftSuper && rightNil:
-			return match.NewSuffix(r.Str)
-
-		case rightSuper && leftNil:
-			return match.NewPrefix(r.Str)
-
-		case leftNil && rightSuffix:
-			return match.NewPrefixSuffix(r.Str, rs.Suffix)
-
-		case rightNil && leftPrefix:
-			return match.NewPrefixSuffix(lp.Prefix, r.Str)
-
-		case rightNil && leftAny:
-			return match.NewSuffixAny(r.Str, la.Separators)
-
-		case leftNil && rightAny:
-			return match.NewPrefixAny(r.Str, ra.Separators)
-		}
-
-		return m
-	}
-
-	return matcher
-}
-
-func compileMatchers(matchers []match.Matcher) (match.Matcher, error) {
-	if len(matchers) == 0 {
-		return nil, fmt.Errorf("compile error: need at least one matcher")
-	}
-	if len(matchers) == 1 {
-		return matchers[0], nil
-	}
-	if m := glueMatchers(matchers); m != nil {
-		return m, nil
-	}
-
-	idx := -1
-	maxLen := -1
-	var val match.Matcher
-	for i, matcher := range matchers {
-		if l := matcher.Len(); l != -1 && l >= maxLen {
-			maxLen = l
-			idx = i
-			val = matcher
-		}
-	}
-
-	if val == nil { // not found matcher with static length
-		r, err := compileMatchers(matchers[1:])
-		if err != nil {
-			return nil, err
-		}
-		return match.NewBTree(matchers[0], nil, r), nil
-	}
-
-	left := matchers[:idx]
-	var right []match.Matcher
-	if len(matchers) > idx+1 {
-		right = matchers[idx+1:]
-	}
-
-	var l, r match.Matcher
-	var err error
-	if len(left) > 0 {
-		l, err = compileMatchers(left)
-		if err != nil {
-			return nil, err
-		}
-	}
-
-	if len(right) > 0 {
-		r, err = compileMatchers(right)
-		if err != nil {
-			return nil, err
-		}
-	}
-
-	return match.NewBTree(val, l, r), nil
-}
-
-func glueMatchers(matchers []match.Matcher) match.Matcher {
-	if m := glueMatchersAsEvery(matchers); m != nil {
-		return m
-	}
-	if m := glueMatchersAsRow(matchers); m != nil {
-		return m
-	}
-	return nil
-}
-
-func glueMatchersAsRow(matchers []match.Matcher) match.Matcher {
-	if len(matchers) <= 1 {
-		return nil
-	}
-
-	var (
-		c []match.Matcher
-		l int
-	)
-	for _, matcher := range matchers {
-		if ml := matcher.Len(); ml == -1 {
-			return nil
-		} else {
-			c = append(c, matcher)
-			l += ml
-		}
-	}
-	return match.NewRow(l, c...)
-}
-
-func glueMatchersAsEvery(matchers []match.Matcher) match.Matcher {
-	if len(matchers) <= 1 {
-		return nil
-	}
-
-	var (
-		hasAny    bool
-		hasSuper  bool
-		hasSingle bool
-		min       int
-		separator []rune
-	)
-
-	for i, matcher := range matchers {
-		var sep []rune
-
-		switch m := matcher.(type) {
-		case match.Super:
-			sep = []rune{}
-			hasSuper = true
-
-		case match.Any:
-			sep = m.Separators
-			hasAny = true
-
-		case match.Single:
-			sep = m.Separators
-			hasSingle = true
-			min++
-
-		case match.List:
-			if !m.Not {
-				return nil
-			}
-			sep = m.List
-			hasSingle = true
-			min++
-
-		default:
-			return nil
-		}
-
-		// initialize
-		if i == 0 {
-			separator = sep
-		}
-
-		if runes.Equal(sep, separator) {
-			continue
-		}
-
-		return nil
-	}
-
-	if hasSuper && !hasAny && !hasSingle {
-		return match.NewSuper()
-	}
-
-	if hasAny && !hasSuper && !hasSingle {
-		return match.NewAny(separator)
-	}
-
-	if (hasAny || hasSuper) && min > 0 && len(separator) == 0 {
-		return match.NewMin(min)
-	}
-
-	every := match.NewEveryOf()
-
-	if min > 0 {
-		every.Add(match.NewMin(min))
-
-		if !hasAny && !hasSuper {
-			every.Add(match.NewMax(min))
-		}
-	}
-
-	if len(separator) > 0 {
-		every.Add(match.NewContains(string(separator), true))
-	}
-
-	return every
-}
-
-func minimizeMatchers(matchers []match.Matcher) []match.Matcher {
-	var done match.Matcher
-	var left, right, count int
-
-	for l := 0; l < len(matchers); l++ {
-		for r := len(matchers); r > l; r-- {
-			if glued := glueMatchers(matchers[l:r]); glued != nil {
-				var swap bool
-
-				if done == nil {
-					swap = true
-				} else {
-					cl, gl := done.Len(), glued.Len()
-					swap = cl > -1 && gl > -1 && gl > cl
-					swap = swap || count < r-l
-				}
-
-				if swap {
-					done = glued
-					left = l
-					right = r
-					count = r - l
-				}
-			}
-		}
-	}
-
-	if done == nil {
-		return matchers
-	}
-
-	next := append(append([]match.Matcher{}, matchers[:left]...), done)
-	if right < len(matchers) {
-		next = append(next, matchers[right:]...)
-	}
-
-	if len(next) == len(matchers) {
-		return next
-	}
-
-	return minimizeMatchers(next)
-}
-
-// minimizeAnyOf tries to apply some heuristics to minimize number of nodes in given tree
-func minimizeTree(tree *ast.Node) *ast.Node {
-	switch tree.Kind {
-	case ast.KindAnyOf:
-		return minimizeTreeAnyOf(tree)
-	default:
-		return nil
-	}
-}
-
-// minimizeAnyOf tries to find common children of given node of AnyOf pattern
-// it searches for common children from left and from right
-// if any common children are found – then it returns new optimized ast tree
-// else it returns nil
-func minimizeTreeAnyOf(tree *ast.Node) *ast.Node {
-	if !areOfSameKind(tree.Children, ast.KindPattern) {
-		return nil
-	}
-
-	commonLeft, commonRight := commonChildren(tree.Children)
-	commonLeftCount, commonRightCount := len(commonLeft), len(commonRight)
-	if commonLeftCount == 0 && commonRightCount == 0 { // there are no common parts
-		return nil
-	}
-
-	var result []*ast.Node
-	if commonLeftCount > 0 {
-		result = append(result, ast.NewNode(ast.KindPattern, nil, commonLeft...))
-	}
-
-	var anyOf []*ast.Node
-	for _, child := range tree.Children {
-		reuse := child.Children[commonLeftCount : len(child.Children)-commonRightCount]
-		var node *ast.Node
-		if len(reuse) == 0 {
-			// this pattern is completely reduced by commonLeft and commonRight patterns
-			// so it become nothing
-			node = ast.NewNode(ast.KindNothing, nil)
-		} else {
-			node = ast.NewNode(ast.KindPattern, nil, reuse...)
-		}
-		anyOf = appendIfUnique(anyOf, node)
-	}
-	switch {
-	case len(anyOf) == 1 && anyOf[0].Kind != ast.KindNothing:
-		result = append(result, anyOf[0])
-	case len(anyOf) > 1:
-		result = append(result, ast.NewNode(ast.KindAnyOf, nil, anyOf...))
-	}
-
-	if commonRightCount > 0 {
-		result = append(result, ast.NewNode(ast.KindPattern, nil, commonRight...))
-	}
-
-	return ast.NewNode(ast.KindPattern, nil, result...)
-}
-
-func commonChildren(nodes []*ast.Node) (commonLeft, commonRight []*ast.Node) {
-	if len(nodes) <= 1 {
-		return
-	}
-
-	// find node that has least number of children
-	idx := leastChildren(nodes)
-	if idx == -1 {
-		return
-	}
-	tree := nodes[idx]
-	treeLength := len(tree.Children)
-
-	// allocate max able size for rightCommon slice
-	// to get ability insert elements in reverse order (from end to start)
-	// without sorting
-	commonRight = make([]*ast.Node, treeLength)
-	lastRight := treeLength // will use this to get results as commonRight[lastRight:]
-
-	var (
-		breakLeft   bool
-		breakRight  bool
-		commonTotal int
-	)
-	for i, j := 0, treeLength-1; commonTotal < treeLength && j >= 0 && !(breakLeft && breakRight); i, j = i+1, j-1 {
-		treeLeft := tree.Children[i]
-		treeRight := tree.Children[j]
-
-		for k := 0; k < len(nodes) && !(breakLeft && breakRight); k++ {
-			// skip least children node
-			if k == idx {
-				continue
-			}
-
-			restLeft := nodes[k].Children[i]
-			restRight := nodes[k].Children[j+len(nodes[k].Children)-treeLength]
-
-			breakLeft = breakLeft || !treeLeft.Equal(restLeft)
-
-			// disable searching for right common parts, if left part is already overlapping
-			breakRight = breakRight || (!breakLeft && j <= i)
-			breakRight = breakRight || !treeRight.Equal(restRight)
-		}
-
-		if !breakLeft {
-			commonTotal++
-			commonLeft = append(commonLeft, treeLeft)
-		}
-		if !breakRight {
-			commonTotal++
-			lastRight = j
-			commonRight[j] = treeRight
-		}
-	}
-
-	commonRight = commonRight[lastRight:]
-
-	return
-}
-
-func appendIfUnique(target []*ast.Node, val *ast.Node) []*ast.Node {
-	for _, n := range target {
-		if reflect.DeepEqual(n, val) {
-			return target
-		}
-	}
-	return append(target, val)
-}
-
-func areOfSameKind(nodes []*ast.Node, kind ast.Kind) bool {
-	for _, n := range nodes {
-		if n.Kind != kind {
-			return false
-		}
-	}
-	return true
-}
-
-func leastChildren(nodes []*ast.Node) int {
-	min := -1
-	idx := -1
-	for i, n := range nodes {
-		if idx == -1 || (len(n.Children) < min) {
-			min = len(n.Children)
-			idx = i
-		}
-	}
-	return idx
-}
-
-func compileTreeChildren(tree *ast.Node, sep []rune) ([]match.Matcher, error) {
-	var matchers []match.Matcher
-	for _, desc := range tree.Children {
-		m, err := compile(desc, sep)
-		if err != nil {
-			return nil, err
-		}
-		matchers = append(matchers, optimizeMatcher(m))
-	}
-	return matchers, nil
-}
-
-func compile(tree *ast.Node, sep []rune) (m match.Matcher, err error) {
-	switch tree.Kind {
-	case ast.KindAnyOf:
-		// todo this could be faster on pattern_alternatives_combine_lite (see glob_test.go)
-		if n := minimizeTree(tree); n != nil {
-			return compile(n, sep)
-		}
-		matchers, err := compileTreeChildren(tree, sep)
-		if err != nil {
-			return nil, err
-		}
-		return match.NewAnyOf(matchers...), nil
-
-	case ast.KindPattern:
-		if len(tree.Children) == 0 {
-			return match.NewNothing(), nil
-		}
-		matchers, err := compileTreeChildren(tree, sep)
-		if err != nil {
-			return nil, err
-		}
-		m, err = compileMatchers(minimizeMatchers(matchers))
-		if err != nil {
-			return nil, err
-		}
-
-	case ast.KindAny:
-		m = match.NewAny(sep)
-
-	case ast.KindSuper:
-		m = match.NewSuper()
-
-	case ast.KindSingle:
-		m = match.NewSingle(sep)
-
-	case ast.KindNothing:
-		m = match.NewNothing()
-
-	case ast.KindList:
-		l := tree.Value.(ast.List)
-		m = match.NewList([]rune(l.Chars), l.Not)
-
-	case ast.KindRange:
-		r := tree.Value.(ast.Range)
-		m = match.NewRange(r.Lo, r.Hi, r.Not)
-
-	case ast.KindText:
-		t := tree.Value.(ast.Text)
-		m = match.NewText(t.Text)
-
-	default:
-		return nil, fmt.Errorf("could not compile tree: unknown node type")
-	}
-
-	return optimizeMatcher(m), nil
-}
-
-func Compile(tree *ast.Node, sep []rune) (match.Matcher, error) {
-	m, err := compile(tree, sep)
-	if err != nil {
-		return nil, err
-	}
-
-	return m, nil
-}

+ 0 - 80
vendor/github.com/gobwas/glob/glob.go

@@ -1,80 +0,0 @@
-package glob
-
-import (
-	"github.com/gobwas/glob/compiler"
-	"github.com/gobwas/glob/syntax"
-)
-
-// Glob represents compiled glob pattern.
-type Glob interface {
-	Match(string) bool
-}
-
-// Compile creates Glob for given pattern and strings (if any present after pattern) as separators.
-// The pattern syntax is:
-//
-//    pattern:
-//        { term }
-//
-//    term:
-//        `*`         matches any sequence of non-separator characters
-//        `**`        matches any sequence of characters
-//        `?`         matches any single non-separator character
-//        `[` [ `!` ] { character-range } `]`
-//                    character class (must be non-empty)
-//        `{` pattern-list `}`
-//                    pattern alternatives
-//        c           matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`)
-//        `\` c       matches character c
-//
-//    character-range:
-//        c           matches character c (c != `\\`, `-`, `]`)
-//        `\` c       matches character c
-//        lo `-` hi   matches character c for lo <= c <= hi
-//
-//    pattern-list:
-//        pattern { `,` pattern }
-//                    comma-separated (without spaces) patterns
-//
-func Compile(pattern string, separators ...rune) (Glob, error) {
-	ast, err := syntax.Parse(pattern)
-	if err != nil {
-		return nil, err
-	}
-
-	matcher, err := compiler.Compile(ast, separators)
-	if err != nil {
-		return nil, err
-	}
-
-	return matcher, nil
-}
-
-// MustCompile is the same as Compile, except that if Compile returns error, this will panic
-func MustCompile(pattern string, separators ...rune) Glob {
-	g, err := Compile(pattern, separators...)
-	if err != nil {
-		panic(err)
-	}
-
-	return g
-}
-
-// QuoteMeta returns a string that quotes all glob pattern meta characters
-// inside the argument text; For example, QuoteMeta(`{foo*}`) returns `\[foo\*\]`.
-func QuoteMeta(s string) string {
-	b := make([]byte, 2*len(s))
-
-	// a byte loop is correct because all meta characters are ASCII
-	j := 0
-	for i := 0; i < len(s); i++ {
-		if syntax.Special(s[i]) {
-			b[j] = '\\'
-			j++
-		}
-		b[j] = s[i]
-		j++
-	}
-
-	return string(b[0:j])
-}

+ 0 - 45
vendor/github.com/gobwas/glob/match/any.go

@@ -1,45 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"github.com/gobwas/glob/util/strings"
-)
-
-type Any struct {
-	Separators []rune
-}
-
-func NewAny(s []rune) Any {
-	return Any{s}
-}
-
-func (self Any) Match(s string) bool {
-	return strings.IndexAnyRunes(s, self.Separators) == -1
-}
-
-func (self Any) Index(s string) (int, []int) {
-	found := strings.IndexAnyRunes(s, self.Separators)
-	switch found {
-	case -1:
-	case 0:
-		return 0, segments0
-	default:
-		s = s[:found]
-	}
-
-	segments := acquireSegments(len(s))
-	for i := range s {
-		segments = append(segments, i)
-	}
-	segments = append(segments, len(s))
-
-	return 0, segments
-}
-
-func (self Any) Len() int {
-	return lenNo
-}
-
-func (self Any) String() string {
-	return fmt.Sprintf("<any:![%s]>", string(self.Separators))
-}

+ 0 - 82
vendor/github.com/gobwas/glob/match/any_of.go

@@ -1,82 +0,0 @@
-package match
-
-import "fmt"
-
-type AnyOf struct {
-	Matchers Matchers
-}
-
-func NewAnyOf(m ...Matcher) AnyOf {
-	return AnyOf{Matchers(m)}
-}
-
-func (self *AnyOf) Add(m Matcher) error {
-	self.Matchers = append(self.Matchers, m)
-	return nil
-}
-
-func (self AnyOf) Match(s string) bool {
-	for _, m := range self.Matchers {
-		if m.Match(s) {
-			return true
-		}
-	}
-
-	return false
-}
-
-func (self AnyOf) Index(s string) (int, []int) {
-	index := -1
-
-	segments := acquireSegments(len(s))
-	for _, m := range self.Matchers {
-		idx, seg := m.Index(s)
-		if idx == -1 {
-			continue
-		}
-
-		if index == -1 || idx < index {
-			index = idx
-			segments = append(segments[:0], seg...)
-			continue
-		}
-
-		if idx > index {
-			continue
-		}
-
-		// here idx == index
-		segments = appendMerge(segments, seg)
-	}
-
-	if index == -1 {
-		releaseSegments(segments)
-		return -1, nil
-	}
-
-	return index, segments
-}
-
-func (self AnyOf) Len() (l int) {
-	l = -1
-	for _, m := range self.Matchers {
-		ml := m.Len()
-		switch {
-		case l == -1:
-			l = ml
-			continue
-
-		case ml == -1:
-			return -1
-
-		case l != ml:
-			return -1
-		}
-	}
-
-	return
-}
-
-func (self AnyOf) String() string {
-	return fmt.Sprintf("<any_of:[%s]>", self.Matchers)
-}

+ 0 - 185
vendor/github.com/gobwas/glob/match/btree.go

@@ -1,185 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"unicode/utf8"
-)
-
-type BTree struct {
-	Value            Matcher
-	Left             Matcher
-	Right            Matcher
-	ValueLengthRunes int
-	LeftLengthRunes  int
-	RightLengthRunes int
-	LengthRunes      int
-}
-
-func NewBTree(Value, Left, Right Matcher) (tree BTree) {
-	tree.Value = Value
-	tree.Left = Left
-	tree.Right = Right
-
-	lenOk := true
-	if tree.ValueLengthRunes = Value.Len(); tree.ValueLengthRunes == -1 {
-		lenOk = false
-	}
-
-	if Left != nil {
-		if tree.LeftLengthRunes = Left.Len(); tree.LeftLengthRunes == -1 {
-			lenOk = false
-		}
-	}
-
-	if Right != nil {
-		if tree.RightLengthRunes = Right.Len(); tree.RightLengthRunes == -1 {
-			lenOk = false
-		}
-	}
-
-	if lenOk {
-		tree.LengthRunes = tree.LeftLengthRunes + tree.ValueLengthRunes + tree.RightLengthRunes
-	} else {
-		tree.LengthRunes = -1
-	}
-
-	return tree
-}
-
-func (self BTree) Len() int {
-	return self.LengthRunes
-}
-
-// todo?
-func (self BTree) Index(s string) (index int, segments []int) {
-	//inputLen := len(s)
-	//// try to cut unnecessary parts
-	//// by knowledge of length of right and left part
-	//offset, limit := self.offsetLimit(inputLen)
-	//for offset < limit {
-	//	// search for matching part in substring
-	//	vi, segments := self.Value.Index(s[offset:limit])
-	//	if index == -1 {
-	//		return -1, nil
-	//	}
-	//	if self.Left == nil {
-	//		if index != offset {
-	//			return -1, nil
-	//		}
-	//	} else {
-	//		left := s[:offset+vi]
-	//		i := self.Left.IndexSuffix(left)
-	//		if i == -1 {
-	//			return -1, nil
-	//		}
-	//		index = i
-	//	}
-	//	if self.Right != nil {
-	//		for _, seg := range segments {
-	//			right := s[:offset+vi+seg]
-	//		}
-	//	}
-
-	//	l := s[:offset+index]
-	//	var left bool
-	//	if self.Left != nil {
-	//		left = self.Left.Index(l)
-	//	} else {
-	//		left = l == ""
-	//	}
-	//}
-
-	return -1, nil
-}
-
-func (self BTree) Match(s string) bool {
-	inputLen := len(s)
-	// try to cut unnecessary parts
-	// by knowledge of length of right and left part
-	offset, limit := self.offsetLimit(inputLen)
-
-	for offset < limit {
-		// search for matching part in substring
-		index, segments := self.Value.Index(s[offset:limit])
-		if index == -1 {
-			releaseSegments(segments)
-			return false
-		}
-
-		l := s[:offset+index]
-		var left bool
-		if self.Left != nil {
-			left = self.Left.Match(l)
-		} else {
-			left = l == ""
-		}
-
-		if left {
-			for i := len(segments) - 1; i >= 0; i-- {
-				length := segments[i]
-
-				var right bool
-				var r string
-				// if there is no string for the right branch
-				if inputLen <= offset+index+length {
-					r = ""
-				} else {
-					r = s[offset+index+length:]
-				}
-
-				if self.Right != nil {
-					right = self.Right.Match(r)
-				} else {
-					right = r == ""
-				}
-
-				if right {
-					releaseSegments(segments)
-					return true
-				}
-			}
-		}
-
-		_, step := utf8.DecodeRuneInString(s[offset+index:])
-		offset += index + step
-
-		releaseSegments(segments)
-	}
-
-	return false
-}
-
-func (self BTree) offsetLimit(inputLen int) (offset int, limit int) {
-	// self.Length, self.RLen and self.LLen are values meaning the length of runes for each part
-	// here we manipulating byte length for better optimizations
-	// but these checks still works, cause minLen of 1-rune string is 1 byte.
-	if self.LengthRunes != -1 && self.LengthRunes > inputLen {
-		return 0, 0
-	}
-	if self.LeftLengthRunes >= 0 {
-		offset = self.LeftLengthRunes
-	}
-	if self.RightLengthRunes >= 0 {
-		limit = inputLen - self.RightLengthRunes
-	} else {
-		limit = inputLen
-	}
-	return offset, limit
-}
-
-func (self BTree) String() string {
-	const n string = "<nil>"
-	var l, r string
-	if self.Left == nil {
-		l = n
-	} else {
-		l = self.Left.String()
-	}
-	if self.Right == nil {
-		r = n
-	} else {
-		r = self.Right.String()
-	}
-
-	return fmt.Sprintf("<btree:[%s<-%s->%s]>", l, self.Value, r)
-}

+ 0 - 58
vendor/github.com/gobwas/glob/match/contains.go

@@ -1,58 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-)
-
-type Contains struct {
-	Needle string
-	Not    bool
-}
-
-func NewContains(needle string, not bool) Contains {
-	return Contains{needle, not}
-}
-
-func (self Contains) Match(s string) bool {
-	return strings.Contains(s, self.Needle) != self.Not
-}
-
-func (self Contains) Index(s string) (int, []int) {
-	var offset int
-
-	idx := strings.Index(s, self.Needle)
-
-	if !self.Not {
-		if idx == -1 {
-			return -1, nil
-		}
-
-		offset = idx + len(self.Needle)
-		if len(s) <= offset {
-			return 0, []int{offset}
-		}
-		s = s[offset:]
-	} else if idx != -1 {
-		s = s[:idx]
-	}
-
-	segments := acquireSegments(len(s) + 1)
-	for i := range s {
-		segments = append(segments, offset+i)
-	}
-
-	return 0, append(segments, offset+len(s))
-}
-
-func (self Contains) Len() int {
-	return lenNo
-}
-
-func (self Contains) String() string {
-	var not string
-	if self.Not {
-		not = "!"
-	}
-	return fmt.Sprintf("<contains:%s[%s]>", not, self.Needle)
-}

+ 0 - 99
vendor/github.com/gobwas/glob/match/every_of.go

@@ -1,99 +0,0 @@
-package match
-
-import (
-	"fmt"
-)
-
-type EveryOf struct {
-	Matchers Matchers
-}
-
-func NewEveryOf(m ...Matcher) EveryOf {
-	return EveryOf{Matchers(m)}
-}
-
-func (self *EveryOf) Add(m Matcher) error {
-	self.Matchers = append(self.Matchers, m)
-	return nil
-}
-
-func (self EveryOf) Len() (l int) {
-	for _, m := range self.Matchers {
-		if ml := m.Len(); l > 0 {
-			l += ml
-		} else {
-			return -1
-		}
-	}
-
-	return
-}
-
-func (self EveryOf) Index(s string) (int, []int) {
-	var index int
-	var offset int
-
-	// make `in` with cap as len(s),
-	// cause it is the maximum size of output segments values
-	next := acquireSegments(len(s))
-	current := acquireSegments(len(s))
-
-	sub := s
-	for i, m := range self.Matchers {
-		idx, seg := m.Index(sub)
-		if idx == -1 {
-			releaseSegments(next)
-			releaseSegments(current)
-			return -1, nil
-		}
-
-		if i == 0 {
-			// we use copy here instead of `current = seg`
-			// cause seg is a slice from reusable buffer `in`
-			// and it could be overwritten in next iteration
-			current = append(current, seg...)
-		} else {
-			// clear the next
-			next = next[:0]
-
-			delta := index - (idx + offset)
-			for _, ex := range current {
-				for _, n := range seg {
-					if ex+delta == n {
-						next = append(next, n)
-					}
-				}
-			}
-
-			if len(next) == 0 {
-				releaseSegments(next)
-				releaseSegments(current)
-				return -1, nil
-			}
-
-			current = append(current[:0], next...)
-		}
-
-		index = idx + offset
-		sub = s[index:]
-		offset += idx
-	}
-
-	releaseSegments(next)
-
-	return index, current
-}
-
-func (self EveryOf) Match(s string) bool {
-	for _, m := range self.Matchers {
-		if !m.Match(s) {
-			return false
-		}
-	}
-
-	return true
-}
-
-func (self EveryOf) String() string {
-	return fmt.Sprintf("<every_of:[%s]>", self.Matchers)
-}

+ 0 - 49
vendor/github.com/gobwas/glob/match/list.go

@@ -1,49 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"github.com/gobwas/glob/util/runes"
-	"unicode/utf8"
-)
-
-type List struct {
-	List []rune
-	Not  bool
-}
-
-func NewList(list []rune, not bool) List {
-	return List{list, not}
-}
-
-func (self List) Match(s string) bool {
-	r, w := utf8.DecodeRuneInString(s)
-	if len(s) > w {
-		return false
-	}
-
-	inList := runes.IndexRune(self.List, r) != -1
-	return inList == !self.Not
-}
-
-func (self List) Len() int {
-	return lenOne
-}
-
-func (self List) Index(s string) (int, []int) {
-	for i, r := range s {
-		if self.Not == (runes.IndexRune(self.List, r) == -1) {
-			return i, segmentsByRuneLength[utf8.RuneLen(r)]
-		}
-	}
-
-	return -1, nil
-}
-
-func (self List) String() string {
-	var not string
-	if self.Not {
-		not = "!"
-	}
-
-	return fmt.Sprintf("<list:%s[%s]>", not, string(self.List))
-}

+ 0 - 81
vendor/github.com/gobwas/glob/match/match.go

@@ -1,81 +0,0 @@
-package match
-
-// todo common table of rune's length
-
-import (
-	"fmt"
-	"strings"
-)
-
-const lenOne = 1
-const lenZero = 0
-const lenNo = -1
-
-type Matcher interface {
-	Match(string) bool
-	Index(string) (int, []int)
-	Len() int
-	String() string
-}
-
-type Matchers []Matcher
-
-func (m Matchers) String() string {
-	var s []string
-	for _, matcher := range m {
-		s = append(s, fmt.Sprint(matcher))
-	}
-
-	return fmt.Sprintf("%s", strings.Join(s, ","))
-}
-
-// appendMerge merges and sorts given already SORTED and UNIQUE segments.
-func appendMerge(target, sub []int) []int {
-	lt, ls := len(target), len(sub)
-	out := make([]int, 0, lt+ls)
-
-	for x, y := 0, 0; x < lt || y < ls; {
-		if x >= lt {
-			out = append(out, sub[y:]...)
-			break
-		}
-
-		if y >= ls {
-			out = append(out, target[x:]...)
-			break
-		}
-
-		xValue := target[x]
-		yValue := sub[y]
-
-		switch {
-
-		case xValue == yValue:
-			out = append(out, xValue)
-			x++
-			y++
-
-		case xValue < yValue:
-			out = append(out, xValue)
-			x++
-
-		case yValue < xValue:
-			out = append(out, yValue)
-			y++
-
-		}
-	}
-
-	target = append(target[:0], out...)
-
-	return target
-}
-
-func reverseSegments(input []int) {
-	l := len(input)
-	m := l / 2
-
-	for i := 0; i < m; i++ {
-		input[i], input[l-i-1] = input[l-i-1], input[i]
-	}
-}

+ 0 - 49
vendor/github.com/gobwas/glob/match/max.go

@@ -1,49 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"unicode/utf8"
-)
-
-type Max struct {
-	Limit int
-}
-
-func NewMax(l int) Max {
-	return Max{l}
-}
-
-func (self Max) Match(s string) bool {
-	var l int
-	for range s {
-		l += 1
-		if l > self.Limit {
-			return false
-		}
-	}
-
-	return true
-}
-
-func (self Max) Index(s string) (int, []int) {
-	segments := acquireSegments(self.Limit + 1)
-	segments = append(segments, 0)
-	var count int
-	for i, r := range s {
-		count++
-		if count > self.Limit {
-			break
-		}
-		segments = append(segments, i+utf8.RuneLen(r))
-	}
-
-	return 0, segments
-}
-
-func (self Max) Len() int {
-	return lenNo
-}
-
-func (self Max) String() string {
-	return fmt.Sprintf("<max:%d>", self.Limit)
-}

+ 0 - 57
vendor/github.com/gobwas/glob/match/min.go

@@ -1,57 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"unicode/utf8"
-)
-
-type Min struct {
-	Limit int
-}
-
-func NewMin(l int) Min {
-	return Min{l}
-}
-
-func (self Min) Match(s string) bool {
-	var l int
-	for range s {
-		l += 1
-		if l >= self.Limit {
-			return true
-		}
-	}
-
-	return false
-}
-
-func (self Min) Index(s string) (int, []int) {
-	var count int
-
-	c := len(s) - self.Limit + 1
-	if c <= 0 {
-		return -1, nil
-	}
-
-	segments := acquireSegments(c)
-	for i, r := range s {
-		count++
-		if count >= self.Limit {
-			segments = append(segments, i+utf8.RuneLen(r))
-		}
-	}
-
-	if len(segments) == 0 {
-		return -1, nil
-	}
-
-	return 0, segments
-}
-
-func (self Min) Len() int {
-	return lenNo
-}
-
-func (self Min) String() string {
-	return fmt.Sprintf("<min:%d>", self.Limit)
-}

+ 0 - 27
vendor/github.com/gobwas/glob/match/nothing.go

@@ -1,27 +0,0 @@
-package match
-
-import (
-	"fmt"
-)
-
-type Nothing struct{}
-
-func NewNothing() Nothing {
-	return Nothing{}
-}
-
-func (self Nothing) Match(s string) bool {
-	return len(s) == 0
-}
-
-func (self Nothing) Index(s string) (int, []int) {
-	return 0, segments0
-}
-
-func (self Nothing) Len() int {
-	return lenZero
-}
-
-func (self Nothing) String() string {
-	return fmt.Sprintf("<nothing>")
-}

+ 0 - 50
vendor/github.com/gobwas/glob/match/prefix.go

@@ -1,50 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-	"unicode/utf8"
-)
-
-type Prefix struct {
-	Prefix string
-}
-
-func NewPrefix(p string) Prefix {
-	return Prefix{p}
-}
-
-func (self Prefix) Index(s string) (int, []int) {
-	idx := strings.Index(s, self.Prefix)
-	if idx == -1 {
-		return -1, nil
-	}
-
-	length := len(self.Prefix)
-	var sub string
-	if len(s) > idx+length {
-		sub = s[idx+length:]
-	} else {
-		sub = ""
-	}
-
-	segments := acquireSegments(len(sub) + 1)
-	segments = append(segments, length)
-	for i, r := range sub {
-		segments = append(segments, length+i+utf8.RuneLen(r))
-	}
-
-	return idx, segments
-}
-
-func (self Prefix) Len() int {
-	return lenNo
-}
-
-func (self Prefix) Match(s string) bool {
-	return strings.HasPrefix(s, self.Prefix)
-}
-
-func (self Prefix) String() string {
-	return fmt.Sprintf("<prefix:%s>", self.Prefix)
-}

+ 0 - 55
vendor/github.com/gobwas/glob/match/prefix_any.go

@@ -1,55 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-	"unicode/utf8"
-
-	sutil "github.com/gobwas/glob/util/strings"
-)
-
-type PrefixAny struct {
-	Prefix     string
-	Separators []rune
-}
-
-func NewPrefixAny(s string, sep []rune) PrefixAny {
-	return PrefixAny{s, sep}
-}
-
-func (self PrefixAny) Index(s string) (int, []int) {
-	idx := strings.Index(s, self.Prefix)
-	if idx == -1 {
-		return -1, nil
-	}
-
-	n := len(self.Prefix)
-	sub := s[idx+n:]
-	i := sutil.IndexAnyRunes(sub, self.Separators)
-	if i > -1 {
-		sub = sub[:i]
-	}
-
-	seg := acquireSegments(len(sub) + 1)
-	seg = append(seg, n)
-	for i, r := range sub {
-		seg = append(seg, n+i+utf8.RuneLen(r))
-	}
-
-	return idx, seg
-}
-
-func (self PrefixAny) Len() int {
-	return lenNo
-}
-
-func (self PrefixAny) Match(s string) bool {
-	if !strings.HasPrefix(s, self.Prefix) {
-		return false
-	}
-	return sutil.IndexAnyRunes(s[len(self.Prefix):], self.Separators) == -1
-}
-
-func (self PrefixAny) String() string {
-	return fmt.Sprintf("<prefix_any:%s![%s]>", self.Prefix, string(self.Separators))
-}

+ 0 - 62
vendor/github.com/gobwas/glob/match/prefix_suffix.go

@@ -1,62 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-)
-
-type PrefixSuffix struct {
-	Prefix, Suffix string
-}
-
-func NewPrefixSuffix(p, s string) PrefixSuffix {
-	return PrefixSuffix{p, s}
-}
-
-func (self PrefixSuffix) Index(s string) (int, []int) {
-	prefixIdx := strings.Index(s, self.Prefix)
-	if prefixIdx == -1 {
-		return -1, nil
-	}
-
-	suffixLen := len(self.Suffix)
-	if suffixLen <= 0 {
-		return prefixIdx, []int{len(s) - prefixIdx}
-	}
-
-	if (len(s) - prefixIdx) <= 0 {
-		return -1, nil
-	}
-
-	segments := acquireSegments(len(s) - prefixIdx)
-	for sub := s[prefixIdx:]; ; {
-		suffixIdx := strings.LastIndex(sub, self.Suffix)
-		if suffixIdx == -1 {
-			break
-		}
-
-		segments = append(segments, suffixIdx+suffixLen)
-		sub = sub[:suffixIdx]
-	}
-
-	if len(segments) == 0 {
-		releaseSegments(segments)
-		return -1, nil
-	}
-
-	reverseSegments(segments)
-
-	return prefixIdx, segments
-}
-
-func (self PrefixSuffix) Len() int {
-	return lenNo
-}
-
-func (self PrefixSuffix) Match(s string) bool {
-	return strings.HasPrefix(s, self.Prefix) && strings.HasSuffix(s, self.Suffix)
-}
-
-func (self PrefixSuffix) String() string {
-	return fmt.Sprintf("<prefix_suffix:[%s,%s]>", self.Prefix, self.Suffix)
-}

+ 0 - 48
vendor/github.com/gobwas/glob/match/range.go

@@ -1,48 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"unicode/utf8"
-)
-
-type Range struct {
-	Lo, Hi rune
-	Not    bool
-}
-
-func NewRange(lo, hi rune, not bool) Range {
-	return Range{lo, hi, not}
-}
-
-func (self Range) Len() int {
-	return lenOne
-}
-
-func (self Range) Match(s string) bool {
-	r, w := utf8.DecodeRuneInString(s)
-	if len(s) > w {
-		return false
-	}
-
-	inRange := r >= self.Lo && r <= self.Hi
-
-	return inRange == !self.Not
-}
-
-func (self Range) Index(s string) (int, []int) {
-	for i, r := range s {
-		if self.Not != (r >= self.Lo && r <= self.Hi) {
-			return i, segmentsByRuneLength[utf8.RuneLen(r)]
-		}
-	}
-
-	return -1, nil
-}
-
-func (self Range) String() string {
-	var not string
-	if self.Not {
-		not = "!"
-	}
-	return fmt.Sprintf("<range:%s[%s,%s]>", not, string(self.Lo), string(self.Hi))
-}

+ 0 - 77
vendor/github.com/gobwas/glob/match/row.go

@@ -1,77 +0,0 @@
-package match
-
-import (
-	"fmt"
-)
-
-type Row struct {
-	Matchers    Matchers
-	RunesLength int
-	Segments    []int
-}
-
-func NewRow(len int, m ...Matcher) Row {
-	return Row{
-		Matchers:    Matchers(m),
-		RunesLength: len,
-		Segments:    []int{len},
-	}
-}
-
-func (self Row) matchAll(s string) bool {
-	var idx int
-	for _, m := range self.Matchers {
-		length := m.Len()
-
-		var next, i int
-		for next = range s[idx:] {
-			i++
-			if i == length {
-				break
-			}
-		}
-
-		if i < length || !m.Match(s[idx:idx+next+1]) {
-			return false
-		}
-
-		idx += next + 1
-	}
-
-	return true
-}
-
-func (self Row) lenOk(s string) bool {
-	var i int
-	for range s {
-		i++
-		if i > self.RunesLength {
-			return false
-		}
-	}
-	return self.RunesLength == i
-}
-
-func (self Row) Match(s string) bool {
-	return self.lenOk(s) && self.matchAll(s)
-}
-
-func (self Row) Len() (l int) {
-	return self.RunesLength
-}
-
-func (self Row) Index(s string) (int, []int) {
-	for i := range s {
-		if len(s[i:]) < self.RunesLength {
-			break
-		}
-		if self.matchAll(s[i:]) {
-			return i, self.Segments
-		}
-	}
-	return -1, nil
-}
-
-func (self Row) String() string {
-	return fmt.Sprintf("<row_%d:[%s]>", self.RunesLength, self.Matchers)
-}

+ 0 - 91
vendor/github.com/gobwas/glob/match/segments.go

@@ -1,91 +0,0 @@
-package match
-
-import (
-	"sync"
-)
-
-type SomePool interface {
-	Get() []int
-	Put([]int)
-}
-
-var segmentsPools [1024]sync.Pool
-
-func toPowerOfTwo(v int) int {
-	v--
-	v |= v >> 1
-	v |= v >> 2
-	v |= v >> 4
-	v |= v >> 8
-	v |= v >> 16
-	v++
-
-	return v
-}
-
-const (
-	cacheFrom             = 16
-	cacheToAndHigher      = 1024
-	cacheFromIndex        = 15
-	cacheToAndHigherIndex = 1023
-)
-
-var (
-	segments0 = []int{0}
-	segments1 = []int{1}
-	segments2 = []int{2}
-	segments3 = []int{3}
-	segments4 = []int{4}
-)
-
-var segmentsByRuneLength [5][]int = [5][]int{
-	0: segments0,
-	1: segments1,
-	2: segments2,
-	3: segments3,
-	4: segments4,
-}
-
-func init() {
-	for i := cacheToAndHigher; i >= cacheFrom; i >>= 1 {
-		func(i int) {
-			segmentsPools[i-1] = sync.Pool{New: func() interface{} {
-				return make([]int, 0, i)
-			}}
-		}(i)
-	}
-}
-
-func getTableIndex(c int) int {
-	p := toPowerOfTwo(c)
-	switch {
-	case p >= cacheToAndHigher:
-		return cacheToAndHigherIndex
-	case p <= cacheFrom:
-		return cacheFromIndex
-	default:
-		return p - 1
-	}
-}
-
-func acquireSegments(c int) []int {
-	// make []int with less capacity than cacheFrom
-	// is faster than acquiring it from pool
-	if c < cacheFrom {
-		return make([]int, 0, c)
-	}
-
-	return segmentsPools[getTableIndex(c)].Get().([]int)[:0]
-}
-
-func releaseSegments(s []int) {
-	c := cap(s)
-
-	// make []int with less capacity than cacheFrom
-	// is faster than acquiring it from pool
-	if c < cacheFrom {
-		return
-	}
-
-	segmentsPools[getTableIndex(c)].Put(s)
-}

+ 0 - 43
vendor/github.com/gobwas/glob/match/single.go

@@ -1,43 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"github.com/gobwas/glob/util/runes"
-	"unicode/utf8"
-)
-
-// single represents ?
-type Single struct {
-	Separators []rune
-}
-
-func NewSingle(s []rune) Single {
-	return Single{s}
-}
-
-func (self Single) Match(s string) bool {
-	r, w := utf8.DecodeRuneInString(s)
-	if len(s) > w {
-		return false
-	}
-
-	return runes.IndexRune(self.Separators, r) == -1
-}
-
-func (self Single) Len() int {
-	return lenOne
-}
-
-func (self Single) Index(s string) (int, []int) {
-	for i, r := range s {
-		if runes.IndexRune(self.Separators, r) == -1 {
-			return i, segmentsByRuneLength[utf8.RuneLen(r)]
-		}
-	}
-
-	return -1, nil
-}
-
-func (self Single) String() string {
-	return fmt.Sprintf("<single:![%s]>", string(self.Separators))
-}

+ 0 - 35
vendor/github.com/gobwas/glob/match/suffix.go

@@ -1,35 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-)
-
-type Suffix struct {
-	Suffix string
-}
-
-func NewSuffix(s string) Suffix {
-	return Suffix{s}
-}
-
-func (self Suffix) Len() int {
-	return lenNo
-}
-
-func (self Suffix) Match(s string) bool {
-	return strings.HasSuffix(s, self.Suffix)
-}
-
-func (self Suffix) Index(s string) (int, []int) {
-	idx := strings.Index(s, self.Suffix)
-	if idx == -1 {
-		return -1, nil
-	}
-
-	return 0, []int{idx + len(self.Suffix)}
-}
-
-func (self Suffix) String() string {
-	return fmt.Sprintf("<suffix:%s>", self.Suffix)
-}

+ 0 - 43
vendor/github.com/gobwas/glob/match/suffix_any.go

@@ -1,43 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-
-	sutil "github.com/gobwas/glob/util/strings"
-)
-
-type SuffixAny struct {
-	Suffix     string
-	Separators []rune
-}
-
-func NewSuffixAny(s string, sep []rune) SuffixAny {
-	return SuffixAny{s, sep}
-}
-
-func (self SuffixAny) Index(s string) (int, []int) {
-	idx := strings.Index(s, self.Suffix)
-	if idx == -1 {
-		return -1, nil
-	}
-
-	i := sutil.LastIndexAnyRunes(s[:idx], self.Separators) + 1
-
-	return i, []int{idx + len(self.Suffix) - i}
-}
-
-func (self SuffixAny) Len() int {
-	return lenNo
-}
-
-func (self SuffixAny) Match(s string) bool {
-	if !strings.HasSuffix(s, self.Suffix) {
-		return false
-	}
-	return sutil.IndexAnyRunes(s[:len(s)-len(self.Suffix)], self.Separators) == -1
-}
-
-func (self SuffixAny) String() string {
-	return fmt.Sprintf("<suffix_any:![%s]%s>", string(self.Separators), self.Suffix)
-}

+ 0 - 33
vendor/github.com/gobwas/glob/match/super.go

@@ -1,33 +0,0 @@
-package match
-
-import (
-	"fmt"
-)
-
-type Super struct{}
-
-func NewSuper() Super {
-	return Super{}
-}
-
-func (self Super) Match(s string) bool {
-	return true
-}
-
-func (self Super) Len() int {
-	return lenNo
-}
-
-func (self Super) Index(s string) (int, []int) {
-	segments := acquireSegments(len(s) + 1)
-	for i := range s {
-		segments = append(segments, i)
-	}
-	segments = append(segments, len(s))
-
-	return 0, segments
-}
-
-func (self Super) String() string {
-	return fmt.Sprintf("<super>")
-}

+ 0 - 45
vendor/github.com/gobwas/glob/match/text.go

@@ -1,45 +0,0 @@
-package match
-
-import (
-	"fmt"
-	"strings"
-	"unicode/utf8"
-)
-
-// raw represents raw string to match
-type Text struct {
-	Str         string
-	RunesLength int
-	BytesLength int
-	Segments    []int
-}
-
-func NewText(s string) Text {
-	return Text{
-		Str:         s,
-		RunesLength: utf8.RuneCountInString(s),
-		BytesLength: len(s),
-		Segments:    []int{len(s)},
-	}
-}
-
-func (self Text) Match(s string) bool {
-	return self.Str == s
-}
-
-func (self Text) Len() int {
-	return self.RunesLength
-}
-
-func (self Text) Index(s string) (int, []int) {
-	index := strings.Index(s, self.Str)
-	if index == -1 {
-		return -1, nil
-	}
-
-	return index, self.Segments
-}
-
-func (self Text) String() string {
-	return fmt.Sprintf("<text:`%v`>", self.Str)
-}

+ 0 - 148
vendor/github.com/gobwas/glob/readme.md

@@ -1,148 +0,0 @@
-# glob.[go](https://golang.org)
-
-[![GoDoc][godoc-image]][godoc-url] [![Build Status][travis-image]][travis-url]
-
-> Go Globbing Library.
-
-## Install
-
-```shell
-    go get github.com/gobwas/glob
-```
-
-## Example
-
-```go
-
-package main
-
-import "github.com/gobwas/glob"
-
-func main() {
-    var g glob.Glob
-    
-    // create simple glob
-    g = glob.MustCompile("*.github.com")
-    g.Match("api.github.com") // true
-    
-    // quote meta characters and then create simple glob 
-    g = glob.MustCompile(glob.QuoteMeta("*.github.com"))
-    g.Match("*.github.com") // true
-    
-    // create new glob with set of delimiters as ["."]
-    g = glob.MustCompile("api.*.com", '.')
-    g.Match("api.github.com") // true
-    g.Match("api.gi.hub.com") // false
-    
-    // create new glob with set of delimiters as ["."]
-    // but now with super wildcard
-    g = glob.MustCompile("api.**.com", '.')
-    g.Match("api.github.com") // true
-    g.Match("api.gi.hub.com") // true
-        
-    // create glob with single symbol wildcard
-    g = glob.MustCompile("?at")
-    g.Match("cat") // true
-    g.Match("fat") // true
-    g.Match("at") // false
-    
-    // create glob with single symbol wildcard and delimiters ['f']
-    g = glob.MustCompile("?at", 'f')
-    g.Match("cat") // true
-    g.Match("fat") // false
-    g.Match("at") // false 
-    
-    // create glob with character-list matchers 
-    g = glob.MustCompile("[abc]at")
-    g.Match("cat") // true
-    g.Match("bat") // true
-    g.Match("fat") // false
-    g.Match("at") // false
-    
-    // create glob with character-list matchers 
-    g = glob.MustCompile("[!abc]at")
-    g.Match("cat") // false
-    g.Match("bat") // false
-    g.Match("fat") // true
-    g.Match("at") // false 
-    
-    // create glob with character-range matchers 
-    g = glob.MustCompile("[a-c]at")
-    g.Match("cat") // true
-    g.Match("bat") // true
-    g.Match("fat") // false
-    g.Match("at") // false
-    
-    // create glob with character-range matchers 
-    g = glob.MustCompile("[!a-c]at")
-    g.Match("cat") // false
-    g.Match("bat") // false
-    g.Match("fat") // true
-    g.Match("at") // false 
-    
-    // create glob with pattern-alternatives list 
-    g = glob.MustCompile("{cat,bat,[fr]at}")
-    g.Match("cat") // true
-    g.Match("bat") // true
-    g.Match("fat") // true
-    g.Match("rat") // true
-    g.Match("at") // false 
-    g.Match("zat") // false 
-}
-
-```
-
-## Performance
-
-This library is created for compile-once patterns. This means, that compilation could take time, but 
-strings matching is done faster, than in case when always parsing template.
-
-If you will not use compiled `glob.Glob` object, and do `g := glob.MustCompile(pattern); g.Match(...)` every time, then your code will be much more slower.
-
-Run `go test -bench=.` from source root to see the benchmarks:
-
-Pattern | Fixture | Match | Speed (ns/op)
---------|---------|-------|--------------
-`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my cat has very bright eyes` | `true` | 432
-`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my dog has very bright eyes` | `false` | 199
-`https://*.google.*` | `https://account.google.com` | `true` | 96
-`https://*.google.*` | `https://google.com` | `false` | 66
-`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://yahoo.com` | `true` | 163
-`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://google.com` | `false` | 197
-`{https://*gobwas.com,http://exclude.gobwas.com}` | `https://safe.gobwas.com` | `true` | 22
-`{https://*gobwas.com,http://exclude.gobwas.com}` | `http://safe.gobwas.com` | `false` | 24
-`abc*` | `abcdef` | `true` | 8.15
-`abc*` | `af` | `false` | 5.68
-`*def` | `abcdef` | `true` | 8.84
-`*def` | `af` | `false` | 5.74
-`ab*ef` | `abcdef` | `true` | 15.2
-`ab*ef` | `af` | `false` | 10.4
-
-The same things with `regexp` package:
-
-Pattern | Fixture | Match | Speed (ns/op)
---------|---------|-------|--------------
-`^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my cat has very bright eyes` | `true` | 2553
-`^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my dog has very bright eyes` | `false` | 1383
-`^https:\/\/.*\.google\..*$` | `https://account.google.com` | `true` | 1205
-`^https:\/\/.*\.google\..*$` | `https://google.com` | `false` | 767
-`^(https:\/\/.*\.google\..*\|.*yandex\..*\|.*yahoo\..*\|.*mail\.ru)$` | `http://yahoo.com` | `true` | 1435
-`^(https:\/\/.*\.google\..*\|.*yandex\..*\|.*yahoo\..*\|.*mail\.ru)$` | `http://google.com` | `false` | 1674
-`^(https:\/\/.*gobwas\.com\|http://exclude.gobwas.com)$` | `https://safe.gobwas.com` | `true` | 1039
-`^(https:\/\/.*gobwas\.com\|http://exclude.gobwas.com)$` | `http://safe.gobwas.com` | `false` | 272
-`^abc.*$` | `abcdef` | `true` | 237
-`^abc.*$` | `af` | `false` | 100
-`^.*def$` | `abcdef` | `true` | 464
-`^.*def$` | `af` | `false` | 265
-`^ab.*ef$` | `abcdef` | `true` | 375
-`^ab.*ef$` | `af` | `false` | 145
-
-[godoc-image]: https://godoc.org/github.com/gobwas/glob?status.svg
-[godoc-url]: https://godoc.org/github.com/gobwas/glob
-[travis-image]: https://travis-ci.org/gobwas/glob.svg?branch=master
-[travis-url]: https://travis-ci.org/gobwas/glob
-
-## Syntax
-
-Syntax is inspired by [standard wildcards](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm),
-except that `**` is aka super-asterisk, that do not sensitive for separators.

+ 0 - 122
vendor/github.com/gobwas/glob/syntax/ast/ast.go

@@ -1,122 +0,0 @@
-package ast
-
-import (
-	"bytes"
-	"fmt"
-)
-
-type Node struct {
-	Parent   *Node
-	Children []*Node
-	Value    interface{}
-	Kind     Kind
-}
-
-func NewNode(k Kind, v interface{}, ch ...*Node) *Node {
-	n := &Node{
-		Kind:  k,
-		Value: v,
-	}
-	for _, c := range ch {
-		Insert(n, c)
-	}
-	return n
-}
-
-func (a *Node) Equal(b *Node) bool {
-	if a.Kind != b.Kind {
-		return false
-	}
-	if a.Value != b.Value {
-		return false
-	}
-	if len(a.Children) != len(b.Children) {
-		return false
-	}
-	for i, c := range a.Children {
-		if !c.Equal(b.Children[i]) {
-			return false
-		}
-	}
-	return true
-}
-
-func (a *Node) String() string {
-	var buf bytes.Buffer
-	buf.WriteString(a.Kind.String())
-	if a.Value != nil {
-		buf.WriteString(" =")
-		buf.WriteString(fmt.Sprintf("%v", a.Value))
-	}
-	if len(a.Children) > 0 {
-		buf.WriteString(" [")
-		for i, c := range a.Children {
-			if i > 0 {
-				buf.WriteString(", ")
-			}
-			buf.WriteString(c.String())
-		}
-		buf.WriteString("]")
-	}
-	return buf.String()
-}
-
-func Insert(parent *Node, children ...*Node) {
-	parent.Children = append(parent.Children, children...)
-	for _, ch := range children {
-		ch.Parent = parent
-	}
-}
-
-type List struct {
-	Not   bool
-	Chars string
-}
-
-type Range struct {
-	Not    bool
-	Lo, Hi rune
-}
-
-type Text struct {
-	Text string
-}
-
-type Kind int
-
-const (
-	KindNothing Kind = iota
-	KindPattern
-	KindList
-	KindRange
-	KindText
-	KindAny
-	KindSuper
-	KindSingle
-	KindAnyOf
-)
-
-func (k Kind) String() string {
-	switch k {
-	case KindNothing:
-		return "Nothing"
-	case KindPattern:
-		return "Pattern"
-	case KindList:
-		return "List"
-	case KindRange:
-		return "Range"
-	case KindText:
-		return "Text"
-	case KindAny:
-		return "Any"
-	case KindSuper:
-		return "Super"
-	case KindSingle:
-		return "Single"
-	case KindAnyOf:
-		return "AnyOf"
-	default:
-		return ""
-	}
-}

+ 0 - 157
vendor/github.com/gobwas/glob/syntax/ast/parser.go

@@ -1,157 +0,0 @@
-package ast
-
-import (
-	"errors"
-	"fmt"
-	"github.com/gobwas/glob/syntax/lexer"
-	"unicode/utf8"
-)
-
-type Lexer interface {
-	Next() lexer.Token
-}
-
-type parseFn func(*Node, Lexer) (parseFn, *Node, error)
-
-func Parse(lexer Lexer) (*Node, error) {
-	var parser parseFn
-
-	root := NewNode(KindPattern, nil)
-
-	var (
-		tree *Node
-		err  error
-	)
-	for parser, tree = parserMain, root; parser != nil; {
-		parser, tree, err = parser(tree, lexer)
-		if err != nil {
-			return nil, err
-		}
-	}
-
-	return root, nil
-}
-
-func parserMain(tree *Node, lex Lexer) (parseFn, *Node, error) {
-	for {
-		token := lex.Next()
-		switch token.Type {
-		case lexer.EOF:
-			return nil, tree, nil
-
-		case lexer.Error:
-			return nil, tree, errors.New(token.Raw)
-
-		case lexer.Text:
-			Insert(tree, NewNode(KindText, Text{token.Raw}))
-			return parserMain, tree, nil
-
-		case lexer.Any:
-			Insert(tree, NewNode(KindAny, nil))
-			return parserMain, tree, nil
-
-		case lexer.Super:
-			Insert(tree, NewNode(KindSuper, nil))
-			return parserMain, tree, nil
-
-		case lexer.Single:
-			Insert(tree, NewNode(KindSingle, nil))
-			return parserMain, tree, nil
-
-		case lexer.RangeOpen:
-			return parserRange, tree, nil
-
-		case lexer.TermsOpen:
-			a := NewNode(KindAnyOf, nil)
-			Insert(tree, a)
-
-			p := NewNode(KindPattern, nil)
-			Insert(a, p)
-
-			return parserMain, p, nil
-
-		case lexer.Separator:
-			p := NewNode(KindPattern, nil)
-			Insert(tree.Parent, p)
-
-			return parserMain, p, nil
-
-		case lexer.TermsClose:
-			return parserMain, tree.Parent.Parent, nil
-
-		default:
-			return nil, tree, fmt.Errorf("unexpected token: %s", token)
-		}
-	}
-	return nil, tree, fmt.Errorf("unknown error")
-}
-
-func parserRange(tree *Node, lex Lexer) (parseFn, *Node, error) {
-	var (
-		not   bool
-		lo    rune
-		hi    rune
-		chars string
-	)
-	for {
-		token := lex.Next()
-		switch token.Type {
-		case lexer.EOF:
-			return nil, tree, errors.New("unexpected end")
-
-		case lexer.Error:
-			return nil, tree, errors.New(token.Raw)
-
-		case lexer.Not:
-			not = true
-
-		case lexer.RangeLo:
-			r, w := utf8.DecodeRuneInString(token.Raw)
-			if len(token.Raw) > w {
-				return nil, tree, fmt.Errorf("unexpected length of lo character")
-			}
-			lo = r
-
-		case lexer.RangeBetween:
-			//
-
-		case lexer.RangeHi:
-			r, w := utf8.DecodeRuneInString(token.Raw)
-			if len(token.Raw) > w {
-				return nil, tree, fmt.Errorf("unexpected length of lo character")
-			}
-
-			hi = r
-
-			if hi < lo {
-				return nil, tree, fmt.Errorf("hi character '%s' should be greater than lo '%s'", string(hi), string(lo))
-			}
-
-		case lexer.Text:
-			chars = token.Raw
-
-		case lexer.RangeClose:
-			isRange := lo != 0 && hi != 0
-			isChars := chars != ""
-
-			if isChars == isRange {
-				return nil, tree, fmt.Errorf("could not parse range")
-			}
-
-			if isRange {
-				Insert(tree, NewNode(KindRange, Range{
-					Lo:  lo,
-					Hi:  hi,
-					Not: not,
-				}))
-			} else {
-				Insert(tree, NewNode(KindList, List{
-					Chars: chars,
-					Not:   not,
-				}))
-			}
-
-			return parserMain, tree, nil
-		}
-	}
-}

+ 0 - 273
vendor/github.com/gobwas/glob/syntax/lexer/lexer.go

@@ -1,273 +0,0 @@
-package lexer
-
-import (
-	"bytes"
-	"fmt"
-	"github.com/gobwas/glob/util/runes"
-	"unicode/utf8"
-)
-
-const (
-	char_any           = '*'
-	char_comma         = ','
-	char_single        = '?'
-	char_escape        = '\\'
-	char_range_open    = '['
-	char_range_close   = ']'
-	char_terms_open    = '{'
-	char_terms_close   = '}'
-	char_range_not     = '!'
-	char_range_between = '-'
-)
-
-var specials = []byte{
-	char_any,
-	char_single,
-	char_escape,
-	char_range_open,
-	char_range_close,
-	char_terms_open,
-	char_terms_close,
-}
-
-func Special(c byte) bool {
-	return bytes.IndexByte(specials, c) != -1
-}
-
-type tokens []Token
-
-func (i *tokens) shift() (ret Token) {
-	ret = (*i)[0]
-	copy(*i, (*i)[1:])
-	*i = (*i)[:len(*i)-1]
-	return
-}
-
-func (i *tokens) push(v Token) {
-	*i = append(*i, v)
-}
-
-func (i *tokens) empty() bool {
-	return len(*i) == 0
-}
-
-var eof rune = 0
-
-type lexer struct {
-	data string
-	pos  int
-	err  error
-
-	tokens     tokens
-	termsLevel int
-
-	lastRune     rune
-	lastRuneSize int
-	hasRune      bool
-}
-
-func NewLexer(source string) *lexer {
-	l := &lexer{
-		data:   source,
-		tokens: tokens(make([]Token, 0, 4)),
-	}
-	return l
-}
-
-func (l *lexer) Next() Token {
-	if l.err != nil {
-		return Token{Error, l.err.Error()}
-	}
-	if !l.tokens.empty() {
-		return l.tokens.shift()
-	}
-
-	l.fetchItem()
-	return l.Next()
-}
-
-func (l *lexer) peek() (r rune, w int) {
-	if l.pos == len(l.data) {
-		return eof, 0
-	}
-
-	r, w = utf8.DecodeRuneInString(l.data[l.pos:])
-	if r == utf8.RuneError {
-		l.errorf("could not read rune")
-		r = eof
-		w = 0
-	}
-
-	return
-}
-
-func (l *lexer) read() rune {
-	if l.hasRune {
-		l.hasRune = false
-		l.seek(l.lastRuneSize)
-		return l.lastRune
-	}
-
-	r, s := l.peek()
-	l.seek(s)
-
-	l.lastRune = r
-	l.lastRuneSize = s
-
-	return r
-}
-
-func (l *lexer) seek(w int) {
-	l.pos += w
-}
-
-func (l *lexer) unread() {
-	if l.hasRune {
-		l.errorf("could not unread rune")
-		return
-	}
-	l.seek(-l.lastRuneSize)
-	l.hasRune = true
-}
-
-func (l *lexer) errorf(f string, v ...interface{}) {
-	l.err = fmt.Errorf(f, v...)
-}
-
-func (l *lexer) inTerms() bool {
-	return l.termsLevel > 0
-}
-
-func (l *lexer) termsEnter() {
-	l.termsLevel++
-}
-
-func (l *lexer) termsLeave() {
-	l.termsLevel--
-}
-
-var inTextBreakers = []rune{char_single, char_any, char_range_open, char_terms_open}
-var inTermsBreakers = append(inTextBreakers, char_terms_close, char_comma)
-
-func (l *lexer) fetchItem() {
-	r := l.read()
-	switch {
-	case r == eof:
-		l.tokens.push(Token{EOF, ""})
-
-	case r == char_terms_open:
-		l.termsEnter()
-		l.tokens.push(Token{TermsOpen, string(r)})
-
-	case r == char_comma && l.inTerms():
-		l.tokens.push(Token{Separator, string(r)})
-
-	case r == char_terms_close && l.inTerms():
-		l.tokens.push(Token{TermsClose, string(r)})
-		l.termsLeave()
-
-	case r == char_range_open:
-		l.tokens.push(Token{RangeOpen, string(r)})
-		l.fetchRange()
-
-	case r == char_single:
-		l.tokens.push(Token{Single, string(r)})
-
-	case r == char_any:
-		if l.read() == char_any {
-			l.tokens.push(Token{Super, string(r) + string(r)})
-		} else {
-			l.unread()
-			l.tokens.push(Token{Any, string(r)})
-		}
-
-	default:
-		l.unread()
-
-		var breakers []rune
-		if l.inTerms() {
-			breakers = inTermsBreakers
-		} else {
-			breakers = inTextBreakers
-		}
-		l.fetchText(breakers)
-	}
-}
-
-func (l *lexer) fetchRange() {
-	var wantHi bool
-	var wantClose bool
-	var seenNot bool
-	for {
-		r := l.read()
-		if r == eof {
-			l.errorf("unexpected end of input")
-			return
-		}
-
-		if wantClose {
-			if r != char_range_close {
-				l.errorf("expected close range character")
-			} else {
-				l.tokens.push(Token{RangeClose, string(r)})
-			}
-			return
-		}
-
-		if wantHi {
-			l.tokens.push(Token{RangeHi, string(r)})
-			wantClose = true
-			continue
-		}
-
-		if !seenNot && r == char_range_not {
-			l.tokens.push(Token{Not, string(r)})
-			seenNot = true
-			continue
-		}
-
-		if n, w := l.peek(); n == char_range_between {
-			l.seek(w)
-			l.tokens.push(Token{RangeLo, string(r)})
-			l.tokens.push(Token{RangeBetween, string(n)})
-			wantHi = true
-			continue
-		}
-
-		l.unread() // unread first peek and fetch as text
-		l.fetchText([]rune{char_range_close})
-		wantClose = true
-	}
-}
-
-func (l *lexer) fetchText(breakers []rune) {
-	var data []rune
-	var escaped bool
-
-reading:
-	for {
-		r := l.read()
-		if r == eof {
-			break
-		}
-
-		if !escaped {
-			if r == char_escape {
-				escaped = true
-				continue
-			}
-
-			if runes.IndexRune(breakers, r) != -1 {
-				l.unread()
-				break reading
-			}
-		}
-
-		escaped = false
-		data = append(data, r)
-	}
-
-	if len(data) > 0 {
-		l.tokens.push(Token{Text, string(data)})
-	}
-}

+ 0 - 88
vendor/github.com/gobwas/glob/syntax/lexer/token.go

@@ -1,88 +0,0 @@
-package lexer
-
-import "fmt"
-
-type TokenType int
-
-const (
-	EOF TokenType = iota
-	Error
-	Text
-	Char
-	Any
-	Super
-	Single
-	Not
-	Separator
-	RangeOpen
-	RangeClose
-	RangeLo
-	RangeHi
-	RangeBetween
-	TermsOpen
-	TermsClose
-)
-
-func (tt TokenType) String() string {
-	switch tt {
-	case EOF:
-		return "eof"
-
-	case Error:
-		return "error"
-
-	case Text:
-		return "text"
-
-	case Char:
-		return "char"
-
-	case Any:
-		return "any"
-
-	case Super:
-		return "super"
-
-	case Single:
-		return "single"
-
-	case Not:
-		return "not"
-
-	case Separator:
-		return "separator"
-
-	case RangeOpen:
-		return "range_open"
-
-	case RangeClose:
-		return "range_close"
-
-	case RangeLo:
-		return "range_lo"
-
-	case RangeHi:
-		return "range_hi"
-
-	case RangeBetween:
-		return "range_between"
-
-	case TermsOpen:
-		return "terms_open"
-
-	case TermsClose:
-		return "terms_close"
-
-	default:
-		return "undef"
-	}
-}
-
-type Token struct {
-	Type TokenType
-	Raw  string
-}
-
-func (t Token) String() string {
-	return fmt.Sprintf("%v<%q>", t.Type, t.Raw)
-}

+ 0 - 14
vendor/github.com/gobwas/glob/syntax/syntax.go

@@ -1,14 +0,0 @@
-package syntax
-
-import (
-	"github.com/gobwas/glob/syntax/ast"
-	"github.com/gobwas/glob/syntax/lexer"
-)
-
-func Parse(s string) (*ast.Node, error) {
-	return ast.Parse(lexer.NewLexer(s))
-}
-
-func Special(b byte) bool {
-	return lexer.Special(b)
-}

+ 0 - 154
vendor/github.com/gobwas/glob/util/runes/runes.go

@@ -1,154 +0,0 @@
-package runes
-
-func Index(s, needle []rune) int {
-	ls, ln := len(s), len(needle)
-
-	switch {
-	case ln == 0:
-		return 0
-	case ln == 1:
-		return IndexRune(s, needle[0])
-	case ln == ls:
-		if Equal(s, needle) {
-			return 0
-		}
-		return -1
-	case ln > ls:
-		return -1
-	}
-
-head:
-	for i := 0; i < ls && ls-i >= ln; i++ {
-		for y := 0; y < ln; y++ {
-			if s[i+y] != needle[y] {
-				continue head
-			}
-		}
-
-		return i
-	}
-
-	return -1
-}
-
-func LastIndex(s, needle []rune) int {
-	ls, ln := len(s), len(needle)
-
-	switch {
-	case ln == 0:
-		if ls == 0 {
-			return 0
-		}
-		return ls
-	case ln == 1:
-		return IndexLastRune(s, needle[0])
-	case ln == ls:
-		if Equal(s, needle) {
-			return 0
-		}
-		return -1
-	case ln > ls:
-		return -1
-	}
-
-head:
-	for i := ls - 1; i >= 0 && i >= ln; i-- {
-		for y := ln - 1; y >= 0; y-- {
-			if s[i-(ln-y-1)] != needle[y] {
-				continue head
-			}
-		}
-
-		return i - ln + 1
-	}
-
-	return -1
-}
-
-// IndexAny returns the index of the first instance of any Unicode code point
-// from chars in s, or -1 if no Unicode code point from chars is present in s.
-func IndexAny(s, chars []rune) int {
-	if len(chars) > 0 {
-		for i, c := range s {
-			for _, m := range chars {
-				if c == m {
-					return i
-				}
-			}
-		}
-	}
-	return -1
-}
-
-func Contains(s, needle []rune) bool {
-	return Index(s, needle) >= 0
-}
-
-func Max(s []rune) (max rune) {
-	for _, r := range s {
-		if r > max {
-			max = r
-		}
-	}
-
-	return
-}
-
-func Min(s []rune) rune {
-	min := rune(-1)
-	for _, r := range s {
-		if min == -1 {
-			min = r
-			continue
-		}
-
-		if r < min {
-			min = r
-		}
-	}
-
-	return min
-}
-
-func IndexRune(s []rune, r rune) int {
-	for i, c := range s {
-		if c == r {
-			return i
-		}
-	}
-	return -1
-}
-
-func IndexLastRune(s []rune, r rune) int {
-	for i := len(s) - 1; i >= 0; i-- {
-		if s[i] == r {
-			return i
-		}
-	}
-
-	return -1
-}
-
-func Equal(a, b []rune) bool {
-	if len(a) == len(b) {
-		for i := 0; i < len(a); i++ {
-			if a[i] != b[i] {
-				return false
-			}
-		}
-
-		return true
-	}
-
-	return false
-}
-
-// HasPrefix tests whether the string s begins with prefix.
-func HasPrefix(s, prefix []rune) bool {
-	return len(s) >= len(prefix) && Equal(s[0:len(prefix)], prefix)
-}
-
-// HasSuffix tests whether the string s ends with suffix.
-func HasSuffix(s, suffix []rune) bool {
-	return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix)
-}

+ 0 - 39
vendor/github.com/gobwas/glob/util/strings/strings.go

@@ -1,39 +0,0 @@
-package strings
-
-import (
-	"strings"
-	"unicode/utf8"
-)
-
-func IndexAnyRunes(s string, rs []rune) int {
-	for _, r := range rs {
-		if i := strings.IndexRune(s, r); i != -1 {
-			return i
-		}
-	}
-
-	return -1
-}
-
-func LastIndexAnyRunes(s string, rs []rune) int {
-	for _, r := range rs {
-		i := -1
-		if 0 <= r && r < utf8.RuneSelf {
-			i = strings.LastIndexByte(s, byte(r))
-		} else {
-			sub := s
-			for len(sub) > 0 {
-				j := strings.IndexRune(s, r)
-				if j == -1 {
-					break
-				}
-				i = j
-				sub = sub[i+1:]
-			}
-		}
-		if i != -1 {
-			return i
-		}
-	}
-	return -1
-}

+ 0 - 1
vendor/github.com/gocarina/gocsv/.gitignore

@@ -1 +0,0 @@
-.idea

+ 0 - 1
vendor/github.com/gocarina/gocsv/.travis.yml

@@ -1 +0,0 @@
-language: go

+ 0 - 21
vendor/github.com/gocarina/gocsv/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Jonathan Picques
-
-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.

+ 0 - 170
vendor/github.com/gocarina/gocsv/README.md

@@ -1,170 +0,0 @@
-Go CSV
-=====
-
-The GoCSV package aims to provide easy serialization and deserialization functions to use CSV in Golang
-
-API and techniques inspired from https://godoc.org/gopkg.in/mgo.v2
-
-[![GoDoc](https://godoc.org/github.com/gocarina/gocsv?status.png)](https://godoc.org/github.com/gocarina/gocsv)
-[![Build Status](https://travis-ci.org/gocarina/gocsv.svg?branch=master)](https://travis-ci.org/gocarina/gocsv)
-
-Installation
-=====
-
-```go get -u github.com/gocarina/gocsv```
-
-Full example
-=====
-
-Consider the following CSV file
-
-```csv
-
-client_id,client_name,client_age
-1,Jose,42
-2,Daniel,26
-3,Vincent,32
-
-```
-
-Easy binding in Go!
----
-
-```go
-
-package main
-
-import (
-	"fmt"
-	"gocsv"
-	"os"
-)
-
-type Client struct { // Our example struct, you can use "-" to ignore a field
-	Id      string `csv:"client_id"`
-	Name    string `csv:"client_name"`
-	Age     string `csv:"client_age"`
-	NotUsed string `csv:"-"`
-}
-
-func main() {
-	clientsFile, err := os.OpenFile("clients.csv", os.O_RDWR|os.O_CREATE, os.ModePerm)
-	if err != nil {
-		panic(err)
-	}
-	defer clientsFile.Close()
-
-	clients := []*Client{}
-
-	if err := gocsv.UnmarshalFile(clientsFile, &clients); err != nil { // Load clients from file
-		panic(err)
-	}
-	for _, client := range clients {
-		fmt.Println("Hello", client.Name)
-	}
-
-	if _, err := clientsFile.Seek(0, 0); err != nil { // Go to the start of the file
-		panic(err)
-	}
-
-	clients = append(clients, &Client{Id: "12", Name: "John", Age: "21"}) // Add clients
-	clients = append(clients, &Client{Id: "13", Name: "Fred"})
-	clients = append(clients, &Client{Id: "14", Name: "James", Age: "32"})
-	clients = append(clients, &Client{Id: "15", Name: "Danny"})
-	csvContent, err := gocsv.MarshalString(&clients) // Get all clients as CSV string
-	//err = gocsv.MarshalFile(&clients, clientsFile) // Use this to save the CSV back to the file
-	if err != nil {
-		panic(err)
-	}
-	fmt.Println(csvContent) // Display all clients as CSV string
-
-}
-
-```
-
-Customizable Converters
----
-
-```go
-
-type DateTime struct {
-	time.Time
-}
-
-// Convert the internal date as CSV string
-func (date *DateTime) MarshalCSV() (string, error) {
-	return date.Time.Format("20060201"), nil
-}
-
-// You could also use the standard Stringer interface 
-func (date *DateTime) String() (string) {
-	return date.String() // Redundant, just for example
-}
-
-// Convert the CSV string as internal date
-func (date *DateTime) UnmarshalCSV(csv string) (err error) {
-	date.Time, err = time.Parse("20060201", csv)
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-type Client struct { // Our example struct with a custom type (DateTime)
-	Id       string   `csv:"id"`
-	Name     string   `csv:"name"`
-	Employed DateTime `csv:"employed"`
-}
-
-```
-
-Customizable CSV Reader / Writer
----
-
-```go
-
-func main() {
-        ...
-	
-        gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader {
-            r := csv.NewReader(in)
-            r.Comma = '|'
-            return r // Allows use pipe as delimiter
-        })	
-	
-        ...
-	
-        gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader {
-            r := csv.NewReader(in)
-            r.LazyQuotes = true
-            r.Comma = '.'
-            return r // Allows use dot as delimiter and use quotes in CSV
-        })
-	
-        ...
-	
-        gocsv.SetCSVReader(func(in io.Reader) gocsv.CSVReader {
-            //return csv.NewReader(in)
-            return gocsv.LazyCSVReader(in) // Allows use of quotes in CSV
-        })
-
-        ...
-
-        gocsv.UnmarshalFile(file, &clients)
-
-        ...
-
-        gocsv.SetCSVWriter(func(out io.Writer) *SafeCSVWriter {
-            writer := csv.NewWriter(out)
-            writer.Comma = '|'
-            return gocsv.NewSafeCSVWriter(writer)
-        })
-
-        ...
-
-        gocsv.MarshalFile(&clients, file)
-
-        ...
-}
-
-```

+ 0 - 319
vendor/github.com/gocarina/gocsv/csv.go

@@ -1,319 +0,0 @@
-// Copyright 2014 Jonathan Picques. All rights reserved.
-// Use of this source code is governed by a MIT license
-// The license can be found in the LICENSE file.
-
-// The GoCSV package aims to provide easy CSV serialization and deserialization to the golang programming language
-
-package gocsv
-
-import (
-	"bytes"
-	"encoding/csv"
-	"fmt"
-	"io"
-	"os"
-	"reflect"
-	"strings"
-)
-
-// FailIfUnmatchedStructTags indicates whether it is considered an error when there is an unmatched
-// struct tag.
-var FailIfUnmatchedStructTags = false
-
-// FailIfDoubleHeaderNames indicates whether it is considered an error when a header name is repeated
-// in the csv header.
-var FailIfDoubleHeaderNames = false
-
-// ShouldAlignDuplicateHeadersWithStructFieldOrder indicates whether we should align duplicate CSV
-// headers per their alignment in the struct definition.
-var ShouldAlignDuplicateHeadersWithStructFieldOrder = false
-
-// TagSeparator defines seperator string for multiple csv tags in struct fields
-var TagSeparator = ","
-
-// --------------------------------------------------------------------------
-// CSVWriter used to format CSV
-
-var selfCSVWriter = DefaultCSVWriter
-
-// DefaultCSVWriter is the default SafeCSVWriter used to format CSV (cf. csv.NewWriter)
-func DefaultCSVWriter(out io.Writer) *SafeCSVWriter {
-	writer := NewSafeCSVWriter(csv.NewWriter(out))
-
-	// As only one rune can be defined as a CSV separator, we are going to trim
-	// the custom tag separator and use the first rune.
-	if runes := []rune(strings.TrimSpace(TagSeparator)); len(runes) > 0 {
-		writer.Comma = runes[0]
-	}
-
-	return writer
-}
-
-// SetCSVWriter sets the SafeCSVWriter used to format CSV.
-func SetCSVWriter(csvWriter func(io.Writer) *SafeCSVWriter) {
-	selfCSVWriter = csvWriter
-}
-
-func getCSVWriter(out io.Writer) *SafeCSVWriter {
-	return selfCSVWriter(out)
-}
-
-// --------------------------------------------------------------------------
-// CSVReader used to parse CSV
-
-var selfCSVReader = DefaultCSVReader
-
-// DefaultCSVReader is the default CSV reader used to parse CSV (cf. csv.NewReader)
-func DefaultCSVReader(in io.Reader) CSVReader {
-	return csv.NewReader(in)
-}
-
-// LazyCSVReader returns a lazy CSV reader, with LazyQuotes and TrimLeadingSpace.
-func LazyCSVReader(in io.Reader) CSVReader {
-	csvReader := csv.NewReader(in)
-	csvReader.LazyQuotes = true
-	csvReader.TrimLeadingSpace = true
-	return csvReader
-}
-
-// SetCSVReader sets the CSV reader used to parse CSV.
-func SetCSVReader(csvReader func(io.Reader) CSVReader) {
-	selfCSVReader = csvReader
-}
-
-func getCSVReader(in io.Reader) CSVReader {
-	return selfCSVReader(in)
-}
-
-// --------------------------------------------------------------------------
-// Marshal functions
-
-// MarshalFile saves the interface as CSV in the file.
-func MarshalFile(in interface{}, file *os.File) (err error) {
-	return Marshal(in, file)
-}
-
-// MarshalString returns the CSV string from the interface.
-func MarshalString(in interface{}) (out string, err error) {
-	bufferString := bytes.NewBufferString(out)
-	if err := Marshal(in, bufferString); err != nil {
-		return "", err
-	}
-	return bufferString.String(), nil
-}
-
-// MarshalBytes returns the CSV bytes from the interface.
-func MarshalBytes(in interface{}) (out []byte, err error) {
-	bufferString := bytes.NewBuffer(out)
-	if err := Marshal(in, bufferString); err != nil {
-		return nil, err
-	}
-	return bufferString.Bytes(), nil
-}
-
-// Marshal returns the CSV in writer from the interface.
-func Marshal(in interface{}, out io.Writer) (err error) {
-	writer := getCSVWriter(out)
-	return writeTo(writer, in, false)
-}
-
-// Marshal returns the CSV in writer from the interface.
-func MarshalWithoutHeaders(in interface{}, out io.Writer) (err error) {
-	writer := getCSVWriter(out)
-	return writeTo(writer, in, true)
-}
-
-// MarshalChan returns the CSV read from the channel.
-func MarshalChan(c <-chan interface{}, out *SafeCSVWriter) error {
-	return writeFromChan(out, c)
-}
-
-// MarshalCSV returns the CSV in writer from the interface.
-func MarshalCSV(in interface{}, out *SafeCSVWriter) (err error) {
-	return writeTo(out, in, false)
-}
-
-// MarshalCSVWithoutHeaders returns the CSV in writer from the interface.
-func MarshalCSVWithoutHeaders(in interface{}, out *SafeCSVWriter) (err error) {
-	return writeTo(out, in, true)
-}
-
-// --------------------------------------------------------------------------
-// Unmarshal functions
-
-// UnmarshalFile parses the CSV from the file in the interface.
-func UnmarshalFile(in *os.File, out interface{}) error {
-	return Unmarshal(in, out)
-}
-
-// UnmarshalString parses the CSV from the string in the interface.
-func UnmarshalString(in string, out interface{}) error {
-	return Unmarshal(strings.NewReader(in), out)
-}
-
-// UnmarshalBytes parses the CSV from the bytes in the interface.
-func UnmarshalBytes(in []byte, out interface{}) error {
-	return Unmarshal(bytes.NewReader(in), out)
-}
-
-// Unmarshal parses the CSV from the reader in the interface.
-func Unmarshal(in io.Reader, out interface{}) error {
-	return readTo(newDecoder(in), out)
-}
-
-// UnmarshalDecoder parses the CSV from the decoder in the interface
-func UnmarshalDecoder(in Decoder, out interface{}) error {
-	return readTo(in, out)
-}
-
-// UnmarshalCSV parses the CSV from the reader in the interface.
-func UnmarshalCSV(in CSVReader, out interface{}) error {
-	return readTo(csvDecoder{in}, out)
-}
-
-// UnmarshalToChan parses the CSV from the reader and send each value in the chan c.
-// The channel must have a concrete type.
-func UnmarshalToChan(in io.Reader, c interface{}) error {
-	if c == nil {
-		return fmt.Errorf("goscv: channel is %v", c)
-	}
-	return readEach(newDecoder(in), c)
-}
-
-// UnmarshalDecoderToChan parses the CSV from the decoder and send each value in the chan c.
-// The channel must have a concrete type.
-func UnmarshalDecoderToChan(in SimpleDecoder, c interface{}) error {
-	if c == nil {
-		return fmt.Errorf("goscv: channel is %v", c)
-	}
-	return readEach(in, c)
-}
-
-// UnmarshalStringToChan parses the CSV from the string and send each value in the chan c.
-// The channel must have a concrete type.
-func UnmarshalStringToChan(in string, c interface{}) error {
-	return UnmarshalToChan(strings.NewReader(in), c)
-}
-
-// UnmarshalBytesToChan parses the CSV from the bytes and send each value in the chan c.
-// The channel must have a concrete type.
-func UnmarshalBytesToChan(in []byte, c interface{}) error {
-	return UnmarshalToChan(bytes.NewReader(in), c)
-}
-
-// UnmarshalToCallback parses the CSV from the reader and send each value to the given func f.
-// The func must look like func(Struct).
-func UnmarshalToCallback(in io.Reader, f interface{}) error {
-	valueFunc := reflect.ValueOf(f)
-	t := reflect.TypeOf(f)
-	if t.NumIn() != 1 {
-		return fmt.Errorf("the given function must have exactly one parameter")
-	}
-	cerr := make(chan error)
-	c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0)
-	go func() {
-		cerr <- UnmarshalToChan(in, c.Interface())
-	}()
-	for {
-		select {
-		case err := <-cerr:
-			return err
-		default:
-		}
-		v, notClosed := c.Recv()
-		if !notClosed || v.Interface() == nil {
-			break
-		}
-		valueFunc.Call([]reflect.Value{v})
-	}
-	return nil
-}
-
-// UnmarshalDecoderToCallback parses the CSV from the decoder and send each value to the given func f.
-// The func must look like func(Struct).
-func UnmarshalDecoderToCallback(in SimpleDecoder, f interface{}) error {
-	valueFunc := reflect.ValueOf(f)
-	t := reflect.TypeOf(f)
-	if t.NumIn() != 1 {
-		return fmt.Errorf("the given function must have exactly one parameter")
-	}
-	cerr := make(chan error)
-	c := reflect.MakeChan(reflect.ChanOf(reflect.BothDir, t.In(0)), 0)
-	go func() {
-		cerr <- UnmarshalDecoderToChan(in, c.Interface())
-	}()
-	for {
-		select {
-		case err := <-cerr:
-			return err
-		default:
-		}
-		v, notClosed := c.Recv()
-		if !notClosed || v.Interface() == nil {
-			break
-		}
-		valueFunc.Call([]reflect.Value{v})
-	}
-	return nil
-}
-
-// UnmarshalBytesToCallback parses the CSV from the bytes and send each value to the given func f.
-// The func must look like func(Struct).
-func UnmarshalBytesToCallback(in []byte, f interface{}) error {
-	return UnmarshalToCallback(bytes.NewReader(in), f)
-}
-
-// UnmarshalStringToCallback parses the CSV from the string and send each value to the given func f.
-// The func must look like func(Struct).
-func UnmarshalStringToCallback(in string, c interface{}) (err error) {
-	return UnmarshalToCallback(strings.NewReader(in), c)
-}
-
-// CSVToMap creates a simple map from a CSV of 2 columns.
-func CSVToMap(in io.Reader) (map[string]string, error) {
-	decoder := newDecoder(in)
-	header, err := decoder.getCSVRow()
-	if err != nil {
-		return nil, err
-	}
-	if len(header) != 2 {
-		return nil, fmt.Errorf("maps can only be created for csv of two columns")
-	}
-	m := make(map[string]string)
-	for {
-		line, err := decoder.getCSVRow()
-		if err == io.EOF {
-			break
-		} else if err != nil {
-			return nil, err
-		}
-		m[line[0]] = line[1]
-	}
-	return m, nil
-}
-
-// CSVToMaps takes a reader and returns an array of dictionaries, using the header row as the keys
-func CSVToMaps(reader io.Reader) ([]map[string]string, error) {
-	r := csv.NewReader(reader)
-	rows := []map[string]string{}
-	var header []string
-	for {
-		record, err := r.Read()
-		if err == io.EOF {
-			break
-		}
-		if err != nil {
-			return nil, err
-		}
-		if header == nil {
-			header = record
-		} else {
-			dict := map[string]string{}
-			for i := range header {
-				dict[header[i]] = record[i]
-			}
-			rows = append(rows, dict)
-		}
-	}
-	return rows, nil
-}

+ 0 - 296
vendor/github.com/gocarina/gocsv/decode.go

@@ -1,296 +0,0 @@
-package gocsv
-
-import (
-	"encoding/csv"
-	"errors"
-	"fmt"
-	"io"
-	"reflect"
-)
-
-// Decoder .
-type Decoder interface {
-	getCSVRows() ([][]string, error)
-}
-
-// SimpleDecoder .
-type SimpleDecoder interface {
-	getCSVRow() ([]string, error)
-}
-
-type decoder struct {
-	in         io.Reader
-	csvDecoder *csvDecoder
-}
-
-func newDecoder(in io.Reader) *decoder {
-	return &decoder{in: in}
-}
-
-func (decode *decoder) getCSVRows() ([][]string, error) {
-	return getCSVReader(decode.in).ReadAll()
-}
-
-func (decode *decoder) getCSVRow() ([]string, error) {
-	if decode.csvDecoder == nil {
-		decode.csvDecoder = &csvDecoder{getCSVReader(decode.in)}
-	}
-	return decode.csvDecoder.Read()
-}
-
-type CSVReader interface {
-	Read() ([]string, error)
-	ReadAll() ([][]string, error)
-}
-
-type csvDecoder struct {
-	CSVReader
-}
-
-func (c csvDecoder) getCSVRows() ([][]string, error) {
-	return c.ReadAll()
-}
-
-func (c csvDecoder) getCSVRow() ([]string, error) {
-	return c.Read()
-}
-
-func maybeMissingStructFields(structInfo []fieldInfo, headers []string) error {
-	if len(structInfo) == 0 {
-		return nil
-	}
-
-	headerMap := make(map[string]struct{}, len(headers))
-	for idx := range headers {
-		headerMap[headers[idx]] = struct{}{}
-	}
-
-	for _, info := range structInfo {
-		found := false
-		for _, key := range info.keys {
-			if _, ok := headerMap[key]; ok {
-				found = true
-				break
-			}
-		}
-		if !found {
-			return fmt.Errorf("found unmatched struct field with tags %v", info.keys)
-		}
-	}
-	return nil
-}
-
-// Check that no header name is repeated twice
-func maybeDoubleHeaderNames(headers []string) error {
-	headerMap := make(map[string]bool, len(headers))
-	for _, v := range headers {
-		if _, ok := headerMap[v]; ok {
-			return fmt.Errorf("Repeated header name: %v", v)
-		}
-		headerMap[v] = true
-	}
-	return nil
-}
-
-func readTo(decoder Decoder, out interface{}) error {
-	outValue, outType := getConcreteReflectValueAndType(out) // Get the concrete type (not pointer) (Slice<?> or Array<?>)
-	if err := ensureOutType(outType); err != nil {
-		return err
-	}
-	outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">)
-	if err := ensureOutInnerType(outInnerType); err != nil {
-		return err
-	}
-	csvRows, err := decoder.getCSVRows() // Get the CSV csvRows
-	if err != nil {
-		return err
-	}
-	if len(csvRows) == 0 {
-		return errors.New("empty csv file given")
-	}
-	if err := ensureOutCapacity(&outValue, len(csvRows)); err != nil { // Ensure the container is big enough to hold the CSV content
-		return err
-	}
-	outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations
-	if len(outInnerStructInfo.Fields) == 0 {
-		return errors.New("no csv struct tags found")
-	}
-
-	headers := csvRows[0]
-	body := csvRows[1:]
-
-	csvHeadersLabels := make(map[int]*fieldInfo, len(outInnerStructInfo.Fields)) // Used to store the correspondance header <-> position in CSV
-
-	headerCount := map[string]int{}
-	for i, csvColumnHeader := range headers {
-		curHeaderCount := headerCount[csvColumnHeader]
-		if fieldInfo := getCSVFieldPosition(csvColumnHeader, outInnerStructInfo, curHeaderCount); fieldInfo != nil {
-			csvHeadersLabels[i] = fieldInfo
-			if ShouldAlignDuplicateHeadersWithStructFieldOrder {
-				curHeaderCount++
-				headerCount[csvColumnHeader] = curHeaderCount
-			}
-		}
-	}
-
-	if FailIfUnmatchedStructTags {
-		if err := maybeMissingStructFields(outInnerStructInfo.Fields, headers); err != nil {
-			return err
-		}
-	}
-	if FailIfDoubleHeaderNames {
-		if err := maybeDoubleHeaderNames(headers); err != nil {
-			return err
-		}
-	}
-
-	for i, csvRow := range body {
-		outInner := createNewOutInner(outInnerWasPointer, outInnerType)
-		for j, csvColumnContent := range csvRow {
-			if fieldInfo, ok := csvHeadersLabels[j]; ok { // Position found accordingly to header name
-				if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct
-					return &csv.ParseError{
-						Line:   i + 2, //add 2 to account for the header & 0-indexing of arrays
-						Column: j + 1,
-						Err:    err,
-					}
-				}
-			}
-		}
-		outValue.Index(i).Set(outInner)
-	}
-	return nil
-}
-
-func readEach(decoder SimpleDecoder, c interface{}) error {
-	headers, err := decoder.getCSVRow()
-	if err != nil {
-		return err
-	}
-	outValue, outType := getConcreteReflectValueAndType(c) // Get the concrete type (not pointer) (Slice<?> or Array<?>)
-	if err := ensureOutType(outType); err != nil {
-		return err
-	}
-	defer outValue.Close()
-	outInnerWasPointer, outInnerType := getConcreteContainerInnerType(outType) // Get the concrete inner type (not pointer) (Container<"?">)
-	if err := ensureOutInnerType(outInnerType); err != nil {
-		return err
-	}
-	outInnerStructInfo := getStructInfo(outInnerType) // Get the inner struct info to get CSV annotations
-	if len(outInnerStructInfo.Fields) == 0 {
-		return errors.New("no csv struct tags found")
-	}
-	csvHeadersLabels := make(map[int]*fieldInfo, len(outInnerStructInfo.Fields)) // Used to store the correspondance header <-> position in CSV
-	headerCount := map[string]int{}
-	for i, csvColumnHeader := range headers {
-		curHeaderCount := headerCount[csvColumnHeader]
-		if fieldInfo := getCSVFieldPosition(csvColumnHeader, outInnerStructInfo, curHeaderCount); fieldInfo != nil {
-			csvHeadersLabels[i] = fieldInfo
-			if ShouldAlignDuplicateHeadersWithStructFieldOrder {
-				curHeaderCount++
-				headerCount[csvColumnHeader] = curHeaderCount
-			}
-		}
-	}
-	if err := maybeMissingStructFields(outInnerStructInfo.Fields, headers); err != nil {
-		if FailIfUnmatchedStructTags {
-			return err
-		}
-	}
-	if FailIfDoubleHeaderNames {
-		if err := maybeDoubleHeaderNames(headers); err != nil {
-			return err
-		}
-	}
-	i := 0
-	for {
-		line, err := decoder.getCSVRow()
-		if err == io.EOF {
-			break
-		} else if err != nil {
-			return err
-		}
-		outInner := createNewOutInner(outInnerWasPointer, outInnerType)
-		for j, csvColumnContent := range line {
-			if fieldInfo, ok := csvHeadersLabels[j]; ok { // Position found accordingly to header name
-				if err := setInnerField(&outInner, outInnerWasPointer, fieldInfo.IndexChain, csvColumnContent, fieldInfo.omitEmpty); err != nil { // Set field of struct
-					return &csv.ParseError{
-						Line:   i + 2, //add 2 to account for the header & 0-indexing of arrays
-						Column: j + 1,
-						Err:    err,
-					}
-				}
-			}
-		}
-		outValue.Send(outInner)
-		i++
-	}
-	return nil
-}
-
-// Check if the outType is an array or a slice
-func ensureOutType(outType reflect.Type) error {
-	switch outType.Kind() {
-	case reflect.Slice:
-		fallthrough
-	case reflect.Chan:
-		fallthrough
-	case reflect.Array:
-		return nil
-	}
-	return fmt.Errorf("cannot use " + outType.String() + ", only slice or array supported")
-}
-
-// Check if the outInnerType is of type struct
-func ensureOutInnerType(outInnerType reflect.Type) error {
-	switch outInnerType.Kind() {
-	case reflect.Struct:
-		return nil
-	}
-	return fmt.Errorf("cannot use " + outInnerType.String() + ", only struct supported")
-}
-
-func ensureOutCapacity(out *reflect.Value, csvLen int) error {
-	switch out.Kind() {
-	case reflect.Array:
-		if out.Len() < csvLen-1 { // Array is not big enough to hold the CSV content (arrays are not addressable)
-			return fmt.Errorf("array capacity problem: cannot store %d %s in %s", csvLen-1, out.Type().Elem().String(), out.Type().String())
-		}
-	case reflect.Slice:
-		if !out.CanAddr() && out.Len() < csvLen-1 { // Slice is not big enough tho hold the CSV content and is not addressable
-			return fmt.Errorf("slice capacity problem and is not addressable (did you forget &?)")
-		} else if out.CanAddr() && out.Len() < csvLen-1 {
-			out.Set(reflect.MakeSlice(out.Type(), csvLen-1, csvLen-1)) // Slice is not big enough, so grows it
-		}
-	}
-	return nil
-}
-
-func getCSVFieldPosition(key string, structInfo *structInfo, curHeaderCount int) *fieldInfo {
-	matchedFieldCount := 0
-	for _, field := range structInfo.Fields {
-		if field.matchesKey(key) {
-			if matchedFieldCount >= curHeaderCount {
-				return &field
-			} else {
-				matchedFieldCount++
-			}
-		}
-	}
-	return nil
-}
-
-func createNewOutInner(outInnerWasPointer bool, outInnerType reflect.Type) reflect.Value {
-	if outInnerWasPointer {
-		return reflect.New(outInnerType)
-	}
-	return reflect.New(outInnerType).Elem()
-}
-
-func setInnerField(outInner *reflect.Value, outInnerWasPointer bool, index []int, value string, omitEmpty bool) error {
-	oi := *outInner
-	if outInnerWasPointer {
-		oi = outInner.Elem()
-	}
-	return setField(oi.FieldByIndex(index), value, omitEmpty)
-}

+ 0 - 139
vendor/github.com/gocarina/gocsv/encode.go

@@ -1,139 +0,0 @@
-package gocsv
-
-import (
-	"fmt"
-	"io"
-	"reflect"
-)
-
-type encoder struct {
-	out io.Writer
-}
-
-func newEncoder(out io.Writer) *encoder {
-	return &encoder{out}
-}
-
-func writeFromChan(writer *SafeCSVWriter, c <-chan interface{}) error {
-	// Get the first value. It wil determine the header structure.
-	firstValue, ok := <-c
-	if !ok {
-		return fmt.Errorf("channel is closed")
-	}
-	inValue, inType := getConcreteReflectValueAndType(firstValue) // Get the concrete type
-	if err := ensureStructOrPtr(inType); err != nil {
-		return err
-	}
-	inInnerWasPointer := inType.Kind() == reflect.Ptr
-	inInnerStructInfo := getStructInfo(inType) // Get the inner struct info to get CSV annotations
-	csvHeadersLabels := make([]string, len(inInnerStructInfo.Fields))
-	for i, fieldInfo := range inInnerStructInfo.Fields { // Used to write the header (first line) in CSV
-		csvHeadersLabels[i] = fieldInfo.getFirstKey()
-	}
-	if err := writer.Write(csvHeadersLabels); err != nil {
-		return err
-	}
-	write := func(val reflect.Value) error {
-		for j, fieldInfo := range inInnerStructInfo.Fields {
-			csvHeadersLabels[j] = ""
-			inInnerFieldValue, err := getInnerField(val, inInnerWasPointer, fieldInfo.IndexChain) // Get the correct field header <-> position
-			if err != nil {
-				return err
-			}
-			csvHeadersLabels[j] = inInnerFieldValue
-		}
-		if err := writer.Write(csvHeadersLabels); err != nil {
-			return err
-		}
-		return nil
-	}
-	if err := write(inValue); err != nil {
-		return err
-	}
-	for v := range c {
-		val, _ := getConcreteReflectValueAndType(v) // Get the concrete type (not pointer) (Slice<?> or Array<?>)
-		if err := ensureStructOrPtr(inType); err != nil {
-			return err
-		}
-		if err := write(val); err != nil {
-			return err
-		}
-	}
-	writer.Flush()
-	return writer.Error()
-}
-
-func writeTo(writer *SafeCSVWriter, in interface{}, omitHeaders bool) error {
-	inValue, inType := getConcreteReflectValueAndType(in) // Get the concrete type (not pointer) (Slice<?> or Array<?>)
-	if err := ensureInType(inType); err != nil {
-		return err
-	}
-	inInnerWasPointer, inInnerType := getConcreteContainerInnerType(inType) // Get the concrete inner type (not pointer) (Container<"?">)
-	if err := ensureInInnerType(inInnerType); err != nil {
-		return err
-	}
-	inInnerStructInfo := getStructInfo(inInnerType) // Get the inner struct info to get CSV annotations
-	csvHeadersLabels := make([]string, len(inInnerStructInfo.Fields))
-	for i, fieldInfo := range inInnerStructInfo.Fields { // Used to write the header (first line) in CSV
-		csvHeadersLabels[i] = fieldInfo.getFirstKey()
-	}
-	if !omitHeaders {
-		if err := writer.Write(csvHeadersLabels); err != nil {
-			return err
-		}
-	}
-	inLen := inValue.Len()
-	for i := 0; i < inLen; i++ { // Iterate over container rows
-		for j, fieldInfo := range inInnerStructInfo.Fields {
-			csvHeadersLabels[j] = ""
-			inInnerFieldValue, err := getInnerField(inValue.Index(i), inInnerWasPointer, fieldInfo.IndexChain) // Get the correct field header <-> position
-			if err != nil {
-				return err
-			}
-			csvHeadersLabels[j] = inInnerFieldValue
-		}
-		if err := writer.Write(csvHeadersLabels); err != nil {
-			return err
-		}
-	}
-	writer.Flush()
-	return writer.Error()
-}
-
-func ensureStructOrPtr(t reflect.Type) error {
-	switch t.Kind() {
-	case reflect.Struct:
-		fallthrough
-	case reflect.Ptr:
-		return nil
-	}
-	return fmt.Errorf("cannot use " + t.String() + ", only slice or array supported")
-}
-
-// Check if the inType is an array or a slice
-func ensureInType(outType reflect.Type) error {
-	switch outType.Kind() {
-	case reflect.Slice:
-		fallthrough
-	case reflect.Array:
-		return nil
-	}
-	return fmt.Errorf("cannot use " + outType.String() + ", only slice or array supported")
-}
-
-// Check if the inInnerType is of type struct
-func ensureInInnerType(outInnerType reflect.Type) error {
-	switch outInnerType.Kind() {
-	case reflect.Struct:
-		return nil
-	}
-	return fmt.Errorf("cannot use " + outInnerType.String() + ", only struct supported")
-}
-
-func getInnerField(outInner reflect.Value, outInnerWasPointer bool, index []int) (string, error) {
-	oi := outInner
-	if outInnerWasPointer {
-		oi = outInner.Elem()
-	}
-	return getFieldAsString(oi.FieldByIndex(index))
-}

+ 0 - 107
vendor/github.com/gocarina/gocsv/reflect.go

@@ -1,107 +0,0 @@
-package gocsv
-
-import (
-	"reflect"
-	"strings"
-	"sync"
-)
-
-// --------------------------------------------------------------------------
-// Reflection helpers
-
-type structInfo struct {
-	Fields []fieldInfo
-}
-
-// fieldInfo is a struct field that should be mapped to a CSV column, or vice-versa
-// Each IndexChain element before the last is the index of an the embedded struct field
-// that defines Key as a tag
-type fieldInfo struct {
-	keys       []string
-	omitEmpty  bool
-	IndexChain []int
-}
-
-func (f fieldInfo) getFirstKey() string {
-	return f.keys[0]
-}
-
-func (f fieldInfo) matchesKey(key string) bool {
-	for _, k := range f.keys {
-		if key == k || strings.TrimSpace(key) == k {
-			return true
-		}
-	}
-	return false
-}
-
-var structMap = make(map[reflect.Type]*structInfo)
-var structMapMutex sync.RWMutex
-
-func getStructInfo(rType reflect.Type) *structInfo {
-	structMapMutex.RLock()
-	stInfo, ok := structMap[rType]
-	structMapMutex.RUnlock()
-	if ok {
-		return stInfo
-	}
-	fieldsList := getFieldInfos(rType, []int{})
-	stInfo = &structInfo{fieldsList}
-	return stInfo
-}
-
-func getFieldInfos(rType reflect.Type, parentIndexChain []int) []fieldInfo {
-	fieldsCount := rType.NumField()
-	fieldsList := make([]fieldInfo, 0, fieldsCount)
-	for i := 0; i < fieldsCount; i++ {
-		field := rType.Field(i)
-		if field.PkgPath != "" {
-			continue
-		}
-		indexChain := append(parentIndexChain, i)
-		// if the field is an embedded struct, create a fieldInfo for each of its fields
-		if field.Anonymous && field.Type.Kind() == reflect.Struct {
-			fieldsList = append(fieldsList, getFieldInfos(field.Type, indexChain)...)
-			continue
-		}
-		fieldInfo := fieldInfo{IndexChain: indexChain}
-		fieldTag := field.Tag.Get("csv")
-		fieldTags := strings.Split(fieldTag, TagSeparator)
-		filteredTags := []string{}
-		for _, fieldTagEntry := range fieldTags {
-			if fieldTagEntry != "omitempty" {
-				filteredTags = append(filteredTags, fieldTagEntry)
-			} else {
-				fieldInfo.omitEmpty = true
-			}
-		}
-
-		if len(filteredTags) == 1 && filteredTags[0] == "-" {
-			continue
-		} else if len(filteredTags) > 0 && filteredTags[0] != "" {
-			fieldInfo.keys = filteredTags
-		} else {
-			fieldInfo.keys = []string{field.Name}
-		}
-		fieldsList = append(fieldsList, fieldInfo)
-	}
-	return fieldsList
-}
-
-func getConcreteContainerInnerType(in reflect.Type) (inInnerWasPointer bool, inInnerType reflect.Type) {
-	inInnerType = in.Elem()
-	inInnerWasPointer = false
-	if inInnerType.Kind() == reflect.Ptr {
-		inInnerWasPointer = true
-		inInnerType = inInnerType.Elem()
-	}
-	return inInnerWasPointer, inInnerType
-}
-
-func getConcreteReflectValueAndType(in interface{}) (reflect.Value, reflect.Type) {
-	value := reflect.ValueOf(in)
-	if value.Kind() == reflect.Ptr {
-		value = value.Elem()
-	}
-	return value, value.Type()
-}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff