Skip to content

Commit 16cd7d0

Browse files
authored
Merge pull request #2 from instructure/rename-import-paths
Rename import paths for new instructure org home
2 parents 8804177 + 071d238 commit 16cd7d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+146
-146
lines changed

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
A pure go library to handle MySQL network protocol and replication.
44

5-
![semver](https://img.shields.io/github/v/tag/go-mysql-org/go-mysql)
6-
![example workflow](https://github.com/go-mysql-org/go-mysql/actions/workflows/ci.yml/badge.svg)
7-
![gomod version](https://img.shields.io/github/go-mod/go-version/go-mysql-org/go-mysql/master)
5+
![semver](https://img.shields.io/github/v/tag/instructure/mc-go-mysql)
6+
![example workflow](https://github.com/instructure/mc-go-mysql/actions/workflows/ci.yml/badge.svg)
7+
![gomod version](https://img.shields.io/github/go-mod/go-version/instructure/mc-go-mysql/master)
88

99
## How to migrate to this repo
1010
To change the used package in your repo it's enough to add this `replace` directive to your `go.mod`:
1111
```
12-
replace github.com/siddontang/go-mysql => github.com/go-mysql-org/go-mysql v1.7.0
12+
replace github.com/siddontang/go-mysql => github.com/instructure/mc-go-mysql v1.7.0
1313
```
1414

1515
v1.7.0 - is the last tag in repo, feel free to choose what you want.
@@ -36,10 +36,10 @@ You can use it as a MySQL replica to sync binlog from master then do something,
3636

3737
```go
3838
import (
39-
"github.com/go-mysql-org/go-mysql/replication"
39+
"github.com/instructure/mc-go-mysql/replication"
4040
"os"
4141
)
42-
// Create a binlog syncer with a unique server id, the server id must be different from other MySQL's.
42+
// Create a binlog syncer with a unique server id, the server id must be different from other MySQL's.
4343
// flavor is mysql or mariadb
4444
cfg := replication.BinlogSyncerConfig {
4545
ServerID: 100,
@@ -109,21 +109,21 @@ Schema: test
109109
Query: DROP TABLE IF EXISTS `test_replication` /* generated by server */
110110
```
111111

112-
## Canal
112+
## Canal
113113

114-
Canal is a package that can sync your MySQL into everywhere, like Redis, Elasticsearch.
114+
Canal is a package that can sync your MySQL into everywhere, like Redis, Elasticsearch.
115115

116-
First, canal will dump your MySQL data then sync changed data using binlog incrementally.
116+
First, canal will dump your MySQL data then sync changed data using binlog incrementally.
117117

118-
You must use ROW format for binlog, full binlog row image is preferred, because we may meet some errors when primary key changed in update for minimal or noblob row image.
118+
You must use ROW format for binlog, full binlog row image is preferred, because we may meet some errors when primary key changed in update for minimal or noblob row image.
119119

120120
A simple example:
121121

122122
```go
123123
package main
124124

125125
import (
126-
"github.com/go-mysql-org/go-mysql/canal"
126+
"github.com/instructure/mc-go-mysql/canal"
127127
"github.com/siddontang/go-log/log"
128128
)
129129

@@ -161,17 +161,17 @@ func main() {
161161
}
162162
```
163163

164-
You can see [go-mysql-elasticsearch](https://github.com/siddontang/go-mysql-elasticsearch) for how to sync MySQL data into Elasticsearch.
164+
You can see [go-mysql-elasticsearch](https://github.com/siddontang/go-mysql-elasticsearch) for how to sync MySQL data into Elasticsearch.
165165

166166
## Client
167167

168-
Client package supports a simple MySQL connection driver which you can use it to communicate with MySQL server.
168+
Client package supports a simple MySQL connection driver which you can use it to communicate with MySQL server.
169169

170170
### Example
171171

172172
```go
173173
import (
174-
"github.com/go-mysql-org/go-mysql/client"
174+
"github.com/instructure/mc-go-mysql/client"
175175
)
176176

177177
// Connect MySQL at 127.0.0.1:3306, with user root, an empty password and database test
@@ -212,7 +212,7 @@ for _, row := range r.Values {
212212
if val.Type == mysql.FieldValueTypeFloat {
213213
_ = val.AsFloat64() // float64
214214
}
215-
}
215+
}
216216
}
217217
```
218218

@@ -247,7 +247,7 @@ err := conn.ExecuteSelectStreaming(`select id, name from table LIMIT 100500`, &r
247247

248248
```go
249249
import (
250-
"github.com/go-mysql-org/go-mysql/client"
250+
"github.com/instructure/mc-go-mysql/client"
251251
)
252252

253253
pool := client.NewPool(log.Debugf, 100, 400, 5, "127.0.0.1:3306", `root`, ``, `test`)
@@ -260,7 +260,7 @@ conn.Execute() / conn.Begin() / etc...
260260

261261
## Server
262262

263-
Server package supplies a framework to implement a simple MySQL server which can handle the packets from the MySQL client.
263+
Server package supplies a framework to implement a simple MySQL server which can handle the packets from the MySQL client.
264264
You can use it to build your own MySQL proxy. The server connection is compatible with MySQL 5.5, 5.6, 5.7, and 8.0 versions,
265265
so that most MySQL clients should be able to connect to the Server without modifications.
266266

@@ -275,7 +275,7 @@ import (
275275
"log"
276276
"net"
277277

278-
"github.com/go-mysql-org/go-mysql/server"
278+
"github.com/instructure/mc-go-mysql/server"
279279
)
280280

281281
func main() {
@@ -334,10 +334,10 @@ Failover supports to promote a new master and let replicas replicate from it aut
334334

335335
Failover supports MySQL >= 5.6.9 with GTID mode, if you use lower version, e.g, MySQL 5.0 - 5.5, please use [MHA](http://code.google.com/p/mysql-master-ha/) or [orchestrator](https://github.com/outbrain/orchestrator).
336336

337-
At the same time, Failover supports MariaDB >= 10.0.9 with GTID mode too.
337+
At the same time, Failover supports MariaDB >= 10.0.9 with GTID mode too.
338338

339339
Why only GTID? Supporting failover with no GTID mode is very hard, because replicas can not find the proper binlog filename and position with the new master.
340-
Although there are many companies use MySQL 5.0 - 5.5, I think upgrade MySQL to 5.6 or higher is easy.
340+
Although there are many companies use MySQL 5.0 - 5.5, I think upgrade MySQL to 5.6 or higher is easy.
341341

342342
## Driver
343343

@@ -349,7 +349,7 @@ package main
349349
import (
350350
"database/sql"
351351

352-
_ "github.com/go-mysql-org/go-mysql/driver"
352+
_ "github.com/instructure/mc-go-mysql/driver"
353353
)
354354

355355
func main() {
@@ -364,15 +364,15 @@ We pass all tests in https://github.com/bradfitz/go-sql-test using go-mysql driv
364364

365365
## Donate
366366

367-
If you like the project and want to buy me a cola, you can through:
367+
If you like the project and want to buy me a cola, you can through:
368368

369369
|PayPal|微信|
370370
|------|---|
371371
|[![](https://www.paypalobjects.com/webstatic/paypalme/images/pp_logo_small.png)](https://paypal.me/siddontang)|[![](https://github.com/siddontang/blog/blob/master/donate/weixin.png)|
372372

373373
## Feedback
374374

375-
go-mysql is still in development, your feedback is very welcome.
375+
go-mysql is still in development, your feedback is very welcome.
376376

377377

378378
Gmail: siddontang@gmail.com

canal/canal.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ import (
1313
"sync/atomic"
1414
"time"
1515

16-
"github.com/go-mysql-org/go-mysql/client"
17-
"github.com/go-mysql-org/go-mysql/dump"
18-
"github.com/go-mysql-org/go-mysql/mysql"
19-
"github.com/go-mysql-org/go-mysql/replication"
20-
"github.com/go-mysql-org/go-mysql/schema"
16+
"github.com/instructure/mc-go-mysql/client"
17+
"github.com/instructure/mc-go-mysql/dump"
18+
"github.com/instructure/mc-go-mysql/mysql"
19+
"github.com/instructure/mc-go-mysql/replication"
20+
"github.com/instructure/mc-go-mysql/schema"
2121
"github.com/pingcap/errors"
2222
"github.com/pingcap/tidb/parser"
2323
"github.com/siddontang/go-log/log"

canal/canal_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"github.com/pingcap/tidb/parser"
1111
"github.com/siddontang/go-log/log"
1212

13-
"github.com/go-mysql-org/go-mysql/mysql"
14-
"github.com/go-mysql-org/go-mysql/replication"
15-
"github.com/go-mysql-org/go-mysql/test_util"
13+
"github.com/instructure/mc-go-mysql/mysql"
14+
"github.com/instructure/mc-go-mysql/replication"
15+
"github.com/instructure/mc-go-mysql/test_util"
1616
)
1717

1818
func Test(t *testing.T) {

canal/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"time"
99

1010
"github.com/BurntSushi/toml"
11-
"github.com/go-mysql-org/go-mysql/client"
12-
"github.com/go-mysql-org/go-mysql/mysql"
11+
"github.com/instructure/mc-go-mysql/client"
12+
"github.com/instructure/mc-go-mysql/mysql"
1313
"github.com/pingcap/errors"
1414
"github.com/siddontang/go-log/log"
1515
"github.com/siddontang/go-log/loggers"

canal/dump.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"strings"
88
"time"
99

10-
"github.com/go-mysql-org/go-mysql/mysql"
11-
"github.com/go-mysql-org/go-mysql/schema"
10+
"github.com/instructure/mc-go-mysql/mysql"
11+
"github.com/instructure/mc-go-mysql/schema"
1212
"github.com/pingcap/errors"
1313
"github.com/shopspring/decimal"
1414
)

canal/handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package canal
22

33
import (
4-
"github.com/go-mysql-org/go-mysql/mysql"
5-
"github.com/go-mysql-org/go-mysql/replication"
4+
"github.com/instructure/mc-go-mysql/mysql"
5+
"github.com/instructure/mc-go-mysql/replication"
66
)
77

88
type EventHandler interface {

canal/master.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package canal
33
import (
44
"sync"
55

6-
"github.com/go-mysql-org/go-mysql/mysql"
6+
"github.com/instructure/mc-go-mysql/mysql"
77
"github.com/siddontang/go-log/loggers"
88
)
99

canal/rows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package canal
33
import (
44
"fmt"
55

6-
"github.com/go-mysql-org/go-mysql/replication"
7-
"github.com/go-mysql-org/go-mysql/schema"
6+
"github.com/instructure/mc-go-mysql/replication"
7+
"github.com/instructure/mc-go-mysql/schema"
88
)
99

1010
// The action name for sync.

canal/sync.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import (
55
"sync/atomic"
66
"time"
77

8-
"github.com/go-mysql-org/go-mysql/mysql"
9-
"github.com/go-mysql-org/go-mysql/replication"
10-
"github.com/go-mysql-org/go-mysql/schema"
118
"github.com/google/uuid"
9+
"github.com/instructure/mc-go-mysql/mysql"
10+
"github.com/instructure/mc-go-mysql/replication"
11+
"github.com/instructure/mc-go-mysql/schema"
1212
"github.com/pingcap/errors"
1313
"github.com/pingcap/tidb/parser/ast"
1414
)

client/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"encoding/binary"
77
"fmt"
88

9-
. "github.com/go-mysql-org/go-mysql/mysql"
10-
"github.com/go-mysql-org/go-mysql/packet"
9+
. "github.com/instructure/mc-go-mysql/mysql"
10+
"github.com/instructure/mc-go-mysql/packet"
1111
"github.com/pingcap/errors"
1212
)
1313

0 commit comments

Comments
 (0)