Documentation ¶
Overview ¶
This code implements a Go package that interacts with a database and provides CRUD operations for entities. The package uses the Gorm ORM to connect to the database.
This code implements a Go package that interacts with a database and provides CRUD operations for entities. The package uses the Gorm ORM to connect to the database.
This code implements a Go package that interacts with a database and provides CRUD operations for entities. The package uses the Gorm ORM to connect to the database.
Index ¶
- type Playlist
- func (r *Playlist) AddSong(user_id uint, song_id uint, playlist_id uint) error
- func (r *Playlist) Create(playlist *entity.Playlist) (*entity.Playlist, error)
- func (r *Playlist) Delete(id uint) error
- func (r *Playlist) Get() []entity.Playlist
- func (r *Playlist) Next(user_id uint, song_id uint, playlist_id uint) error
- func (r *Playlist) Pause(user_id uint, song_id uint, playlist_id uint) error
- func (r *Playlist) Play(user_id uint, song_id uint, playlist_id uint) error
- func (r *Playlist) Prev(user_id uint, song_id uint, playlist_id uint) error
- func (r *Playlist) Update(id uint, playlist *entity.Playlist) (*entity.Playlist, error)
- type Song
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Playlist ¶
The Playlist type wraps a *gorm.DB object and has nine methods: Get, Create, Update, Delete and others which provide basic CRUD functionality for the Playlist entity.
func NewPlaylist ¶
Crates a new instance of playlist with DI.
func (*Playlist) Create ¶
The Create method creates a new playlist in the database and updates the user entity that created the playlist.
type Song ¶
The Song type wraps a *gorm.DB object and has four methods: Get, Create, Update, Delete which provide basic CRUD functionality for the Song entity.
type User ¶
The User type wraps a *gorm.DB object and has four methods: Get, Create, Update, Delete which provide basic CRUD functionality for the User entity.