Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) FetchLibrary() ([]*jamsonic.Artist, error)
- func (c *Client) GetProvider() jamsonic.MusicProvider
- func (c *Client) GetStream(songID string) (io.ReadCloser, error)
- func (c *Client) GetTrackInfo(trackID string) (*jamsonic.Track, error)
- func (c *Client) Host() string
- func (c *Client) ListPlaylistEntries() ([]*jamsonic.PlaylistEntry, error)
- func (c *Client) ListPlaylists() ([]*jamsonic.Playlist, error)
- func (c *Client) ListTracks() ([]*jamsonic.Track, error)
- type Credentials
Constants ¶
This section is empty.
Variables ¶
var ( // CredentialKey is the database key for the credential structure. CredentialKey = []byte("subsonicCredsKey") // ErrAuthenticationFailed is returned if authentication with the server failed. ErrAuthenticationFailed = errors.New("authentication failed") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Credentials // contains filtered or unexported fields }
Client is the Subsonic client which talks to the Subsonic server.
func New ¶
func New(db jamsonic.AuthStore, credRequester jamsonic.CredentialRequester, logger *jamsonic.Logger) (*Client, error)
New returns a new instance of the Subsonic client. If credentials are stored in the storage, the client will use the stored credentials. Otherwise, it will request the user to enter the server url, username, and password on the command line.
func (*Client) FetchLibrary ¶
FetchLibrary gets the library from the server. Library structure:
Artist1{ Album1{ Track1, Track2,... }, Album2{...} } Artist2{...}
func (*Client) GetProvider ¶
func (c *Client) GetProvider() jamsonic.MusicProvider
GetProvider returns the provider identifier.
func (*Client) GetStream ¶
func (c *Client) GetStream(songID string) (io.ReadCloser, error)
GetStream returns a ReadCloser stream of the track. The audio is encoded as a MP3.
func (*Client) GetTrackInfo ¶
GetTrackInfo is an old API and is not implemented for this provider.
func (*Client) ListPlaylistEntries ¶
func (c *Client) ListPlaylistEntries() ([]*jamsonic.PlaylistEntry, error)
ListPlaylistEntries is an old API and is not implemented for this provider.
func (*Client) ListPlaylists ¶
ListPlaylists should return the playlists. Currently this feature is not implemented for this provider.