app

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package app implements most of the application logic

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App is an autodeb server application

func NewApp

func NewApp(db *database.Database, dataFS filesystem.FS) (*App, error)

NewApp create an app from a configuration

func (*App) GetAllFileUploadsByUploadID added in v0.3.0

func (app *App) GetAllFileUploadsByUploadID(uploadID uint) ([]*models.FileUpload, error)

GetAllFileUploadsByUploadID returns all FileUploads associated to an upload

func (*App) GetAllJobs

func (app *App) GetAllJobs() ([]*models.Job, error)

GetAllJobs returns all jobs

func (*App) GetAllUploads

func (app *App) GetAllUploads() ([]*models.Upload, error)

GetAllUploads returns all uploads

func (*App) GetJob added in v0.4.0

func (app *App) GetJob(id uint) (*models.Job, error)

GetJob returns the job with the given id

func (*App) GetJobLog added in v0.4.0

func (app *App) GetJobLog(jobID uint) (io.ReadCloser, error)

GetJobLog returns the log of a job

func (*App) GetUploadDSC added in v0.3.0

func (app *App) GetUploadDSC(uploadID uint) (io.ReadCloser, error)

GetUploadDSC returns the DSC of the upload with a matching id

func (*App) GetUploadFile added in v0.3.0

func (app *App) GetUploadFile(uploadID uint, filename string) (io.ReadCloser, error)

GetUploadFile returns the file associated with the upload id and filename

func (*App) JobsDirectory added in v0.4.0

func (app *App) JobsDirectory() string

JobsDirectory contains saved data for jobs such as logs

func (*App) ProcessUpload

func (app *App) ProcessUpload(uploadParameters *UploadParameters, content io.Reader) (*models.Upload, error)

ProcessUpload processes uploads

func (*App) SaveJobLog added in v0.4.0

func (app *App) SaveJobLog(jobID uint, content io.Reader) error

SaveJobLog will save logs for a job

func (*App) UnqueueNextJob added in v0.3.0

func (app *App) UnqueueNextJob() (*models.Job, error)

UnqueueNextJob returns the next job and marks it as assigned

func (*App) UpdateJob added in v0.4.0

func (app *App) UpdateJob(job *models.Job) error

UpdateJob will update a job

func (*App) UploadedFilesDirectory

func (app *App) UploadedFilesDirectory() string

UploadedFilesDirectory contains files that are not yet associated with a package upload.

func (*App) UploadsDirectory

func (app *App) UploadsDirectory() string

UploadsDirectory contains completed uploads.

type UploadParameters

type UploadParameters = uploads.UploadParameters

UploadParameters define upload options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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