Documentation
¶
Overview ¶
package handlers implements route handlers
Index ¶
- func CreateAliasHandler(store db.DB) http.HandlerFunc
- func DeleteAlbumHandler(store db.DB) http.HandlerFunc
- func DeleteAliasHandler(store db.DB) http.HandlerFunc
- func DeleteApiKeyHandler(store db.DB) http.HandlerFunc
- func DeleteArtistHandler(store db.DB) http.HandlerFunc
- func DeleteListenHandler(store db.DB) http.HandlerFunc
- func DeleteTrackHandler(store db.DB) http.HandlerFunc
- func GenerateApiKeyHandler(store db.DB) http.HandlerFunc
- func GetAlbumHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetAliasesHandler(store db.DB) http.HandlerFunc
- func GetApiKeysHandler(store db.DB) http.HandlerFunc
- func GetArtistHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetListenActivityHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetListensHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTopAlbumsHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTopArtistsHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTopTracksHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func GetTrackHandler(store db.DB) func(w http.ResponseWriter, r *http.Request)
- func HealthHandler() http.HandlerFunc
- func ImageHandler(store db.DB) http.HandlerFunc
- func LbzSubmitListenHandler(store db.DB, mbzc mbz.MusicBrainzCaller) func(w http.ResponseWriter, r *http.Request)
- func LbzValidateTokenHandler(store db.DB) http.HandlerFunc
- func LoginHandler(store db.DB) http.HandlerFunc
- func LogoutHandler(store db.DB) http.HandlerFunc
- func MeHandler(store db.DB) http.HandlerFunc
- func MergeArtistsHandler(store db.DB) http.HandlerFunc
- func MergeReleaseGroupsHandler(store db.DB) http.HandlerFunc
- func MergeTracksHandler(store db.DB) http.HandlerFunc
- func OptsFromRequest(r *http.Request) db.GetItemsOpts
- func ReplaceImageHandler(store db.DB) http.HandlerFunc
- func SearchHandler(store db.DB) http.HandlerFunc
- func SetPrimaryAliasHandler(store db.DB) http.HandlerFunc
- func StatsHandler(store db.DB) http.HandlerFunc
- func UpdateApiKeyLabelHandler(store db.DB) http.HandlerFunc
- func UpdateUserHandler(store db.DB) http.HandlerFunc
- type LbzAdditionalInfo
- type LbzArtist
- type LbzListenType
- type LbzMBIDMapping
- type LbzSubmitListenPayload
- type LbzSubmitListenRequest
- type LbzTrackMeta
- type LbzValidateResponse
- type ReplaceImageResponse
- type SearchResults
- type StatsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAliasHandler ¶
func CreateAliasHandler(store db.DB) http.HandlerFunc
CreateAliasHandler creates new aliases for a given artist, album, or track.
func DeleteAlbumHandler ¶
func DeleteAlbumHandler(store db.DB) http.HandlerFunc
DeleteAlbumHandler deletes an album by its ID.
func DeleteAliasHandler ¶
func DeleteAliasHandler(store db.DB) http.HandlerFunc
DeleteAliasHandler deletes an alias for a given artist or album ID.
func DeleteApiKeyHandler ¶
func DeleteApiKeyHandler(store db.DB) http.HandlerFunc
func DeleteArtistHandler ¶
func DeleteArtistHandler(store db.DB) http.HandlerFunc
DeleteArtistHandler deletes an artist by its ID.
func DeleteListenHandler ¶
func DeleteListenHandler(store db.DB) http.HandlerFunc
DeleteListenHandler deletes a listen record by track ID and timestamp.
func DeleteTrackHandler ¶
func DeleteTrackHandler(store db.DB) http.HandlerFunc
DeleteTrackHandler deletes a track by its ID.
func GenerateApiKeyHandler ¶
func GenerateApiKeyHandler(store db.DB) http.HandlerFunc
func GetAlbumHandler ¶
func GetAliasesHandler ¶
func GetAliasesHandler(store db.DB) http.HandlerFunc
GetAliasesHandler retrieves all aliases for a given artist or album ID.
func GetApiKeysHandler ¶
func GetApiKeysHandler(store db.DB) http.HandlerFunc
func GetArtistHandler ¶
func GetListensHandler ¶
func GetTopAlbumsHandler ¶
func GetTopArtistsHandler ¶
func GetTopTracksHandler ¶
func GetTrackHandler ¶
func HealthHandler ¶
func HealthHandler() http.HandlerFunc
func ImageHandler ¶
func ImageHandler(store db.DB) http.HandlerFunc
func LbzSubmitListenHandler ¶
func LbzSubmitListenHandler(store db.DB, mbzc mbz.MusicBrainzCaller) func(w http.ResponseWriter, r *http.Request)
func LbzValidateTokenHandler ¶
func LbzValidateTokenHandler(store db.DB) http.HandlerFunc
func LoginHandler ¶
func LoginHandler(store db.DB) http.HandlerFunc
func LogoutHandler ¶
func LogoutHandler(store db.DB) http.HandlerFunc
func MergeArtistsHandler ¶
func MergeArtistsHandler(store db.DB) http.HandlerFunc
func MergeReleaseGroupsHandler ¶
func MergeReleaseGroupsHandler(store db.DB) http.HandlerFunc
func MergeTracksHandler ¶
func MergeTracksHandler(store db.DB) http.HandlerFunc
func OptsFromRequest ¶
func OptsFromRequest(r *http.Request) db.GetItemsOpts
func ReplaceImageHandler ¶
func ReplaceImageHandler(store db.DB) http.HandlerFunc
func SearchHandler ¶
func SearchHandler(store db.DB) http.HandlerFunc
func SetPrimaryAliasHandler ¶
func SetPrimaryAliasHandler(store db.DB) http.HandlerFunc
sets the primary alias for albums, artists, and tracks
func StatsHandler ¶
func StatsHandler(store db.DB) http.HandlerFunc
func UpdateApiKeyLabelHandler ¶
func UpdateApiKeyLabelHandler(store db.DB) http.HandlerFunc
func UpdateUserHandler ¶
func UpdateUserHandler(store db.DB) http.HandlerFunc
Types ¶
type LbzAdditionalInfo ¶
type LbzAdditionalInfo struct {
MediaPlayer string `json:"media_player,omitempty"`
SubmissionClient string `json:"submission_client,omitempty"`
SubmissionClientVersion string `json:"submission_client_version,omitempty"`
ReleaseMBID string `json:"release_mbid,omitempty"`
ReleaseGroupMBID string `json:"release_group_mbid,omitempty"`
ArtistMBIDs []string `json:"artist_mbids,omitempty"`
ArtistNames []string `json:"artist_names,omitempty"`
RecordingMBID string `json:"recording_mbid,omitempty"`
DurationMs int32 `json:"duration_ms,omitempty"`
Duration int32 `json:"duration,omitempty"`
Tags []string `json:"tags,omitempty"`
AlbumArtist string `json:"albumartist,omitempty"`
}
type LbzListenType ¶
type LbzListenType string
const ( ListenTypeSingle LbzListenType = "single" ListenTypePlayingNow LbzListenType = "playing_now" ListenTypeImport LbzListenType = "import" )
type LbzMBIDMapping ¶ added in v0.0.5
type LbzSubmitListenPayload ¶
type LbzSubmitListenPayload struct {
ListenedAt int64 `json:"listened_at,omitempty"`
TrackMeta LbzTrackMeta `json:"track_metadata"`
}
type LbzSubmitListenRequest ¶
type LbzSubmitListenRequest struct {
ListenType LbzListenType `json:"listen_type,omitempty"`
Payload []LbzSubmitListenPayload `json:"payload,omitempty"`
}
type LbzTrackMeta ¶
type LbzTrackMeta struct {
ArtistName string `json:"artist_name"` // required
TrackName string `json:"track_name"` // required
ReleaseName string `json:"release_name,omitempty"`
MBIDMapping LbzMBIDMapping `json:"mbid_mapping"`
AdditionalInfo LbzAdditionalInfo `json:"additional_info,omitempty"`
}
type LbzValidateResponse ¶
type ReplaceImageResponse ¶
type SearchResults ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.