repo

package
v0.0.0-...-64ae474 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ITEMS_PER_PAGE = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type CommentsRepository

type CommentsRepository interface {
	Create(ctx context.Context, comment *models.Comment) (uuid.UUID, error)
	FindByID(ctx context.Context, commentID uuid.UUID) (*models.Comment, error)

	FindByImageID(
		ctx context.Context,
		imageID uuid.UUID,
	) ([]models.Comment, error)
}

func NewPGXCommentsRepository

func NewPGXCommentsRepository(pool *pgxpool.Pool) CommentsRepository

type ImagesRepository

type ImagesRepository interface {
	Create(ctx context.Context, image *models.Image) (uuid.UUID, error)
	GetImageByID(
		ctx context.Context,
		imageID uuid.UUID,
	) (*models.Image, error)
	GetImagesByUserID(
		ctx context.Context,
		userID uuid.UUID,
	) ([]models.Image, error)

	FindMany(ctx context.Context, page uint64) ([]models.Post, error)
	FindByID(ctx context.Context, id uuid.UUID) (*models.Image, error)
}

func NewPGXImagesRepository

func NewPGXImagesRepository(db *pgxpool.Pool) ImagesRepository

type PGXCommentsRepository

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

func (*PGXCommentsRepository) Create

func (r *PGXCommentsRepository) Create(
	ctx context.Context,
	comment *models.Comment,
) (uuid.UUID, error)

func (*PGXCommentsRepository) FindByID

func (r *PGXCommentsRepository) FindByID(
	ctx context.Context,
	commentID uuid.UUID,
) (*models.Comment, error)

func (*PGXCommentsRepository) FindByImageID

func (r *PGXCommentsRepository) FindByImageID(
	ctx context.Context,
	imageID uuid.UUID,
) ([]models.Comment, error)

type PGXImagesRepository

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

func (*PGXImagesRepository) Create

func (r *PGXImagesRepository) Create(
	ctx context.Context,
	image *models.Image,
) (uuid.UUID, error)

func (*PGXImagesRepository) FindByID

func (r *PGXImagesRepository) FindByID(
	ctx context.Context,
	id uuid.UUID,
) (*models.Image, error)

func (*PGXImagesRepository) FindMany

func (r *PGXImagesRepository) FindMany(
	ctx context.Context,
	page uint64,
) ([]models.Post, error)

func (*PGXImagesRepository) GetImageByID

func (r *PGXImagesRepository) GetImageByID(
	ctx context.Context,
	imageID uuid.UUID,
) (*models.Image, error)

func (*PGXImagesRepository) GetImagesByUserID

func (r *PGXImagesRepository) GetImagesByUserID(
	ctx context.Context,
	userID uuid.UUID,
) ([]models.Image, error)

type PGXUsersRepository

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

func (*PGXUsersRepository) Create

func (r *PGXUsersRepository) Create(ctx context.Context, user *models.User) (uuid.UUID, error)

func (*PGXUsersRepository) FindByEmail

func (r *PGXUsersRepository) FindByEmail(ctx context.Context, email string) (*models.User, error)

func (*PGXUsersRepository) FindByID

func (r *PGXUsersRepository) FindByID(ctx context.Context, id uuid.UUID) (*models.User, error)

func (*PGXUsersRepository) Update

func (r *PGXUsersRepository) Update(ctx context.Context, user *models.User) error

type UsersRepository

type UsersRepository interface {
	Create(ctx context.Context, user *models.User) (uuid.UUID, error)
	FindByEmail(ctx context.Context, email string) (*models.User, error)
	FindByID(ctx context.Context, id uuid.UUID) (*models.User, error)
	Update(ctx context.Context, user *models.User) error
}

func NewPGXUsersRepository

func NewPGXUsersRepository(db *pgxpool.Pool) UsersRepository

Jump to

Keyboard shortcuts

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