Documentation
¶
Overview ¶
Copyright © 2020 Marvin
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, 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.
Copyright © 2020 Marvin ¶
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, 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.
Copyright © 2020 Marvin ¶
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, 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.
Index ¶
- Constants
- Variables
- func DiffStructArray(structA, structB interface{}) ([]interface{}, []interface{}, bool)
- func FilterDifferenceStringItems(originItems, excludeItems []string) []string
- func FilterIntersectionStringItems(originItems, newItems []string) []string
- func GetOutBoundIP(pprofPort string) (string, error)
- func GetStringSliceElementIndex(items []string, item string) int
- func IsContainString(items []string, item string) bool
- func IsEmptyString(str string) bool
- func IsNum(s string) bool
- func IsSubsetString(originItems, checkItems []string) (bool, []string)
- func ReSplit(text string, cut string) []string
- func ReplaceQuotesString(s string) string
- func ReplaceSpecifiedString(s string, oldStr, newStr string) string
- func SplitIntSlice(arr []int, num int64) [][]int
- func SplitMultipleSlice(arr []interface{}, num int64) [][]interface{}
- func StrconvFloatBitSize(s string, bitSize int) (float64, error)
- func StrconvIntBitSize(s string, bitSize int) (int64, error)
- func StrconvRune(s string) (int32, error)
- func StrconvUintBitSize(s string, bitSize int) (uint64, error)
- func StringArrayToCapitalChar(strs []string) string
- func StringsBuilder(str ...string) string
- func TrimLastChar(s string) string
- func VersionOrdinal(version string) string
Constants ¶
const ( UpdateOperation = "UPDATE" InsertOperation = "INSERT" DeleteOperation = "DELETE" TruncateOperation = "TRUNCATE" DropOperation = "DROP" DDLOperation = "DDL" TruncateTableOperation = "TRUNCATE TABLE" DropTableOperation = "DROP TABLE" )
同步操作类型
const ( OracleGBKCharacterSet = "GBK" OracleUTF8CharacterSet = "UTF8" // oracle collation 默认大小写敏感,a != A OracleCollationBin = "BIN" // MySQL 支持 check 约束版本 > 8.0.15 MySQLCheckConsVersion = "8.0.15" // MySQL 版本分隔符号 MySQLVersionDelimiter = "-" // MySQL 字符集/排序规则 MySQLCharacterSet = "utf8mb4" MySQLCollation = "utf8mb4_bin" // JSON 格式化某字段 ColumnsJSON = "column" IndexJSON = "index" PUConstraintJSON = "puk" FKConstraintJSON = "fk" CKConstraintJSON = "ck" PartitionJSON = "partition" // 默认值规则 DefaultValueSysdate = "SYSDATE" DefaultValueSysdateMap = "NOW()" )
Variables ¶
var CurrentResetFlag = 0
用于控制当程序消费追平到当前 CURRENT 重做日志, 当值 == 0 启用 filterOracleRedoGreaterOrEqualRecordByTable 大于或者等于 当值 == 1 启用 filterOracleRedoGreaterOrEqualRecordByTable 大于,避免已被消费得日志一直被重复消费
Functions ¶
func DiffStructArray ¶
func DiffStructArray(structA, structB interface{}) ([]interface{}, []interface{}, bool)
用于对比 struct 是否相等
func FilterDifferenceStringItems ¶
过滤排除元素,返回新数组
func FilterIntersectionStringItems ¶
过滤两个数组相同元素(交集),返回新数组
func GetStringSliceElementIndex ¶
获取数组元素下标
func IsSubsetString ¶
两个数组对比,判断 checkItems 是否是 originItems 子集
func ReplaceSpecifiedString ¶
替换指定字符
func SplitMultipleSlice ¶ added in v1.0.4
func SplitMultipleSlice(arr []interface{}, num int64) [][]interface{}
多重数组拆分
func StrconvFloatBitSize ¶ added in v1.0.4
func StrconvIntBitSize ¶ added in v1.0.4
字符转换
func StrconvRune ¶ added in v1.0.4
func StrconvUintBitSize ¶ added in v1.0.4
Types ¶
This section is empty.