repositories

package
v0.0.0-...-d952293 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 10 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 {
	List(ctx context.Context, userId int) ([]models.Note, error)
	GetById(ctx context.Context, userId int, id int) (*models.Note, error)
	Create(ctx context.Context, userId int, title, content, color string) (*models.Note, error)
	Update(ctx context.Context, userId int, id int, title, content, color string) (*models.Note, error)
	Delete(ctx context.Context, userId int, id int) error
}

func NewNoteRepository

func NewNoteRepository(dbpool *pgxpool.Pool) NoteRepository

type RepositoryError

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

type UserRepository

type UserRepository interface {
	Create(ctx context.Context, email, password, token string) (*models.User, string, 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)
	FindByEmail(ctx context.Context, email string) (*models.User, error)
}

func NewUserRepository

func NewUserRepository(db *pgxpool.Pool) UserRepository

Jump to

Keyboard shortcuts

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