Documentation
¶
Index ¶
- Constants
- func H(r chi.Router, path string, f Handler)
- func HGone(r chi.Router, path string)
- func NewError(code int, message ...interface{}) error
- func NewResponse() *responses.Subsonic
- func RequiredParamInt(r *http.Request, param string, msg string) (int, error)
- func RequiredParamString(r *http.Request, param string, msg string) (string, error)
- func RequiredParamStrings(r *http.Request, param string, msg string) ([]string, error)
- func SendError(w http.ResponseWriter, r *http.Request, err error)
- func SendResponse(w http.ResponseWriter, r *http.Request, payload *responses.Subsonic)
- func ToAlbum(entry engine.Entry) responses.Child
- func ToAlbums(entries engine.Entries) []responses.Child
- func ToArtists(entries engine.Entries) []responses.Artist
- func ToChild(entry engine.Entry) responses.Child
- func ToChildren(entries engine.Entries) []responses.Child
- func ToGenres(genres model.Genres) *responses.Genres
- type AlbumListController
- func (c *AlbumListController) GetAlbumList(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *AlbumListController) GetAlbumList2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *AlbumListController) GetNowPlaying(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *AlbumListController) GetRandomSongs(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *AlbumListController) GetStarred(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *AlbumListController) GetStarred2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- type BrowsingController
- func (c *BrowsingController) GetAlbum(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetArtist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetArtistInfo(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetArtistInfo2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetArtists(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetGenres(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetIndexes(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetMusicDirectory(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetMusicFolders(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *BrowsingController) GetSong(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- type Handler
- type MediaAnnotationController
- func (c *MediaAnnotationController) Scrobble(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *MediaAnnotationController) SetRating(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *MediaAnnotationController) Star(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *MediaAnnotationController) Unstar(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- type MediaRetrievalController
- type PlaylistsController
- func (c *PlaylistsController) CreatePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *PlaylistsController) DeletePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *PlaylistsController) GetPlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *PlaylistsController) GetPlaylists(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- func (c *PlaylistsController) UpdatePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
- type Router
- type SearchingController
- type StreamController
- type SubsonicError
- type SystemController
- type UsersController
Constants ¶
View Source
const Version = "1.8.0"
Variables ¶
This section is empty.
Functions ¶
func H ¶
Add the Subsonic handler, with and without `.view` extension Ex: if path = `ping` it will create the routes `/ping` and `/ping.view`
func HGone ¶
Add a handler that returns 410 - Gone. Used to signal that an endpoint will not be implemented
func NewResponse ¶
func RequiredParamInt ¶
func RequiredParamString ¶
func RequiredParamStrings ¶
func SendResponse ¶
Types ¶
type AlbumListController ¶
type AlbumListController struct {
// contains filtered or unexported fields
}
func NewAlbumListController ¶
func NewAlbumListController(listGen engine.ListGenerator) *AlbumListController
func (*AlbumListController) GetAlbumList ¶
func (c *AlbumListController) GetAlbumList(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*AlbumListController) GetAlbumList2 ¶
func (c *AlbumListController) GetAlbumList2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*AlbumListController) GetNowPlaying ¶
func (c *AlbumListController) GetNowPlaying(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*AlbumListController) GetRandomSongs ¶
func (c *AlbumListController) GetRandomSongs(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*AlbumListController) GetStarred ¶
func (c *AlbumListController) GetStarred(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*AlbumListController) GetStarred2 ¶
func (c *AlbumListController) GetStarred2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type BrowsingController ¶
type BrowsingController struct {
// contains filtered or unexported fields
}
func NewBrowsingController ¶
func NewBrowsingController(browser engine.Browser) *BrowsingController
func (*BrowsingController) GetAlbum ¶
func (c *BrowsingController) GetAlbum(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetArtist ¶
func (c *BrowsingController) GetArtist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetArtistInfo ¶ added in v0.7.3
func (c *BrowsingController) GetArtistInfo(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
TODO Integrate with Last.FM
func (*BrowsingController) GetArtistInfo2 ¶ added in v0.7.3
func (c *BrowsingController) GetArtistInfo2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
TODO Integrate with Last.FM
func (*BrowsingController) GetArtists ¶
func (c *BrowsingController) GetArtists(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetGenres ¶
func (c *BrowsingController) GetGenres(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetIndexes ¶
func (c *BrowsingController) GetIndexes(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetMusicDirectory ¶
func (c *BrowsingController) GetMusicDirectory(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetMusicFolders ¶
func (c *BrowsingController) GetMusicFolders(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*BrowsingController) GetSong ¶
func (c *BrowsingController) GetSong(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type MediaAnnotationController ¶
type MediaAnnotationController struct {
// contains filtered or unexported fields
}
func NewMediaAnnotationController ¶
func NewMediaAnnotationController(scrobbler engine.Scrobbler, ratings engine.Ratings) *MediaAnnotationController
func (*MediaAnnotationController) Scrobble ¶
func (c *MediaAnnotationController) Scrobble(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*MediaAnnotationController) SetRating ¶
func (c *MediaAnnotationController) SetRating(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*MediaAnnotationController) Star ¶
func (c *MediaAnnotationController) Star(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*MediaAnnotationController) Unstar ¶
func (c *MediaAnnotationController) Unstar(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type MediaRetrievalController ¶
type MediaRetrievalController struct {
// contains filtered or unexported fields
}
func NewMediaRetrievalController ¶
func NewMediaRetrievalController(cover engine.Cover) *MediaRetrievalController
func (*MediaRetrievalController) GetAvatar ¶
func (c *MediaRetrievalController) GetAvatar(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*MediaRetrievalController) GetCoverArt ¶
func (c *MediaRetrievalController) GetCoverArt(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type PlaylistsController ¶
type PlaylistsController struct {
// contains filtered or unexported fields
}
func NewPlaylistsController ¶
func NewPlaylistsController(pls engine.Playlists) *PlaylistsController
func (*PlaylistsController) CreatePlaylist ¶
func (c *PlaylistsController) CreatePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*PlaylistsController) DeletePlaylist ¶
func (c *PlaylistsController) DeletePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*PlaylistsController) GetPlaylist ¶
func (c *PlaylistsController) GetPlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*PlaylistsController) GetPlaylists ¶
func (c *PlaylistsController) GetPlaylists(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*PlaylistsController) UpdatePlaylist ¶
func (c *PlaylistsController) UpdatePlaylist(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type Router ¶
type Router struct {
Browser engine.Browser
Cover engine.Cover
ListGenerator engine.ListGenerator
Playlists engine.Playlists
Ratings engine.Ratings
Scrobbler engine.Scrobbler
Search engine.Search
Users engine.Users
Streamer engine.MediaStreamer
// contains filtered or unexported fields
}
type SearchingController ¶
type SearchingController struct {
// contains filtered or unexported fields
}
func NewSearchingController ¶
func NewSearchingController(search engine.Search) *SearchingController
func (*SearchingController) Search2 ¶
func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*SearchingController) Search3 ¶
func (c *SearchingController) Search3(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type StreamController ¶
type StreamController struct {
// contains filtered or unexported fields
}
func NewStreamController ¶
func NewStreamController(streamer engine.MediaStreamer) *StreamController
func (*StreamController) Download ¶
func (c *StreamController) Download(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*StreamController) Stream ¶
func (c *StreamController) Stream(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type SubsonicError ¶
type SubsonicError struct {
// contains filtered or unexported fields
}
func (SubsonicError) Error ¶
func (e SubsonicError) Error() string
type SystemController ¶
type SystemController struct{}
func NewSystemController ¶
func NewSystemController() *SystemController
func (*SystemController) GetLicense ¶
func (c *SystemController) GetLicense(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
func (*SystemController) Ping ¶
func (c *SystemController) Ping(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
type UsersController ¶
type UsersController struct{}
func NewUsersController ¶
func NewUsersController() *UsersController
func (*UsersController) GetUser ¶
func (c *UsersController) GetUser(w http.ResponseWriter, r *http.Request) (*responses.Subsonic, error)
TODO This is a placeholder. The real one has to read this info from a config file or the database
Source Files
¶
Click to show internal directories.
Click to hide internal directories.