Documentation ¶
Index ¶
- Variables
- func RunMigrateUp(db *Database) error
- func TrackMapNameToId(typ string, name string) string
- func TrackQuery() *goqu.SelectDataset
- type Album
- type AlbumChanges
- type AlbumResolverAdapter
- func (a *AlbumResolverAdapter) GetDefaultSort() string
- func (a *AlbumResolverAdapter) MapName(name string) (types.Name, error)
- func (a *AlbumResolverAdapter) MapNameToId(typ, name string) (string, error)
- func (a *AlbumResolverAdapter) ResolveFunctionCall(resolver *filter.Resolver, name string, args []ast.Expr) (filter.FilterExpr, error)
- func (a *AlbumResolverAdapter) ResolveTable(typ string) (filter.Table, error)
- type Artist
- type ArtistChanges
- type Config
- type Connection
- type CreateAlbumParams
- type CreateArtistParams
- type CreatePlaylistParams
- type CreateTrackParams
- type Database
- func (db *Database) AddGenreToTrack(ctx context.Context, genreId, trackId string) error
- func (db *Database) AddItemsToPlaylist(ctx context.Context, playlistId string, trackIds []string) error
- func (db *Database) AddTagToTrack(ctx context.Context, tagId, trackId string) error
- func (db *Database) Begin() (*Database, *sql.Tx, error)
- func (db *Database) CreateAlbum(ctx context.Context, params CreateAlbumParams) (Album, error)
- func (db *Database) CreateArtist(ctx context.Context, params CreateArtistParams) (Artist, error)
- func (db *Database) CreateConfig(ctx context.Context, ownerId string) (Config, error)
- func (db *Database) CreateGenre(ctx context.Context, name string) (Genre, error)
- func (db *Database) CreatePlaylist(ctx context.Context, params CreatePlaylistParams) (Playlist, error)
- func (db *Database) CreateTag(ctx context.Context, name string) (Tag, error)
- func (db *Database) CreateTrack(ctx context.Context, params CreateTrackParams) (Track, error)
- func (db *Database) CreateUser(ctx context.Context, username, password string) (User, error)
- func (db *Database) DeleteItemsFromPlaylist(ctx context.Context, playlistId string, trackIndices []int) error
- func (db *Database) Exec(ctx context.Context, s ToSQL) (sql.Result, error)
- func (db *Database) GetAlbumById(ctx context.Context, id string) (Album, error)
- func (db *Database) GetAlbumByName(ctx context.Context, name string) (Album, error)
- func (db *Database) GetAlbumByPath(ctx context.Context, path string) (Album, error)
- func (db *Database) GetAlbumsByArtist(ctx context.Context, artistId string) ([]Album, error)
- func (db *Database) GetAllAlbums(ctx context.Context, filterStr string) ([]Album, error)
- func (db *Database) GetAllArtists(ctx context.Context) ([]Artist, error)
- func (db *Database) GetAllGenres(ctx context.Context) ([]Genre, error)
- func (db *Database) GetAllTags(ctx context.Context) ([]Tag, error)
- func (db *Database) GetAllTracks(ctx context.Context, filterStr string, sortStr string, includeAll bool) ([]Track, error)
- func (db *Database) GetAllUsers(ctx context.Context) ([]User, error)
- func (db *Database) GetArtistById(ctx context.Context, id string) (Artist, error)
- func (db *Database) GetArtistByName(ctx context.Context, name string) (Artist, error)
- func (db *Database) GetArtistByPath(ctx context.Context, path string) (Artist, error)
- func (db *Database) GetConfig(ctx context.Context) (*Config, error)
- func (db *Database) GetGenreByName(ctx context.Context, name string) (Genre, error)
- func (db *Database) GetPlaylistById(ctx context.Context, id string) (Playlist, error)
- func (db *Database) GetPlaylistItems(ctx context.Context, playlistId string) ([]PlaylistItem, error)
- func (db *Database) GetPlaylistsByUser(ctx context.Context, userId string) ([]Playlist, error)
- func (db *Database) GetTagByName(ctx context.Context, name string) (Tag, error)
- func (db *Database) GetTrackById(ctx context.Context, id string) (Track, error)
- func (db *Database) GetTrackByName(ctx context.Context, name string) (Track, error)
- func (db *Database) GetTrackByNameAndAlbum(ctx context.Context, name string, albumId string) (Track, error)
- func (db *Database) GetTrackByPath(ctx context.Context, path string) (Track, error)
- func (db *Database) GetTrackGenres(ctx context.Context, trackId string) ([]Genre, error)
- func (db *Database) GetTrackTags(ctx context.Context, trackId string) ([]Tag, error)
- func (db *Database) GetTracksByAlbum(ctx context.Context, albumId string) ([]Track, error)
- func (db *Database) GetUserById(ctx context.Context, id string) (User, error)
- func (db *Database) GetUserByUsername(ctx context.Context, username string) (User, error)
- func (db *Database) Invalidate()
- func (db *Database) MarkAllAlbumsUnavailable(ctx context.Context) error
- func (db *Database) MarkAllArtistsUnavailable(ctx context.Context) error
- func (db *Database) MarkAllTracksUnavailable(ctx context.Context) error
- func (db *Database) MovePlaylistItem(ctx context.Context, playlistId string, trackId string, toIndex int) error
- func (db *Database) Query(ctx context.Context, s ToSQL) (*sql.Rows, error)
- func (db *Database) QueryRow(ctx context.Context, s ToSQL) (*sql.Row, error)
- func (db *Database) RemoveGenreFromTrack(ctx context.Context, genreId, trackId string) error
- func (db *Database) RemoveTagFromTrack(ctx context.Context, tagId, trackId string) error
- func (db *Database) UpdateAlbum(ctx context.Context, id string, changes AlbumChanges) error
- func (db *Database) UpdateArtist(ctx context.Context, id string, changes ArtistChanges) error
- func (db *Database) UpdateTrack(ctx context.Context, id string, changes TrackChanges) error
- type Genre
- type Playlist
- type PlaylistItem
- type Scan
- type Tag
- type ToSQL
- type Track
- type TrackChanges
- type TrackResolverAdapter
- func (a *TrackResolverAdapter) DefaultSort() string
- func (a *TrackResolverAdapter) MapName(name string) (types.Name, error)
- func (a *TrackResolverAdapter) MapNameToId(typ, name string) (string, error)
- func (a *TrackResolverAdapter) MapSortName(name string) (types.Name, error)
- func (a *TrackResolverAdapter) ResolveFunctionCall(resolver *filter.Resolver, name string, args []ast.Expr) (filter.FilterExpr, error)
- func (a *TrackResolverAdapter) ResolveTable(typ string) (filter.Table, error)
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidFilter = errors.New("Invalid filter")
View Source
var ErrInvalidSort = errors.New("Invalid sort")
View Source
var ErrItemNotFound = errors.New("database: item not found")
Functions ¶
func RunMigrateUp ¶ added in v0.14.0
func TrackMapNameToId ¶ added in v0.11.0
func TrackQuery ¶ added in v0.13.0
func TrackQuery() *goqu.SelectDataset
Types ¶
type AlbumChanges ¶ added in v0.7.0
type AlbumResolverAdapter ¶ added in v0.11.0
type AlbumResolverAdapter struct { }
func (*AlbumResolverAdapter) GetDefaultSort ¶ added in v0.11.0
func (a *AlbumResolverAdapter) GetDefaultSort() string
func (*AlbumResolverAdapter) MapName ¶ added in v0.11.0
func (a *AlbumResolverAdapter) MapName(name string) (types.Name, error)
func (*AlbumResolverAdapter) MapNameToId ¶ added in v0.11.0
func (a *AlbumResolverAdapter) MapNameToId(typ, name string) (string, error)
func (*AlbumResolverAdapter) ResolveFunctionCall ¶ added in v0.11.0
func (a *AlbumResolverAdapter) ResolveFunctionCall(resolver *filter.Resolver, name string, args []ast.Expr) (filter.FilterExpr, error)
func (*AlbumResolverAdapter) ResolveTable ¶ added in v0.11.0
func (a *AlbumResolverAdapter) ResolveTable(typ string) (filter.Table, error)
type ArtistChanges ¶ added in v0.7.0
type Connection ¶ added in v0.10.0
type CreateAlbumParams ¶
type CreateAlbumParams struct { Name string CoverArt sql.NullString ArtistId string Path string }
type CreateArtistParams ¶
type CreateArtistParams struct { Name string Picture sql.NullString Path string }
type CreatePlaylistParams ¶ added in v0.10.0
type CreateTrackParams ¶
type Database ¶ added in v0.6.0
type Database struct { RawConn *sql.DB Conn Connection }
func (*Database) AddGenreToTrack ¶ added in v0.11.0
func (*Database) AddItemsToPlaylist ¶ added in v0.10.0
func (*Database) AddTagToTrack ¶ added in v0.8.0
func (*Database) CreateAlbum ¶ added in v0.6.0
func (*Database) CreateArtist ¶ added in v0.6.0
func (*Database) CreateConfig ¶ added in v0.10.0
func (*Database) CreateGenre ¶ added in v0.11.0
func (*Database) CreatePlaylist ¶ added in v0.10.0
func (*Database) CreateTrack ¶ added in v0.6.0
func (*Database) CreateUser ¶ added in v0.10.0
func (*Database) DeleteItemsFromPlaylist ¶ added in v0.10.0
func (db *Database) DeleteItemsFromPlaylist(ctx context.Context, playlistId string, trackIndices []int) error
TODO(patrik): Change from trackIndices to trackIds
func (*Database) GetAlbumById ¶ added in v0.6.0
func (*Database) GetAlbumByName ¶ added in v0.10.0
func (*Database) GetAlbumByPath ¶ added in v0.6.0
func (*Database) GetAlbumsByArtist ¶ added in v0.6.0
func (*Database) GetAllAlbums ¶ added in v0.6.0
func (*Database) GetAllArtists ¶ added in v0.6.0
func (*Database) GetAllGenres ¶ added in v0.11.0
func (*Database) GetAllTags ¶ added in v0.9.0
func (*Database) GetAllTracks ¶ added in v0.6.0
func (*Database) GetAllUsers ¶ added in v0.12.0
func (*Database) GetArtistById ¶ added in v0.6.0
func (*Database) GetArtistByName ¶ added in v0.8.0
func (*Database) GetArtistByPath ¶ added in v0.6.0
func (*Database) GetGenreByName ¶ added in v0.11.0
func (*Database) GetPlaylistById ¶ added in v0.10.0
func (*Database) GetPlaylistItems ¶ added in v0.10.0
func (*Database) GetPlaylistsByUser ¶ added in v0.10.0
func (*Database) GetTagByName ¶ added in v0.8.0
func (*Database) GetTrackById ¶ added in v0.6.0
func (*Database) GetTrackByName ¶ added in v0.10.0
func (*Database) GetTrackByNameAndAlbum ¶ added in v0.11.0
func (*Database) GetTrackByPath ¶ added in v0.6.0
func (*Database) GetTrackGenres ¶ added in v0.11.0
func (*Database) GetTrackTags ¶ added in v0.8.0
func (*Database) GetTracksByAlbum ¶ added in v0.6.0
func (*Database) GetUserById ¶ added in v0.10.0
func (*Database) GetUserByUsername ¶ added in v0.10.0
func (*Database) Invalidate ¶ added in v0.11.0
func (db *Database) Invalidate()
func (*Database) MarkAllAlbumsUnavailable ¶ added in v0.7.0
func (*Database) MarkAllArtistsUnavailable ¶ added in v0.7.0
func (*Database) MarkAllTracksUnavailable ¶ added in v0.7.0
func (*Database) MovePlaylistItem ¶ added in v0.10.0
func (db *Database) MovePlaylistItem(ctx context.Context, playlistId string, trackId string, toIndex int) error
TODO(patrik): Add bounds check for toIndex
func (*Database) RemoveGenreFromTrack ¶ added in v0.11.0
func (*Database) RemoveTagFromTrack ¶ added in v0.8.0
func (*Database) UpdateAlbum ¶ added in v0.7.0
func (*Database) UpdateArtist ¶ added in v0.7.0
func (*Database) UpdateTrack ¶ added in v0.6.0
type PlaylistItem ¶ added in v0.10.0
type Track ¶
type TrackChanges ¶ added in v0.7.0
type TrackResolverAdapter ¶ added in v0.11.0
type TrackResolverAdapter struct{}
func (*TrackResolverAdapter) DefaultSort ¶ added in v0.15.2
func (a *TrackResolverAdapter) DefaultSort() string
func (*TrackResolverAdapter) MapName ¶ added in v0.11.0
func (a *TrackResolverAdapter) MapName(name string) (types.Name, error)
func (*TrackResolverAdapter) MapNameToId ¶ added in v0.11.0
func (a *TrackResolverAdapter) MapNameToId(typ, name string) (string, error)
func (*TrackResolverAdapter) MapSortName ¶ added in v0.15.2
func (a *TrackResolverAdapter) MapSortName(name string) (types.Name, error)
func (*TrackResolverAdapter) ResolveFunctionCall ¶ added in v0.11.0
func (a *TrackResolverAdapter) ResolveFunctionCall(resolver *filter.Resolver, name string, args []ast.Expr) (filter.FilterExpr, error)
func (*TrackResolverAdapter) ResolveTable ¶ added in v0.11.0
func (a *TrackResolverAdapter) ResolveTable(typ string) (filter.Table, error)
Click to show internal directories.
Click to hide internal directories.