Help us shape the future of Go! Take the 2026 Go Developer Survey

usermodel

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserModel

type UserModel struct {
	DB *domain.DB
	// contains filtered or unexported fields
}

UserModel represents the model for app

func (*UserModel) CreateWithEmail added in v0.14.0

func (m *UserModel) CreateWithEmail(email, password string) (domain.User, error)

Create creates a new user rename to CreateWithPassword

func (*UserModel) CreateWithTSNet added in v0.14.0

func (m *UserModel) CreateWithTSNet(tsnetIdentifier string, tsnetExtraName string) (domain.User, error)

func (*UserModel) DeleteAdmin

func (m *UserModel) DeleteAdmin(userID domain.UserID) error

DeleteAdmin removes the user id from the tableof admin users for this server.

func (*UserModel) DeleteTSNet added in v0.14.0

func (m *UserModel) DeleteTSNet(userID domain.UserID) error

func (*UserModel) GetAll

func (m *UserModel) GetAll() ([]domain.User, error)

GetAll returns all users.

func (*UserModel) GetAllAdmins

func (m *UserModel) GetAllAdmins() ([]domain.UserID, error)

GetAllAdmins returns the list of user ids that are admins

func (*UserModel) GetFromEmail

func (m *UserModel) GetFromEmail(email string) (domain.User, error)

GetFromEmail returns a user it retunrs sql.ErrNoRows if not found

func (*UserModel) GetFromEmailPassword

func (m *UserModel) GetFromEmailPassword(email, password string) (domain.User, error)

GetFromEmailPassword is the proverbial authentication function

func (*UserModel) GetFromID

func (m *UserModel) GetFromID(userID domain.UserID) (domain.User, error)

GetFromID returns a user it retunrs sql.ErrNoRows if not found

func (*UserModel) GetFromTSNet added in v0.14.0

func (m *UserModel) GetFromTSNet(tsnetIdentifier string) (domain.User, error)

func (*UserModel) IsAdmin

func (m *UserModel) IsAdmin(userID domain.UserID) bool

IsAdmin tells you if the user is an admin on DropServer

func (*UserModel) MakeAdmin

func (m *UserModel) MakeAdmin(userID domain.UserID) error

MakeAdmin adds the user_id to the table of DropServer admin users

func (*UserModel) PrepareStatements

func (m *UserModel) PrepareStatements()

PrepareStatements prepares the statements

func (*UserModel) UpdateEmail added in v0.10.1

func (m *UserModel) UpdateEmail(userID domain.UserID, email string) error

func (*UserModel) UpdatePassword

func (m *UserModel) UpdatePassword(userID domain.UserID, password string) error

UpdatePassword updates the password for the user.

func (*UserModel) UpdateTSNet added in v0.14.0

func (m *UserModel) UpdateTSNet(userID domain.UserID, tsnetIdentifier string, tsnetExtraName string) error

Jump to

Keyboard shortcuts

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