job

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(handlerType string, dbService database.DBService, jobId string, eventQ *EventQ,
	jobQueues map[string]*EventQ, mu *sync.Mutex, notifier string, jobParams config.JobParams,
	bInsecure bool, bPlain bool) (handler, error)

Types

type DefaultHandler

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

func NewDefaultHandler

func NewDefaultHandler(dbService database.DBService, jobId string, userEventQ *EventQ,
	jobQueues map[string]*EventQ, mu *sync.Mutex, notifier string, jobParams config.JobParams,
	bInsecure bool, bPlain bool) (*DefaultHandler, error)

func (*DefaultHandler) ChangeState

func (h *DefaultHandler) ChangeState(state JobHandlerState)

func (*DefaultHandler) Do

func (h *DefaultHandler) Do()

type EventQ

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

func NewEventQ

func NewEventQ(qSize int) *EventQ

func (*EventQ) Dequeue

func (q *EventQ) Dequeue() *JobEvent

func (*EventQ) Enqueue

func (q *EventQ) Enqueue(jobEvent *JobEvent) error

func (*EventQ) GetJobEventBuffer added in v0.1.5

func (q *EventQ) GetJobEventBuffer() <-chan *JobEvent

type JobBuilder

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

JobBuilder is a struct used to build a job.

func NewJobBuilder

func NewJobBuilder(dbService database.DBService, jobParams config.JobParams) *JobBuilder

func (*JobBuilder) GetTasks

func (b *JobBuilder) GetTasks(jobSpec *openapi.JobSpec) (
	tasks []objects.Task, roles []string, err error,
)

type JobEvent

type JobEvent struct {
	Requester string
	JobStatus openapi.JobStatus
	ErrCh     chan error
}

func NewJobEvent

func NewJobEvent(requester string, jobStatus openapi.JobStatus) *JobEvent

type JobHandlerState

type JobHandlerState interface {
	ApplyChange()
	ApplyNone()
	CleanUp()
	Complete()
	Deploy(event *JobEvent)
	Fail()
	Run(event *JobEvent)
	Start(event *JobEvent)
	Stop(event *JobEvent)
	Timeout()
	Update(event *JobEvent)
}

func NewStateApplying

func NewStateApplying(h *DefaultHandler) JobHandlerState

func NewStateCompleted

func NewStateCompleted(h *DefaultHandler) JobHandlerState

func NewStateDeploying

func NewStateDeploying(h *DefaultHandler) JobHandlerState

func NewStateFailed

func NewStateFailed(h *DefaultHandler) JobHandlerState

func NewStateReady

func NewStateReady(h *DefaultHandler) JobHandlerState

func NewStateRunning

func NewStateRunning(h *DefaultHandler) JobHandlerState

func NewStateStarting

func NewStateStarting(h *DefaultHandler) JobHandlerState

func NewStateStopping

func NewStateStopping(h *DefaultHandler) JobHandlerState

func NewStateTerminated

func NewStateTerminated(h *DefaultHandler) JobHandlerState

type Manager

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

func NewManager

func NewManager(dbService database.DBService, jobEventQ *EventQ, notifier string, jobParams config.JobParams,
	bInsecure bool, bPlain bool) (*Manager, error)

func (*Manager) Do

func (mgr *Manager) Do()

type StateApplying

type StateApplying struct {
	StateBase
}

func (*StateApplying) ApplyChange

func (s *StateApplying) ApplyChange()

func (*StateApplying) ApplyNone

func (s *StateApplying) ApplyNone()

func (*StateApplying) Stop

func (s *StateApplying) Stop(event *JobEvent)

func (*StateApplying) Timeout

func (s *StateApplying) Timeout()

type StateBase

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

func (*StateBase) ApplyChange

func (s *StateBase) ApplyChange()

func (*StateBase) ApplyNone

func (s *StateBase) ApplyNone()

func (*StateBase) CleanUp

func (s *StateBase) CleanUp()

func (*StateBase) Complete

func (s *StateBase) Complete()

func (*StateBase) Deploy

func (s *StateBase) Deploy(event *JobEvent)

func (*StateBase) Fail

func (s *StateBase) Fail()

func (*StateBase) Run

func (s *StateBase) Run(event *JobEvent)

func (*StateBase) Start

func (s *StateBase) Start(event *JobEvent)

func (*StateBase) Stop

func (s *StateBase) Stop(event *JobEvent)

func (*StateBase) Timeout

func (s *StateBase) Timeout()

func (*StateBase) Update

func (s *StateBase) Update(event *JobEvent)

type StateCompleted

type StateCompleted struct {
	StateBase
}

type StateDeploying

type StateDeploying struct {
	StateBase
}

func (*StateDeploying) Fail

func (s *StateDeploying) Fail()

func (*StateDeploying) Run

func (s *StateDeploying) Run(event *JobEvent)

func (*StateDeploying) Stop

func (s *StateDeploying) Stop(event *JobEvent)

func (*StateDeploying) Timeout

func (s *StateDeploying) Timeout()

type StateFailed

type StateFailed struct {
	StateBase
}

type StateReady

type StateReady struct {
	StateBase
}

func (*StateReady) Start

func (s *StateReady) Start(event *JobEvent)

type StateRunning

type StateRunning struct {
	StateBase
}

func (*StateRunning) Complete

func (s *StateRunning) Complete()

func (*StateRunning) Fail

func (s *StateRunning) Fail()

func (*StateRunning) Stop

func (s *StateRunning) Stop(event *JobEvent)

func (*StateRunning) Timeout

func (s *StateRunning) Timeout()

func (*StateRunning) Update

func (s *StateRunning) Update(event *JobEvent)

type StateStarting

type StateStarting struct {
	StateBase
}

func (*StateStarting) Deploy

func (s *StateStarting) Deploy(event *JobEvent)

func (*StateStarting) Fail

func (s *StateStarting) Fail()

func (*StateStarting) Timeout

func (s *StateStarting) Timeout()

type StateStopping

type StateStopping struct {
	StateBase
}

func (*StateStopping) CleanUp

func (s *StateStopping) CleanUp()

type StateTerminated

type StateTerminated struct {
	StateBase
}

Jump to

Keyboard shortcuts

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