marathon

package
v0.0.0-...-33bb219 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package marathon provides a scheduler using the Marathon REST API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID        string `json:"id"`
	Instances int    `json:"instances"`
}

App from the Marathon API.

type AppsMessage

type AppsMessage struct {
	Apps []App `json:"apps"`
}

AppsMessage from the Marathon API.

type MarathonScheduler

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

MarathonScheduler holds Marathon API URL and a Backoff struct for each task.

func NewScheduler

func NewScheduler(marathonAPI string, demandUpdate chan struct{}) *MarathonScheduler

NewScheduler returns a pointer to the scheduler.

func (*MarathonScheduler) Cleanup

func (m *MarathonScheduler) Cleanup() error

Cleanup gives the scheduler an opportunity to stop anything that needs to be stopped

func (*MarathonScheduler) CountAllTasks

func (m *MarathonScheduler) CountAllTasks(running *demand.Tasks) error

CountAllTasks tells us how many instances of each task are currently running.

func (*MarathonScheduler) InitScheduler

func (m *MarathonScheduler) InitScheduler(task *demand.Task) (err error)

InitScheduler initializes the scheduler.

func (*MarathonScheduler) StopStartTasks

func (m *MarathonScheduler) StopStartTasks(tasks *demand.Tasks) error

StopStartTasks by calling the Marathon scaling API.

Jump to

Keyboard shortcuts

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