Documentation
¶
Index ¶
- Constants
- func ConvertStringToUUID(s string) uuid.UUID
- func ConvertStringsToUUIDs(strings []string) []uuid.UUID
- func ConvertUUIDToStringPtr(uuid uuid.UUID) *string
- func ConvertUUIDsToStrings(uuids []uuid.UUID) []string
- func GenerateRandomCode(length int) (string, error)
- func IsBlank(s string) bool
- func RedisOptionsFromURL(redisURL string) (address string, dbIndex int, err error)
Constants ¶
View Source
const ( // Regular expression will match on the following URL formats: // redis://127.0.0.1:6379 // redis://localhost:6379/5 // 127.0.0.1:6379/57 // localhost:6379/156 RedisURLRegex = `^(?:redis:\/\/)?([^:]+:\d+)(?:\/(\d+))?$` )
Variables ¶
This section is empty.
Functions ¶
func ConvertStringToUUID ¶
ConvertStringToUUID converts a string to a UUID.
Parameters:
s string - The string to be converted.
Returns:
uuid.UUID - The UUID converted from the string.
func ConvertStringsToUUIDs ¶
ConvertStringsToUUIDs converts a slice of strings to a slice of UUIDs, skipping any strings that are not valid UUIDs.
Parameters:
strings []string - A slice of strings to be converted.
Returns:
[]uuid.UUID - A slice containing the UUIDs converted from the valid strings.
func ConvertUUIDToStringPtr ¶
ConvertUUIDToStringPtr converts a given UUID to its string representation and returns a pointer to the resulting string.
Parameters:
- uuid: The UUID to be converted.
Returns:
- A pointer to the string representation of the provided UUID.
func ConvertUUIDsToStrings ¶
ConvertUUIDsToStrings converts a slice of UUIDs to a slice of their string representations.
Parameters:
uuids []uuid.UUID - A slice of UUIDs to be converted.
Returns:
[]string - A slice containing the string representations of the provided UUIDs.
func GenerateRandomCode ¶
GenerateRandomCode generates a random code of the given length.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.