Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactorization of Module API #23

Open
wants to merge 39 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
04bead7
Godeps updates
christianparpart Sep 17, 2016
126a944
adds some helper more functions
christianparpart Sep 17, 2016
a92774d
initial and incomplete refactor code with more abstract (easy) module…
christianparpart Sep 17, 2016
3cd00d7
adds shutdown code paths
christianparpart Sep 17, 2016
f719a65
partial move to new module interface
christianparpart Sep 17, 2016
92a715c
move group filtering to core
christianparpart Sep 17, 2016
960b313
adds SIGTERM/SIGQUIT handling
christianparpart Sep 19, 2016
2497185
code cleanup
christianparpart Sep 19, 2016
4e2ec33
comments be comments
christianparpart Sep 19, 2016
5f2dcf9
moved isGroupIncluded into the core. so out of here
christianparpart Sep 19, 2016
b229999
initial porting of haproxy module (into its own new file)
christianparpart Sep 19, 2016
eaa5e53
haproxy: adds gw settings support, more cleanups
christianparpart Sep 19, 2016
629e3a4
haproxy: filter by protocol (tcp/http)
christianparpart Sep 19, 2016
c9c1efd
snip
christianparpart Sep 19, 2016
8a6aae3
core: also import main apps labels and then port based labels on top …
christianparpart Sep 19, 2016
5c85d64
haproxy: got it working.
christianparpart Sep 19, 2016
cb6e63b
do pointers for AppCluster and related & streamline file naming.
christianparpart Sep 19, 2016
2ab446b
some API documentation
christianparpart Sep 19, 2016
a8e1418
some initial (general purpose) tests, for helper.go
christianparpart Sep 19, 2016
484a3b7
port files module
christianparpart Sep 19, 2016
c457449
documentation update
christianparpart Sep 19, 2016
f6709d1
core: ensure RemoveTask also removes it from app cluster's task list
christianparpart Sep 19, 2016
3f0588e
wip
christianparpart Sep 20, 2016
f07d0d8
wip
christianparpart Sep 20, 2016
0b6edaf
Go linter warning fixes
Sep 20, 2016
70d6180
WIP rewrite DNS module and packaging
Sep 20, 2016
dc89ef1
Rename module_api to core. looks prettier ^o^
christianparpart Sep 20, 2016
cc58b40
renamed modules_api to core, created util & sse namespace, and adapte…
christianparpart Sep 20, 2016
c189804
slightly improved eventlogger output (just prefixes, yeah)
christianparpart Sep 20, 2016
e42b90e
adds eventlogger module to CLI param list
christianparpart Sep 20, 2016
6edc0cc
haproxy module cleanup
christianparpart Sep 20, 2016
7afe6b9
conform to hipster bus-words
christianparpart Sep 20, 2016
2cbea5a
wip
christianparpart Sep 20, 2016
67a38ac
The Marathon ID is stored in Name
Sep 21, 2016
9e84035
wip wrt. deployment_info
christianparpart Sep 22, 2016
a81b363
It was not return the fqdn for the request
Feb 24, 2017
441b0db
Exported methods without a comment
Feb 24, 2017
8921ded
Remove old code
Mar 9, 2017
11bb7fa
Add logging
Mar 9, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions core/app.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package core

// Marathon independant application definitions

type AppCluster struct {
Name string // Marathon's human reaable AppId (i.e. /path/to/app)
Id string // globally unique ID that identifies this application
ServicePort uint // service port to listen to in service discovery
Protocol string // service protocol
PortName string // user filled port name
Labels map[string]string // key/value pairs of labels (port-local | global)
HealthCheck *AppHealthCheck // healthcheck, if available, or nil
Backends []AppBackend // ordered list of backend tasks
PortIndex int // Marathon's application port index
}

type AppHealthCheck struct {
Protocol string
Path string
Command *string
GracePeriodSeconds uint
IntervalSeconds uint
TimeoutSeconds uint
MaxConsecutiveFailures uint
IgnoreHttp1xx bool
}

type AppBackend struct {
Id string
Host string
Port uint
State string
}
30 changes: 30 additions & 0 deletions core/event_listener.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package core

// EventListener provides an interface for hooking into
// standard service discovery API calls, such as adding and removing
// backends from load balancers (app clusters).
type EventListener interface {
// Startup is invoked upon application startup
Startup()

// Shutdown is invoked upon application shutdown
Shutdown()

// Apply installs the load balancer for all apps.
//
// This function is invoked upon startup to synchronize with the current
// state.
Apply(apps []*AppCluster)

// AddTask must add the given backend to the cluster.
//
// It is assured that the task to be added is also already added to the
// given AppCluster.
AddTask(task *AppBackend, app *AppCluster)

// RemoveTask must remove the given backend from the cluster.
//
// It is ensured that the task to be removed is not present in the given
// AppCluster.
RemoveTask(task *AppBackend, app *AppCluster)
}
218 changes: 0 additions & 218 deletions dns_manager.go

This file was deleted.

Loading