Documentation ¶
Index ¶
- Constants
- Variables
- func GetContainerFromIpcLikeConfig(p *Project, conf string) string
- func GetServiceHash(service Service) string
- func Merge(p *Project, bytes []byte) (map[string]*ServiceConfig, error)
- func NameAlias(name string) (string, string)
- func NewDefaultListener(p *Project) chan<- ProjectEvent
- type Command
- type ConfigLookup
- type Container
- type Context
- type EmptyService
- func (e *EmptyService) Build() error
- func (e *EmptyService) Containers() ([]Container, error)
- func (e *EmptyService) Create() error
- func (e *EmptyService) Delete() error
- func (e *EmptyService) Down() error
- func (e *EmptyService) Info() (InfoSet, error)
- func (e *EmptyService) Kill() error
- func (e *EmptyService) Log() error
- func (e *EmptyService) Pull() error
- func (e *EmptyService) Restart() error
- func (e *EmptyService) Scale(count int) error
- func (e *EmptyService) Start() error
- func (e *EmptyService) Up() error
- type EnvironmentLookup
- type Event
- type Info
- type InfoPart
- type InfoSet
- 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) Build(services ...string) error
- 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) Kill(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) Parse() error
- func (p *Project) Pull(services ...string) error
- func (p *Project) Restart(services ...string) error
- func (p *Project) Start(services ...string) error
- func (p *Project) Up(services ...string) error
- type ProjectEvent
- type Service
- type ServiceConfig
- type ServiceFactory
- type ServiceRelationship
- type ServiceRelationshipType
- type ServiceState
- type SliceorMap
- type Stringorslice
Constants ¶
View Source
const ( CONTAINER_ID = "container_id" NO_EVENT = Event(iota) CONTAINER_CREATED = Event(iota) CONTAINER_STARTED = Event(iota) SERVICE_ADD = Event(iota) SERVICE_UP_START = Event(iota) SERVICE_UP_IGNORED = Event(iota) SERVICE_UP = Event(iota) SERVICE_CREATE_START = Event(iota) SERVICE_CREATE = Event(iota) SERVICE_DELETE_START = Event(iota) SERVICE_DELETE = Event(iota) SERVICE_DOWN_START = Event(iota) SERVICE_DOWN = Event(iota) SERVICE_RESTART_START = Event(iota) SERVICE_RESTART = Event(iota) SERVICE_PULL_START = Event(iota) SERVICE_PULL = Event(iota) SERVICE_KILL_START = Event(iota) SERVICE_KILL = Event(iota) SERVICE_START_START = Event(iota) SERVICE_START = Event(iota) SERVICE_BUILD_START = Event(iota) SERVICE_BUILD = Event(iota) PROJECT_DOWN_START = Event(iota) PROJECT_DOWN_DONE = Event(iota) PROJECT_CREATE_START = Event(iota) PROJECT_CREATE_DONE = Event(iota) PROJECT_UP_START = Event(iota) PROJECT_UP_DONE = Event(iota) PROJECT_DELETE_START = Event(iota) PROJECT_DELETE_DONE = Event(iota) PROJECT_RESTART_START = Event(iota) PROJECT_RESTART_DONE = Event(iota) PROJECT_RELOAD = Event(iota) PROJECT_RELOAD_TRIGGER = Event(iota) PROJECT_KILL_START = Event(iota) PROJECT_KILL_DONE = Event(iota) PROJECT_START_START = Event(iota) PROJECT_START_DONE = Event(iota) PROJECT_BUILD_START = Event(iota) PROJECT_BUILD_DONE = Event(iota) )
View Source
const REL_TYPE_IPC_NAMESPACE = ServiceRelationshipType("ipc")
View Source
const REL_TYPE_LINK = ServiceRelationshipType("")
View Source
const REL_TYPE_NET_NAMESPACE = ServiceRelationshipType("netns")
View Source
const REL_TYPE_VOLUMES_FROM = ServiceRelationshipType("volumesFrom")
Variables ¶
View Source
var ( EXECUTED ServiceState = ServiceState("executed") UNKNOWN ServiceState = ServiceState("unknown") ErrRestart error = errors.New("Restart execution") ErrUnsupported error = errors.New("UnsupportedOperation") )
View Source
var (
ValidRemotes = []string{
"git://",
"git@github.com:",
"github.com",
"http:",
"https:",
}
)
Functions ¶
func GetServiceHash ¶
func NewDefaultListener ¶
func NewDefaultListener(p *Project) chan<- ProjectEvent
Types ¶
type Command ¶
type Command struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func (Command) MarshalYAML ¶
func (*Command) UnmarshalYAML ¶
type ConfigLookup ¶
type Context ¶
type Context struct { Timeout int Log bool Signal string ComposeFile string ComposeBytes []byte ProjectName string ServiceFactory ServiceFactory EnvironmentLookup EnvironmentLookup ConfigLookup ConfigLookup LoggerFactory logger.Factory IgnoreMissingConfig bool Project *Project // contains filtered or unexported fields }
type EmptyService ¶
type EmptyService struct { }
func (*EmptyService) Build ¶
func (e *EmptyService) Build() error
func (*EmptyService) Containers ¶
func (e *EmptyService) Containers() ([]Container, error)
func (*EmptyService) Create ¶
func (e *EmptyService) Create() error
func (*EmptyService) Delete ¶
func (e *EmptyService) Delete() error
func (*EmptyService) Down ¶
func (e *EmptyService) Down() error
func (*EmptyService) Info ¶
func (e *EmptyService) Info() (InfoSet, error)
func (*EmptyService) Kill ¶
func (e *EmptyService) Kill() error
func (*EmptyService) Log ¶
func (e *EmptyService) Log() error
func (*EmptyService) Pull ¶
func (e *EmptyService) Pull() error
func (*EmptyService) Restart ¶
func (e *EmptyService) Restart() error
func (*EmptyService) Scale ¶
func (e *EmptyService) Scale(count int) error
func (*EmptyService) Start ¶
func (e *EmptyService) Start() error
func (*EmptyService) Up ¶
func (e *EmptyService) Up() error
type EnvironmentLookup ¶
type EnvironmentLookup interface {
Lookup(key, serviceName string, config *ServiceConfig) []string
}
type MaporColonSlice ¶
type MaporColonSlice struct {
// contains filtered or unexported fields
}
func NewMaporColonSlice ¶
func NewMaporColonSlice(parts []string) MaporColonSlice
func (MaporColonSlice) MarshalYAML ¶
func (s MaporColonSlice) MarshalYAML() (interface{}, error)
func (*MaporColonSlice) Slice ¶
func (s *MaporColonSlice) Slice() []string
func (*MaporColonSlice) UnmarshalYAML ¶
func (s *MaporColonSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type MaporEqualSlice ¶
type MaporEqualSlice struct {
// contains filtered or unexported fields
}
func NewMaporEqualSlice ¶
func NewMaporEqualSlice(parts []string) MaporEqualSlice
func (MaporEqualSlice) MarshalYAML ¶
func (s MaporEqualSlice) MarshalYAML() (interface{}, error)
func (*MaporEqualSlice) Slice ¶
func (s *MaporEqualSlice) Slice() []string
func (*MaporEqualSlice) UnmarshalYAML ¶
func (s *MaporEqualSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type MaporSpaceSlice ¶
type MaporSpaceSlice struct {
// contains filtered or unexported fields
}
func NewMaporSpaceSlice ¶
func NewMaporSpaceSlice(parts []string) MaporSpaceSlice
func (MaporSpaceSlice) MarshalYAML ¶
func (s MaporSpaceSlice) MarshalYAML() (interface{}, error)
func (*MaporSpaceSlice) Slice ¶
func (s *MaporSpaceSlice) Slice() []string
func (*MaporSpaceSlice) UnmarshalYAML ¶
func (s *MaporSpaceSlice) UnmarshalYAML(unmarshal func(interface{}) error) error
type Project ¶
type Project struct { Name string Configs map[string]*ServiceConfig File string ReloadCallback func() error // contains filtered or unexported fields }
func NewProject ¶
func (*Project) AddListener ¶
func (p *Project) AddListener(c chan<- ProjectEvent)
type ProjectEvent ¶
type Service ¶
type Service interface { Info() (InfoSet, error) Name() string Build() error Create() error Up() error Start() error Down() error Delete() error Restart() error Log() error Pull() error Kill() error Config() *ServiceConfig DependentServices() []ServiceRelationship Containers() ([]Container, error) Scale(count int) error }
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 ServiceRelationship ¶
type ServiceRelationship struct {
Target, Alias string
Type ServiceRelationshipType
Optional bool
}
func DefaultDependentServices ¶
func DefaultDependentServices(p *Project, s Service) []ServiceRelationship
func NewServiceRelationship ¶
func NewServiceRelationship(nameAlias string, relType ServiceRelationshipType) ServiceRelationship
type ServiceRelationshipType ¶
type ServiceRelationshipType string
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.