Documentation ¶
Index ¶
- Constants
- Variables
- func Merge(p *Project, bytes []byte) (map[string]*ServiceConfig, error)
- type Command
- type ConfigLookup
- type Container
- type EmptyService
- type EnvironmentLookup
- type Event
- type FileConfigLookup
- type MaporColonSlice
- type MaporEqualSlice
- type MaporSpaceSlice
- type Project
- func (p *Project) AddConfig(name string, config *ServiceConfig) error
- func (p *Project) AddListener(c chan<- ProjectEvent)
- func (p *Project) Create(services ...string) error
- func (p *Project) CreateService(name string) (Service, error)
- func (p *Project) Delete(services ...string) error
- func (p *Project) Down(services ...string) error
- func (p *Project) Load(bytes []byte) error
- func (p *Project) Log(services ...string) error
- func (p *Project) Notify(event Event, serviceName string, data map[string]string)
- func (p *Project) Restart(services ...string) error
- func (p *Project) Up(services ...string) 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_IGNORED = Event("Ignoring") SERVICE_UP = Event("Started") SERVICE_CREATE_START = Event("Creating") SERVICE_CREATE = Event("Created") SERVICE_DELETE_START = Event("Deleting") SERVICE_DELETE = Event("Deleted") SERVICE_DOWN_START = Event("Stopping") SERVICE_DOWN = Event("Stopped") SERVICE_RESTART_START = Event("Restarting") SERVICE_RESTART = Event("Restarted") PROJECT_DOWN_START = Event("Stopping project") PROJECT_DOWN_DONE = Event("Project stopped") PROJECT_CREATE_START = Event("Creating project") PROJECT_CREATE_DONE = Event("Project created") PROJECT_UP_START = Event("Starting project") PROJECT_UP_DONE = Event("Project started") PROJECT_DELETE_START = Event("Deleting project") PROJECT_DELETE_DONE = Event("Project deleted") PROJECT_RESTART_START = Event("Restarting project") PROJECT_RESTART_DONE = Event("Project restarted") 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") )
View Source
var (
ValidRemotes = []string{
"git://",
"git@github.com:",
"github.com",
"http:",
"https:",
}
)
Functions ¶
Types ¶
type Command ¶ added in v0.3.2
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶ added in v0.3.2
func (Command) MarshalYAML ¶ added in v0.3.2
func (*Command) UnmarshalYAML ¶ added in v0.3.2
type ConfigLookup ¶ added in v0.3.2
type EmptyService ¶ added in v0.3.2
type EmptyService struct { }
func (*EmptyService) Create ¶ added in v0.3.2
func (e *EmptyService) Create() error
func (*EmptyService) Delete ¶ added in v0.3.2
func (e *EmptyService) Delete() error
func (*EmptyService) Down ¶ added in v0.3.2
func (e *EmptyService) Down() error
func (*EmptyService) Log ¶ added in v0.3.2
func (e *EmptyService) Log() error
func (*EmptyService) Restart ¶ added in v0.3.2
func (e *EmptyService) Restart() error
func (*EmptyService) Scale ¶ added in v0.3.2
func (e *EmptyService) Scale(count int) error
func (*EmptyService) Up ¶ added in v0.3.2
func (e *EmptyService) Up() error
type EnvironmentLookup ¶
type EnvironmentLookup interface {
Lookup(key, serviceName string, config *ServiceConfig) []string
}
type FileConfigLookup ¶ added in v0.3.2
type FileConfigLookup struct { }
type MaporColonSlice ¶ added in v0.3.2
type MaporColonSlice struct {
// contains filtered or unexported fields
}
func NewMaporColonSlice ¶ added in v0.3.2
func NewMaporColonSlice(parts []string) MaporColonSlice
func (MaporColonSlice) MarshalYAML ¶ added in v0.3.2
func (s MaporColonSlice) MarshalYAML() (interface{}, error)
func (*MaporColonSlice) Slice ¶ added in v0.3.2
func (s *MaporColonSlice) Slice() []string
func (*MaporColonSlice) UnmarshalYAML ¶ added in v0.3.2
func (s *MaporColonSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type MaporEqualSlice ¶ added in v0.3.2
type MaporEqualSlice struct {
// contains filtered or unexported fields
}
func NewMaporEqualSlice ¶ added in v0.3.2
func NewMaporEqualSlice(parts []string) MaporEqualSlice
func (MaporEqualSlice) MarshalYAML ¶ added in v0.3.2
func (s MaporEqualSlice) MarshalYAML() (interface{}, error)
func (*MaporEqualSlice) Slice ¶ added in v0.3.2
func (s *MaporEqualSlice) Slice() []string
func (*MaporEqualSlice) UnmarshalYAML ¶ added in v0.3.2
func (s *MaporEqualSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type MaporSpaceSlice ¶ added in v0.3.2
type MaporSpaceSlice struct {
// contains filtered or unexported fields
}
func NewMaporSpaceSlice ¶ added in v0.3.2
func NewMaporSpaceSlice(parts []string) MaporSpaceSlice
func (MaporSpaceSlice) MarshalYAML ¶ added in v0.3.2
func (s MaporSpaceSlice) MarshalYAML() (interface{}, error)
func (*MaporSpaceSlice) Slice ¶ added in v0.3.2
func (s *MaporSpaceSlice) Slice() []string
func (*MaporSpaceSlice) UnmarshalYAML ¶ added in v0.3.2
func (s *MaporSpaceSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type Project ¶
type Project struct { EnvironmentLookup EnvironmentLookup ConfigLookup ConfigLookup Name string Configs map[string]*ServiceConfig File 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)
type ProjectEvent ¶
type ServiceConfig ¶
type ServiceConfig struct { Build string `yaml:"build,omitempty"` CapAdd []string `yaml:"cap_add,omitempty"` CapDrop []string `yaml:"cap_drop,omitempty"` CpuSet string `yaml:"cpu_set,omitempty"` Command Command `yaml:"command"` // omitempty breaks serialization! Detach string `yaml:"detach,omitempty"` Devices []string `yaml:"devices,omitempty"` Dns Stringorslice `yaml:"dns"` // omitempty breaks serialization! DnsSearch Stringorslice `yaml:"dns_search"` // omitempty breaks serialization! Dockerfile string `yaml:"dockerfile,omitempty"` DomainName string `yaml:"domainname,omitempty"` Entrypoint Command `yaml:"entrypoint"` // omitempty breaks serialization! EnvFile Stringorslice `yaml:"env_file"` // omitempty breaks serialization! Environment MaporEqualSlice `yaml:"environment"` // omitempty breaks serialization! Hostname string `yaml:"hostname,omitempty"` Image string `yaml:"image,omitempty"` Labels SliceorMap `yaml:"labels"` // omitempty breaks serialization! Links MaporColonSlice `yaml:"links"` // omitempty breaks serialization! LogDriver string `yaml:"log_driver,omitempty"` MemLimit int64 `yaml:"mem_limit,omitempty"` MemSwapLimit int64 `yaml:"mem_swap_limit,omitempty"` Name string `yaml:"name,omitempty"` Net string `yaml:"net,omitempty"` Pid string `yaml:"pid,omitempty"` Uts string `yaml:"uts,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"` SecurityOpt []string `yaml:"security_opt,omitempty"` Tty bool `yaml:"tty,omitempty"` User string `yaml:"user,omitempty"` VolumeDriver string `yaml:"volume_driver,omitempty"` Volumes []string `yaml:"volumes,omitempty"` VolumesFrom []string `yaml:"volumes_from,omitempty"` WorkingDir string `yaml:"working_dir,omitempty"` Expose []string `yaml:"expose,omitempty"` ExternalLinks []string `yaml:"external_links,omitempty"` LogOpt map[string]string `yaml:"log_opt,omitempty"` ExtraHosts []string `yaml:"extra_hosts,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.