Documentation ¶
Overview ¶
Package clid implements a prefixed ulid ID type.
Index ¶
Constants ¶
View Source
const ( // Separator for string encoding, we like '-' for showing them in urls. Separator = "-" // must be this length, to prevent above through large strings and to make storage size predictable. PrefixSize = 4 // ZeroPrefix is shown when a zero value is encoded, for recognizing that case easily. ZeroPrefix = "zzzz" // StorageSize determines the size of our identifier when stored, useful for sql schemas. StorageSize = 26 + PrefixSize + 1 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID struct {
// contains filtered or unexported fields
}
ID implements a prefixed ULID identifier.
func NewFromParts ¶
NewFromParts creates an id from its parts.
func (ID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*ID) UnmarshalGQL ¶
UnmarshalGQL implements the graphql.Unmarshaler interface.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
Click to show internal directories.
Click to hide internal directories.