service

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2026 License: GPL-3.0 Imports: 23 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 Generator added in v0.2.0

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

func (*Generator) Create added in v0.2.0

func (g *Generator) Create(ctx context.Context, userID int, genSave dto.GeneratorSave) (dto.Generator, error)

func (*Generator) Delete added in v0.2.0

func (g *Generator) Delete(ctx context.Context, userID, genID int, deletePlaylist bool) error

func (*Generator) GetByUser added in v0.2.0

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

func (*Generator) Preview added in v0.2.0

func (g *Generator) Preview(ctx context.Context, userID int, params dto.GeneratorParams) ([]dto.Track, error)

func (*Generator) Refresh added in v0.2.0

func (g *Generator) Refresh(ctx context.Context, userID, genID int) error

func (*Generator) Update added in v0.2.0

func (g *Generator) Update(ctx context.Context, userID int, genSave dto.GeneratorSave) (dto.Generator, error)
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 (*Service) NewGenerator added in v0.2.0

func (s *Service) NewGenerator() *Generator
func (s *Service) NewLink() *Link

func (*Service) NewPlaylist

func (s *Service) NewPlaylist() *Playlist

func (*Service) NewSetting added in v0.2.0

func (s *Service) NewSetting() *Setting

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 Setting added in v0.2.0

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

func (*Setting) Export added in v0.2.0

func (s *Setting) Export(ctx context.Context, userID int, zip []byte) error

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) GetByIDs added in v0.2.0

func (t *Track) GetByIDs(ctx context.Context, trackIDs []int) ([]dto.Track, 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