service

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package service is the business logic connects the api with the internal mechanisms

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directory

type Directory struct {
	// contains filtered or unexported fields
}

func (*Directory) GetByUser

func (d *Directory) GetByUser(ctx context.Context, userID int) ([]dto.Directory, error)

func (*Directory) Sync

func (d *Directory) Sync(ctx context.Context, userID int, roots []dto.Directory) ([]dto.Directory, error)

Sync brings the database up to date with the data received from the api

type Link struct {
	// contains filtered or unexported fields
}

func (*Link) GetAllByUser

func (l *Link) GetAllByUser(ctx context.Context, userID int) ([]dto.Link, error)

func (*Link) Sync

func (l *Link) Sync(ctx context.Context, userID int, linksSave []dto.Link) ([]dto.Link, error)

type Playlist

type Playlist struct {
	// contains filtered or unexported fields
}

func (*Playlist) GetByUser

func (p *Playlist) GetByUser(ctx context.Context, userID int) ([]dto.Playlist, error)

func (*Playlist) GetCover

func (p *Playlist) GetCover(ctx context.Context, playlistID int) ([]byte, error)

func (*Playlist) GetDuplicates

func (p *Playlist) GetDuplicates(ctx context.Context, userID int) ([]dto.PlaylistDuplicate, error)

func (*Playlist) GetUnplayables

func (p *Playlist) GetUnplayables(ctx context.Context, userID int) ([]dto.PlaylistUnplayable, error)

func (*Playlist) RemoveDuplicates

func (p *Playlist) RemoveDuplicates(ctx context.Context, userID int) error

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(repo repository.Repository) *Service

func (*Service) NewDirectory

func (s *Service) NewDirectory() *Directory
func (s *Service) NewLink() *Link

func (*Service) NewPlaylist

func (s *Service) NewPlaylist() *Playlist

func (*Service) NewTask

func (s *Service) NewTask() *Task

func (*Service) NewTrack

func (s *Service) NewTrack() *Track

func (*Service) NewUser

func (s *Service) NewUser() *User

type Task

type Task struct {
	// contains filtered or unexported fields
}

func (*Task) GetHistory

func (t *Task) GetHistory(ctx context.Context, filter dto.TaskFilter) ([]dto.TaskHistory, error)

func (*Task) GetTasks

func (t *Task) GetTasks(ctx context.Context, userID int) ([]dto.Task, error)

func (*Task) Start

func (t *Task) Start(ctx context.Context, userID int, taskUID string) error

type Track

type Track struct {
	// contains filtered or unexported fields
}

func (*Track) GetAdded

func (t *Track) GetAdded(ctx context.Context, filter dto.TrackFilter) ([]dto.TrackAdded, error)

func (*Track) GetDeleted

func (t *Track) GetDeleted(ctx context.Context, filter dto.TrackFilter) ([]dto.TrackDeleted, error)

func (*Track) GetHistory

func (t *Track) GetHistory(ctx context.Context, filter dto.HistoryFilter) ([]dto.History, error)

type User

type User struct {
	// contains filtered or unexported fields
}

func (*User) Create

func (u *User) Create(ctx context.Context, userSave dto.User) (dto.User, error)

func (*User) GetByID

func (u *User) GetByID(ctx context.Context, id int) (dto.User, error)

func (*User) GetByUID

func (u *User) GetByUID(ctx context.Context, uid string) (dto.User, error)

func (*User) Update

func (u *User) Update(ctx context.Context, userSave dto.User) (dto.User, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL