Documentation ¶
Index ¶
- Variables
- type TracksRepository
- func (r *TracksRepository) CreateArtist(ctx context.Context, tx pgx.Tx, artist dao.Artist) (id int, err error)
- func (r *TracksRepository) CreateLyric(ctx context.Context, tx pgx.Tx, lyrics []dao.Lyric) (err error)
- func (r *TracksRepository) CreateLyricFromSlice(ctx context.Context, tx pgx.Tx, trackID int, lyrics []string) (err error)
- func (r *TracksRepository) CreateTrack(ctx context.Context, tx pgx.Tx, track dao.Track) (id int, err error)
- func (r *TracksRepository) DeleteLyricByTrackID(ctx context.Context, tx pgx.Tx, trackID int) (err error)
- func (r *TracksRepository) DeleteTrackByID(ctx context.Context, trackID int) (err error)
- func (r *TracksRepository) GetArtistIDByTrackID(ctx context.Context, tx pgx.Tx, id int) (artistID int, err error)
- func (r *TracksRepository) GetByID(ctx context.Context, id int) (track entities.Track, err error)
- func (r *TracksRepository) GetLyricPaginated(ctx context.Context, _ pgx.Tx, trackID int, offset int) (lyric dao.Lyric, err error)
- func (r *TracksRepository) GetLyricsByTrackIDs(ctx context.Context, tx pgx.Tx, ids []int) (lyrics []dao.Lyric, err error)
- func (r *TracksRepository) GetTrack(ctx context.Context, tx pgx.Tx, id int) (track entities.Track, err error)
- func (r *TracksRepository) GetTrackLyric(ctx context.Context, tx pgx.Tx, trackID int) (lyric []string, err error)
- func (r *TracksRepository) GetTracksByFilter(ctx context.Context, tx pgx.Tx, filter entities.TrackGetListFilters) (tracks map[int]entities.Track, err error)
- func (r *TracksRepository) IsArtistExists(ctx context.Context, tx pgx.Tx, name string) (id int, exists bool)
- func (r *TracksRepository) IsTrackExists(ctx context.Context, track string, artist string) (exists bool, err error)
- func (r *TracksRepository) UpdateArtist(ctx context.Context, tx pgx.Tx, artist dao.Artist) (err error)
- func (r *TracksRepository) UpdateTrack(ctx context.Context, tx pgx.Tx, track dao.Track) (err error)
- func (r *TracksRepository) WithTx(ctx context.Context, fn func(tx pgx.Tx) error) error
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 (*TracksRepository) CreateLyric ¶
func (*TracksRepository) CreateLyricFromSlice ¶
func (*TracksRepository) CreateTrack ¶
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 (*TracksRepository) GetLyricPaginated ¶
func (*TracksRepository) GetLyricsByTrackIDs ¶
func (*TracksRepository) GetTrackLyric ¶
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 (*TracksRepository) IsTrackExists ¶
func (*TracksRepository) UpdateArtist ¶
func (*TracksRepository) UpdateTrack ¶
Click to show internal directories.
Click to hide internal directories.