Documentation
¶
Index ¶
- Constants
- Variables
- func GetRegex(pattern string) *regexp.Regexp
- func Init()
- func IsValidNginxModuleArtifact(value string) bool
- func IsValidNginxModuleChecksum(value string) bool
- func IsValidNginxModulePackage(value string) bool
- func RegisterRegex(pattern string)
- func StripAnsiControlSeq(value string) string
Constants ¶
View Source
const ( ModelDownloaderRepoIDPattern = `^[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*$` VMNameValidationPattern = `^[a-zA-Z0-9][a-zA-Z0-9._-]{0,63}$` VMCommonPattern = `^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,63}$` VLLMMetricSamplePattern = `^([a-zA-Z_:][a-zA-Z0-9_:]*)(\{(?:[^"\\]|"(?:\\.|[^"\\])*")*\})?\s+(\S+)(?:\s+.*)?$` VLLMMetricLabelPattern = `([a-zA-Z_][a-zA-Z0-9_]*)\s*=\s*("(?:[^"\\]|\\.)*")` NumberAlphaPattern = `(\d+)([A-Za-z]+)` ComposeDisallowedCharsPattern = `[^a-z0-9_-]+` ComposeNamePattern = `^[a-z0-9][a-z0-9_-]{0,255}$` ComposeEnvVarPattern = `\$\{([^}]+)\}` DiskKeyValuePattern = `([A-Za-z0-9_]+)=("([^"\\]|\\.)*"|[^ \t]+)` ValidatorNamePattern = `^[a-zA-Z\p{Han}]{1}[a-zA-Z0-9_\p{Han}]{0,30}$` ValidatorIPPattern = `^((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}$` DomainPattern = `^([\w\p{Han}\-\*]{1,100}\.){1,10}([\w\p{Han}\-]{1,24}|[\w\p{Han}\-]{1,24}\.[\w\p{Han}\-]{1,24})(:\d{1,5})?$` NginxServerNamePattern = `^(?:\*|[\w\p{Han}-]{1,63})(?:\.(?:\*|[\w\p{Han}-]{1,63}))*$` ProxyCacheZonePattern = `keys_zone=proxy_cache_zone_of_[\w.]+:(\d+)([kmgt]?)` ProxyCacheMaxSizePattern = `max_size=([0-9.]+)([kmgt]?)` ProxyCacheMaxSizeValidationPattern = `max_size=\d+(\.\d+)?[kmgt]?` ProxyCacheInactivePattern = `inactive=(\d+)([smhd])` NumberWordPattern = `^(\d+)(\w+)$` AlertIPPattern = `from\s+([0-9.]+)\s+port\s+(\d+)` CosDualStackPattern = `.*cos-dualstack\..*` VersionPattern = `v(\d+\.\d+\.\d+)` PhpAssignmentPattern = `^\s*([a-z_]+)\s*=\s*(.*)$` DurationWithOptionalUnitPattern = `^(\d+)([smhdw]?)$` MysqlGroupPattern = `\[*\]` AnsiEscapePattern = "\x1b\\[[0-9;?]*[A-Za-z]|\x1b=|\x1b>" AnsiControlSeqPattern = `\x1b\[[0-9;?]*[ -/]*[@-~]` RecycleBinFilePattern = `_1p_file_1p_(.+)_p_(\d+)_(\d+)` OrderByValidationPattern = `^[a-zA-Z_][a-zA-Z0-9_]*$` SQLIdentifierPattern = `^[A-Za-z_][A-Za-z0-9_]*$` NginxHostPattern = `^[a-zA-Z0-9.-]+(:[0-9]+)?$` NginxPathPattern = `^/[a-zA-Z0-9._/\-]*$` SSHSyslogLinePattern = `^([A-Z][a-z]{2}\s+\d{1,2}\s+\d{2}:\d{2}:\d{2})\s+\S+\s+(sshd(?:-session)?)(?:\[(\d+)\])?:\s+(.*)$` SSHRFC3339LinePattern = `^(\d{4}-\d{2}-\d{2}T\S+)\s+\S+\s+(sshd(?:-session)?)(?:\[(\d+)\])?:\s+(.*)$` SSHDateTimeLinePattern = `^(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2})\s+\S+\s+(sshd(?:-session)?)(?:\[(\d+)\])?:\s+(.*)$` SSHAcceptedPattern = `^Accepted (\S+) for (.+?) from ([0-9a-fA-F:.]+) port (\d+)` SSHFailedPattern = `^Failed (\S+) for (?:(invalid user) )?(.+?) from ([0-9a-fA-F:.]+) port (\d+)` SSHInvalidUserPattern = `^Invalid user (.+?) from ([0-9a-fA-F:.]+)(?: port (\d+))?` SSHClosedPattern = `^Connection closed by (?:(?:authenticating|invalid) user (.+?) )?([0-9a-fA-F:.]+) port (\d+)` SSHDisconnectedPattern = `^Disconnected from (?:(?:authenticating|invalid) user (.+?) )?([0-9a-fA-F:.]+) port (\d+)` SSHDisconnectPattern = `^Received disconnect from ([0-9a-fA-F:.]+) port (\d+)` SSHMaxAuthPattern = `^error: maximum authentication attempts exceeded for (?:(?:invalid user) )?(.+?) from ([0-9a-fA-F:.]+) port (\d+)` SSHNotAllowedPattern = `^User (.+?) from ([0-9a-fA-F:.]+) not allowed` SyslogPRIPattern = `^<(\d{1,3})>(?:\d\s+)?` SyslogRFC3164Pattern = `^([A-Z][a-z]{2}\s{1,2}\d{1,2}\s\d{2}:\d{2}:\d{2})\s+(.*)$` SyslogRFC3339Pattern = `^(\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)\s+(.*)$` SyslogServicePattern = `^(?:\S+\s+)?([[:alnum:]_.@/-]+)(?:\[\d+\])?:\s*(.*)$` NginxModulePackagePattern = `^[a-zA-Z0-9][a-zA-Z0-9+.-]*$` NginxModuleArtifactPattern = `^[a-zA-Z0-9_./+-]+\.so$` NginxModuleChecksumPattern = `^[a-fA-F0-9]{64}$` AcceleratorMetricValuePattern = `^\s*([+-]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+))\s*(.*?)\s*$` AscendVersionPattern = `(?i)\bVersion:\s*([^\s|]+)` AscendMemoryPattern = `([0-9]+(?:\.[0-9]+)?)\s*/\s*([0-9]+(?:\.[0-9]+)?)` NvidiaGPUUUIDPattern = `^GPU-[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$` NvidiaGPUDeviceIDPattern = `^([0-9]+|GPU-[a-zA-Z0-9-]+|MIG-[a-zA-Z0-9/-]+)$` IntelGPURenderNamePattern = `^renderD[0-9]+$` IntelGPUDevicePathPattern = `^/dev/dri/renderD[0-9]+$` AscendGPUDeviceNamePattern = `^davinci[0-9]+$` AscendGPUDevicePathPattern = `^/dev/davinci[0-9]+$` AscendGPUDeviceIDPattern = `^[0-9]+$` )
Variables ¶
View Source
var ( UFWNumberedRulePrefixRegex = regexp.MustCompile(`^\s*\[\s*([0-9]+)\]\s+(.+?)\s*$`) UFWNumberedRuleRegex = regexp.MustCompile(`^\s*\[\s*([0-9]+)\]\s+(.+?)\s+(ALLOW|DENY|REJECT|LIMIT)(?:\s+(IN|OUT|FWD))?\s+(.+?)\s*$`) ForwardInterfaceRegex = regexp.MustCompile(`^[A-Za-z0-9_.:@-]{1,15}$`) )
Functions ¶
func RegisterRegex ¶
func RegisterRegex(pattern string)
func StripAnsiControlSeq ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.