Documentation
¶
Index ¶
- func DedupeStrings(input []string) []string
- func DedupeURLs(URLs []*url.URL) []*url.URL
- func FileExists(filename string) bool
- func GetHostname() string
- func GetOutboundIP() net.IP
- func GetSHA1(str string) string
- func GetSHA1FromFile(filePath string) string
- func MakeAbsolute(base *url.URL, URLs []*url.URL) []*url.URL
- func Pointer[T any](d T) *T
- func RemoveFragments(URLs []*url.URL) []*url.URL
- func StringContainsSliceElements(target string, slice []string) bool
- func StringInSlice(a string, list []string) bool
- func StringSliceToURLSlice(rawURLs []string) (URLs []*url.URL)
- func URLToString(u *url.URL) string
- func ValidateURL(u *url.URL) error
- type DiskStatus
- type TAtomBool
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DedupeStrings ¶
DedupeStrings take a slice of string and dedupe it
func DedupeURLs ¶
DedupeURLs take a slice of *url.URL and dedupe it
func FileExists ¶
FileExists checks if a file exists and is not a directory before we try using it to prevent further errors
func GetHostname ¶
func GetHostname() string
func GetOutboundIP ¶
Note: GetOutboundIP does not establish any connection and the destination does not need to exist for this function to work.
func GetSHA1FromFile ¶
GetSHA1FromFile calculate the SHA1 of a file
func MakeAbsolute ¶
MakeAbsolute turn all URLs in a slice of url.URL into absolute URLs, based on a given base *url.URL
func StringContainsSliceElements ¶
StringContainsSliceElements if the string contains one of the elements of a slice
func StringInSlice ¶
StringInSlice return true if the string is in the slice
func StringSliceToURLSlice ¶
StringSliceToURLSlice takes a slice of string and return a slice of url.URL
func URLToString ¶
Types ¶
type DiskStatus ¶
type DiskStatus struct { All uint64 `json:"all"` Used uint64 `json:"used"` Free uint64 `json:"free"` Avail uint64 `json:"avail"` }
func GetFreeDiskSpace ¶
func GetFreeDiskSpace(path string) (disk DiskStatus)