apps

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2016 License: Apache-2.0 Imports: 3 Imported by: 26

Documentation

Index

Constants

View Source
const MarathonConsulLabel = "consul"

Only Marathon apps with this label will be registered in Consul

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Labels          map[string]string `json:"labels"`
	HealthChecks    []HealthCheck     `json:"healthChecks"`
	ID              AppID             `json:"id"`
	Tasks           []Task            `json:"tasks"`
	PortDefinitions []PortDefinition  `json:"portDefinitions"`
}

func ParseApp

func ParseApp(jsonBlob []byte) (*App, error)

func ParseApps

func ParseApps(jsonBlob []byte) ([]*App, error)

func (*App) IsConsulApp added in v0.3.1

func (app *App) IsConsulApp() bool

func (*App) RegistrationIntents added in v1.0.0

func (app *App) RegistrationIntents(task *Task, nameSeparator string) []*RegistrationIntent

func (*App) RegistrationIntentsNumber added in v1.0.0

func (app *App) RegistrationIntentsNumber() int

type AppID added in v1.0.0

type AppID string

Marathon Application Id (aka PathId) Usually in the form of /rootGroup/subGroup/subSubGroup/name allowed characters: lowercase letters, digits, hyphens, slash

func (AppID) String added in v1.0.0

func (id AppID) String() string

type Apps added in v1.0.0

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

type HealthCheck

type HealthCheck struct {
	Path                   string `json:"path"`
	PortIndex              int    `json:"portIndex"`
	Port                   int    `json:"port"`
	Protocol               string `json:"protocol"`
	GracePeriodSeconds     int    `json:"gracePeriodSeconds"`
	IntervalSeconds        int    `json:"intervalSeconds"`
	TimeoutSeconds         int    `json:"timeoutSeconds"`
	MaxConsecutiveFailures int    `json:"maxConsecutiveFailures"`
	Command                struct {
		Value string `json:"value"`
	}
}

type HealthCheckResult added in v0.3.2

type HealthCheckResult struct {
	Alive bool `json:"alive"`
}

type PortDefinition added in v1.0.0

type PortDefinition struct {
	Labels map[string]string `json:"labels"`
}

type RegistrationIntent added in v1.0.0

type RegistrationIntent struct {
	Name string
	Port int
	Tags []string
}

type Task added in v0.3.2

type Task struct {
	ID                 TaskID              `json:"id"`
	TaskStatus         string              `json:"taskStatus"`
	AppID              AppID               `json:"appId"`
	Host               string              `json:"host"`
	Ports              []int               `json:"ports"`
	HealthCheckResults []HealthCheckResult `json:"healthCheckResults"`
}

func ParseTask added in v0.3.2

func ParseTask(event []byte) (*Task, error)

func ParseTasks added in v0.3.2

func ParseTasks(jsonBlob []byte) ([]*Task, error)

func (*Task) IsHealthy added in v0.3.2

func (t *Task) IsHealthy() bool

type TaskID added in v1.0.0

type TaskID string

Marathon Task ID Usually in the form of AppId.uuid with '/' replaced with '_'

func (TaskID) AppID added in v1.0.0

func (id TaskID) AppID() AppID

func (TaskID) String added in v1.0.0

func (id TaskID) String() string

type TasksResponse added in v0.3.2

type TasksResponse struct {
	Tasks []*Task `json:"tasks"`
}

Jump to

Keyboard shortcuts

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