Documentation ¶
Index ¶
- Variables
- func AppsToTargetGroups(apps *AppList) map[string]*targetgroup.Group
- func RandomAppsURL(servers []string) string
- type App
- type AppList
- type AppListClient
- type Container
- type Discovery
- type DockerContainer
- type IPAddress
- type Network
- type PortDefinition
- type PortMapping
- type SDConfig
- type Task
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AppsToTargetGroups ¶
func AppsToTargetGroups(apps *AppList) map[string]*targetgroup.Group
AppsToTargetGroups takes an array of Marathon apps and converts them into target groups.
func RandomAppsURL ¶
RandomAppsURL randomly selects a server from an array and creates an URL pointing to the app list.
Types ¶
type App ¶
type App struct { ID string `json:"id"` Tasks []Task `json:"tasks"` RunningTasks int `json:"tasksRunning"` Labels map[string]string `json:"labels"` Container Container `json:"container"` PortDefinitions []PortDefinition `json:"portDefinitions"` Networks []Network `json:"networks"` }
App describes a service running on Marathon.
type AppListClient ¶
AppListClient defines a function that can be used to get an application list from marathon.
type Container ¶
type Container struct { Docker DockerContainer `json:"docker"` PortMappings []PortMapping `json:"portMappings"` }
Container describes the runtime an app in running in.
type Discovery ¶
type Discovery struct {
// contains filtered or unexported fields
}
Discovery provides service discovery based on a Marathon instance.
func NewDiscovery ¶
NewDiscovery returns a new Marathon Discovery.
type DockerContainer ¶
type DockerContainer struct { Image string `json:"image"` PortMappings []PortMapping `json:"portMappings"` }
DockerContainer describes a container which uses the docker runtime.
type IPAddress ¶
IPAddress describes the address and protocol the container's network interface is bound to.
type PortDefinition ¶
PortDefinition describes which load balancer port you should access to access the service.
type PortMapping ¶
type PortMapping struct { Labels map[string]string `json:"labels"` ContainerPort uint32 `json:"containerPort"` ServicePort uint32 `json:"servicePort"` }
PortMapping describes in which port the process are binding inside the docker container.
type SDConfig ¶
type SDConfig struct { Servers []string `yaml:"servers,omitempty"` RefreshInterval model.Duration `yaml:"refresh_interval,omitempty"` AuthToken config_util.Secret `yaml:"auth_token,omitempty"` AuthTokenFile string `yaml:"auth_token_file,omitempty"` HTTPClientConfig config_util.HTTPClientConfig `yaml:",inline"` }
SDConfig is the configuration for services running on Marathon.
func (*SDConfig) UnmarshalYAML ¶
UnmarshalYAML implements the yaml.Unmarshaler interface.