Documentation ¶
Index ¶
- Constants
- Variables
- type EnvironmentLookup
- type Event
- type Maporslice
- type Project
- func (p *Project) AddConfig(name string, config *ServiceConfig) error
- func (p *Project) AddListener(c chan<- ProjectEvent)
- func (p *Project) CreateService(name string, config ServiceConfig) (Service, error)
- func (p *Project) Load(bytes []byte) error
- func (p *Project) Notify(event Event, serviceName string, data map[string]string)
- func (p *Project) Up() error
- type ProjectEvent
- type Service
- type ServiceConfig
- type ServiceFactory
- type ServiceState
- type SliceorMap
- type Stringorslice
Constants ¶
View Source
const ( CONTAINER_ID = "container_id" CONTAINER_STARTING = Event("Starting container") CONTAINER_CREATED = Event("Created container") CONTAINER_STARTED = Event("Started container") SERVICE_ADD = Event("Adding") SERVICE_UP_START = Event("Starting") SERVICE_UP = Event("Started") PROJECT_UP_START = Event("Starting project") PROJECT_UP_DONE = Event("Project started") PROJECT_RELOAD = Event("Reloading project") PROJECT_RELOAD_TRIGGER = Event("Triggering project reload") )
Variables ¶
View Source
var ( EXECUTED ServiceState = ServiceState("executed") UNKNOWN ServiceState = ServiceState("unknown") ErrRestart error = errors.New("Restart execution") )
Functions ¶
This section is empty.
Types ¶
type EnvironmentLookup ¶
type EnvironmentLookup interface {
Lookup(key, serviceName string, config *ServiceConfig) []string
}
type Maporslice ¶
type Maporslice struct {
// contains filtered or unexported fields
}
func NewMaporslice ¶
func NewMaporslice(parts []string) Maporslice
func (*Maporslice) MarshalYAML ¶
func (s *Maporslice) MarshalYAML() (interface{}, error)
func (*Maporslice) Slice ¶
func (s *Maporslice) Slice() []string
func (*Maporslice) UnmarshalYAML ¶
func (s *Maporslice) UnmarshalYAML(unmarshal func(interface{}) error) error
type Project ¶
type Project struct { EnvironmentLookup EnvironmentLookup Name string ReloadCallback func() error // contains filtered or unexported fields }
func NewProject ¶
func NewProject(name string, factory ServiceFactory) *Project
func (*Project) AddListener ¶
func (p *Project) AddListener(c chan<- ProjectEvent)
func (*Project) CreateService ¶
func (p *Project) CreateService(name string, config ServiceConfig) (Service, error)
type ProjectEvent ¶
type Service ¶
type Service interface { Name() string Up() error Config() *ServiceConfig }
type ServiceConfig ¶
type ServiceConfig struct { CapAdd []string `yaml:"cap_add,omitempty"` CapDrop []string `yaml:"cap_drop,omitempty"` Command string `yaml:"command,omitempty"` Detach string `yaml:"detach,omitempty"` Dns Stringorslice `yaml:"dns,omitempty"` DnsSearch Stringorslice `yaml:"dns_search,omitempty"` DomainName string `yaml:"domainname,omitempty"` Entrypoint string `yaml:"entrypoint,omitempty"` EnvFile string `yaml:"env_file,omitempty"` Environment Maporslice `yaml:"environment,omitempty"` Hostname string `yaml:"hostname,omitempty"` Image string `yaml:"image,omitempty"` Labels SliceorMap `yaml:"labels,omitempty"` Links []string `yaml:"links,omitempty"` LogDriver string `yaml:"log_driver,omitempty"` MemLimit int64 `yaml:"mem_limit,omitempty"` Name string `yaml:"name,omitempty"` Net string `yaml:"net,omitempty"` Pid string `yaml:"pid,omitempty"` Ipc string `yaml:"ipc,omitempty"` Ports []string `yaml:"ports,omitempty"` Privileged bool `yaml:"privileged,omitempty"` Restart string `yaml:"restart,omitempty"` ReadOnly bool `yaml:"read_only,omitempty"` StdinOpen bool `yaml:"stdin_open,omitempty"` Tty bool `yaml:"tty,omitempty"` User string `yaml:"user,omitempty"` Volumes []string `yaml:"volumes,omitempty"` VolumesFrom []string `yaml:"volumes_from,omitempty"` WorkingDir string `yaml:"working_dir,omitempty"` //`yaml:"build,omitempty"` Expose []string `yaml:"expose,omitempty"` ExternalLinks []string `yaml:"external_links,omitempty"` }
type ServiceFactory ¶
type ServiceFactory interface {
Create(project *Project, name string, serviceConfig *ServiceConfig) (Service, error)
}
type ServiceState ¶
type ServiceState string
type SliceorMap ¶
type SliceorMap struct {
// contains filtered or unexported fields
}
func NewSliceorMap ¶
func NewSliceorMap(parts map[string]string) SliceorMap
func (*SliceorMap) MapParts ¶
func (s *SliceorMap) MapParts() map[string]string
func (*SliceorMap) MarshalYAML ¶
func (s *SliceorMap) MarshalYAML() (interface{}, error)
func (*SliceorMap) UnmarshalYAML ¶
func (s *SliceorMap) UnmarshalYAML(unmarshal func(interface{}) error) error
type Stringorslice ¶
type Stringorslice struct {
// contains filtered or unexported fields
}
func NewStringorslice ¶
func NewStringorslice(parts ...string) Stringorslice
func (*Stringorslice) Len ¶
func (s *Stringorslice) Len() int
func (*Stringorslice) MarshalYAML ¶
func (s *Stringorslice) MarshalYAML() (interface{}, error)
func (*Stringorslice) Slice ¶
func (s *Stringorslice) Slice() []string
func (*Stringorslice) UnmarshalYAML ¶
func (s *Stringorslice) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.