Documentation
¶
Overview ¶
Package api provides the RESTful API of the wavepipe media server.
Index ¶
- Constants
- func APIInfo(r render.Render, params martini.Params)
- func GetAlbums(r render.Render, params martini.Params)
- func GetArtists(r render.Render, req *http.Request, params martini.Params)
- func GetFolders(r render.Render, params martini.Params)
- func GetLogin(r render.Render, req *http.Request, sessionUser *data.User, ...)
- func GetLogout(r render.Render, req *http.Request, session *data.Session, ...)
- func GetSongs(r render.Render, params martini.Params)
- func GetStream(httpRes http.ResponseWriter, r render.Render, params martini.Params)
- func GetTranscode(httpReq *http.Request, httpRes http.ResponseWriter, r render.Render, ...)
- type AlbumsResponse
- type ArtistsResponse
- type Error
- type ErrorResponse
- type FoldersResponse
- type Information
- type LoginResponse
- type SongsResponse
Constants ¶
const APIDocumentation = "https://github.com/mdlayher/wavepipe/blob/master/API.md"
APIDocumentation provides a link to the current API documentation
const APIVersion = "v0"
APIVersion is the current version of the API
Variables ¶
This section is empty.
Functions ¶
func GetAlbums ¶
GetAlbums retrieves one or more albums from wavepipe, and returns a HTTP status and JSON
func GetArtists ¶
GetArtists retrieves one or more artists from wavepipe, and returns a HTTP status and JSON
func GetFolders ¶
GetFolders retrieves one or more folders from wavepipe, and returns a HTTP status and JSON
func GetLogin ¶
GetLogin creates a new session on the wavepipe API, and returns a HTTP status and JSON
func GetLogout ¶
GetLogout destroys a new session from the wavepipe API, and returns a HTTP status and JSON
func GetSongs ¶
GetSongs retrieves one or more songs from wavepipe, and returns a HTTP status and JSON
func GetStream ¶
GetStream a raw, non-transcoded, media file stream from wavepipe. On success, this API will return a binary stream. On failure, it will return a JSON error.
func GetTranscode ¶
func GetTranscode(httpReq *http.Request, httpRes http.ResponseWriter, r render.Render, params martini.Params)
GetTranscode returns a transcoded media file stream from wavepipe. On success, this API will return a binary transcode. On failure, it will return a JSON error.
Types ¶
type AlbumsResponse ¶
type AlbumsResponse struct {
Error *Error `json:"error"`
Albums []data.Album `json:"albums"`
Songs []data.Song `json:"songs"`
// contains filtered or unexported fields
}
AlbumsResponse represents the JSON response for /api/albums
func (*AlbumsResponse) RenderError ¶
func (a *AlbumsResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*AlbumsResponse) ServerError ¶
func (a *AlbumsResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message
type ArtistsResponse ¶
type ArtistsResponse struct {
Error *Error `json:"error"`
Artists []data.Artist `json:"artists"`
Albums []data.Album `json:"albums"`
Songs []data.Song `json:"songs"`
// contains filtered or unexported fields
}
ArtistsResponse represents the JSON response for /api/artists
func (*ArtistsResponse) RenderError ¶
func (a *ArtistsResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*ArtistsResponse) ServerError ¶
func (a *ArtistsResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message
type ErrorResponse ¶
type ErrorResponse struct {
Error *Error `json:"error"`
// contains filtered or unexported fields
}
ErrorResponse represents the JSON response for endpoints which only return an error
func (*ErrorResponse) RenderError ¶
func (e *ErrorResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*ErrorResponse) ServerError ¶
func (e *ErrorResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message
type FoldersResponse ¶
type FoldersResponse struct {
Error *Error `json:"error"`
Folders []data.Folder `json:"folders"`
Subfolders []data.Folder `json:"subfolders"`
Songs []data.Song `json:"songs"`
// contains filtered or unexported fields
}
FoldersResponse represents the JSON response for /api/folders
func (*FoldersResponse) RenderError ¶
func (f *FoldersResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*FoldersResponse) ServerError ¶
func (f *FoldersResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message
type Information ¶
type Information struct {
Error *Error `json:"error"`
Version string `json:"version"`
Supported []string `json:"supported"`
Documentation string `json:"documentation"`
Endpoints []string `json:"endpoints"`
}
Information represents information about the API
type LoginResponse ¶
type LoginResponse struct {
Error *Error `json:"error"`
Session *data.Session `json:"session"`
// contains filtered or unexported fields
}
LoginResponse represents the JSON response for /api/logins
func (*LoginResponse) RenderError ¶
func (l *LoginResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*LoginResponse) ServerError ¶
func (l *LoginResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message
type SongsResponse ¶
type SongsResponse struct {
Error *Error `json:"error"`
Songs []data.Song `json:"songs"`
// contains filtered or unexported fields
}
SongsResponse represents the JSON response for /api/songs
func (*SongsResponse) RenderError ¶
func (s *SongsResponse) RenderError(code int, message string)
RenderError renders a JSON error message with the specified HTTP status code and message
func (*SongsResponse) ServerError ¶
func (s *SongsResponse) ServerError()
ServerError is a shortcut to render a HTTP 500 with generic "server error" message