Documentation ¶
Index ¶
Constants ¶
View Source
const SlugLength = 7
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TypeID ¶
type TypeID struct {
// contains filtered or unexported fields
}
func FromString ¶
Returns a typeID given a string. String should be in the format of ([a-zA-Z0-9]+)_([a-zA-Z0-9]+)
func (*TypeID) Bytes ¶
Returns the id portion of the TypeID (without the type prefix). The random bytes are a valid UUID v4.
func (*TypeID) Slug ¶
Returns a 7-character slug that is URL friendly.
Slugs meet the following properties: - They are 7 characters long - The slug is a prefix of the random character portion of a TypeID. - Slugs use the base58 character set, in order to avoid confusion between similar characters. - Some effort is put to avoid the most common curse words.
func (*TypeID) String ¶
The TypeID in string format.
TypeIDs have the following format:
prefix_1234567abcdefghijklmnopq
Where:
- prefix is prefix suffix specified at creation time
- '_' is used as a separator between the type prefix and the random character of the id.
- 1234567 are seven characters that can be used as a slug, from the base58 character set.
- abcdefghijklmnopq are 17 random characters from the base62 character set.
Click to show internal directories.
Click to hide internal directories.