Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultOptions = CustomSlug{ CanBe2ConsecutiveLetters: false, HasNumbers: true, HasCapitalLetters: true, }
Functions ¶
func AddBadCombination ¶
func GenerateSlug ¶
GenerateSlug returns a random slug with the size specified
func IsHumanReadable ¶
IsHumanReadable checks if a slug is human readable
Types ¶
type CustomSlug ¶
type CustomSlug struct { // Do you want "ABC..."? HasCapitalLetters bool // Do you want "0123..." HasNumbers bool // Do you want "aa" or "DD"...? CanBe2ConsecutiveLetters bool // contains filtered or unexported fields }
func (*CustomSlug) GenerateSlug ¶
func (options *CustomSlug) GenerateSlug(random uint64, size uint) string
GenerateSlug returns a random slug with the size specified
func (*CustomSlug) IsHumanReadable ¶
func (options *CustomSlug) IsHumanReadable(slug string) bool
IsHumanReadable checks if a slug is human readable
Click to show internal directories.
Click to hide internal directories.