user

package
v0.0.0-...-cf27a83 Latest Latest
Warning

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

Go to latest
Published: May 27, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PasswordHash

func PasswordHash(password string) ([]byte, error)

Types

type AuthInfo

type AuthInfo struct {
	UserID       string
	IsLocked     bool
	PasswordHash []byte
}

func (*AuthInfo) IsSamePassword

func (a *AuthInfo) IsSamePassword(password string) bool

type Registration

type Registration struct {
	UserID       string
	Email        string
	Username     string
	PasswordHash []byte
}

type Repository

type Repository interface {
	FindAuthInfo(username string) (*AuthInfo, error)

	FindUserByID(id string) (*User, error)

	HasAccount(username string) (bool, error)

	CreateAccount(r *Registration) (bool, error)
}

type User

type User struct {
	Username  string
	FirstName string
	LastName  string
}

Jump to

Keyboard shortcuts

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