marathon

package
v0.0.0-...-fe2ccbf Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2016 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	ID        string
	Container Container
	Labels    map[string]string
	Ports     []int
}

App represents an application as returned by the Marathon REST API.

type Apps

type Apps struct {
	Apps []App
}

Apps represents a list of applications as returned by the Marathon REST API.

type Config

type Config struct {
	Enabled bool
	Servers string
}

Config contains settings required by the Notifier and ServiceGenerator.

type Container

type Container struct {
	Docker Docker
}

Container as returned by the Marathon REST API.

type Docker

type Docker struct {
	Network      string
	PortMappings []PortMapping
}

Docker container as returned by the Marathon REST API.

type Event

type Event struct {
	EventType string
}

Event as send by the event bus of Marathon.

type Generator

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

Generator talks to Marathon and creates a list of services as a result.

func NewServiceGenerator

func NewServiceGenerator(c *Config) (*Generator, error)

NewServiceGenerator creates and returns a new ServiceGenerator.

func (*Generator) Generate

func (g *Generator) Generate() ([]*types.Service, error)

Generate queries a Marathon master to receive running applications and tasks and generates a list of services.

type PortMapping

type PortMapping struct {
	ContainerPort int
	Protocol      string
	ServicePort   int
}

PortMapping of a Docker container as returend by the Marathon REST API.

type Task

type Task struct {
	AppID        string
	Host         string
	Ports        []int
	ServicePorts []int
}

Task as returend by the Marathon REST API.

type Tasks

type Tasks struct {
	Tasks []Task
}

Tasks represents a list of tasks as returend by the Marathon REST API.

type Watcher

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

Receives messages via the HTTP event bus of Marathon.

func NewNotifier

func NewNotifier(c *Config) *Watcher

NewNotifier creates and returns a new Notifier

func (*Watcher) Start

func (wt *Watcher) Start(refresh chan string, quit chan int, wg *sync.WaitGroup)

Start a HTTP server and register its endpoint with Marathon in order to receive event notifications.

Jump to

Keyboard shortcuts

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