Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidLength is returned when a token's data is an invalid length. ErrInvalidLength = errors.New("invalid length") // ErrSaltEmpty is returned when a token's data is an invalid length. ErrSaltEmpty = errors.New("salt empty") )
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind int64
Kind represents the kind of model to encode a token for.
type Tokenizer ¶
type Tokenizer struct {
// contains filtered or unexported fields
}
Tokenizer generates public tokens for database IDs to obfuscate the database IDs.
func (*Tokenizer) DecodeToken ¶
DecodeToken returns the kind and id number of a provided token.
func (*Tokenizer) EncodeToken ¶
EncodeToken turns a model kind and id into a token.
Click to show internal directories.
Click to hide internal directories.