Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HashString ¶
HashString will attempt to hash the string. Will never return a string longer than length
func TruncateString ¶
func TruncateString(s string, opt TruncateStringOptions) string
TruncateString will attempt to truncate a string to a max length, adding a suffix to avoid collisions. Will never return a string longer than maxLength chars
Types ¶
type TruncateStringOptions ¶
type TruncateStringOptions struct {
// AlwaysAddHash will always cause the hash to be appended.
// Useful to stop users assuming that the name will never be truncated.
AlwaysAddHash bool
// MaxLength controls the maximum length of the string.
MaxLength int
// HashLength controls the length of the hash to be appended.
HashLength int
}
TruncateStringOptions contains parameters for how we truncate strings
Click to show internal directories.
Click to hide internal directories.