Documentation
¶
Overview ¶
Package repository interacts with the databank and returns models
Index ¶
- type Album
- func (a *Album) Create(ctx context.Context, album *model.Album) error
- func (a *Album) CreateArtist(ctx context.Context, artist *model.AlbumArtist) error
- func (a *Album) CreateUser(ctx context.Context, user *model.AlbumUser) error
- func (a *Album) DeleteArtistByArtistAlbum(ctx context.Context, artist model.AlbumArtist) error
- func (a *Album) DeleteUserByUserAlbum(ctx context.Context, user model.AlbumUser) error
- func (a *Album) GetAll(ctx context.Context) ([]*model.Album, error)
- func (a *Album) GetBySpotify(ctx context.Context, spotifyID string) (*model.Album, error)
- func (a *Album) GetByUser(ctx context.Context, userID int) ([]*model.Album, error)
- func (a *Album) Update(ctx context.Context, album model.Album) error
- type Artist
- func (a *Artist) Create(ctx context.Context, artist *model.Artist) error
- func (a *Artist) GetAll(ctx context.Context) ([]*model.Artist, error)
- func (a *Artist) GetByAlbum(ctx context.Context, albumID int) ([]*model.Artist, error)
- func (a *Artist) GetBySpotify(ctx context.Context, spotifyID string) (*model.Artist, error)
- func (a *Artist) GetByTrack(ctx context.Context, trackID int) ([]*model.Artist, error)
- func (a *Artist) Update(ctx context.Context, artist model.Artist) error
- type Directory
- func (d *Directory) Create(ctx context.Context, directory *model.Directory) error
- func (d *Directory) CreatePlaylist(ctx context.Context, directory *model.DirectoryPlaylist) error
- func (d *Directory) DeleteByUser(ctx context.Context, userID int) error
- func (d *Directory) GetByUserPopulated(ctx context.Context, userID int) ([]*model.Directory, error)
- func (d *Directory) Update(ctx context.Context, directory model.Directory) error
- type Generator
- func (g *Generator) Create(ctx context.Context, gen *model.Generator) error
- func (g *Generator) CreateTrackBatch(ctx context.Context, tracks []model.GeneratorTrack) error
- func (g *Generator) Delete(ctx context.Context, genID int) error
- func (g *Generator) DeleteTrackByGenerator(ctx context.Context, id int) error
- func (g *Generator) Get(ctx context.Context, id int) (*model.Generator, error)
- func (g *Generator) GetAll(ctx context.Context) ([]*model.Generator, error)
- func (g *Generator) GetByUserPopulated(ctx context.Context, userID int) ([]*model.Generator, error)
- func (g *Generator) Update(ctx context.Context, gen model.Generator) error
- type History
- func (h *History) Create(ctx context.Context, history *model.History) error
- func (h *History) CreateBatch(ctx context.Context, histories []model.History) error
- func (h *History) DeleteOlder(ctx context.Context, userID int, playedAt time.Time) error
- func (h *History) GetPopulatedFiltered(ctx context.Context, filter model.HistoryFilter) ([]*model.History, error)
- func (h *History) GetPopulatedFilteredPaginated(ctx context.Context, filter model.HistoryFilter) ([]*model.History, error)
- func (h *History) GetPreviousPopulated(ctx context.Context, userID int, playedAt time.Time) (*model.History, error)
- func (h *History) GetSkippedUnknownPopulated(ctx context.Context, userID int) ([]*model.History, error)
- func (h *History) Update(ctx context.Context, history model.History) error
- type Link
- type Playlist
- func (p *Playlist) Create(ctx context.Context, playlist *model.Playlist) error
- func (p *Playlist) CreateTrack(ctx context.Context, track *model.PlaylistTrack) error
- func (p *Playlist) CreateUser(ctx context.Context, user *model.PlaylistUser) error
- func (p *Playlist) DeleteTrackByPlaylistTrack(ctx context.Context, track model.PlaylistTrack) error
- func (p *Playlist) DeleteUserByUserPlaylist(ctx context.Context, user model.PlaylistUser) error
- func (p *Playlist) Get(ctx context.Context, playlistID int) (*model.Playlist, error)
- func (p *Playlist) GetBySpotify(ctx context.Context, spotifyID string) (*model.Playlist, error)
- func (p *Playlist) GetByUser(ctx context.Context, userID int) ([]*model.Playlist, error)
- func (p *Playlist) GetByUserPopulated(ctx context.Context, userID int) ([]*model.Playlist, error)
- func (p *Playlist) GetDuplicateTracksByUser(ctx context.Context, userID int) ([]*model.Playlist, error)
- func (p *Playlist) GetTrackByPlaylistIDs(ctx context.Context, playlistIDs []int) ([]*model.PlaylistTrack, error)
- func (p *Playlist) GetUnplayableTracksByUser(ctx context.Context, userID int) ([]*model.Playlist, error)
- func (p *Playlist) Update(ctx context.Context, playlist model.Playlist) error
- type Repository
- func (r *Repository) NewAlbum() *Album
- func (r *Repository) NewArtist() *Artist
- func (r *Repository) NewDirectory() *Directory
- func (r *Repository) NewGenerator() *Generator
- func (r *Repository) NewHistory() *History
- func (r *Repository) NewLink() *Link
- func (r *Repository) NewPlaylist() *Playlist
- func (r *Repository) NewShow() *Show
- func (r *Repository) NewTask() *Task
- func (r *Repository) NewTrack() *Track
- func (r *Repository) NewUser() *User
- func (r *Repository) WithRollback(ctx context.Context, fn func(ctx context.Context) error) error
- type Show
- func (s *Show) Create(ctx context.Context, show *model.Show) error
- func (s *Show) CreateUser(ctx context.Context, user *model.ShowUser) error
- func (s *Show) DeleteUserByUserShow(ctx context.Context, user model.ShowUser) error
- func (s *Show) GetAll(ctx context.Context) ([]*model.Show, error)
- func (s *Show) GetBySpotify(ctx context.Context, spotifyID string) (*model.Show, error)
- func (s *Show) GetByUser(ctx context.Context, userID int) ([]*model.Show, error)
- func (s *Show) Update(ctx context.Context, show model.Show) error
- type Task
- func (t *Task) Create(ctx context.Context, task model.Task) error
- func (t *Task) CreateRun(ctx context.Context, task *model.Task) error
- func (t *Task) GetByRunID(ctx context.Context, runID int) (*model.Task, error)
- func (t *Task) GetByUID(ctx context.Context, taskUID string) (*model.Task, error)
- func (t *Task) GetRunFiltered(ctx context.Context, filter model.TaskFilter) ([]*model.Task, error)
- func (t *Task) GetRunLastAllByUser(ctx context.Context, userID int) ([]*model.Task, error)
- func (t *Task) SetInactiveAll(ctx context.Context) error
- func (t *Task) Update(ctx context.Context, task model.Task) error
- type Track
- func (t *Track) Create(ctx context.Context, track *model.Track) error
- func (t *Track) CreateArtist(ctx context.Context, artist *model.TrackArtist) error
- func (t *Track) DeleteArtistByArtistTrack(ctx context.Context, artist model.TrackArtist) error
- func (t *Track) GetAll(ctx context.Context) ([]*model.Track, error)
- func (t *Track) GetAllByID(ctx context.Context, trackIDs []int) ([]*model.Track, error)
- func (t *Track) GetAllBySpotify(ctx context.Context, spotifyIDs []string) ([]*model.Track, error)
- func (t *Track) GetByGenerator(ctx context.Context, generatorID int) ([]*model.Track, error)
- func (t *Track) GetByName(ctx context.Context, name string) ([]*model.Track, error)
- func (t *Track) GetByPlaylist(ctx context.Context, playlistID int) ([]*model.Track, error)
- func (t *Track) GetBySpotify(ctx context.Context, spotifyID string) (*model.Track, error)
- func (t *Track) GetCreatedFiltered(ctx context.Context, filter model.TrackFilter) ([]*model.Track, error)
- func (t *Track) GetDeletedFiltered(ctx context.Context, filter model.TrackFilter) ([]*model.Track, error)
- func (t *Track) Update(ctx context.Context, track model.Track) error
- type User
- func (u *User) Create(ctx context.Context, user *model.User) error
- func (u *User) GetActualAll(ctx context.Context) ([]*model.User, error)
- func (u *User) GetAllByID(ctx context.Context, ids []int) ([]*model.User, error)
- func (u *User) GetByID(ctx context.Context, id int) (*model.User, error)
- func (u *User) GetByUID(ctx context.Context, uid string) (*model.User, error)
- func (u *User) Update(ctx context.Context, user model.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
// contains filtered or unexported fields
}
func (*Album) CreateArtist ¶
func (*Album) CreateUser ¶
func (*Album) DeleteArtistByArtistAlbum ¶
func (*Album) DeleteUserByUserAlbum ¶
func (*Album) GetBySpotify ¶
type Artist ¶
type Artist struct {
// contains filtered or unexported fields
}
func (*Artist) GetByAlbum ¶
func (*Artist) GetBySpotify ¶
func (*Artist) GetByTrack ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func (*Directory) CreatePlaylist ¶
func (*Directory) DeleteByUser ¶
func (*Directory) GetByUserPopulated ¶
type Generator ¶ added in v0.2.0
type Generator struct {
// contains filtered or unexported fields
}
func (*Generator) CreateTrackBatch ¶ added in v0.2.0
func (*Generator) DeleteTrackByGenerator ¶ added in v0.2.0
func (*Generator) GetByUserPopulated ¶ added in v0.2.0
type History ¶
type History struct {
// contains filtered or unexported fields
}
func (*History) CreateBatch ¶ added in v0.2.0
CreateBatch let's you create a batch of history entries It will panic if the skipped field is nil!!!
func (*History) DeleteOlder ¶ added in v0.2.0
func (*History) GetPopulatedFiltered ¶
func (*History) GetPopulatedFilteredPaginated ¶ added in v0.2.0
func (*History) GetPreviousPopulated ¶ added in v0.2.0
func (*History) GetSkippedUnknownPopulated ¶ added in v0.2.0
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) GetAllByUser ¶
type Playlist ¶
type Playlist struct {
// contains filtered or unexported fields
}
func (*Playlist) CreateTrack ¶
func (*Playlist) CreateUser ¶
func (*Playlist) DeleteTrackByPlaylistTrack ¶
func (*Playlist) DeleteUserByUserPlaylist ¶
func (*Playlist) GetBySpotify ¶
func (*Playlist) GetByUserPopulated ¶
func (*Playlist) GetDuplicateTracksByUser ¶
func (*Playlist) GetTrackByPlaylistIDs ¶ added in v0.2.0
func (*Playlist) GetUnplayableTracksByUser ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func New ¶
func New(db db.DB) *Repository
func (*Repository) NewAlbum ¶
func (r *Repository) NewAlbum() *Album
func (*Repository) NewArtist ¶
func (r *Repository) NewArtist() *Artist
func (*Repository) NewDirectory ¶
func (r *Repository) NewDirectory() *Directory
func (*Repository) NewGenerator ¶ added in v0.2.0
func (r *Repository) NewGenerator() *Generator
func (*Repository) NewHistory ¶
func (r *Repository) NewHistory() *History
func (*Repository) NewLink ¶
func (r *Repository) NewLink() *Link
func (*Repository) NewPlaylist ¶
func (r *Repository) NewPlaylist() *Playlist
func (*Repository) NewShow ¶
func (r *Repository) NewShow() *Show
func (*Repository) NewTask ¶
func (r *Repository) NewTask() *Task
func (*Repository) NewTrack ¶
func (r *Repository) NewTrack() *Track
func (*Repository) NewUser ¶
func (r *Repository) NewUser() *User
func (*Repository) WithRollback ¶
type Show ¶
type Show struct {
// contains filtered or unexported fields
}
func (*Show) CreateUser ¶
func (*Show) DeleteUserByUserShow ¶
func (*Show) GetBySpotify ¶
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
func (*Task) GetByRunID ¶
func (*Task) GetRunFiltered ¶
func (*Task) GetRunLastAllByUser ¶
type Track ¶
type Track struct {
// contains filtered or unexported fields
}
func (*Track) CreateArtist ¶
func (*Track) DeleteArtistByArtistTrack ¶
func (*Track) GetAllByID ¶ added in v0.2.0
func (*Track) GetAllBySpotify ¶ added in v0.2.0
func (*Track) GetByGenerator ¶ added in v0.2.0
func (*Track) GetByPlaylist ¶
func (*Track) GetBySpotify ¶
func (*Track) GetCreatedFiltered ¶
func (*Track) GetDeletedFiltered ¶
Click to show internal directories.
Click to hide internal directories.