Documentation
¶
Index ¶
- Constants
- Variables
- func ContainsString(slice []string, val string) bool
- func ParseRepositoryTag(repos string) (string, string)
- type Apparatchik
- func (a *Apparatchik) ApplicatioNames() []string
- func (a *Apparatchik) ApplicationByName(name string) (*Application, error)
- func (p *Apparatchik) ApplicationStatus(applicatioName string) (ApplicationStatus, error)
- func (a *Apparatchik) GetApplicationByName(name string) (*Application, error)
- func (a *Apparatchik) GetContainerIDForGoal(applicatioName, goalName string) (*string, error)
- func (a *Apparatchik) HandleDockerEvent(evt events.Message)
- func (a *Apparatchik) NewApplication(name string, config *ApplicationConfiguration) (ApplicationStatus, error)
- func (a *Apparatchik) Stop()
- func (a *Apparatchik) TerminateApplication(applicationName string) error
- type Application
- func (a *Application) GoalStatusUpdate(goalName, status string)
- func (a *Application) HandleDockerEvent(evt events.Message)
- func (a *Application) Inspect(goalName string) (types.ContainerJSON, error)
- func (a *Application) RequestGoalStart(name string)
- func (a *Application) Status() ApplicationStatus
- func (a *Application) TerminateApplication()
- type ApplicationConfiguration
- type ApplicationStatus
- type AuthConfiguration
- type Goal
- func (g *Goal) AddLineToTail(line string)
- func (goal *Goal) AddStats(st types.StatsJSON)
- func (goal *Goal) ContainerStarted()
- func (goal *Goal) FetchImage()
- func (goal *Goal) FetchImageFailed(reason string)
- func (goal *Goal) FetchImageFinished()
- func (goal *Goal) GetContainerID() *string
- func (goal *Goal) HandleDockerEvent(evt events.Message)
- func (goal *Goal) Inspect() (types.ContainerJSON, error)
- func (goal *Goal) SetContainerID(containerID string)
- func (goal *Goal) SetCurrentStatus(status string)
- func (goal *Goal) SetExitCode(exitCode int)
- func (goal *Goal) SiblingStatusUpdate(goalName, status string)
- func (goal *Goal) Start()
- func (goal *Goal) Status() GoalStatus
- func (goal *Goal) StopContainer()
- func (g *Goal) Tail() string
- func (goal *Goal) TerminateGoal()
- type GoalConfiguration
- type GoalEvent
- type GoalStatus
- type LinkedContainer
- type TransitionLogEntry
Constants ¶
View Source
const MaxListeners = 500
Variables ¶
Functions ¶
func ContainsString ¶
func ParseRepositoryTag ¶
Types ¶
type Apparatchik ¶
var ApparatchikInstance *Apparatchik
func StartApparatchik ¶
func StartApparatchik(dockerClient *client.Client) (*Apparatchik, error)
func (*Apparatchik) ApplicatioNames ¶
func (a *Apparatchik) ApplicatioNames() []string
func (*Apparatchik) ApplicationByName ¶
func (a *Apparatchik) ApplicationByName(name string) (*Application, error)
func (*Apparatchik) ApplicationStatus ¶
func (p *Apparatchik) ApplicationStatus(applicatioName string) (ApplicationStatus, error)
func (*Apparatchik) GetApplicationByName ¶
func (a *Apparatchik) GetApplicationByName(name string) (*Application, error)
func (*Apparatchik) GetContainerIDForGoal ¶
func (a *Apparatchik) GetContainerIDForGoal(applicatioName, goalName string) (*string, error)
func (*Apparatchik) HandleDockerEvent ¶
func (a *Apparatchik) HandleDockerEvent(evt events.Message)
func (*Apparatchik) NewApplication ¶
func (a *Apparatchik) NewApplication(name string, config *ApplicationConfiguration) (ApplicationStatus, error)
func (*Apparatchik) Stop ¶
func (a *Apparatchik) Stop()
func (*Apparatchik) TerminateApplication ¶
func (a *Apparatchik) TerminateApplication(applicationName string) error
type Application ¶
type Application struct {
sync.Mutex
Name string
Configuration *ApplicationConfiguration
Goals map[string]*Goal
MainGoal string
ApplicationFileName string
DockerClient *client.Client
*emission.Emitter
}
func NewApplication ¶
func NewApplication(applicationName string, applicationConfiguration *ApplicationConfiguration, dockerClient *client.Client) *Application
func NewApplicationWithDockerClientFromEnv ¶
func NewApplicationWithDockerClientFromEnv(applicationName string, applicationConfiguration *ApplicationConfiguration) (*Application, error)
func (*Application) GoalStatusUpdate ¶
func (a *Application) GoalStatusUpdate(goalName, status string)
func (*Application) HandleDockerEvent ¶
func (a *Application) HandleDockerEvent(evt events.Message)
func (*Application) Inspect ¶
func (a *Application) Inspect(goalName string) (types.ContainerJSON, error)
func (*Application) RequestGoalStart ¶
func (a *Application) RequestGoalStart(name string)
func (*Application) Status ¶
func (a *Application) Status() ApplicationStatus
func (*Application) TerminateApplication ¶
func (a *Application) TerminateApplication()
type ApplicationConfiguration ¶
type ApplicationConfiguration struct {
Goals map[string]*GoalConfiguration `json:"goals"`
MainGoal string `json:"main_goal"`
}
func (*ApplicationConfiguration) Clone ¶
func (c *ApplicationConfiguration) Clone() *ApplicationConfiguration
func (*ApplicationConfiguration) Validate ¶
func (c *ApplicationConfiguration) Validate() error
type ApplicationStatus ¶
type ApplicationStatus struct {
Name string `json:"name"`
Goals map[string]GoalStatus `json:"goals"`
MainGoal string `json:"main_goal"`
}
type AuthConfiguration ¶
type AuthConfiguration struct {
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
Email string `json:"email,omitempty"`
ServerAddress string `json:"serveraddress,omitempty"`
}
TODO { "identitytoken": "9cbaf023786cd7..." }
type Goal ¶
type Goal struct {
sync.Mutex
Name string
ApplicationName string
DockerClient *client.Client
CurrentStatus string
Goals map[string]*Goal
RunAfterStatuses map[string]string
LinksStatuses map[string]string
UpstreamGoalStatuses map[string]string
ShouldRun bool
ImageExists bool
AuthConfig AuthConfiguration
SmartRestart bool
ContainerId *string
ExitCode *int
*emission.Emitter
// contains filtered or unexported fields
}
func NewGoal ¶
func NewGoal(application *Application, goalName string, applicationName string, configs map[string]*GoalConfiguration, dockerClient *client.Client) *Goal
func (*Goal) AddLineToTail ¶
func (*Goal) ContainerStarted ¶
func (goal *Goal) ContainerStarted()
func (*Goal) FetchImage ¶
func (goal *Goal) FetchImage()
func (*Goal) FetchImageFailed ¶
func (*Goal) FetchImageFinished ¶
func (goal *Goal) FetchImageFinished()
func (*Goal) GetContainerID ¶
func (*Goal) HandleDockerEvent ¶
func (*Goal) Inspect ¶
func (goal *Goal) Inspect() (types.ContainerJSON, error)
TODO move this down the chain - application level
func (*Goal) SetContainerID ¶
func (*Goal) SetCurrentStatus ¶
func (*Goal) SetExitCode ¶
func (*Goal) SiblingStatusUpdate ¶
func (*Goal) Status ¶
func (goal *Goal) Status() GoalStatus
func (*Goal) StopContainer ¶
func (goal *Goal) StopContainer()
func (*Goal) TerminateGoal ¶
func (goal *Goal) TerminateGoal()
type GoalConfiguration ¶
type GoalConfiguration struct {
Image string `json:"image"`
Command []string `json:"command,omitempty"`
RunAfter []string `json:"run_after,omitempty"`
Links []string `json:"links,omitempty"`
ExtraHosts []string `json:"extra_hosts,omitempty"`
Ports []string `json:"ports,omitempty"`
Expose []string `json:"expose,omitempty"`
Volumes []string `json:"volumes,omitempty"`
Environment map[string]string `json:"environment,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
LogDriver string `json:"log_driver,omitempty"`
LogConfig map[string]string `json:"log_config,omitempty"`
Net string `json:"net,omitempty"`
Dns []string `json:"dns,omitempty"`
CapAdd []string `json:"cap_add,omitempty"`
CapDrop []string `json:"cap_drop,omitempty"`
DNSSearch []string `json:"dns_search,omitempty"`
Devices []string `json:"devices,omitempty"`
SecurityOpt []string `json:"security_opt,omitempty"`
WorkingDir string `json:"working_dir,omitempty"`
Entrypoint []string `json:"entrypoint,omitempty"`
User string `json:"user,omitempty"`
Hostname string `json:"hostname,omitempty"`
Domainname string `json:"domainname,omitempty"`
MacAddress string `json:"mac_address,omitempty"`
MemLimit int64 `json:"mem_limit,omitempty"`
MemSwapLimit int64 `json:"memswap_limit,omitempty"`
Privileged bool `json:"privileged,omitempty"`
Restart string `json:"restart,omitempty"`
StdinOpen bool `json:"stdin_open,omitempty"`
AttachStdin bool `json:"attach_stdin,omitempty"`
AttachStdout bool `json:"attach_stdout,omitempty"`
AttachStderr bool `json:"attach_stderr,omitempty"`
Tty bool `json:"tty,omitempty"`
CpuSet string `json:"cpuset,omitempty"`
ReadOnly bool `json:"read_only,omitempty"`
VolumeDriver string `json:"volume_driver,omitempty"`
AuthConfig AuthConfiguration `json:"auth_config,omitempty"`
ContainerName string `json:"container_name,omitempty"`
ExternalLinks []string `json:"external_links,omitempty"`
SmartRestart bool `json:"smart_restart,omitempty"`
}
func (*GoalConfiguration) Clone ¶
func (gc *GoalConfiguration) Clone() *GoalConfiguration
func (*GoalConfiguration) LinkedContainers ¶
func (gc *GoalConfiguration) LinkedContainers() []LinkedContainer
type GoalStatus ¶
type LinkedContainer ¶
type TransitionLogEntry ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.