forked from pingcap/tidb-binlog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release-3.0' into release-3.1
- Loading branch information
Showing
34 changed files
with
3,226 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package binlogctl | ||
|
||
import ( | ||
"github.com/pingcap/log" | ||
"github.com/pingcap/tidb-binlog/pkg/encrypt" | ||
"go.uber.org/zap" | ||
) | ||
|
||
// EncryptHandler log the encrypted text if success or return error. | ||
func EncryptHandler(text string) error { | ||
enc, err := encrypt.Encrypt(text) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
log.Info("encrypt text", zap.String("encrypted", string(enc))) | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package loopbacksync | ||
|
||
const ( | ||
//MarkTableName mark table name | ||
MarkTableName = "retl._drainer_repl_mark" | ||
//ChannelID channel id | ||
ChannelID = "channel_id" | ||
//Val val | ||
Val = "val" | ||
//ChannelInfo channel info | ||
ChannelInfo = "channel_info" | ||
) | ||
|
||
//LoopBackSync loopback sync info | ||
type LoopBackSync struct { | ||
ChannelID int64 | ||
LoopbackControl bool | ||
SyncDDL bool | ||
} | ||
|
||
//NewLoopBackSyncInfo return LoopBackSyncInfo objec | ||
func NewLoopBackSyncInfo(ChannelID int64, LoopbackControl, SyncDDL bool) *LoopBackSync { | ||
l := &LoopBackSync{ | ||
ChannelID: ChannelID, | ||
LoopbackControl: LoopbackControl, | ||
SyncDDL: SyncDDL, | ||
} | ||
return l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2019 PingCAP, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package loopbacksync | ||
|
||
import "testing" | ||
|
||
//TestNewLoopBackSyncInfo test loopBackSyncInfo alloc | ||
func TestNewLoopBackSyncInfo(t *testing.T) { | ||
var ChannelID int64 = 1 | ||
var LoopbackControl = true | ||
var SyncDDL = false | ||
l := NewLoopBackSyncInfo(ChannelID, LoopbackControl, SyncDDL) | ||
if l == nil { | ||
t.Error("alloc loopBackSyncInfo objec failed ") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.