Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SecretByteLen is the length in byte of the secret. SecretByteLen int = 64 // PasswordByteLen is the length in byte of the secret. PasswordByteLen int = 16 )
Variables ¶
This section is empty.
Functions ¶
func NewUserResource ¶
func NewUserResource( ctx context.Context, user *User, ) register.UserResource
NewUserResource generates a new user resource.
Types ¶
type ErrUniqueConstraintViolation ¶
type ErrUniqueConstraintViolation struct {
Err error
}
ErrUniqueConstraintViolation is returned when a object insertion violates a unique constraint.
func (ErrUniqueConstraintViolation) Error ¶
func (e ErrUniqueConstraintViolation) Error() string
type User ¶
type User struct { Token string Created time.Time Status register.UsrStatus Username string Email string Secret string Password string MintToken *string `db:"mint_token"` }
User represents a user object. Users are not tied to a mint user until they are verified.
func CreateUser ¶
CreateUser creates and stores a new User object.
func LoadUserByUsername ¶
LoadUserByUsername attempts to load a user with the given username.
func (*User) RollPassword ¶
RollPassword generates a new password for the user.
Click to show internal directories.
Click to hide internal directories.