Documentation
¶
Index ¶
- Variables
- func AddUnderscore(str string) string
- func ArrayContains(slice []string, val string) bool
- func CalculateTime(old, new time.Time) string
- func ChangeCase(s string) string
- func CheckAndFindAvailablePort(hostAddress string) (string, error)
- func CheckErr(msg string, err error)
- func ExtractHostPortFromURL(rawURL string) (string, int, error)
- func ExtractTitle(respByte []byte) (string, string)
- func ExtractValueFromMap(d *map[string]any, givenKey string) (any, error)
- func FindAndReplaceAll(value, search, replace string, regex bool) (string, error)
- func FormatNumericID(number float64, width int) string
- func FormatStringID(str string, width int) string
- func IsPortAvailable(host string) bool
- func ParseDataFromFrontend[T interface{}](results []interface{}) T
- func ParseDatabaseName(site string) string
- func PrintAnyData(m any) string
- func PseudorandomString(length int) string
- func PseudorandomStringWithAlphabet(length int, alphabet string) string
- func RandomString(length int) string
- func RandomStringWithAlphabet(length int, alphabet string) string
- func ResponseToByte(resp *http.Response) ([]byte, error)
- func ResponseToString(resp *http.Response) (string, error)
- func SmartSort(s string) string
- func StructToJsonTOMap(s any) (map[string]any, error)
- func StructToMap(s any, tag string) map[string]any
- func StructToMapExtact(s any) map[string]any
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AddUnderscore ¶
Add underscrore to a string until it reachs 15 length
func ArrayContains ¶
func CalculateTime ¶
func ChangeCase ¶
func ExtractTitle ¶
func ExtractValueFromMap ¶
func FindAndReplaceAll ¶
ReplaceString processes the input `value` string, replacing occurrences of `search` with `replace`. If `regex` is true, `search` is treated as a regular expression.
func FormatNumericID ¶
func FormatStringID ¶
func IsPortAvailable ¶
func ParseDataFromFrontend ¶
func ParseDataFromFrontend[T interface{}](results []interface{}) T
Parse Data From Frontend to Search
func ParseDatabaseName ¶
func PseudorandomString ¶
PseudorandomString generates a pseudorandom string with the specified length.
The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
For a cryptographically random string (but a little bit slower) use RandomString instead.
func PseudorandomStringWithAlphabet ¶
PseudorandomStringWithAlphabet generates a pseudorandom string with the specified length and characters set.
For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead.
func RandomString ¶
RandomString generates a cryptographically random string with the specified length.
The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
func RandomStringWithAlphabet ¶
RandomStringWithAlphabet generates a cryptographically random string with the specified length and characters set.
It panics if for some reason rand.Int returns a non-nil error.
func StructToMapExtact ¶
Types ¶
This section is empty.