Documentation ¶
Index ¶
- Constants
- func CheckPathContainsIPPort(path string) bool
- func FloatToString(val float64) string
- func FmtFloatFromInterface(val interface{}) float64
- func FmtIntFromInterface(val interface{}) int64
- func FmtStringFromInterface(val interface{}) string
- func GetFilterAppKey(s string) string
- func GetVariableKey(s string) string
- func IsMatchCIDRIpv4(s string) bool
- func IsMatchDomainPort(s string) bool
- func IsMatchFilterAppKey(s string) bool
- func IsMatchIpPort(s string) bool
- func IsMatchSchemeIpPort(s string) bool
- func IsMatchString(regexpPattern RegexpPattern, s string) error
- func IsMatchVariable(s string) bool
- func IsRestfulParam(param string) bool
- func IsRestfulPath(path string) bool
- func ReplaceRestfulPath(path, replaceStr string) string
- func SetFilterAppKey(key string) string
- type RegexpPattern
Constants ¶
View Source
const ( // EnglishOrNumber_ 英文开头,数字字母下划线组合 EnglishOrNumber_ RegexpPattern = `^[a-zA-Z][a-zA-Z0-9_]*$` // AnyEnglishOrNumber_ 数字字母下划线任意组合 AnyEnglishOrNumber_ = `^[a-zA-Z0-9_]+$` // UUIDExp UUID正则 数字字母横杠下划线任意组合 UUIDExp = `^[a-zA-Z0-9-_]+$` // DomainPortExp 域名或者域名:端口 DomainPortExp = `^[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.?[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?(:[0-9]+)?$` // IPPortExp IP:PORT IPPortExp = `^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}:[0-9]+$` // SchemeIPPortExp scheme://IP:PORT SchemeIPPortExp = `^[a-zA-z]+://((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}:[0-9]+$` // CIDRIpv4Exp IPV4或者IPV4的CIDR CIDRIpv4Exp = `` /* 138-byte string literal not displayed */ // CheckPathIPPortExp (scheme://)?ip:port CheckPathIPPortExp = `([a-zA-z]+://)?((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}:[0-9]+` )
Variables ¶
This section is empty.
Functions ¶
func CheckPathContainsIPPort ¶
CheckPathContainsIPPort 检查路径中是否包含xxx://ip:port
func FloatToString ¶
func FmtFloatFromInterface ¶
func FmtFloatFromInterface(val interface{}) float64
func FmtIntFromInterface ¶
func FmtIntFromInterface(val interface{}) int64
func FmtStringFromInterface ¶
func FmtStringFromInterface(val interface{}) string
func GetFilterAppKey ¶
GetFilterAppKey 从标准格式appkey{abc}中取得key abc
func IsMatchDomainPort ¶
IsMatchDomainPort 判断字符串是否符合域名或者域名:port
func IsMatchFilterAppKey ¶
IsMatchFilterAppKey 判断字符串是否匹配策略筛选条件key(应用)标准格式appkey{abc}
func IsMatchSchemeIpPort ¶
IsMatchSchemeIpPort 判断字符串是否符合scheme://ip:port
func IsMatchString ¶
func IsMatchString(regexpPattern RegexpPattern, s string) error
func ReplaceRestfulPath ¶
ReplaceRestfulPath 将restful路径转换成apinto的正则匹配路径
func SetFilterAppKey ¶
Types ¶
type RegexpPattern ¶
type RegexpPattern string
Click to show internal directories.
Click to hide internal directories.