utils

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

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.

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.

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

View Source
const (
	UpdateOperation        = "UPDATE"
	InsertOperation        = "INSERT"
	DeleteOperation        = "DELETE"
	TruncateOperation      = "TRUNCATE"
	DropOperation          = "DROP"
	DDLOperation           = "DDL"
	TruncateTableOperation = "TRUNCATE TABLE"
	DropTableOperation     = "DROP TABLE"
)

同步操作类型

Variables

View Source
var CurrentResetFlag = 0

用于控制当程序消费追平到当前 CURRENT 重做日志, 当值 == 0 启用 filterOracleRedoGreaterOrEqualRecordByTable 大于或者等于 当值 == 1 启用 filterOracleRedoGreaterOrEqualRecordByTable 大于,避免已被消费得日志一直被重复消费

Functions

func DiffStructArray

func DiffStructArray(structA, structB interface{}) ([]interface{}, []interface{}, bool)

用于对比 struct 是否相等

func FilterDifferenceStringItems

func FilterDifferenceStringItems(originItems, excludeItems []string) []string

过滤排除元素,返回新数组

func FilterIntersectionStringItems

func FilterIntersectionStringItems(originItems, newItems []string) []string

过滤两个数组相同元素(交集),返回新数组

func GetStringSliceElementIndex

func GetStringSliceElementIndex(items []string, item string) int

获取数组元素下标

func IsContainString

func IsContainString(items []string, item string) bool

数组中是否包含某元素

func IsEmptyString

func IsEmptyString(str string) bool

是否空字符串

func IsNum

func IsNum(s string) bool

判断字符是否是数字

func IsSubsetString

func IsSubsetString(originItems, checkItems []string) (bool, []string)

两个数组对比,判断 checkItems 是否是 originItems 子集

func ReSplit

func ReSplit(text string, cut string) []string

忽略大小写切分字符串

func ReplaceQuotesString

func ReplaceQuotesString(s string) string

替换字符串引号字符

func ReplaceSpecifiedString

func ReplaceSpecifiedString(s string, oldStr, newStr string) string

替换指定字符

func SplitIntSlice

func SplitIntSlice(arr []int, num int64) [][]int

数组拆分

func SplitMultipleStringSlice

func SplitMultipleStringSlice(arr []string, num int64) [][]string

多重数组拆分

func StringArrayToCapitalChar

func StringArrayToCapitalChar(strs []string) string

字符数组转字符

func StringsBuilder

func StringsBuilder(str ...string) string

字符串拼接

func TrimLastChar

func TrimLastChar(s string) string

删除字符中最后一个字母

func VersionOrdinal

func VersionOrdinal(version string) string

用于版本号比较

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL