repository

package
v0.0.0-...-c0ea003 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidCredentials error = errors.New("invalid credentials")
	ErrorUserNotActivated   error = errors.New("user is not yet activated")
	ErrorInternalServer     error = errors.New("internal server error")
)

Functions

This section is empty.

Types

type IUserServiceRepository

type IUserServiceRepository interface {
	// Activate the user, so that the user can log in
	ActivateUser(userId string) error

	// Login the user
	LoginUser(username string, email string, password string) (*models.User, error)

	// RegisterUser registers a user
	RegisterUser(id string, firstName string, lastName string, email string, username string, privacyLevel int) (int, error)

	GetUserById(userId string) (*models.UserWithPrivacy, error)
}

func NewUserRepository

func NewUserRepository(serviceUrl string) IUserServiceRepository

type UserRepository

type UserRepository struct {
	// contains filtered or unexported fields
}

func (*UserRepository) ActivateUser

func (u *UserRepository) ActivateUser(userId string) error

func (*UserRepository) GetUserById

func (u *UserRepository) GetUserById(id string) (*models.UserWithPrivacy, error)

func (*UserRepository) LoginUser

func (u *UserRepository) LoginUser(username string, email string, password string) (*models.User, error)

func (*UserRepository) RegisterUser

func (u *UserRepository) RegisterUser(id string, firstName string, lastName string, email string, username string, privacyLevel int) (int, error)

Jump to

Keyboard shortcuts

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