user

package
v0.0.0-...-53df4c2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package user ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	// ID is the user's unique identifier. (unique, crypto-secure random)
	ID snowflake.Snowflake `json:"id"`

	// Email is the user's email address. (unique, end-user data)
	Email string `json:"email,omitempty"`

	// Confirmed represents if the User has confirmed their email address.
	Confirmed bool `json:"confirmed"`

	// Locked represents if the User's account is locked.
	Locked bool `json:"-"`

	// Avatar is a hash of the User's avatar.
	Avatar string `json:"avatar"`

	// CreatedAt is a timestamp of when the account was created.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// contains filtered or unexported fields
}

User represents a Cosmos User.

func New

func New(email string, password []byte) (*User, error)

New .

func (*User) HasPassword

func (u *User) HasPassword() bool

HasPassword returns true if the user has a password.

func (*User) SetPassword

func (u *User) SetPassword(password []byte) error

SetPassword hashes a raw password and updates the user's password.

func (*User) VerifyPassword

func (u *User) VerifyPassword(password []byte) error

VerifyPassword takes a password and the user's hashed password and verifies the password against the hashed password.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL