Documentation
¶
Index ¶
- func LoggerMiddleware(logger slog.Logger, excludePaths []string) func(http.Handler) http.Handler
- type ErrBadParameter
- type ErrIDNotFound
- type ErrParamNotDefined
- type ErrUnauthorized
- type ImageType
- type ReqAlbumArtistsGet
- type ReqAlbumTracksGet
- type ReqAlbumsAlbumArtistGet
- type ReqAlbumsAlbumTrackGet
- type ReqAlbumsGet
- type ReqAlbumsTrackGet
- type ReqAlbumsUpdate
- type ReqArtistsCreate
- type ReqArtistsGet
- type ReqArtistsUpdate
- type ReqDevicesGet
- type ReqDevicesPlayerAddToQueue
- type ReqDevicesPlayerSetRepeat
- type ReqDevicesPlayerSetShuffle
- type ReqDevicesPlayerSetState
- type ReqDevicesRegister
- type ReqDevicesUpdatePlayContext
- type ReqDevicesUpdatePlaybackState
- type ReqImportAlbum
- type ReqImportSearchMb
- type ReqLikesGet
- type ReqList
- type ReqListPagination
- type ReqListPlaylistTracks
- type ReqListPlaylists
- type ReqListTrackPagination
- type ReqListTracksOfAlbum
- type ReqMediaFilesGet
- type ReqMediaFilesGetFile
- type ReqNoContent
- type ReqPlaylistTracksGet
- type ReqPlaylistsAddTrack
- type ReqPlaylistsGet
- type ReqPlaylistsUpdate
- type ReqRatingsGet
- type ReqSearch
- type ReqSmartPlaylistArtistGet
- type ReqSmartPlaylistContentGet
- type ReqSyncPlayHistory
- type ReqSyncSync
- type ReqTokensBase
- type ReqTrackAnalysisGet
- type ReqTrackArtistsGet
- type ReqTracksAddRating
- type ReqTracksGet
- type ReqTracksUpdate
- type ReqUsersApiTokenCreate
- type ReqUsersBase
- type ReqUsersCreate
- type ReqUsersList
- type ReqUsersTokenDelete
- type ReqUsersUpdate
- type ReqUsersUpdateProfile
- type Request
- type Request1
- type Response
- type Server
- type ServerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrBadParameter ¶
type ErrBadParameter struct {
// contains filtered or unexported fields
}
func (ErrBadParameter) Error ¶
func (e ErrBadParameter) Error() string
func (ErrBadParameter) UserError ¶
func (e ErrBadParameter) UserError() string
type ErrIDNotFound ¶
type ErrIDNotFound struct {
// contains filtered or unexported fields
}
func (ErrIDNotFound) Error ¶
func (e ErrIDNotFound) Error() string
func (ErrIDNotFound) UserError ¶
func (e ErrIDNotFound) UserError() string
type ErrParamNotDefined ¶
type ErrParamNotDefined struct {
// contains filtered or unexported fields
}
func (ErrParamNotDefined) Error ¶
func (e ErrParamNotDefined) Error() string
func (ErrParamNotDefined) UserError ¶
func (e ErrParamNotDefined) UserError() string
type ErrUnauthorized ¶
type ErrUnauthorized struct{}
func (ErrUnauthorized) Error ¶
func (e ErrUnauthorized) Error() string
func (ErrUnauthorized) UserError ¶
func (e ErrUnauthorized) UserError() string
type ReqAlbumArtistsGet ¶
type ReqAlbumArtistsGet struct {
AlbumArtistID uuid.UUID `path:"albumArtistID" description:"ID of the wanted album artist"`
}
func (ReqAlbumArtistsGet) Validate ¶
func (r ReqAlbumArtistsGet) Validate() (validationMessages string, err error)
type ReqAlbumTracksGet ¶
type ReqAlbumTracksGet struct {
AlbumTrackID uuid.UUID `path:"albumTrackID" description:"ID of the wanted album track"`
}
func (ReqAlbumTracksGet) Validate ¶
func (r ReqAlbumTracksGet) Validate() (validationMessages string, err error)
type ReqAlbumsAlbumArtistGet ¶
type ReqAlbumsAlbumArtistGet struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album"`
ArtistID uuid.UUID `path:"artistID" description:"ID of the wanted artist"`
Role types.ArtistRole `path:"role" description:"Role of the wanted artist"`
}
func (ReqAlbumsAlbumArtistGet) Validate ¶
func (r ReqAlbumsAlbumArtistGet) Validate() (validationMessages string, err error)
type ReqAlbumsAlbumTrackGet ¶
type ReqAlbumsAlbumTrackGet struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album track"`
DiscNumber int `path:"discNumber" description:"Disc number of the wanted album track"`
TrackNumber int `path:"trackNumber" description:"Track number of the wanted album track"`
}
func (ReqAlbumsAlbumTrackGet) Validate ¶
func (r ReqAlbumsAlbumTrackGet) Validate() (validationMessages string, err error)
type ReqAlbumsGet ¶
type ReqAlbumsGet struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album"`
}
func (ReqAlbumsGet) Validate ¶
func (r ReqAlbumsGet) Validate() (validationMessages string, err error)
type ReqAlbumsTrackGet ¶
type ReqAlbumsTrackGet struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album"`
TrackID uuid.UUID `path:"trackID" description:"ID of the wanted track"`
}
func (ReqAlbumsTrackGet) Validate ¶
func (r ReqAlbumsTrackGet) Validate() (validationMessages string, err error)
type ReqAlbumsUpdate ¶
type ReqAlbumsUpdate struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album"`
types.AlbumUpdate
}
func (ReqAlbumsUpdate) Validate ¶
func (r ReqAlbumsUpdate) Validate() (validationMessages string, err error)
type ReqArtistsCreate ¶
type ReqArtistsCreate struct {
types.ArtistBase
}
func (ReqArtistsCreate) Validate ¶
func (r ReqArtistsCreate) Validate() (validationMessages string, err error)
type ReqArtistsGet ¶
type ReqArtistsGet struct {
ArtistID uuid.UUID `path:"artistID" description:"ID of the wanted artist"`
}
func (ReqArtistsGet) Validate ¶
func (r ReqArtistsGet) Validate() (validationMessages string, err error)
type ReqArtistsUpdate ¶
type ReqArtistsUpdate struct {
ArtistID uuid.UUID `path:"artistID" description:"ID of the wanted artist"`
types.ArtistBase
}
func (ReqArtistsUpdate) Validate ¶
func (r ReqArtistsUpdate) Validate() (validationMessages string, err error)
type ReqDevicesGet ¶
type ReqDevicesGet struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
}
func (ReqDevicesGet) Validate ¶
func (r ReqDevicesGet) Validate() (validationMessages string, err error)
type ReqDevicesPlayerAddToQueue ¶
type ReqDevicesPlayerAddToQueue struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.TrackDetailed
}
func (ReqDevicesPlayerAddToQueue) Validate ¶
func (r ReqDevicesPlayerAddToQueue) Validate() (validationMessages string, err error)
type ReqDevicesPlayerSetRepeat ¶
type ReqDevicesPlayerSetRepeat struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.SetDevicePlayerRepeatReq
}
func (ReqDevicesPlayerSetRepeat) Validate ¶
func (r ReqDevicesPlayerSetRepeat) Validate() (validationMessages string, err error)
type ReqDevicesPlayerSetShuffle ¶
type ReqDevicesPlayerSetShuffle struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.SetDevicePlayerShuffleReq
}
func (ReqDevicesPlayerSetShuffle) Validate ¶
func (r ReqDevicesPlayerSetShuffle) Validate() (validationMessages string, err error)
type ReqDevicesPlayerSetState ¶
type ReqDevicesPlayerSetState struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.PlayerState
}
func (ReqDevicesPlayerSetState) Validate ¶
func (r ReqDevicesPlayerSetState) Validate() (validationMessages string, err error)
type ReqDevicesRegister ¶
type ReqDevicesRegister struct {
types.ReqDevicesRegister
}
func (ReqDevicesRegister) Validate ¶
func (r ReqDevicesRegister) Validate() (validationMessages string, err error)
type ReqDevicesUpdatePlayContext ¶
type ReqDevicesUpdatePlayContext struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.PlayContextDTO
}
func (ReqDevicesUpdatePlayContext) Validate ¶
func (r ReqDevicesUpdatePlayContext) Validate() (validationMessages string, err error)
type ReqDevicesUpdatePlaybackState ¶
type ReqDevicesUpdatePlaybackState struct {
DeviceID uuid.UUID `path:"deviceID" description:"ID of the wanted device"`
types.PlaybackStateDTO
}
func (ReqDevicesUpdatePlaybackState) Validate ¶
func (r ReqDevicesUpdatePlaybackState) Validate() (validationMessages string, err error)
type ReqImportAlbum ¶
type ReqImportAlbum struct {
File []byte `form:"file" required:"true" description:"Zip file content" json:"-"`
Metadata types.ImportAlbum `form:"metadata" required:"true" description:"Additional metadata" json:"-"`
}
func (ReqImportAlbum) Validate ¶
func (r ReqImportAlbum) Validate() (validationMessages string, err error)
type ReqImportSearchMb ¶
type ReqImportSearchMb struct {
Artist string `query:"artist" description:"The name of the artist."`
Album string `query:"album" description:"The name of the album."`
}
func (ReqImportSearchMb) Validate ¶
func (r ReqImportSearchMb) Validate() (validationMessages string, err error)
type ReqLikesGet ¶
func (ReqLikesGet) Validate ¶
func (r ReqLikesGet) Validate() (validationMessages string, err error)
type ReqList ¶
type ReqListPagination ¶
type ReqListPagination struct {
SortOrder database.SortOrder `query:"sortOrder" description:"Sort ascending or descending."`
SortBy database.SortBy `query:"sortBy" description:"Sort by key."`
Page int `query:"page" description:"The page of data wanted."`
Limit int `query:"limit" description:"Number of results per page."`
}
func (ReqListPagination) Validate ¶
func (r ReqListPagination) Validate() (validationMessages string, err error)
type ReqListPlaylistTracks ¶
type ReqListPlaylistTracks struct {
PlaylistID uuid.UUID `path:"playlistID" description:"ID of the wanted playlist"`
Count bool `query:"count" description:"Only return the count, not the payload."`
SortOrder database.SortOrder `query:"sortOrder" description:"Sort ascending or descending."`
SortBy database.SortBy `query:"sortBy" description:"Sort by key."`
}
func (ReqListPlaylistTracks) Validate ¶
func (r ReqListPlaylistTracks) Validate() (validationMessages string, err error)
type ReqListPlaylists ¶
type ReqListPlaylists struct {
Count bool `query:"count" description:"Only return the count, not the payload."`
SortOrder database.SortOrder `query:"sortOrder" description:"Sort ascending or descending."`
SortBy database.SortBy `query:"sortBy" description:"Sort by key."`
IncludePublic bool `query:"includePublic" description:"Include public playlists"`
}
func (ReqListPlaylists) Validate ¶
func (r ReqListPlaylists) Validate() (validationMessages string, err error)
type ReqListTrackPagination ¶
type ReqListTrackPagination struct {
types.TrackFilter
Page int `query:"page" description:"The page of data wanted."`
Limit int `query:"limit" description:"Number of results per page."`
}
func (ReqListTrackPagination) Validate ¶
func (r ReqListTrackPagination) Validate() (validationMessages string, err error)
type ReqListTracksOfAlbum ¶
type ReqListTracksOfAlbum struct {
AlbumID uuid.UUID `path:"albumID" description:"ID of the wanted album"`
Count bool `query:"count" description:"Only return the count, not the payload."`
}
func (ReqListTracksOfAlbum) Validate ¶
func (r ReqListTracksOfAlbum) Validate() (validationMessages string, err error)
type ReqMediaFilesGet ¶
type ReqMediaFilesGet struct {
MediafileID uuid.UUID `path:"mediafileID" description:"ID of the wanted media file"`
}
func (ReqMediaFilesGet) Validate ¶
func (r ReqMediaFilesGet) Validate() (validationMessages string, err error)
type ReqMediaFilesGetFile ¶
type ReqMediaFilesGetFile struct {
MediafileID uuid.UUID `path:"mediafileID" description:"ID of the wanted media file"`
Range string `header:"Range" description:"Optional HTTP Range header for partial content retrieval." example:"bytes=0-1023"`
}
func (ReqMediaFilesGetFile) Validate ¶
func (r ReqMediaFilesGetFile) Validate() (validationMessages string, err error)
type ReqNoContent ¶
type ReqNoContent struct{}
func (ReqNoContent) Validate ¶
func (r ReqNoContent) Validate() (validationMessages string, err error)
type ReqPlaylistTracksGet ¶
type ReqPlaylistTracksGet struct {
PlaylistTrackID uuid.UUID `path:"playlistTrackID" description:"ID of the wanted playlist track"`
}
func (ReqPlaylistTracksGet) Validate ¶
func (r ReqPlaylistTracksGet) Validate() (validationMessages string, err error)
type ReqPlaylistsAddTrack ¶
type ReqPlaylistsAddTrack struct {
PlaylistID uuid.UUID `path:"playlistID" description:"ID of the wanted playlist"`
types.PlaylistTrackReq
}
func (ReqPlaylistsAddTrack) Validate ¶
func (r ReqPlaylistsAddTrack) Validate() (validationMessages string, err error)
type ReqPlaylistsGet ¶
type ReqPlaylistsGet struct {
PlaylistID uuid.UUID `path:"playlistID" description:"ID of the wanted playlist"`
}
func (ReqPlaylistsGet) Validate ¶
func (r ReqPlaylistsGet) Validate() (validationMessages string, err error)
type ReqPlaylistsUpdate ¶
type ReqPlaylistsUpdate struct {
PlaylistID uuid.UUID `path:"playlistID" description:"ID of the wanted playlist"`
types.PlaylistBase
}
func (ReqPlaylistsUpdate) Validate ¶
func (r ReqPlaylistsUpdate) Validate() (validationMessages string, err error)
type ReqRatingsGet ¶
type ReqRatingsGet struct {
RatingID uuid.UUID `path:"ratingID" description:"ID of the wanted rating"`
}
func (ReqRatingsGet) Validate ¶
func (r ReqRatingsGet) Validate() (validationMessages string, err error)
type ReqSearch ¶
type ReqSearch struct {
SearchTerm string `query:"q" description:"Free text search string"`
}
type ReqSmartPlaylistArtistGet ¶
type ReqSmartPlaylistArtistGet struct {
ID uuid.UUID `path:"artistID" description:"ID of the wanted smart playlist artist"`
}
func (ReqSmartPlaylistArtistGet) Validate ¶
func (r ReqSmartPlaylistArtistGet) Validate() (validationMessages string, err error)
type ReqSmartPlaylistContentGet ¶
type ReqSmartPlaylistContentGet struct {
ID uuid.UUID `path:"contentID" description:"ID of the wanted smart playlist content"`
}
func (ReqSmartPlaylistContentGet) Validate ¶
func (r ReqSmartPlaylistContentGet) Validate() (validationMessages string, err error)
type ReqSyncPlayHistory ¶
type ReqSyncPlayHistory struct {
types.SyncPlayHistoryReq
}
func (ReqSyncPlayHistory) Validate ¶
func (r ReqSyncPlayHistory) Validate() (validationMessages string, err error)
type ReqSyncSync ¶
func (ReqSyncSync) Validate ¶
func (r ReqSyncSync) Validate() (validationMessages string, err error)
type ReqTokensBase ¶
type ReqTokensBase struct {
TokenID uuid.UUID `path:"tokenID" description:"ID of the wanted token"`
}
func (ReqTokensBase) Validate ¶
func (r ReqTokensBase) Validate() (validationMessages string, err error)
type ReqTrackAnalysisGet ¶
type ReqTrackAnalysisGet struct {
ID uuid.UUID `path:"trackAnalysisID" description:"ID of the wanted track analysis"`
}
func (ReqTrackAnalysisGet) Validate ¶
func (r ReqTrackAnalysisGet) Validate() (validationMessages string, err error)
type ReqTrackArtistsGet ¶
type ReqTrackArtistsGet struct {
TrackArtistID uuid.UUID `path:"trackArtistID" description:"ID of the wanted track artist"`
}
func (ReqTrackArtistsGet) Validate ¶
func (r ReqTrackArtistsGet) Validate() (validationMessages string, err error)
type ReqTracksAddRating ¶
type ReqTracksAddRating struct {
TrackID uuid.UUID `path:"trackID" description:"ID of the wanted track"`
types.RatingReq
}
func (ReqTracksAddRating) Validate ¶
func (r ReqTracksAddRating) Validate() (validationMessages string, err error)
type ReqTracksGet ¶
type ReqTracksGet struct {
TrackID uuid.UUID `path:"trackID" description:"ID of the wanted track"`
}
func (ReqTracksGet) Validate ¶
func (r ReqTracksGet) Validate() (validationMessages string, err error)
type ReqTracksUpdate ¶
type ReqTracksUpdate struct {
TrackID uuid.UUID `path:"trackID" description:"ID of the wanted track"`
types.TrackUpdate
}
func (ReqTracksUpdate) Validate ¶
func (r ReqTracksUpdate) Validate() (validationMessages string, err error)
type ReqUsersApiTokenCreate ¶
type ReqUsersApiTokenCreate struct {
types.CreateUserApiTokenReq
}
func (ReqUsersApiTokenCreate) Validate ¶
func (r ReqUsersApiTokenCreate) Validate() (validationMessages string, err error)
type ReqUsersBase ¶
func (ReqUsersBase) Validate ¶
func (r ReqUsersBase) Validate() (validationMessages string, err error)
type ReqUsersCreate ¶
type ReqUsersCreate struct {
types.CreateUserReq
}
func (ReqUsersCreate) Validate ¶
func (r ReqUsersCreate) Validate() (validationMessages string, err error)
type ReqUsersList ¶
type ReqUsersList struct {
IncludeMachineUsers bool `` /* 126-byte string literal not displayed */
Count bool `query:"count" description:"Only return the count, not the payload."`
SortOrder database.SortOrder `query:"sortOrder" description:"Sort ascending or descending."`
SortBy database.SortBy `query:"sortBy" description:"Sort by key."`
}
func (ReqUsersList) Validate ¶
func (r ReqUsersList) Validate() (validationMessages string, err error)
type ReqUsersTokenDelete ¶
type ReqUsersTokenDelete struct {
TokenID uuid.UUID `path:"tokenID" description:"ID of the wanted token"`
}
func (ReqUsersTokenDelete) Validate ¶
func (r ReqUsersTokenDelete) Validate() (validationMessages string, err error)
type ReqUsersUpdate ¶
type ReqUsersUpdate struct {
UserID uuid.UUID `path:"userID" description:"ID of the wanted user"`
types.UpdateUserReq
}
func (ReqUsersUpdate) Validate ¶
func (r ReqUsersUpdate) Validate() (validationMessages string, err error)
type ReqUsersUpdateProfile ¶
type ReqUsersUpdateProfile struct {
types.UpdateProfileReq
}
func (ReqUsersUpdateProfile) Validate ¶
func (r ReqUsersUpdateProfile) Validate() (validationMessages string, err error)
type Request1 ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(slogHandler slog.Handler, m *mediamanager.MediaManager, a *auth.Auth, i *importer.Importer, mb *musicbrainz.MusicBrainz, j *jobmanager.JobManager, sseHub *sse.Hub, d *device.DeviceManager, distFs fs.FS, c config.ServerConfig) Server
type ServerError ¶
Source Files
¶
- admin.go
- album.go
- albumArtist.go
- albumTrack.go
- api.go
- artist.go
- assets.go
- auth.go
- device.go
- docs.go
- errors.go
- import.go
- like.go
- mediafile.go
- middleware.go
- playlist.go
- playlisttrack.go
- rating.go
- requests.go
- search.go
- server.go
- smartplaylist.go
- sync.go
- token.go
- track.go
- trackanalysis.go
- trackartist.go
- types.go
- userroles.go
- users.go
- utils.go
Click to show internal directories.
Click to hide internal directories.