model

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenPassword

func GenPassword() (string, error)

GenPassword generates a new random password

Types

type User

type User struct {
	ID            string
	Email         string
	EmailVerified bool
	Password      string
	Name          string
	Nickname      string
	GivenName     string
	FamilyName    string
	CreatedAt     time.Time
	UpdatedAt     time.Time
	IsAdmin       bool
}

User holds the user profile

func DeserializeUser

func DeserializeUser(b []byte) (*User, error)

DeserializeUser deserializes

func NewUser

func NewUser(email string, rawPassword string) (*User, error)

NewUser create a new user object

func (*User) CheckPassword

func (u *User) CheckPassword(raw string) (bool, error)

CheckPassword checks the password

func (*User) GenID

func (u *User) GenID() (err error)

GenID newid

func (User) Serialize

func (u User) Serialize() ([]byte, error)

Serialize gets a representation

func (*User) SetPassword

func (u *User) SetPassword(raw string) (err error)

SetPassword sets the user password (and hashes it)

Jump to

Keyboard shortcuts

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