task

package
v0.0.0-...-4caa0be Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(states []string, state string) bool

func ValidStateTransition

func ValidStateTransition(src string, dst string) bool

Types

type Docker

type Docker struct {
	Client      *client.Client
	Config      config.Config
	ContainerId string
}

func (*Docker) Run

func (d *Docker) Run() DockerResult

func (*Docker) Stop

func (d *Docker) Stop(id string) DockerResult

type DockerResult

type DockerResult struct {
	Error       error
	Action      string
	ContainerId string
	Result      string
	Message     string
}

type Local

type Local struct {
	Name        string
	PortMapping string
	Cpu         float64
	Memory      float64
	ContainerID string
	Owner       string
}

type State

type State int
const (
	Pending State = iota
	Scheduled
	Running
	Completed
	Failed
)

func (State) String

func (s State) String() string

type Task

type Task struct {
	ID            uuid.UUID `json:"id"`
	Name          string    `json:"name"`
	State         string    `json:"state"`
	Image         string    `json:"image"`
	Memory        int64     `json:"memory"`
	Disk          int64     `json:"disk"`
	ExposedPorts  string    `json:"exposedPorts"`
	PortBindings  string    `json:"portBindings"`
	RestartPolicy string    `json:"restartPolicy"`
	StartTime     time.Time `json:"startTime"`
	EndTime       time.Time `json:"endTime"`
	FinishTime    time.Time `json:"finishTime"`
	Duration      time.Time `json:"duration"`
	ContainerID   string    `json:"containerId"`
	Cpus          float32   `json:"cpus"`
}

func (*Task) NewConfig

func (t *Task) NewConfig(task *Task) config.Config

func (*Task) NewDocker

func (t *Task) NewDocker(conf config.Config) Docker

type TaskEvent

type TaskEvent struct {
	ID        uuid.UUID
	State     State
	Timestamp time.Time
	Task      Task
}

Jump to

Keyboard shortcuts

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