Documentation
¶
Index ¶
- type AlbumService
- func (s *AlbumService) AlbumHasCover(albumID uuid.UUID, format string) bool
- func (s *AlbumService) AssignAlbumCoverByPath(albumID uuid.UUID, sourcePath string, format string) error
- func (s *AlbumService) CreateAlbum(title string, releaseDate time.Time, artistName string) (*model.Album, error)
- func (s *AlbumService) DeleteAlbum(album *model.Album) error
- func (s *AlbumService) GetAlbumByID(uuid uuid.UUID) (*model.Album, error)
- func (s *AlbumService) GetAlbumCoverPath(id uuid.UUID, format string, res string) string
- func (s *AlbumService) GetOrCreateAlbum(title string, artists []model.Artist) (*model.Album, error)
- func (s *AlbumService) UpdateAlbum(id uuid.UUID, title string, releaseDate time.Time) (*model.Album, error)
- func (s *AlbumService) WriteAlbumCover(albumID uuid.UUID, data io.Reader, id string, format string) error
- type ArtistService
- func (s *ArtistService) AddIdentifierToArtist(artistID uuid.UUID, identifier string) error
- func (s *ArtistService) CreateArtist(name string, identifiers []string) (*model.Artist, error)
- func (s *ArtistService) DeleteArtist(id uuid.UUID) error
- func (s *ArtistService) GetArtistByIdentifier(identifier string) (*model.Artist, error)
- func (s *ArtistService) UpdateArtist(id uuid.UUID, name string) (*model.Artist, error)
- type BandwidthPoint
- type FileStorage
- type MailService
- func (ms *MailService) CreateRequestMail(category, message string, userID uuid.UUID) (*model.RequestMail, error)
- func (ms *MailService) GetCategories() []string
- func (ms *MailService) GetNextRequestMail() (*model.RequestMail, error)
- func (ms *MailService) GetRequestMails() []model.RequestMail
- func (ms *MailService) SetStatus(mailID uint, status int) error
- type PlaylistService
- func (ps *PlaylistService) CreatePlaylist(playlistID uuid.UUID, userID uuid.UUID, name string, parentFolder uuid.UUID, ...) (model.Playlist, error)
- func (ps *PlaylistService) CreatePlaylistFolder(folderID uuid.UUID, userID uuid.UUID, name string, parentFolder *uuid.UUID) (model.PlaylistFolder, error)
- func (ps *PlaylistService) CreatePlaylistWithContents(userID uuid.UUID, name string, songIDs []uuid.UUID) (model.Playlist, error)
- func (ps *PlaylistService) GetRootFolderID(userID uuid.UUID) (uuid.UUID, error)
- type SearchArtist
- type SearchResult
- type SearchService
- func (s *SearchService) DeleteAllDocuments() error
- func (s *SearchService) DeleteDocument(id uuid.UUID) error
- func (s *SearchService) IndexAlbum(album *model.Album) error
- func (s *SearchService) IndexAlbums(albums []model.Album) error
- func (s *SearchService) IndexArtist(artist *model.Artist) error
- func (s *SearchService) IndexArtists(artists []model.Artist) error
- func (s *SearchService) IndexPlaylist(playlist *model.Playlist) error
- func (s *SearchService) IndexPlaylists(playlists []model.Playlist) error
- func (s *SearchService) IndexSong(song *model.Song) error
- func (s *SearchService) IndexSongs(songs []model.Song) error
- func (s *SearchService) Search(query string, limit int, filterType string) ([]SearchResult, error)
- type SongCreationArtist
- type SongService
- func (s *SongService) AssignFileToSong(songID uuid.UUID, format string, data io.Reader) (*model.SongFile, error)
- func (s *SongService) AssignFileToSongByPath(songID uuid.UUID, sourcePath string) (*model.SongFile, error)
- func (s *SongService) CreateSong(title string, artistsInput []SongCreationArtist, albumTitle string, ...) (*model.Song, error)
- func (s *SongService) DeleteSong(songID uuid.UUID) error
- func (s *SongService) DeleteSongFile(fileID uuid.UUID) error
- func (s *SongService) GetSongFiles(songID uuid.UUID) ([]model.SongFile, error)
- func (s *SongService) GetSongsByAlbumID(albumID uuid.UUID) ([]model.Song, error)
- func (s *SongService) ProbeDuration(path string) (float64, error)
- func (s *SongService) UpdateSong(songID uuid.UUID, title string, artistsInput []SongCreationArtist, ...) (*model.Song, error)
- type StatsService
- type UserService
- func (s *UserService) CheckPassword(user *model.User, password string) error
- func (s *UserService) CreateUser(username, password string) (*model.User, error)
- func (s *UserService) DeleteUser(user *model.User) error
- func (s *UserService) GenerateToken(user *model.User) (string, error)
- func (s *UserService) GetUserByUsername(username string) (*model.User, error)
- func (s *UserService) UpdatePassword(user *model.User, newPassword string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlbumService ¶
type AlbumService struct {
Store *store.AlbumStore
Storage FileStorage
SearchSvc *SearchService
}
func (*AlbumService) AlbumHasCover ¶
func (s *AlbumService) AlbumHasCover(albumID uuid.UUID, format string) bool
func (*AlbumService) AssignAlbumCoverByPath ¶
func (*AlbumService) CreateAlbum ¶
func (*AlbumService) DeleteAlbum ¶
func (s *AlbumService) DeleteAlbum(album *model.Album) error
func (*AlbumService) GetAlbumByID ¶
func (*AlbumService) GetAlbumCoverPath ¶
func (*AlbumService) GetOrCreateAlbum ¶
func (*AlbumService) UpdateAlbum ¶
func (*AlbumService) WriteAlbumCover ¶
type ArtistService ¶
type ArtistService struct {
Store *store.ArtistStore
SearchSvc *SearchService
}
func (*ArtistService) AddIdentifierToArtist ¶
func (s *ArtistService) AddIdentifierToArtist(artistID uuid.UUID, identifier string) error
func (*ArtistService) CreateArtist ¶
func (*ArtistService) DeleteArtist ¶
func (s *ArtistService) DeleteArtist(id uuid.UUID) error
func (*ArtistService) GetArtistByIdentifier ¶
func (s *ArtistService) GetArtistByIdentifier(identifier string) (*model.Artist, error)
func (*ArtistService) UpdateArtist ¶
type BandwidthPoint ¶
type FileStorage ¶
type MailService ¶
type MailService struct {
Store *store.MailStore
SettingsStore *store.SettingsStore
}
func NewMailService ¶
func NewMailService(store *store.MailStore, settingsStore *store.SettingsStore) *MailService
func (*MailService) CreateRequestMail ¶
func (ms *MailService) CreateRequestMail(category, message string, userID uuid.UUID) (*model.RequestMail, error)
func (*MailService) GetCategories ¶
func (ms *MailService) GetCategories() []string
func (*MailService) GetNextRequestMail ¶
func (ms *MailService) GetNextRequestMail() (*model.RequestMail, error)
func (*MailService) GetRequestMails ¶
func (ms *MailService) GetRequestMails() []model.RequestMail
type PlaylistService ¶
type PlaylistService struct {
Store *store.PlaylistStore
SearchSvc *SearchService
}
func NewPlaylistService ¶
func NewPlaylistService(store *store.PlaylistStore) *PlaylistService
func (*PlaylistService) CreatePlaylist ¶
func (*PlaylistService) CreatePlaylistFolder ¶
func (*PlaylistService) CreatePlaylistWithContents ¶
func (*PlaylistService) GetRootFolderID ¶
type SearchArtist ¶
type SearchResult ¶
type SearchResult struct {
ID uuid.UUID `json:"id"`
Type string `json:"type"` // "song", "artist", "album", "playlist"
Title string `json:"title"`
Sub *string `json:"sub,omitempty"` // Artist name for songs
// For songs
Artists []SearchArtist `json:"artists,omitempty"`
AlbumID *uuid.UUID `json:"album_id,omitempty"`
AlbumTitle *string `json:"album_title,omitempty"`
}
type SearchService ¶
type SearchService struct {
// contains filtered or unexported fields
}
func NewSearchService ¶
func NewSearchService() (*SearchService, error)
func (*SearchService) DeleteAllDocuments ¶
func (s *SearchService) DeleteAllDocuments() error
func (*SearchService) DeleteDocument ¶
func (s *SearchService) DeleteDocument(id uuid.UUID) error
func (*SearchService) IndexAlbum ¶
func (s *SearchService) IndexAlbum(album *model.Album) error
func (*SearchService) IndexAlbums ¶
func (s *SearchService) IndexAlbums(albums []model.Album) error
func (*SearchService) IndexArtist ¶
func (s *SearchService) IndexArtist(artist *model.Artist) error
func (*SearchService) IndexArtists ¶
func (s *SearchService) IndexArtists(artists []model.Artist) error
func (*SearchService) IndexPlaylist ¶
func (s *SearchService) IndexPlaylist(playlist *model.Playlist) error
func (*SearchService) IndexPlaylists ¶
func (s *SearchService) IndexPlaylists(playlists []model.Playlist) error
func (*SearchService) IndexSongs ¶
func (s *SearchService) IndexSongs(songs []model.Song) error
func (*SearchService) Search ¶
func (s *SearchService) Search(query string, limit int, filterType string) ([]SearchResult, error)
type SongCreationArtist ¶
type SongService ¶
type SongService struct {
Store *store.SongStore
Storage FileStorage
ArtistSvc *ArtistService
AlbumSvc *AlbumService
SearchSvc *SearchService
}
func (*SongService) AssignFileToSong ¶
func (*SongService) AssignFileToSongByPath ¶
func (*SongService) CreateSong ¶
func (s *SongService) CreateSong(title string, artistsInput []SongCreationArtist, albumTitle string, albumID uuid.UUID) (*model.Song, error)
func (*SongService) DeleteSong ¶
func (s *SongService) DeleteSong(songID uuid.UUID) error
func (*SongService) DeleteSongFile ¶
func (s *SongService) DeleteSongFile(fileID uuid.UUID) error
func (*SongService) GetSongFiles ¶
func (*SongService) GetSongsByAlbumID ¶
func (*SongService) ProbeDuration ¶
func (s *SongService) ProbeDuration(path string) (float64, error)
func (*SongService) UpdateSong ¶
type StatsService ¶
type StatsService struct {
// contains filtered or unexported fields
}
func NewStatsService ¶
func NewStatsService() *StatsService
func (*StatsService) GetBandwidthHistory ¶
func (s *StatsService) GetBandwidthHistory() []BandwidthPoint
func (*StatsService) RecordIncoming ¶
func (s *StatsService) RecordIncoming(bytes int64)
func (*StatsService) RecordOutgoing ¶
func (s *StatsService) RecordOutgoing(bytes int64)
type UserService ¶
type UserService struct {
Store *store.UserStore
PlaylistService *PlaylistService
JWTSecret string
}
func (*UserService) CheckPassword ¶
func (s *UserService) CheckPassword(user *model.User, password string) error
func (*UserService) CreateUser ¶
func (s *UserService) CreateUser(username, password string) (*model.User, error)
func (*UserService) DeleteUser ¶
func (s *UserService) DeleteUser(user *model.User) error
func (*UserService) GenerateToken ¶
func (s *UserService) GenerateToken(user *model.User) (string, error)
func (*UserService) GetUserByUsername ¶
func (s *UserService) GetUserByUsername(username string) (*model.User, error)
func (*UserService) UpdatePassword ¶
func (s *UserService) UpdatePassword(user *model.User, newPassword string) error
Click to show internal directories.
Click to hide internal directories.