Documentation
¶
Overview ¶
Package model contains all databank models
Index ¶
- type Album
- type AlbumArtist
- type AlbumUser
- type Artist
- type Directory
- type DirectoryPlaylist
- type Generator
- type GeneratorParams
- type GeneratorPreset
- type GeneratorPresetOldTopParams
- type GeneratorPresetTopParams
- type GeneratorTrack
- type GeneratorWindow
- type History
- type HistoryFilter
- type Link
- type Playlist
- type PlaylistTrack
- type PlaylistUser
- type Show
- type ShowUser
- type Task
- type TaskFilter
- type TaskResult
- type Track
- type TrackArtist
- type TrackFilter
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
ID int
SpotifyID string
Name string
TrackAmount int
Popularity int
CoverID string
CoverURL string
UpdatedAt time.Time
// Non db fields
Artists []Artist
}
func AlbumModel ¶
func (*Album) EqualEntry ¶
type AlbumArtist ¶
type Artist ¶
type Artist struct {
ID int
SpotifyID string
Name string
Followers int
Popularity int
CoverID string
CoverURL string
UpdatedAt time.Time
}
func ArtistModel ¶
func (*Artist) EqualEntry ¶
type Directory ¶
type Directory struct {
ID int
UserID int
Name string
ParentID int
// Non db fields
Playlists []Playlist
}
func DirectoryModel ¶
type DirectoryPlaylist ¶
type Generator ¶ added in v0.2.0
type Generator struct {
ID int
UserID int
Name string
Description string
PlaylistID int
Interval time.Duration
SpotifyOutdated bool
Params GeneratorParams
UpdatedAt time.Time
CreatedAt time.Time
// Non db fields
User User
Tracks []Track
}
func GeneratorModel ¶ added in v0.2.0
type GeneratorParams ¶ added in v0.2.0
type GeneratorParams struct {
TrackAmount int `json:"track_amount"`
ExcludedPlaylistIDs []int `json:"excluded_playlist_ids"`
ExcludedTrackIDs []int `json:"excluded_track_ids"`
Preset GeneratorPreset `json:"preset"`
ParamsTop *GeneratorPresetTopParams `json:"params_top,omitzero"`
ParamsOldTop *GeneratorPresetOldTopParams `json:"params_old_top,omitzero"`
}
type GeneratorPreset ¶ added in v0.2.0
type GeneratorPreset string
const ( GeneratorPresetTop GeneratorPreset = "top" GeneratorPresetOldTop GeneratorPreset = "old_top" )
type GeneratorPresetOldTopParams ¶ added in v0.2.0
type GeneratorPresetOldTopParams struct {
PeakWindow GeneratorWindow `json:"peak_window"`
RecentWindow GeneratorWindow `json:"recent_window"`
}
type GeneratorPresetTopParams ¶ added in v0.2.0
type GeneratorPresetTopParams struct {
Window GeneratorWindow `json:"window"`
}
type GeneratorTrack ¶ added in v0.2.0
type GeneratorWindow ¶ added in v0.2.0
type History ¶
type History struct {
ID int
UserID int
TrackID int
PlayedAt time.Time
Skipped *bool
AlbumID int
ArtistID int
PlaylistID int
ShowID int
// Non db fields
Track Track
PlayCount int
}
func HistoryModel ¶
type HistoryFilter ¶
type Link ¶
type Playlist ¶
type Playlist struct {
ID int
SpotifyID string
OwnerID int
Name string
Description string
Public *bool
TrackAmount int
Collaborative *bool
CoverID string
CoverURL string
SnapshotID string
UpdatedAt time.Time
// Non db fields
Owner User
Duplicates []Track
Unplayables []Track
}
func PlaylistModel ¶
func (*Playlist) EqualEntry ¶
type PlaylistTrack ¶
type PlaylistTrack struct {
ID int
PlaylistID int
TrackID int
CreatedAt time.Time
DeletedAt time.Time
}
func PlaylistTrackModel ¶ added in v0.2.0
func PlaylistTrackModel(p sqlc.PlaylistTrack) *PlaylistTrack
type PlaylistUser ¶
type Show ¶
type Show struct {
ID int
SpotifyID string
Name string
EpisodeAmount int
CoverID string
CoverURL string
UpdatedAt time.Time
}
func (*Show) EqualEntry ¶
type Task ¶
type TaskFilter ¶
type TaskResult ¶
type TaskResult string
const ( TaskSuccess TaskResult = "success" TaskFailed TaskResult = "failed" )
type Track ¶
type Track struct {
ID int `json:"id"`
SpotifyID string `json:"spotify_id"`
Name string `json:"name"`
Popularity int `json:"popularity"`
DurationMs int `json:"duration_ms"`
UpdatedAt time.Time `json:"updated_at"`
// Non db fields
Artists []Artist
Playlist Playlist
CreatedAt time.Time
DeletedAt time.Time
}
func TrackModel ¶
func (*Track) EqualEntry ¶
type TrackArtist ¶
Click to show internal directories.
Click to hide internal directories.