Documentation ¶
Overview ¶
Package local implements having local cache of remote serve relational data (artist,album,playlist,song).
Index ¶
- type Db
- func (db *Db) Close() error
- func (db *Db) GetAlbums(query *interfaces.QueryOpts) (albums []*models.Album, n int, err error)
- func (db *Db) GetArtists(query *interfaces.QueryOpts) (artists []*models.Artist, count int, err error)
- func (db *Db) GetPlaylists() ([]*models.Playlist, error)
- func (db *Db) GetSongs(page int, pageSize int) ([]*models.Song, int, error)
- func (db *Db) GetStats() (models.StorageInfo, error)
- func (db *Db) UpdateAlbums(albums []*models.Album) error
- func (db *Db) UpdateArtists(artists []*models.Artist) error
- func (db *Db) UpdatePlaylists(playlists []*models.Playlist) error
- func (db *Db) UpdateSongs(songs []*models.Song) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Db ¶
type Db struct {
// contains filtered or unexported fields
}
Db implements storing relational data to local database as cache. Schema reflects the data coming from server and tries to store updated content and not enforce relational integrity. This should also mean getting data from db and server should return same results for same queries.
func (*Db) GetArtists ¶
func (*Db) UpdateArtists ¶
UpdateArtists updates/inserts artists.
func (*Db) UpdatePlaylists ¶
UpdatePlaylists updates playlists. Songs are expected to already exist.
Click to show internal directories.
Click to hide internal directories.