Documentation
ΒΆ
Index ΒΆ
- Constants
- func AppendOutputToTxt(output string, filename string)
- func AppendOutputToTxtAndExit(output string, filename string)
- func GenerateRandomUserAgent() string
- func GetHost(input string) (string, error)
- func GetPath(input string) (string, error)
- func GetProtocol(input string) (string, error)
- func HasProtocol(input string) bool
- func ReadFileLineByLine(inputFile string) []string
- func RemoveDuplicateValues[T comparable](slice []T) []T
- func RemovePort(input string) string
- func RemoveProtocol(input string) string
- func SameDomain(url1 string, url2 string) bool
- func ScanInputStdin() []string
- func Version() string
Constants ΒΆ
const (
Permission0644 = 0644
)
Variables ΒΆ
This section is empty.
Functions ΒΆ
func AppendOutputToTxt ΒΆ
AppendOutputToTxt tries to append the output string in the file `filename` taken as input.
func AppendOutputToTxtAndExit ΒΆ
AppendOutputToTxtAndExit appends the output string in the file `filename` taken as input. ---> If it encounters an error, it logs the error and exits !!!!
func GenerateRandomUserAgent ΒΆ
func GenerateRandomUserAgent() string
GenerateRandomUserAgent generates a random user agent (can be Chrome or Firefox).
func GetHost ΒΆ
GetHost takes as input a string and tries to parse it as url, if it's a well formatted url this function returns the host (the domain if you prefer).
func GetProtocol ΒΆ
GetProtocol takes as input a string and tries to parse it as url, if it's a well formatted url this function returns the protocol (the scheme if you prefer).
func HasProtocol ΒΆ
HasProtocol takes as input a string and checks if it has a protocol ( like in a URI/URL).
func ReadFileLineByLine ΒΆ
ReadFileLineByLine reads from a file taken as input and returns a slice of strings (duplicates allowed).
func RemoveDuplicateValues ΒΆ
func RemoveDuplicateValues[T comparable](slice []T) []T
RemoveDuplicateValues removes duplicates from a slice of T taken as input and returns the result.
func RemovePort ΒΆ
RemovePort removes port from the input string If it's not present it returns the input.
func RemoveProtocol ΒΆ
RemoveProtocol removes the protocol from the input string (something://...) If it's not present it returns the input.
func SameDomain ΒΆ
SameDomain checks if two urls have the same domain.
func ScanInputStdin ΒΆ
func ScanInputStdin() []string
ScanInputStdin return the array of elements taken as input on stdin.
Types ΒΆ
This section is empty.
