service

package
v0.4.159 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package service contains abstraction for job runners.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DockerJob

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

func NewDockerJob

func NewDockerJob(depReq *models.DeploymentRequest) *DockerJob

NewJob creates a new job, let it be docker container or something else.

func (*DockerJob) Run

func (dj *DockerJob) Run(
	beforeStart PreStartCallback,
	running RunningCallback,
	failed FailedCallback,
	succeeded SucceededCallback,
) error

type FailedCallback

type FailedCallback func()

type JobRunner

type JobRunner interface {
	Run() error
	Stop() error
	IsRunning() bool
	IsStopped() bool
}

JobRunner is kind of base class for all the runner. Note: When adding new methods for other comcrete class (interface implementations), make sure methods are common to all the runners.

type PreStartCallback

type PreStartCallback func()

type RunningCallback

type RunningCallback func()

type SucceededCallback

type SucceededCallback func()

Jump to

Keyboard shortcuts

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