aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/go-xorm/xorm/mysql_driver.go
diff options
context:
space:
mode:
authorpeter zhang <admin@ddatsh.com>2017-04-27 07:47:16 +0800
committer无闻 <u@gogs.io>2017-04-26 19:47:16 -0400
commit10ee2e0dad6471e8912cc833faf33db7eaa55fa8 (patch)
treeb1d2f03768781a31d7a68d2c5a9a7140e170f261 /vendor/github.com/go-xorm/xorm/mysql_driver.go
parent6500aafcb867e37379b1f238198e95134b09ac4e (diff)
vendor: update xorm version for fix git clone error build with golang 1.8.1 (#4460)
Diffstat (limited to 'vendor/github.com/go-xorm/xorm/mysql_driver.go')
-rw-r--r--vendor/github.com/go-xorm/xorm/mysql_driver.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/github.com/go-xorm/xorm/mysql_driver.go b/vendor/github.com/go-xorm/xorm/mysql_driver.go
deleted file mode 100644
index 6ceeed58..00000000
--- a/vendor/github.com/go-xorm/xorm/mysql_driver.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 The Xorm Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package xorm
-
-import (
- "regexp"
- "strings"
-
- "github.com/go-xorm/core"
-)
-
-type mysqlDriver struct {
-}
-
-func (p *mysqlDriver) Parse(driverName, dataSourceName string) (*core.Uri, error) {
- dsnPattern := regexp.MustCompile(
- `^(?:(?P<user>.*?)(?::(?P<passwd>.*))?@)?` + // [user[:password]@]
- `(?:(?P<net>[^\(]*)(?:\((?P<addr>[^\)]*)\))?)?` + // [net[(addr)]]
- `\/(?P<dbname>.*?)` + // /dbname
- `(?:\?(?P<params>[^\?]*))?$`) // [?param1=value1&paramN=valueN]
- matches := dsnPattern.FindStringSubmatch(dataSourceName)
- //tlsConfigRegister := make(map[string]*tls.Config)
- names := dsnPattern.SubexpNames()
-
- uri := &core.Uri{DbType: core.MYSQL}
-
- for i, match := range matches {
- switch names[i] {
- case "dbname":
- uri.DbName = match
- case "params":
- if len(match) > 0 {
- kvs := strings.Split(match, "&")
- for _, kv := range kvs {
- splits := strings.Split(kv, "=")
- if len(splits) == 2 {
- switch splits[0] {
- case "charset":
- uri.Charset = splits[1]
- }
- }
- }
- }
-
- }
- }
- return uri, nil
-}