Documentation
¶
Overview ¶
Package dto forms the bridge between the api data and the internal models
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Validate = validator.New(validator.WithRequiredStructEnabled())
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type History ¶
type HistoryFilter ¶
func (HistoryFilter) ToModel ¶
func (h HistoryFilter) ToModel() *model.HistoryFilter
type Link ¶
type Playlist ¶
type Playlist struct {
ID int `json:"id" validate:"required"`
SpotifyID string `json:"spotify_id"`
Owner User `json:"owner,omitzero"`
Name string `json:"name"`
Description string `json:"description,omitzero"`
Public bool `json:"public"`
TrackAmount int `json:"track_amount"`
Collaborative bool `json:"collaborative"`
HasCover bool `json:"has_cover"`
}
type PlaylistDuplicate ¶
type PlaylistDuplicate struct {
Playlist
Duplicates []TrackDuplicate `json:"duplicates"`
}
func PlaylistDuplicateDTO ¶
type PlaylistUnplayable ¶
func PlaylistUnplayableDTO ¶
type Task ¶
type Task struct {
TaskUID string `json:"uid"`
Name string `json:"name"`
Status task.Status `json:"status"`
NextRun time.Time `json:"next_run"`
LastStatus model.TaskResult `json:"last_status,omitempty"`
LastRun *time.Time `json:"last_run,omitzero"`
LastMessage string `json:"last_message,omitempty"`
LastError string `json:"last_error,omitempty"`
Interval *time.Duration `json:"interval,omitzero"`
}
type TaskFilter ¶
func (*TaskFilter) ToModel ¶
func (t *TaskFilter) ToModel() *model.TaskFilter
type TaskHistory ¶
type TaskHistory struct {
ID int `json:"id"`
Name string `json:"name"`
Result model.TaskResult `json:"result"`
RunAt time.Time `json:"run_at"`
Message string `json:"message"`
Error string `json:"error,omitempty"`
Duration time.Duration `json:"duration"`
}
func TaskHistoryDTO ¶
func TaskHistoryDTO(task *model.Task) TaskHistory
type Track ¶
type TrackAdded ¶
type TrackAdded struct {
Track
Playlist Playlist `json:"playlist"`
CreatedAt time.Time `json:"created_at"`
}
func TrackAddedDTO ¶
func TrackAddedDTO(t *model.Track) TrackAdded
type TrackDeleted ¶
type TrackDeleted struct {
Track
Playlist Playlist `json:"playlist"`
DeletedAt time.Time `json:"deleted_at"`
}
func TrackDeletedDTO ¶
func TrackDeletedDTO(t *model.Track) TrackDeleted
type TrackDuplicate ¶
func TrackDuplicateDTO ¶
func TrackDuplicateDTO(t *model.Track, amount int) TrackDuplicate
type TrackFilter ¶
func (TrackFilter) ToModel ¶
func (t TrackFilter) ToModel() *model.TrackFilter
Click to show internal directories.
Click to hide internal directories.