models

package
v0.0.0-...-410c955 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const UserAuthKeySize = 1 + 8 + sha512.Size

Variables

View Source
var SecretSalt = "secret salt"

Functions

This section is empty.

Types

type User

type User struct {
	ID            UserId       `pg:",pk"  json:"user_id"`
	CreatedAt     time.Time    `pg:"default:now()" json:"-"`
	UpdatedAt     time.Time    `pg:"default:now()" json:"-"`
	DeletedAt     *time.Time   `pg:",soft_delete" json:"deleted_at,omitempty"`
	Email         string       `pg:"type:varchar(500),unique,notnull" json:"email"`
	Password      UserPassword `json:"-"`
	PasswordPlain string       `json:"password_plain,omitempty" pg:"-"`
	Name          string       `pg:"name"  json:"name"`
	// contains filtered or unexported fields
}

func AuthKeyToUserSearch

func AuthKeyToUserSearch(k string) (*User, error)

func (User) AuthHash

func (u User) AuthHash() UserPassword

func (User) GetAuthKey

func (u User) GetAuthKey() string

func (*User) SetPassword

func (u *User) SetPassword(password string)

type UserAuthKey

type UserAuthKey [UserAuthKeySize]byte

type UserId

type UserId uint64

type UserPassword

type UserPassword [sha512.Size]byte

Jump to

Keyboard shortcuts

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