Documentation ¶
Overview ¶
Copyright 2021 SANGFOR TECHNOLOGIES
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 ¶
- func CheckIP(ip string) error
- func CheckPort(port string) (err error)
- func CheckVersion(version string) error
- func GetClusterHint(params map[string]string) string
- func GetHint(params map[string]string) string
- func HasString(elem string, arr []string) bool
- func IntCompare(v1 string, v2 string) (bool, bool, error)
- func IsGTEVersion(v1 string, v2 string) (error, bool)
- func IsNil(i interface{}) bool
- func Random(length int) string
- func RandomExpirationSecond(expiration int) time.Duration
- func RandomHash() string
- func RandomHash32() string
- func RandomPort(start int, end int) int
- func RegexpMatchPattern(s string, regexpPatterns []string) bool
- func SemicolonTerminated(statement string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckVersion ¶
CheckVersion check if version is with format x.y.z
func GetClusterHint ¶
func IntCompare ¶
IntCompare check if v1 is higher than v2
func IsGTEVersion ¶
IsGTEVersion check if version v1 is gte v2
func RandomExpirationSecond ¶
RandomExpirationSecond random expiration
func RandomPort ¶
RandomPort get random between start and end,[start,end)
func RegexpMatchPattern ¶
RegexpMatchPattern returns true if s matches any of the provided regexpPatterns
func SemicolonTerminated ¶
SemicolonTerminated is a utility function that makes sure a statement is terminated with a semicolon, if it isn't already
Types ¶
This section is empty.