task

package
v0.0.0-...-cf60b3e Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name          string
	AttachStdin   bool
	AttachStdout  bool
	AttachStderr  bool
	Cmd           []string
	Image         string
	CPU           float64
	Memory        int64
	Disk          int64
	ExposedPorts  nat.PortSet
	Env           []string
	RestartPolicy string
	Runtime       Runtime
}

type Docker

type Docker struct {
	Client *client.Client
	Config Config
}

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
}

type Runtime

type Runtime struct {
	ContainerID string
}

type State

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

type Task

type Task struct {
	ID            uuid.UUID
	Name          string
	State         job.State
	Image         string
	CPU           float64
	Memory        int
	Disk          int
	ExposedPorts  nat.PortSet
	PortBindings  map[string]string
	RestartPolicy string
	StartTime     time.Time
	FinishTime    time.Time
	Timestamp     time.Time
}

type TaskEvent

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

Jump to

Keyboard shortcuts

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