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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const TABLE_NAME string = "jobs"

Variables

This section is empty.

Functions

func ParseTimeString

func ParseTimeString(timeString string) (time.Time, error)

Types

type Customer

type Customer struct {
	ID int
}

type Job

type Job struct {
	ID            int
	Status        int
	UserID        int
	APIURL        string
	CreatedAt     time.Time
	CompletedTime *time.Time
}

type JobService

type JobService struct {
	DB *sql.DB
}

func NewJobService

func NewJobService(db *sql.DB) JobService

func (JobService) Create

func (s JobService) Create(ctx context.Context, job Job) (int, error)

create job

func (JobService) GetByStatus

func (s JobService) GetByStatus(ctx context.Context, status jobstatus.JobStatus) ([]Job, error)

Get jobs by status and returns Array of jobs and error

func (JobService) UpdateStatus

func (s JobService) UpdateStatus(ctx context.Context, job Job) (bool, error)

Updates job status by ID and returns a boolean and error

type Service

type Service struct {
	// DB  DBModel
	Job JobService
}

Models is the wrapper for all models

func New

func New(db *sql.DB) Service

Jump to

Keyboard shortcuts

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