orchestrator

package
v0.1.6-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Healthy   int = 0
	Deploying int = 1
	Error     int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	Path string
}

func NewCache

func NewCache(c Cache) Cache

func (*Cache) CacheJob

func (c *Cache) CacheJob(j Job) error

func (*Cache) ListCache

func (c *Cache) ListCache() ([]CacheJob, error)

func (*Cache) SearchCache

func (c *Cache) SearchCache(id string) (Job, error)

func (*Cache) UncacheJob

func (c *Cache) UncacheJob(j Job) error

type CacheData

type CacheData struct {
	Jobs []CacheJob `json:"jobs"`
}

type CacheJob

type CacheJob struct {
	Name        string `json:"name"`
	ContainerId string `json:"container_id"`
	ImageName   string `json:"image_name"`
	Port        int    `json:"port"`
}

type Job

type Job struct {
	Context   context.Context
	Port      int
	Name      string
	ImageName string
	Id        string
	Health    int
}

func NewJob

func NewJob(job Job) Job

func (*Job) Run

func (j *Job) Run() error

type Orchestrator

type Orchestrator struct {
	Context context.Context
	Cache   Cache
	Jobs    []Job
}

func NewOrchestrator

func NewOrchestrator(o Orchestrator) (Orchestrator, error)

func (*Orchestrator) Get

func (o *Orchestrator) Get(job string) (Job, error)

func (*Orchestrator) List

func (o *Orchestrator) List() []CacheJob

func (*Orchestrator) New

func (o *Orchestrator) New(job Job) error

Jump to

Keyboard shortcuts

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