Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseModelWithoutId ¶
type FullListeningSession ¶
type FullListeningSession struct { SimpleListeningSession Owner SimpleUser `gorm:"foreignKey:owner_id" json:"owner"` FallbackPlaylistMetadata *PlaylistMetadata `gorm:"foreignKey:fallback_playlist;references:spotify_playlist_id" json:"fallback_playlist_metadata"` }
func (FullListeningSession) TableName ¶
func (FullListeningSession) TableName() string
type FullUser ¶
type FullUser struct { SimpleUser ListeningSessions []SimpleListeningSession `gorm:"foreignKey:owner_id" json:"listening_sessions"` }
type LoginSession ¶
type LoginSession struct { BaseModel SessionId string UserId *uint User *SimpleUser `gorm:"foreignKey:user_id"` Active bool CallbackRedirect string }
func (LoginSession) IsAuthenticated ¶
func (l LoginSession) IsAuthenticated() bool
func (LoginSession) IsValid ¶
func (l LoginSession) IsValid() bool
type PlaylistMetadata ¶
type PlaylistMetadata struct { BaseModelWithoutId SpotifyPlaylistId string `gorm:"primaryKey" json:"spotify_playlist_id"` Name string `json:"name"` TrackCount uint `json:"track_count"` ImageThumbnailUrl string `json:"image_thumbnail_url"` OwnerName string `json:"owner_name"` }
func (PlaylistMetadata) FromFullPlaylist ¶
func (playlistMetadata PlaylistMetadata) FromFullPlaylist(fullPlaylist spotify.FullPlaylist) PlaylistMetadata
func (PlaylistMetadata) FromSimplePlaylist ¶
func (playlistMetadata PlaylistMetadata) FromSimplePlaylist(simplePlaylist spotify.SimplePlaylist) PlaylistMetadata
type SimpleListeningSession ¶
type SimpleListeningSession struct { BaseModel Active bool `json:"active"` OwnerId uint `json:"owner_id"` JoinId string `json:"join_id"` QueuePlaylistId string `gorm:"column:queue_playlist" json:"queue_playlist_id"` Title string `json:"title"` FallbackPlaylistId *string `gorm:"column:fallback_playlist" json:"fallback_playlist_id"` FallbackPlaylistShuffle bool `json:"fallback_playlist_shuffle"` }
func (SimpleListeningSession) TableName ¶
func (SimpleListeningSession) TableName() string
type SimpleUser ¶
type SimpleUser struct { BaseModel SpotifyId string `json:"spotify_id"` SpotifyDisplayName string `json:"spotify_display_name"` Country string `json:"country"` SpotifyAccessToken string `json:"-"` SpotifyRefreshToken string `json:"-"` SpotifyTokenType string `json:"-"` SpotifyTokenExpiry time.Time `json:"-"` }
func (SimpleUser) GetToken ¶
func (u SimpleUser) GetToken() *oauth2.Token
func (SimpleUser) SetToken ¶
func (u SimpleUser) SetToken(token *oauth2.Token) SimpleUser
func (SimpleUser) TableName ¶
func (SimpleUser) TableName() string
type SongRequest ¶
type SongRequest struct { BaseModel SessionId uint `json:"session_id"` SpotifyTrackId string `json:"spotify_track_id"` TrackMetadata TrackMetadata `gorm:"foreignKey:spotify_track_id;references:spotify_track_id" json:"track_metadata"` Played bool `json:"-"` Locked bool `json:"-"` RequestedBy string `json:"requested_by"` Weight int64 `json:"-"` }
type TrackMetadata ¶
type TrackMetadata struct { BaseModelWithoutId SpotifyTrackId string `gorm:"primaryKey" json:"spotify_track_id"` TrackName string `json:"track_name"` ArtistName string `json:"artist_name"` AlbumName string `json:"album_name"` AlbumImageThumbnailUrl string `json:"album_image_thumbnail_url"` }
func (TrackMetadata) SetMetadata ¶
func (trackMetadata TrackMetadata) SetMetadata(spotifyTrack spotify.FullTrack) TrackMetadata
Click to show internal directories.
Click to hide internal directories.