Documentation ¶
Index ¶
- func DeleteTrack(trackID uint, user *User) (err error)
- func InitDB() (*gorm.DB, error)
- func MigrateDb()
- func PlaylistDelete(playlistID uint, user *User) (err error)
- type Playlist
- func PlaylistCreate(user *User, playlistForm forms.PlaylistForm) (playlist *Playlist, err error)
- func PlaylistGet(playlistID uint, user *User) (playlist *Playlist, err error)
- func PlaylistGetByH(h string) (playlist *Playlist, err error)
- func PlaylistList(user *User) (playlists []Playlist, err error)
- type Track
- type User
- func FindUserByID(userID uint) (user *User, err error)
- func FindUserByUserName(username string) (user *User, err error)
- func RegisterUser(signUpForm forms.SignUpForm) (user *User, err error)
- func SignInUser(signInForm forms.SignInForm) (user *User, err error)
- func UserList() (users []User, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteTrack ¶
func PlaylistDelete ¶
Types ¶
type Playlist ¶
type Playlist struct { gorm.Model Name string `json:"name" gorm:"not null;size:256"` Description string `json:"description"` Private bool `json:"private"` Tracks []Track `json:"tracks"` Hash string `json:"sharehash"` UserID uint `json:"-"` }
func PlaylistCreate ¶
func PlaylistCreate(user *User, playlistForm forms.PlaylistForm) (playlist *Playlist, err error)
func PlaylistGetByH ¶
func PlaylistList ¶
type Track ¶
type Track struct { gorm.Model Name string `json:"name" gorm:"size:256"` TrackPath string `json:"track_path"` PlaylistID uint }
func CreateTrack ¶
type User ¶
type User struct { gorm.Model Username string `json:"username" gorm:"unique_index;not null;size:64"` Description string `json:"description"` Age int `json:"age" gorm:"default:16"` Password string `json:"-" gorm:"unique_index;not null;size:64"` Playlists []Playlist `json:"-"` }
func FindUserByID ¶
func FindUserByUserName ¶
func RegisterUser ¶
func RegisterUser(signUpForm forms.SignUpForm) (user *User, err error)
func SignInUser ¶
func SignInUser(signInForm forms.SignInForm) (user *User, err error)
Click to show internal directories.
Click to hide internal directories.