Documentation ¶
Index ¶
- Constants
- Variables
- type MongoTrackRepository
- func (t MongoTrackRepository) AllTracks(page, limit int) ([]*Track, int, error)
- func (t MongoTrackRepository) Count() (int64, error)
- func (t MongoTrackRepository) CountWithLyrics() (int64, error)
- func (t MongoTrackRepository) CountWithoutLyrics() (int64, error)
- func (t MongoTrackRepository) FindTrack(spotifyID string) (*Track, error)
- func (t MongoTrackRepository) LatestTracks(limit int64) ([]*Track, error)
- func (t MongoTrackRepository) Save(track *Track) error
- func (t MongoTrackRepository) Search(query string, page, limit int, language string) ([]*Track, int, error)
- func (t MongoTrackRepository) TracksWithLyricsError() ([]*Track, error)
- func (t MongoTrackRepository) TracksWithoutLyrics() ([]*Track, error)
- func (t MongoTrackRepository) TracksWithoutLyricsError() ([]*Track, error)
- type Repositories
- type Track
- type TrackRepository
Constants ¶
View Source
const TrackCollection = "tracks"
Variables ¶
View Source
var ( ErrTrackNotFound = errors.New("track not found") ErrTracksNotFound = errors.New("tracks not found") )
Functions ¶
This section is empty.
Types ¶
type MongoTrackRepository ¶
type MongoTrackRepository struct {
// contains filtered or unexported fields
}
func NewMongoTrackRepository ¶
func NewMongoTrackRepository(db *mongo.Database, maxLyricsImportError int) (MongoTrackRepository, error)
func (MongoTrackRepository) AllTracks ¶
func (t MongoTrackRepository) AllTracks(page, limit int) ([]*Track, int, error)
func (MongoTrackRepository) Count ¶
func (t MongoTrackRepository) Count() (int64, error)
func (MongoTrackRepository) CountWithLyrics ¶
func (t MongoTrackRepository) CountWithLyrics() (int64, error)
func (MongoTrackRepository) CountWithoutLyrics ¶
func (t MongoTrackRepository) CountWithoutLyrics() (int64, error)
func (MongoTrackRepository) FindTrack ¶
func (t MongoTrackRepository) FindTrack(spotifyID string) (*Track, error)
func (MongoTrackRepository) LatestTracks ¶
func (t MongoTrackRepository) LatestTracks(limit int64) ([]*Track, error)
func (MongoTrackRepository) Save ¶
func (t MongoTrackRepository) Save(track *Track) error
func (MongoTrackRepository) TracksWithLyricsError ¶
func (t MongoTrackRepository) TracksWithLyricsError() ([]*Track, error)
func (MongoTrackRepository) TracksWithoutLyrics ¶
func (t MongoTrackRepository) TracksWithoutLyrics() ([]*Track, error)
func (MongoTrackRepository) TracksWithoutLyricsError ¶
func (t MongoTrackRepository) TracksWithoutLyricsError() ([]*Track, error)
type Repositories ¶
type Repositories struct { Tracks TrackRepository // contains filtered or unexported fields }
type Track ¶
type Track struct { ID primitive.ObjectID `bson:"_id"` SpotifyID string `bson:"spotify_id"` Artist string `bson:"artist"` AlbumName string `bson:"album_name"` ImageURL string `bson:"image_url"` PreviewURL string `bson:"preview_url"` Name string `bson:"name"` Lyrics string `bson:"lyrics"` LyricsImportErrorCount int `bson:"lyrics_import_error_count"` Loaded bool `bson:"loaded"` Language string `bson:"language"` }
type TrackRepository ¶
type TrackRepository interface { FindTrack(string) (*Track, error) LatestTracks(limit int64) ([]*Track, error) TracksWithoutLyricsError() ([]*Track, error) AllTracks(page, limit int) ([]*Track, int, error) Search(query string, page, limit int, language string) ([]*Track, int, error) Save(track *Track) error Count() (int64, error) CountWithLyrics() (int64, error) }
Click to show internal directories.
Click to hide internal directories.