Documentation ¶
Index ¶
- Constants
- func AlbumNotFound() *pyrin.Error
- func ApiTokenNotFound() *pyrin.Error
- func ArtistNotFound() *pyrin.Error
- func ConvertSqlNullInt64(value sql.NullInt64) *int64
- func ConvertSqlNullString(value sql.NullString) *string
- func DiscardEntriesStringArray(arr []string) []string
- func DiscardEntriesStringArrayPtr(arr *[]string) *[]string
- func InstallAlbumHandlers(app core.App, group pyrin.Group)
- func InstallArtistHandlers(app core.App, group pyrin.Group)
- func InstallAuthHandlers(app core.App, group pyrin.Group)
- func InstallHandlers(app core.App, g pyrin.Group)
- func InstallPlaylistHandlers(app core.App, group pyrin.Group)
- func InstallQueueHandlers(app core.App, group pyrin.Group)
- func InstallSystemHandlers(app core.App, group pyrin.Group)
- func InstallTagHandlers(app core.App, group pyrin.Group)
- func InstallTaglistHandlers(app core.App, group pyrin.Group)
- func InstallTrackHandlers(app core.App, group pyrin.Group)
- func InstallUserHandlers(app core.App, group pyrin.Group)
- func InvalidAuth(message string) *pyrin.Error
- func InvalidFilter(err error) *pyrin.Error
- func InvalidSort(err error) *pyrin.Error
- func PlaylistAlreadyHasTrack() *pyrin.Error
- func PlaylistNotFound() *pyrin.Error
- func RegisterHandlers(app core.App, router pyrin.Router)
- func Server(app core.App) (*pyrin.Server, error)
- func StringArray(arr []string) []string
- func TaglistNotFound() *pyrin.Error
- func TestFilter(filterStr string) error
- func TrackNotFound() *pyrin.Error
- func User(app core.App, c pyrin.Context) (*database.User, error)
- func UserAlreadyExists() *pyrin.Error
- type AddItemToPlaylistBody
- type Album
- type ApiToken
- type Artist
- type ArtistInfo
- type ChangePasswordBody
- type CreateAlbum
- type CreateAlbumBody
- type CreateApiToken
- type CreateApiTokenBody
- type CreateArtist
- type CreateArtistBody
- type CreatePlaylist
- type CreatePlaylistBody
- type CreateTaglist
- type CreateTaglistBody
- type EditAlbumBody
- type EditArtistBody
- type EditTrackBody
- type Export
- type ExportAlbum
- type ExportArtist
- type ExportTrack
- type GetAlbumById
- type GetAlbumTracks
- type GetAlbums
- type GetAllApiTokens
- type GetArtistAlbumsById
- type GetArtistById
- type GetArtists
- type GetMe
- type GetPlaylistById
- type GetPlaylists
- type GetSystemInfo
- type GetTaglistById
- type GetTaglistTracks
- type GetTaglists
- type GetTrackById
- type GetTracks
- type GetUserQuickPlaylistItemIds
- type Name
- type Playlist
- type PostPlaylistFilterBody
- type RemovePlaylistItemBody
- type Signin
- type SigninBody
- type Signup
- type SignupBody
- type Taglist
- type Track
- type TrackId
- type UpdateTaglistBody
- type UpdateUserSettingsBody
- type UploadTrack
- type UploadTrackBody
Constants ¶
View Source
const ( ErrTypeInvalidAuth pyrin.ErrorType = "INVALID_AUTH" ErrTypeArtistNotFound pyrin.ErrorType = "ARTIST_NOT_FOUND" ErrTypeAlbumNotFound pyrin.ErrorType = "ALBUM_NOT_FOUND" ErrTypeTrackNotFound pyrin.ErrorType = "TRACK_NOT_FOUND" ErrTypeTaglistNotFound pyrin.ErrorType = "TAGLIST_NOT_FOUND" ErrTypeApiTokenNotFound pyrin.ErrorType = "API_TOKEN_NOT_FOUND" ErrTypeInvalidFilter pyrin.ErrorType = "INVALID_FILTER" ErrTypeInvalidSort pyrin.ErrorType = "INVALID_SORT" ErrTypeUserAlreadyExists pyrin.ErrorType = "USER_ALREADY_EXISTS" ErrTypePlaylistNotFound pyrin.ErrorType = "PLAYLIST_NOT_FOUND" ErrTypePlaylistAlreadyHasTrack pyrin.ErrorType = "PLAYLIST_ALREADY_HAS_TRACK" )
Variables ¶
This section is empty.
Functions ¶
func AlbumNotFound ¶ added in v0.15.0
func ApiTokenNotFound ¶ added in v0.18.0
func ArtistNotFound ¶ added in v0.15.0
func ConvertSqlNullInt64 ¶ added in v0.18.0
func ConvertSqlNullString ¶ added in v0.18.0
func ConvertSqlNullString(value sql.NullString) *string
func DiscardEntriesStringArray ¶ added in v0.18.0
func DiscardEntriesStringArrayPtr ¶ added in v0.18.0
TODO(patrik): Should this be pyrins default
func InstallQueueHandlers ¶
TODO(patrik): Add back
func InstallTagHandlers ¶
TODO(patrik): Add back
func InstallTaglistHandlers ¶ added in v0.18.0
func InstallUserHandlers ¶ added in v0.18.0
func InvalidAuth ¶ added in v0.18.0
func InvalidFilter ¶ added in v0.15.0
func InvalidSort ¶ added in v0.15.2
func PlaylistAlreadyHasTrack ¶ added in v0.18.2
func PlaylistNotFound ¶ added in v0.18.0
func StringArray ¶ added in v0.18.0
TODO(patrik): Move to pyrin
func TaglistNotFound ¶ added in v0.18.0
func TestFilter ¶ added in v0.18.0
func TrackNotFound ¶ added in v0.15.0
func UserAlreadyExists ¶ added in v0.18.0
Types ¶
type AddItemToPlaylistBody ¶ added in v0.18.0
type AddItemToPlaylistBody struct {
TrackId string `json:"trackId"`
}
type Album ¶ added in v0.18.0
type Album struct { Id string `json:"id"` Name Name `json:"name"` Year *int64 `json:"year"` CoverArt types.Images `json:"coverArt"` ArtistId string `json:"artistId"` ArtistName Name `json:"artistName"` Tags []string `json:"tags"` FeaturingArtists []ArtistInfo `json:"featuringArtists"` AllArtists []ArtistInfo `json:"allArtists"` Created int64 `json:"created"` Updated int64 `json:"updated"` }
type Artist ¶ added in v0.18.0
type ArtistInfo ¶ added in v0.18.0
func ConvertDBFeaturingArtists ¶ added in v0.18.0
func ConvertDBFeaturingArtists(extras database.FeaturingArtists) []ArtistInfo
type ChangePasswordBody ¶ added in v0.17.0
type ChangePasswordBody struct { CurrentPassword string `json:"currentPassword"` NewPassword string `json:"newPassword"` NewPasswordConfirm string `json:"newPasswordConfirm"` }
TODO(patrik): Test if this works with validation
func (ChangePasswordBody) Validate ¶ added in v0.17.0
func (b ChangePasswordBody) Validate() error
type CreateAlbum ¶ added in v0.17.0
type CreateAlbum struct {
AlbumId string `json:"albumId"`
}
type CreateAlbumBody ¶ added in v0.17.0
type CreateAlbumBody struct { Name string `json:"name"` OtherName string `json:"otherName"` ArtistId string `json:"artistId"` Year int64 `json:"year"` Tags []string `json:"tags"` FeaturingArtists []string `json:"featuringArtists"` }
func (*CreateAlbumBody) Transform ¶ added in v0.18.0
func (b *CreateAlbumBody) Transform()
func (CreateAlbumBody) Validate ¶ added in v0.17.0
func (b CreateAlbumBody) Validate() error
type CreateApiToken ¶ added in v0.18.0
type CreateApiToken struct {
Token string `json:"token"`
}
type CreateApiTokenBody ¶ added in v0.18.0
type CreateApiTokenBody struct {
Name string `json:"name"`
}
func (*CreateApiTokenBody) Transform ¶ added in v0.18.0
func (b *CreateApiTokenBody) Transform()
func (CreateApiTokenBody) Validate ¶ added in v0.18.0
func (b CreateApiTokenBody) Validate() error
type CreateArtist ¶ added in v0.18.0
type CreateArtist struct {
Id string `json:"id"`
}
type CreateArtistBody ¶ added in v0.18.0
func (*CreateArtistBody) Transform ¶ added in v0.18.0
func (b *CreateArtistBody) Transform()
func (CreateArtistBody) Validate ¶ added in v0.18.0
func (b CreateArtistBody) Validate() error
type CreatePlaylist ¶ added in v0.18.0
type CreatePlaylist struct {
Playlist
}
type CreatePlaylistBody ¶ added in v0.18.0
type CreatePlaylistBody struct {
Name string `json:"name"`
}
func (*CreatePlaylistBody) Transform ¶ added in v0.18.0
func (b *CreatePlaylistBody) Transform()
func (CreatePlaylistBody) Validate ¶ added in v0.18.0
func (b CreatePlaylistBody) Validate() error
type CreateTaglist ¶ added in v0.18.0
type CreateTaglist struct {
Id string `json:"id"`
}
type CreateTaglistBody ¶ added in v0.18.0
func (*CreateTaglistBody) Transform ¶ added in v0.18.0
func (b *CreateTaglistBody) Transform()
func (CreateTaglistBody) Validate ¶ added in v0.18.0
func (b CreateTaglistBody) Validate() error
type EditAlbumBody ¶ added in v0.18.0
type EditAlbumBody struct { Name *string `json:"name,omitempty"` OtherName *string `json:"otherName,omitempty"` ArtistId *string `json:"artistId,omitempty"` Year *int64 `json:"year,omitempty"` Tags *[]string `json:"tags,omitempty"` FeaturingArtists *[]string `json:"featuringArtists,omitempty"` }
func (*EditAlbumBody) Transform ¶ added in v0.18.0
func (b *EditAlbumBody) Transform()
func (EditAlbumBody) Validate ¶ added in v0.18.0
func (b EditAlbumBody) Validate() error
type EditArtistBody ¶ added in v0.17.0
func (*EditArtistBody) Transform ¶ added in v0.18.0
func (b *EditArtistBody) Transform()
func (EditArtistBody) Validate ¶ added in v0.17.0
func (b EditArtistBody) Validate() error
type EditTrackBody ¶ added in v0.18.0
type EditTrackBody struct { Name *string `json:"name,omitempty"` OtherName *string `json:"otherName,omitempty"` ArtistId *string `json:"artistId,omitempty"` Year *int64 `json:"year,omitempty"` Number *int64 `json:"number,omitempty"` Tags *[]string `json:"tags,omitempty"` FeaturingArtists *[]string `json:"featuringArtists,omitempty"` }
func (*EditTrackBody) Transform ¶ added in v0.18.0
func (b *EditTrackBody) Transform()
func (EditTrackBody) Validate ¶ added in v0.18.0
func (b EditTrackBody) Validate() error
type Export ¶ added in v0.16.2
type Export struct { Artists []ExportArtist `json:"artists"` Albums []ExportAlbum `json:"albums"` Tracks []ExportTrack `json:"tracks"` }
type ExportAlbum ¶ added in v0.16.2
type ExportArtist ¶ added in v0.16.2
type ExportTrack ¶ added in v0.16.2
type ExportTrack struct { Id string `json:"id"` Name string `json:"name"` AlbumId string `json:"albumId"` ArtistId string `json:"artistId"` Duration int64 `json:"duration"` Number int64 `json:"number"` Year int64 `json:"year"` OriginalFilename string `json:"originalFilename"` MobileFilename string `json:"mobileFilename"` Created int64 `json:"created"` Tags []string `json:"tags"` }
type GetAlbumById ¶ added in v0.18.0
type GetAlbumById struct {
Album
}
type GetAlbumTracks ¶ added in v0.18.0
type GetAlbumTracks struct {
Tracks []Track `json:"tracks"`
}
type GetAllApiTokens ¶ added in v0.18.0
type GetAllApiTokens struct {
Tokens []ApiToken `json:"tokens"`
}
type GetArtistAlbumsById ¶ added in v0.18.0
type GetArtistAlbumsById struct {
Albums []Album `json:"albums"`
}
type GetArtistById ¶ added in v0.18.0
type GetArtistById struct {
Artist
}
type GetArtists ¶ added in v0.18.0
type GetArtists struct {
Artists []Artist `json:"artists"`
}
type GetPlaylistById ¶ added in v0.18.0
type GetPlaylists ¶ added in v0.18.0
type GetPlaylists struct {
Playlists []Playlist `json:"playlists"`
}
type GetSystemInfo ¶ added in v0.18.0
type GetSystemInfo struct {
Version string `json:"version"`
}
type GetTaglistById ¶ added in v0.18.0
type GetTaglistById struct {
Taglist
}
type GetTaglistTracks ¶ added in v0.18.0
type GetTaglists ¶ added in v0.18.0
type GetTaglists struct {
Taglists []Taglist `json:"taglists"`
}
type GetTrackById ¶ added in v0.18.0
type GetTrackById struct {
Track
}
type GetUserQuickPlaylistItemIds ¶ added in v0.18.0
type GetUserQuickPlaylistItemIds struct {
TrackIds []string `json:"trackIds"`
}
type PostPlaylistFilterBody ¶ added in v0.18.0
func (*PostPlaylistFilterBody) Transform ¶ added in v0.18.0
func (b *PostPlaylistFilterBody) Transform()
func (PostPlaylistFilterBody) Validate ¶ added in v0.18.0
func (b PostPlaylistFilterBody) Validate() error
type RemovePlaylistItemBody ¶ added in v0.18.0
type RemovePlaylistItemBody struct {
TrackId string `json:"trackId"`
}
type SigninBody ¶ added in v0.18.0
func (SigninBody) Validate ¶ added in v0.18.0
func (b SigninBody) Validate() error
type SignupBody ¶ added in v0.18.0
type SignupBody struct { Username string `json:"username"` Password string `json:"password"` PasswordConfirm string `json:"passwordConfirm"` }
TODO(patrik): Test if this works with validation
func (*SignupBody) Transform ¶ added in v0.18.0
func (b *SignupBody) Transform()
TODO(patrik): Remove? and let the usernameRegex handle error
func (SignupBody) Validate ¶ added in v0.18.0
func (b SignupBody) Validate() error
type Track ¶ added in v0.18.0
type Track struct { Id string `json:"id"` Name Name `json:"name"` Duration int64 `json:"duration"` Number *int64 `json:"number"` Year *int64 `json:"year"` OriginalMediaUrl string `json:"originalMediaUrl"` MobileMediaUrl string `json:"mobileMediaUrl"` CoverArt types.Images `json:"coverArt"` AlbumId string `json:"albumId"` ArtistId string `json:"artistId"` AlbumName Name `json:"albumName"` ArtistName Name `json:"artistName"` Tags []string `json:"tags"` FeaturingArtists []ArtistInfo `json:"featuringArtists"` AllArtists []ArtistInfo `json:"allArtists"` Created int64 `json:"created"` Updated int64 `json:"updated"` }
type UpdateTaglistBody ¶ added in v0.18.0
type UpdateTaglistBody struct { Name *string `json:"name,omitempty"` Filter *string `json:"filter,omitempty"` }
func (*UpdateTaglistBody) Transform ¶ added in v0.18.0
func (b *UpdateTaglistBody) Transform()
func (UpdateTaglistBody) Validate ¶ added in v0.18.0
func (b UpdateTaglistBody) Validate() error
type UpdateUserSettingsBody ¶ added in v0.18.0
type UpdateUserSettingsBody struct { DisplayName *string `json:"displayName,omitempty"` QuickPlaylist *string `json:"quickPlaylist,omitempty"` }
func (*UpdateUserSettingsBody) Transform ¶ added in v0.18.0
func (b *UpdateUserSettingsBody) Transform()
func (UpdateUserSettingsBody) Validate ¶ added in v0.18.0
func (b UpdateUserSettingsBody) Validate() error
type UploadTrack ¶ added in v0.18.0
type UploadTrack struct {
Id string `json:"id"`
}
type UploadTrackBody ¶ added in v0.18.0
type UploadTrackBody struct { Name string `json:"name"` OtherName string `json:"otherName"` Number int64 `json:"number"` Year int64 `json:"year"` AlbumId string `json:"albumId"` ArtistId string `json:"artistId"` Tags []string `json:"tags"` FeaturingArtists []string `json:"featuringArtists"` }
func (*UploadTrackBody) Transform ¶ added in v0.18.0
func (b *UploadTrackBody) Transform()
func (UploadTrackBody) Validate ¶ added in v0.18.0
func (b UploadTrackBody) Validate() error
Click to show internal directories.
Click to hide internal directories.