Documentation
¶
Index ¶
- func EnsureBin() error
- func SnakeToCamel(txt string) string
- func SubnetFromDocker(docker *client.Client) ([]*net.IPNet, error)
- func ValidateNoDotDot(src, dest string, ro bool) error
- func ValidateVolumeInplace(src, dest string, ro bool) error
- type Compose
- func (c *Compose) InjectCacheVolume()
- func (c Compose) MarshalYAML() (interface{}, error)
- func (c Compose) NewServiceGraph() ServiceGraph
- func (c *Compose) RegisteredName() string
- func (c *Compose) UnmarshalYAML(value *yaml.Node) error
- func (c Compose) Up(workingDirectory string, environments map[string]string, runID int) (_run.Run, error)
- func (c Compose) Validate() error
- func (c *Compose) WalkServices(fn func(name string, value map[string]interface{}) error) error
- type ComposeValidator
- type DockerRun
- type Networks
- type Recomposator
- type ServiceDepth
- type ServiceGraph
- type ServicePatcher
- type ServiceValidator
- type VolumePatcher
- type VolumeValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SnakeToCamel ¶
func ValidateNoDotDot ¶
func ValidateVolumeInplace ¶
Types ¶
type Compose ¶
type Compose struct { Networks map[string]interface{} `json:"networks,omitempty"` Volumes map[string]interface{} `json:"volumes,omitempty"` Version string `json:"version"` // Compose version Services map[string]interface{} `json:"services"` X map[string]interface{} `json:"X,omitempty"` // The x-stuff on top level, just for aliasing }
Compose is a docker-compose project FIXME there is more first level keys, like volume or networks
func (*Compose) InjectCacheVolume ¶
func (c *Compose) InjectCacheVolume()
InjectCacheVolume adds cache directory as volume to each service in a compose file
func (Compose) MarshalYAML ¶
MarshalYAML is used to marshal a Compose back to its yaml form
func (Compose) NewServiceGraph ¶
func (c Compose) NewServiceGraph() ServiceGraph
NewServiceGraph generates a graph of deps from a compose description
func (*Compose) RegisteredName ¶
func (*Compose) UnmarshalYAML ¶
UnmarshalYAML is used to unmarshal a docker-compose (yaml) file
type ComposeValidator ¶
type ComposeValidator struct {
// contains filtered or unexported fields
}
var ( StandardValidtator *ComposeValidator StandardConfig map[string]interface{} )
func NewComposeValidtor ¶
func NewComposeValidtor(cfg map[string]interface{}) (*ComposeValidator, error)
func (*ComposeValidator) UseServiceValidator ¶
func (cv *ComposeValidator) UseServiceValidator(s ServiceValidator)
func (*ComposeValidator) UseVolumeValidator ¶
func (cv *ComposeValidator) UseVolumeValidator(v VolumeValidator)
func (*ComposeValidator) Validate ¶
func (cv *ComposeValidator) Validate(c *Compose) []error
type DockerRun ¶
type DockerRun struct { Path string `json:"path"` RID string `json:"runner_id"` // RID is internal ID used by the docker runner ID int `json:"id"` // ID is the density run ID for this task Start time.Time `json:"start"` Finish time.Time `json:"down"` ExitCode int `json:"exit_code"` Running bool `json:"running"` }
DockerRun implements task.Run for Docker
func (*DockerRun) RegisteredName ¶
type Networks ¶
type Networks struct {
// contains filtered or unexported fields
}
func NewNetworks ¶
type Recomposator ¶
type Recomposator struct {
// contains filtered or unexported fields
}
func NewRecomposator ¶
func NewRecomposator(docker *client.Client, cfg map[string]interface{}) (*Recomposator, error)
func StandardRecomposator ¶
func StandardRecomposator(docker *client.Client) (*Recomposator, error)
func (*Recomposator) Recompose ¶
func (r *Recomposator) Recompose(name string, c *Compose) (*Compose, error)
Recompose take a naive and validated Compose and return a Compose as it will be run
func (*Recomposator) UseServicePatcher ¶
func (r *Recomposator) UseServicePatcher(p ServicePatcher)
func (*Recomposator) UseVolumePatcher ¶
func (r *Recomposator) UseVolumePatcher(p VolumePatcher)
type ServiceDepth ¶
ServiceDepth represents the level of deps for a services
type ServiceGraph ¶
ServiceGraph represents a map of services to dependencies
func (ServiceGraph) ByServiceDepth ¶
func (s ServiceGraph) ByServiceDepth() ServiceDepth
ByServiceDepth computes deps depth by service
type ServicePatcher ¶
type ServiceValidator ¶
type VolumePatcher ¶
func PatchVolumeInVolumes ¶
func PatchVolumeInVolumes(target string) (VolumePatcher, error)
type VolumeValidator ¶
func ValidateNotAsDeep ¶
func ValidateNotAsDeep(deep int) VolumeValidator