-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add Undo config #410
Merged
Merged
add Undo config #410
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
10fba9a
doc: v1.0.2-RC1 release file (#338)
raspberry-hu 2983fad
doc: v1.0.2-RC1 release file (#338)
jasondeng1997 29591b3
Merge remote-tracking branch 'origin/master'
jasondeng1997 6e0ac7a
Merge remote-tracking branch 'origin/master'
jasondeng1997 e93ce2f
Merge remote-tracking branch 'origin/master'
jasondeng1997 a2ffd6a
Merge remote-tracking branch 'origin/master'
jasondeng1997 c990bbd
Merge remote-tracking branch 'origin/master'
jasondeng1997 e3380e5
Merge remote-tracking branch 'origin/master'
jasondeng1997 9d7e7d0
Merge remote-tracking branch 'origin/master'
jasondeng1997 6e0c1ad
Merge remote-tracking branch 'origin/master'
jasondeng1997 0bff304
Merge remote-tracking branch 'origin/master'
jasondeng1997 d1376f6
Merge remote-tracking branch 'origin/master'
jasondeng1997 f85166b
Merge remote-tracking branch 'origin/master'
jasondeng1997 1f19eed
Merge remote-tracking branch 'origin/master'
jasondeng1997 81f6d39
Merge remote-tracking branch 'origin/master'
jasondeng1997 bd4eebe
Merge remote-tracking branch 'origin/master'
jasondeng1997 9f2a4f9
Merge remote-tracking branch 'origin/master'
jasondeng1997 f2005e6
Merge branch 'seata:master' into master
jasondeng1997 98e4ffc
Merge branch 'seata:master' into master
jasondeng1997 4604d46
Merge branch 'seata:master' into master
jasondeng1997 be73193
Merge branch 'seata:master' into master
jasondeng1997 4580f3f
Merge remote-tracking branch 'origin/master'
jasondeng1997 c2e8fed
Merge remote-tracking branch 'origin/master'
jasondeng1997 dddefdb
Merge remote-tracking branch 'origin/master'
jasondeng1997 1b18b1b
Merge remote-tracking branch 'origin/master'
jasondeng1997 21f8a6e
Merge remote-tracking branch 'origin/master'
jasondeng1997 938f560
Merge remote-tracking branch 'origin/master'
jasondeng1997 f50bfa0
Merge remote-tracking branch 'origin/master'
jasondeng1997 9a76349
feat:提交说明
jasondeng1997 3f7dacb
feat:提交说明
jasondeng1997 bf8e154
Merge remote-tracking branch 'origin/undo' into undo
jasondeng1997 beb89bf
Merge remote-tracking branch 'origin/undo' into undo
jasondeng1997 f35bc90
Merge remote-tracking branch 'origin/undo' into undo
jasondeng1997 6c962c3
Merge remote-tracking branch 'origin/undo' into undo
jasondeng1997 a9e7bff
Merge remote-tracking branch 'origin/undo' into undo
jasondeng1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You 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, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package undo | ||
|
||
import ( | ||
"flag" | ||
) | ||
|
||
type CompressConfig struct { | ||
Enable bool `yaml:"enable" json:"enable,omitempty" ` | ||
Type string `yaml:"type" json:"type,omitempty" ` | ||
Threshold int `yaml:"threshold" json:"threshold,omitempty" ` | ||
} | ||
|
||
type UndoConfig struct { | ||
DataValidation bool `yaml:"data-validation" json:"data-validation,omitempty" ` | ||
LogSerialization string `yaml:"log-serialization" json:"log-serialization,omitempty" ` | ||
LogTable string `yaml:"log-table" json:"log-table,omitempty" ` | ||
OnlyCareUpdateColumns bool `yaml:"only-care-update-columns" json:"only-care-update-columns,omitempty" ` | ||
Compress CompressConfig `yaml:"compress" json:"compress,omitempty" ` | ||
} | ||
|
||
func (ufg *UndoConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { | ||
f.BoolVar(&ufg.DataValidation, prefix+".data-validation", true, "Judge whether the before image and after image are the same,If it is the same, undo will not be recorded") | ||
f.StringVar(&ufg.LogSerialization, prefix+".log-serialization", "jackson", "Serialization method.") | ||
f.StringVar(&ufg.LogTable, prefix+".log-table", "undo_log", "undo log table name.") | ||
f.BoolVar(&ufg.OnlyCareUpdateColumns, prefix+".only-care-update-columns", true, "The switch for degrade check.") | ||
|
||
} | ||
|
||
// RegisterFlagsWithPrefix for Compress. | ||
func (cfg *CompressConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { | ||
f.BoolVar(&cfg.Enable, prefix+".log-table-name", true, "Whether compression is required.") | ||
f.StringVar(&cfg.Type, prefix+".clean-period", "zip", "Compression type") | ||
f.IntVar(&cfg.Threshold, prefix+".clean-period", 64, "Compression threshold Unit: k") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 在client.Config加上,还有单测 |
||
} |
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,54 @@ | ||
package undo | ||
|
||
import ( | ||
"flag" | ||
"testing" | ||
) | ||
|
||
func TestCompressConfig_RegisterFlagsWithPrefix(t *testing.T) { | ||
type fields struct { | ||
Enable bool | ||
Type string | ||
Threshold int | ||
} | ||
type args struct { | ||
prefix string | ||
f *flag.FlagSet | ||
} | ||
tests := []struct { | ||
name string | ||
fields fields | ||
args args | ||
}{ | ||
// TODO: Add test cases. | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
}) | ||
} | ||
} | ||
|
||
func TestUndoConfig_RegisterFlagsWithPrefix(t *testing.T) { | ||
type fields struct { | ||
DataValidation bool | ||
LogSerialization string | ||
LogTable string | ||
OnlyCareUpdateColumns bool | ||
Compress CompressConfig | ||
} | ||
type args struct { | ||
prefix string | ||
f *flag.FlagSet | ||
} | ||
tests := []struct { | ||
name string | ||
fields fields | ||
args args | ||
}{ | ||
// TODO: Add test cases. | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
}) | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里要调用下 Compress.RegisterFlagsWithPrefix