Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Album ¶
type Album struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Title string
ReleaseDate time.Time
Songs []Song `gorm:"constraint:OnDelete:CASCADE;"`
Identifiers []AlbumIdentifier `gorm:"constraint:OnDelete:CASCADE;"`
}
func (*Album) GetArtistName ¶
type AlbumIdentifier ¶
type AlbumIdentifier struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Identifier string `gorm:"not null"`
AlbumID uuid.UUID `gorm:"type:uuid;not null"`
Album Album
}
func (*AlbumIdentifier) BeforeCreate ¶
func (a *AlbumIdentifier) BeforeCreate(tx *gorm.DB) (err error)
type Artist ¶
type ArtistIdentifier ¶
type ArtistIdentifier struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Identifier string `gorm:"index;not null" `
ArtistID uuid.UUID `gorm:"type:uuid;not null"`
Artist Artist
}
func (*ArtistIdentifier) BeforeCreate ¶
func (a *ArtistIdentifier) BeforeCreate(tx *gorm.DB) (err error)
type MBArtistCredit ¶
func (MBArtistCredit) TableName ¶
func (MBArtistCredit) TableName() string
type MBRecording ¶
type MBRecording struct {
ID int `gorm:"primaryKey"`
GID string `gorm:"column:gid"`
Name string `gorm:"column:name"`
ArtistCreditID int `gorm:"column:artist_credit"`
ArtistCredit *MBArtistCredit `gorm:"foreignKey:ArtistCreditID;references:ID"`
Length int `gorm:"column:length"`
}
func (MBRecording) TableName ¶
func (MBRecording) TableName() string
type Playlist ¶
type Playlist struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string `gorm:"not null"`
FolderID uuid.UUID `gorm:"type:uuid;index"`
PlaylistFolder *PlaylistFolder `gorm:"foreignKey:FolderID"`
UserID uuid.UUID `gorm:"type:uuid;index;not null"`
PlaylistSongs []PlaylistSong `gorm:"foreignKey:PlaylistID;constraint:OnDelete:CASCADE;"`
}
type PlaylistFolder ¶
type PlaylistFolder struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
UserID uuid.UUID `gorm:"type:uuid;not null;index"`
User User `gorm:"foreignKey:UserID"`
ParentID *uuid.UUID `gorm:"type:uuid;index"`
Parent *PlaylistFolder
Children []*PlaylistFolder `gorm:"foreignKey:ParentID"`
Playlists []Playlist `gorm:"foreignKey:FolderID;constraint:OnDelete:CASCADE;"`
}
type PlaylistSong ¶
type PlaylistSong struct {
PlaylistID uuid.UUID `gorm:"type:uuid;primaryKey"`
SongID uuid.UUID `gorm:"type:uuid;primaryKey"`
// Order is a fractional index string for sorting
Order string `gorm:"type:text;not null;default:''"`
CreatedAt time.Time
// Associations
Playlist Playlist `gorm:"foreignKey:PlaylistID"`
Song Song `gorm:"foreignKey:SongID"`
}
type RequestMail ¶
type RequestMailStatus ¶
type RequestMailStatus int
const ( RequestMailStatusPending RequestMailStatus = iota // 0 RequestMailStatusProcessing // 1 RequestMailStatusCompleted // 2 RequestMailStatusRejected // 3 )
type Song ¶
type Song struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
AlbumID uuid.UUID `gorm:"type:uuid"`
Album Album
Title string `gorm:"index"`
Artists []Artist `gorm:"many2many:song_artists;constraint:OnDelete:CASCADE;"`
SongFiles []SongFile `gorm:"constraint:OnDelete:CASCADE;"`
Identifiers []SongIdentifier `gorm:"constraint:OnDelete:CASCADE;"`
}
type SongFile ¶
type SongIdentifier ¶
type SongIdentifier struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Identifier string `gorm:"not null"`
SongID uuid.UUID `gorm:"type:uuid;not null"`
Song Song
}
func (*SongIdentifier) BeforeCreate ¶
func (a *SongIdentifier) BeforeCreate(tx *gorm.DB) (err error)
type User ¶
type User struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Username string `gorm:"uniqueIndex;not null"`
PasswordHash string `gorm:"not null" json:"-"`
IsAdmin bool `gorm:"default:false"`
BannedUntil *time.Time `gorm:"default:null"`
}
Click to show internal directories.
Click to hide internal directories.