Documentation ¶
Index ¶
- Variables
- type Database
- type ProcessSettings
- type Storage
- type Task
- type Tasker
- func (t *Tasker) ApplySettings(s interface{}) error
- func (*Tasker) CheckSettingsIsValid(s interface{}) error
- func (*Tasker) GetSettingsPrefix() string
- func (t *Tasker) ProcessImageFile(log *zerolog.Logger, fileName string) (string, error)
- func (t *Tasker) ProcessMusicFile(log *zerolog.Logger, fileName string, uid int64, sets ...*ProcessSettings) (taskID int64, result <-chan error, err error)
- func (t *Tasker) Shutdown(wait time.Duration)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrShutdown = errors.New("shutdown")
)
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { TasksCreate(fileName string, uid int64) (int64, error) TasksSetStatusInProgress(id int64) error TasksSetStatusError(id int64, errorText string) error TasksSetStatusSuccess(id, musicID int64) error // MusicIsExists returns true if db already has wor with that data MusicIsExists(title, album, artist string) bool // MusicGetAlbumPicture returns true if album already has picture // also returns name of the picture file MusicGetAlbumPicture(album, artist string) (bool, string, error) // MusicCreate creates new music row in the DB MusicCreate(fileNameMiddle, fileNameHigh, picture string, duration, uid int64, musicInfo *music.Music, preData *dbmodels.PreMusicData) (int64, error) }
Database methods for tasker
type ProcessSettings ¶ added in v0.0.2
type ProcessSettings struct { Bitrate *settings.Tasker PreData *dbmodels.PreMusicData }
ProcessSettings contains bitrate settings and preload file
type Storage ¶
type Storage interface { // GetTmpPathToFile returns full path of the tmp file GetTmpPathToFile(fileName string) string // GenerateNewTmpFileName returns name of the new tmp file with extension GenerateNewTmpFileName(ext string) string // GenerateNewPathToTmpFile generetes full path to the new tmp file GenerateNewPathToTmpFile(ext string) string // RemoveTmpFile removes file in the tmp storage RemoveTmpFile(tmpFile string) error // RemovePrefixFile removes file in the prefix storage RemovePrefixFile(fileName string) error // CopyFromTmpToPrefixStorage moves file from tmp to prefix storage CopyFromTmpToPrefixStorage(tmpFile string) (string, error) }
Storage file system storage
type Task ¶
type Task struct {
// contains filtered or unexported fields
}
Task is an element of the tasker
type Tasker ¶
type Tasker struct {
// contains filtered or unexported fields
}
Tasker parses files and moves them in the storage
func (*Tasker) ApplySettings ¶ added in v0.0.2
ApplySettings applies the new default bitrate settings
func (*Tasker) CheckSettingsIsValid ¶ added in v0.0.2
CheckSettingsIsValid checks is this settings valid
func (*Tasker) GetSettingsPrefix ¶ added in v0.0.2
GetSettingsPrefix returns prefix of the settings name
func (*Tasker) ProcessImageFile ¶ added in v0.0.2
ProcessImageFile processes and creates new image file returns name of the new file
Click to show internal directories.
Click to hide internal directories.