job

package
v2.1.10 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTaskPollingInterval = 5 * time.Second

DefaultTaskPollingInterval is the default interval for polling task.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	*internaljob.Job
	Preheat
	SyncPeers
}

Job is an implementation of job.

func New

func New(cfg *config.Config, gdb *gorm.DB) (*Job, error)

New returns a new Job.

func (*Job) Serve added in v2.0.30

func (j *Job) Serve()

Serve starts the job server.

func (*Job) Stop added in v2.0.30

func (j *Job) Stop()

Stop stops the job server.

type Preheat

type Preheat interface {
	// CreatePreheat creates a preheat job.
	CreatePreheat(context.Context, []models.Scheduler, types.PreheatArgs) (*internaljob.GroupJobState, error)
}

Preheat is an interface for preheat job.

type PreheatType

type PreheatType string
const (
	// PreheatImageType is image type of preheat job.
	PreheatImageType PreheatType = "image"

	// PreheatFileType is file type of preheat job.
	PreheatFileType PreheatType = "file"
)

type SyncPeers added in v2.0.30

type SyncPeers interface {
	// Run sync peers.
	Run(context.Context) error

	// Started sync peers server.
	Serve()

	// Stop sync peers server.
	Stop()
}

SyncPeers is an interface for sync peers.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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