configstore

package
v0.0.0-...-de830e9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2014 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigStore

type ConfigStore interface {
	Get(ref string) (JobConfig, error)
	Put(JobConfig) (ref string, err error)
}

ConfigStore defines read and write behavior expected from a config store.

type HealthCheck

type HealthCheck struct {
	Protocol     string             `json:"protocol"` // HTTP, TCP
	Port         string             `json:"port"`     // from key of ports map in container config, i.e. env var name
	InitialDelay agent.JSONDuration `json:"initial_delay"`
	Timeout      agent.JSONDuration `json:"timeout"`
	Interval     agent.JSONDuration `json:"interval"`

	// Special parameters for HTTP health checks.
	HTTPPath                string `json:"http_path,omitempty"`                 // e.g. "/-/health"
	HTTPAcceptableResponses []int  `json:"http_acceptable_responses,omitempty"` // e.g. [200,201,301]
}

HealthCheck defines how a third party can determine if an instance of a given task is healthy. HealthChecks are defined and persisted in the config store, but executed by the agent or scheduler.

HealthChecks are largely inspired by the Marathon definition. https://github.com/mesosphere/marathon/blob/master/REST.md

func (HealthCheck) Valid

func (c HealthCheck) Valid() error

Valid performs a validation check, to ensure invalid structures may be detected as early as possible.

type JobConfig

type JobConfig struct {
	Job          string        `json:"job"`         // goku-activity, stream-api, dispatcher-web, etc.
	Environment  string        `json:"environment"` // dev, staging, prod
	Product      string        `json:"product"`     // search, stream, revdev, etc.
	Scale        int           `json:"scale"`
	HealthChecks []HealthCheck `json:"health_checks"`

	agent.ContainerConfig
}

JobConfig defines a configuration for a job, which is a collection of identical tasks. JobConfigs are declared by the user and stored in the config store. JobConfigs are maintained and persisted by the scheduler when they're scheduled.

func (JobConfig) Hash

func (c JobConfig) Hash() string

Hash produces a short and unique content-addressable string.

func (JobConfig) Valid

func (c JobConfig) Valid() error

Valid performs a validation check, to ensure invalid structures may be detected as early as possible.

Jump to

Keyboard shortcuts

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