Skip to content

Commit

Permalink
定制驱动暴露原始net.Conn
Browse files Browse the repository at this point in the history
  • Loading branch information
saber-x committed Oct 25, 2024
1 parent d375410 commit ea16680
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 2 deletions.
4 changes: 3 additions & 1 deletion connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"os"
"strconv"
"strings"
"sync/atomic"
)

var (
Expand All @@ -25,7 +26,8 @@ var (
type connector struct {
cfg *Config // immutable private copy.
encodedAttributes string // Encoded connection attributes.
connected atomicBool
// 见官方pr #1558 drop support of Go 1.19; replace atomicBool by atomic.Bool
connected atomic.Bool
}

func encodeConnectionAttributes(cfg *Config) string {
Expand Down
47 changes: 46 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,49 @@ module github.com/senhe-tech/go-mysql-driver

go 1.18

require filippo.io/edwards25519 v1.1.0
require (
filippo.io/edwards25519 v1.1.0
github.com/senhe-tech/go-utils v0.0.0-20240704110542-b79299d49bc4
)

require (
github.com/bytedance/sonic v1.11.9 // indirect
github.com/bytedance/sonic/loader v0.1.1 // indirect
github.com/cloudwego/base64x v0.1.4 // indirect
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/gin-gonic/gin v1.10.0 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.22.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/godbus/dbus/v5 v5.1.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/net v0.26.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
senhe.io/go-json v0.0.0-00010101000000-000000000000 // indirect
)

replace senhe.io/go-json => github.com/senhe-tech/go-json v1.20.0-p2
7 changes: 7 additions & 0 deletions hack.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mysql

import "net"

func (mc *mysqlConn) Conn() net.Conn {
return mc.netConn
}

0 comments on commit ea16680

Please sign in to comment.