models

package
v0.0.0-...-f03aceb Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const TABLE_NAME string = "jobs"

Variables

This section is empty.

Functions

This section is empty.

Types

type DBModel

type DBModel struct {
	DB *sql.DB
}

DBModel is the type for db connection values

func (*DBModel) Add

func (m *DBModel) Add(ctx context.Context, job *Job) (bool, error)

func (*DBModel) MarkAsCompleted

func (m *DBModel) MarkAsCompleted(ctx context.Context, jobID int) (bool, error)

func (*DBModel) UpdateJobStatus

func (m *DBModel) UpdateJobStatus(ctx context.Context, jobID int, jobStatus jobstatus.JobStatus) (bool, error)

type Job

type Job struct {
	ID            int
	UserID        int
	Status        jobstatus.JobStatus
	ScannerID     int
	ScannerIP     string
	CreatedAt     time.Time
	CompletedTime *time.Time
}

func (*Job) GetLocalWorkDir

func (jm *Job) GetLocalWorkDir(cfg config.Config) string

Model Functions

func (*Job) GetRemoteWorkDir

func (jm *Job) GetRemoteWorkDir(cfg config.Config) string

type Models

type Models struct {
	DB DBModel
}

Models is the wrapper for all models

Jump to

Keyboard shortcuts

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