repositories

package
v0.0.0-...-c5e0098 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDuplicateEmail = newRepositoryError(errors.New("duplicate email"))
View Source
var ErrEmailNotFound = newRepositoryError(errors.New("email not found"))
View Source
var ErrInvalidTokenOrUserAlreadyConfirmed = newRepositoryError(errors.New("invalid token or user already confirmed"))

Functions

This section is empty.

Types

type NoteRepository

type NoteRepository interface {
	Create(ctx context.Context, userId int64, title, content, color string) (*models.Note, error)
	GetById(ctx context.Context, id int64) (*models.Note, error)
	List(ctx context.Context, userId int64) ([]models.Note, error)
	Update(ctx context.Context, id int64, title, content, color string) (*models.Note, error)
	Delete(ctx context.Context, id int64) error
}

func NewNoteRepository

func NewNoteRepository(dbpool *pgxpool.Pool) NoteRepository

type RepositoriesError

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

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, email, password, hashToken string) (*models.User, string, error)
	FindByEmail(ctx context.Context, email string) (*models.User, error)
	ConfirmUserByToken(ctx context.Context, token string) error
	CreateResetPasswordToken(ctx context.Context, email, hashToken string) (string, error)
	GetUserConfirmationByToken(ctx context.Context, token string) (*models.UserConfirmationToken, error)
	UpdatePasswordByToken(ctx context.Context, newPassword, token string) (string, error)
}

func NewUserRepository

func NewUserRepository(dbpoll *pgxpool.Pool) UserRepository

Jump to

Keyboard shortcuts

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