repositories

package
v0.0.0-...-b197d47 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTrackAlreadyExists = errors.New("track is already exists")
)

Functions

This section is empty.

Types

type TracksRepository

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

func NewTracksRepository

func NewTracksRepository(db *pgxpool.Pool) *TracksRepository

func (*TracksRepository) CreateArtist

func (r *TracksRepository) CreateArtist(ctx context.Context, tx pgx.Tx, artist dao.Artist) (id int, err error)

func (*TracksRepository) CreateLyric

func (r *TracksRepository) CreateLyric(ctx context.Context, tx pgx.Tx, lyrics []dao.Lyric) (err error)

func (*TracksRepository) CreateLyricFromSlice

func (r *TracksRepository) CreateLyricFromSlice(ctx context.Context, tx pgx.Tx, trackID int, lyrics []string) (err error)

func (*TracksRepository) CreateTrack

func (r *TracksRepository) CreateTrack(ctx context.Context, tx pgx.Tx, track dao.Track) (id int, err error)

func (*TracksRepository) DeleteLyricByTrackID

func (r *TracksRepository) DeleteLyricByTrackID(ctx context.Context, tx pgx.Tx, trackID int) (err error)

func (*TracksRepository) DeleteTrackByID

func (r *TracksRepository) DeleteTrackByID(ctx context.Context, trackID int) (err error)

func (*TracksRepository) GetArtistIDByTrackID

func (r *TracksRepository) GetArtistIDByTrackID(ctx context.Context, tx pgx.Tx, id int) (artistID int, err error)

func (*TracksRepository) GetByID

func (r *TracksRepository) GetByID(ctx context.Context, id int) (track entities.Track, err error)

func (*TracksRepository) GetLyricPaginated

func (r *TracksRepository) GetLyricPaginated(ctx context.Context, _ pgx.Tx, trackID int, offset int) (lyric dao.Lyric, err error)

func (*TracksRepository) GetLyricsByTrackIDs

func (r *TracksRepository) GetLyricsByTrackIDs(ctx context.Context, tx pgx.Tx, ids []int) (lyrics []dao.Lyric, err error)

func (*TracksRepository) GetTrack

func (r *TracksRepository) GetTrack(ctx context.Context, tx pgx.Tx, id int) (track entities.Track, err error)

func (*TracksRepository) GetTrackLyric

func (r *TracksRepository) GetTrackLyric(ctx context.Context, tx pgx.Tx, trackID int) (lyric []string, err error)

func (*TracksRepository) GetTracksByFilter

func (r *TracksRepository) GetTracksByFilter(ctx context.Context, tx pgx.Tx, filter entities.TrackGetListFilters) (tracks map[int]entities.Track, err error)

func (*TracksRepository) IsArtistExists

func (r *TracksRepository) IsArtistExists(ctx context.Context, tx pgx.Tx, name string) (id int, exists bool)

func (*TracksRepository) IsTrackExists

func (r *TracksRepository) IsTrackExists(ctx context.Context, track string, artist string) (exists bool, err error)

func (*TracksRepository) UpdateArtist

func (r *TracksRepository) UpdateArtist(ctx context.Context, tx pgx.Tx, artist dao.Artist) (err error)

func (*TracksRepository) UpdateTrack

func (r *TracksRepository) UpdateTrack(ctx context.Context, tx pgx.Tx, track dao.Track) (err error)

func (*TracksRepository) WithTx

func (r *TracksRepository) WithTx(ctx context.Context, fn func(tx pgx.Tx) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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