Documentation ¶
Overview ¶
Author:
Carlos Timoshenko carlostimoshenkorodrigueslopes@gmail.com https://github.com/softctrl
This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Author:
Carlos Timoshenko carlostimoshenkorodrigueslopes@gmail.com https://github.com/softctrl
This project is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
Index ¶
- Constants
- Variables
- func CalculateSCSW(__word1, __word2 string) float64
- func Contains(_slice []string, _value string) bool
- func Dim(x, y int) int
- func IntToIp(__ip int64) string
- func IpToInt(__ip string) int64
- func IsEmpty(__value string) bool
- func IsInteger(__value string) bool
- func IsIpAddress(__ip string) bool
- func Join(__values []string, sep string) string
- func JoinQuoted(__values []string, sep string) string
- func Json_Unmarshal_Array(data []byte) ([]map[string]*json.RawMessage, error)
- func Json_Unmarshal_Object(data []byte) (map[string]*json.RawMessage, error)
- func Max(_x, _y int) int
- func Min(_x, _y int) int
- func Quoted(__value []byte) []byte
- func QuotedString(__value string) string
- func RemoveAccents(__value []byte) []byte
- func RemoveAccentsString(__value string) string
- func RemoveDuplicatedSpaces(__value string) string
- func RemoveNonWords(__value string) string
Constants ¶
const ( JOINED_VALUES_FMT = "%s" JOINED_QUOTED_VALUES_FMT = "[%s]" EMPTY_ARRAY = "[]" QUOTE = '"' COMMA = ',' )
Variables ¶
var DUPLICATED_SPACES_PATTERN = rgx.MustCompile("\\s+")
This pattern will matches duplicated spaces occurencies.
var INTEGER_PATTERN = rgx.MustCompile("^\\d+$")
This pattern will only matche a valid integer value.
var IP_ADDRESS_PATTERN = rgx.MustCompile("^(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(\\.(25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}$")
This pattern will matches only valis IPV6 Address. Based on: https://stackoverflow.com/questions/15875013/extract-ip-addresses-from-strings-using-regex
var NON_WORDS_PATTERN = rgx.MustCompile("[^a-zA-Z0-9-. \"]+")
It will mathces only symbols there is not from a to Z, 0 to 9, ., space and (").
Functions ¶
func CalculateSCSW ¶
Calculate the similarity of two words, under the SC Algorithm :D
func IntToIp ¶
IntToIp parses an Ip address on in format to his valid string representation. Based on: https://github.com/softctrl/sc-utils-java/blob/master/sc-utils-java/src/main/java/br/com/softctrl/utils/IpUtils.java
func IpToInt ¶
Based on: http://www.0x09.com.br/2013/10/numerical-representation-of-ipv4-address.html
func IsIpAddress ¶
func JoinQuoted ¶
func Json_Unmarshal_Array ¶
func Json_Unmarshal_Array(data []byte) ([]map[string]*json.RawMessage, error)
Json_Unmarshal_Array utilitary method.
func Json_Unmarshal_Object ¶
func Json_Unmarshal_Object(data []byte) (map[string]*json.RawMessage, error)
Json_Unmarshal_Object utilitary method.
func QuotedString ¶
func RemoveAccents ¶
Remove all accents from an informed byte array Based on: https://gist.github.com/tkrajina/d423e9b9fc2e72d63072
func RemoveAccentsString ¶
Remove all accents from an informed string
func RemoveDuplicatedSpaces ¶
Remove all duplicated spaces from an informed string
func RemoveNonWords ¶
Types ¶
This section is empty.