Documentation
¶
Index ¶
- func Batch[T any](ch <-chan T, size uint32) []T
- func ExtractHostFromUrl(rawUrl string) (string, error)
- func GenerateRandomString(n int) (string, error)
- func GetEnvVarDefault(name string, def string) string
- func IsSubset[T comparable](subset []T, superset []T) bool
- func RemoveFrom[T comparable](slice []T, item T) []T
- func SplitName(fullName string) (string, string)
- func UrlIsSecure(rawUrl string) (bool, error)
- type ImageFmt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Batch ¶
Batch collects items from a channel into a slice of the specified size. Stops if the channel is closed or empty. Does NOT block if the channel is empty.
func ExtractHostFromUrl ¶
ExtractHostFromUrl extracts the hostname from a given URL string. Returns an error if the URL is invalid.
func GenerateRandomString ¶
GenerateRandomString generates a random string of size n
func GetEnvVarDefault ¶
GetEnvVarDefault retrieves the value of the specified environment variable. Returns a default value if the variable is not set.
func IsSubset ¶
func IsSubset[T comparable](subset []T, superset []T) bool
IsSubset checks if all elements of the subset are present in the superset.
func RemoveFrom ¶
func RemoveFrom[T comparable](slice []T, item T) []T
RemoveFrom removes all occurrences of a specified item from a slice.
func SplitName ¶
SplitName splits a full name into first and last name. If no last name exists, it returns an empty string.
func UrlIsSecure ¶
UrlIsSecure checks if a given URL uses the HTTPS scheme. Returns an error if the URL is invalid.