Documentation
¶
Overview ¶
Copyright © 2024 Alessandro Riva
Licensed under the MIT License. See the LICENSE file for details.
Copyright © 2024 Alessandro Riva ¶
Licensed under the MIT License. See the LICENSE file for details.
Copyright © 2024 Alessandro Riva ¶
Licensed under the MIT License. See the LICENSE file for details.
Index ¶
- Variables
- func GetPromptedInput(prompt string) string
- func HumanReadableDate(dateString string) (string, error)
- func IsValidDomain(domain string) bool
- func PrintEntry(entryName string, entryValue interface{})
- func PrintError(format string, a ...interface{})
- func PrintHeader(format string, a ...interface{})
- func PrintSuccess(format string, a ...interface{})
- func PrintWarning(format string, a ...interface{})
- func PrintYesNo(val bool) string
- func RemoveDuplicates(items []string) []string
- func ShortStr(s string, maxLength int) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IPRegex = regexp.MustCompile(`\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b`) RFC1918Regex = regexp.MustCompile(`^(10\.\d{1,3}\.\d{1,3}\.\d{1,3}|172\.(1[6-9]|2[0-9]|3[0-1])\.\d{1,3}\.\d{1,3}|192\.168\.\d{1,3}\.\d{1,3})$`) URLRegex = regexp.MustCompile(`https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&\/\/=]*)`) EmailRegex = regexp.MustCompile(`[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}`) DomainRegex = regexp.MustCompile(`(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+(?:[a-zA-Z]{2,})|localhost)`) SHA256Regex = regexp.MustCompile(`\b[a-fA-F0-9]{64}\b`) )
Functions ¶
func GetPromptedInput ¶
getPromptedInput prompts the user for input if the standard input is not a pipe
func HumanReadableDate ¶
func IsValidDomain ¶
func PrintEntry ¶
func PrintEntry(entryName string, entryValue interface{})
func PrintError ¶
func PrintError(format string, a ...interface{})
func PrintHeader ¶
func PrintHeader(format string, a ...interface{})
func PrintSuccess ¶
func PrintSuccess(format string, a ...interface{})
func PrintWarning ¶
func PrintWarning(format string, a ...interface{})
func PrintYesNo ¶
func RemoveDuplicates ¶
Remove duplicates from a slice
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.