Documentation ¶
Index ¶
- Variables
- func NewShellVars(src devenv.Variables) []string
- type Action
- type ComposePlanMetadata
- type ComposeShellExecutable
- type ContainerMonitorExecutable
- type ContainerResolver
- type DockerComposePlanner
- type ExecOption
- type ExecOptions
- type Executable
- type ExecutionPlan
- type ExecutionPlanner
- type MkdirExecutable
- type PrintExecutable
- type PruneContainersExecutable
- type PruneImagesExecutable
- type PruneVolumesExecutable
- type ShellExecutable
- type TimeoutExecutableWrapper
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrPlanNotAvailable = errors.New(`plan for given action is not available`)
)
Functions ¶
func NewShellVars ¶
Types ¶
type ComposePlanMetadata ¶
type ComposePlanMetadata struct { Profile *devenv.Profile Variables devenv.Variables Vars map[string]string WorkingDir string DockerVersion types.Version ComposePath string ResourceDir string LocalDataDir string }
func (ComposePlanMetadata) Project ¶
func (m ComposePlanMetadata) Project() *devenv.Profile
Project is an alias of Profile
type ComposeShellExecutable ¶
ComposeShellExecutable ShellExecutable variant with special dry-run strategy for docker compose CLI
func (ComposeShellExecutable) Exec ¶
func (exec ComposeShellExecutable) Exec(ctx context.Context, opts ExecOption) error
func (ComposeShellExecutable) String ¶
func (exec ComposeShellExecutable) String() string
type ContainerMonitorExecutable ¶
type ContainerMonitorExecutable struct { ApiClient *client.Client Names []string Resolver ContainerResolver Desc string // contains filtered or unexported fields }
func NewContainerMonitorExecutable ¶
func NewContainerMonitorExecutable(client *client.Client, opts ...func(exec *ContainerMonitorExecutable)) *ContainerMonitorExecutable
func (*ContainerMonitorExecutable) Exec ¶
func (exec *ContainerMonitorExecutable) Exec(ctx context.Context, opts ExecOption) error
func (*ContainerMonitorExecutable) String ¶
func (exec *ContainerMonitorExecutable) String() string
func (*ContainerMonitorExecutable) WithTimeout ¶
func (exec *ContainerMonitorExecutable) WithTimeout(timeout time.Duration) Executable
type ContainerResolver ¶
func ComposeContainerResolver ¶
func ComposeContainerResolver(profileName string) ContainerResolver
func ExactNameContainerResolver ¶
func ExactNameContainerResolver() ContainerResolver
type DockerComposePlanner ¶
type DockerComposePlanner struct { // WorkingDir the working directory. Usually is the temporary dir configured by rootcmd.GlobalArgs WorkingDir string Profile *devenv.Profile // contains filtered or unexported fields }
func NewDockerComposePlanner ¶
func NewDockerComposePlanner(p *devenv.Profile, wd string) *DockerComposePlanner
func (*DockerComposePlanner) Plan ¶
func (pl *DockerComposePlanner) Plan(action Action) (ExecutionPlan, error)
func (*DockerComposePlanner) Prepare ¶
func (pl *DockerComposePlanner) Prepare() (err error)
type ExecOption ¶
var DefaultExecOption ExecOption
type ExecOptions ¶
type ExecOptions func(opt *ExecOption)
type Executable ¶
type Executable interface {
Exec(ctx context.Context, opts ExecOption) error
}
func NewContainerHookExecutables ¶
func NewContainerHookExecutables(dockerClient *dockerclient.Client, phase devenv.HookPhase, _ ComposePlanMetadata, cResolver ContainerResolver, hooks ...devenv.Hook) ([]Executable, error)
NewContainerHookExecutables create an executable that monitor existing containers and wait for it to stop Note: Currently, we don't support manually start containers. So the hook containers should be started.
Therefore, only post-start containers are possible.
type ExecutionPlan ¶
type ExecutionPlan interface { Steps() []Executable Metadata() interface{} Execute(ctx context.Context, opts ...ExecOptions) error }
func NewClosableExecutionPlan ¶
func NewClosableExecutionPlan(metadata interface{}, closerFunc func() error, execs ...Executable) ExecutionPlan
func NewExecutionPlan ¶
func NewExecutionPlan(metadata interface{}, execs ...Executable) ExecutionPlan
type ExecutionPlanner ¶
type ExecutionPlanner interface {
Plan(action Action) (ExecutionPlan, error)
}
type MkdirExecutable ¶
func (MkdirExecutable) Exec ¶
func (exec MkdirExecutable) Exec(ctx context.Context, opts ExecOption) error
func (MkdirExecutable) String ¶
func (exec MkdirExecutable) String() string
type PrintExecutable ¶
type PrintExecutable string
func (PrintExecutable) Exec ¶
func (exec PrintExecutable) Exec(ctx context.Context, opts ExecOption) error
func (PrintExecutable) String ¶
func (exec PrintExecutable) String() string
type PruneContainersExecutable ¶
type PruneContainersExecutable struct { ApiClient *dockerclient.Client // contains filtered or unexported fields }
func (*PruneContainersExecutable) Exec ¶
func (exec *PruneContainersExecutable) Exec(ctx context.Context, opts ExecOption) error
func (*PruneContainersExecutable) String ¶
func (exec *PruneContainersExecutable) String() string
type PruneImagesExecutable ¶
type PruneImagesExecutable struct { ApiClient *dockerclient.Client // contains filtered or unexported fields }
func (*PruneImagesExecutable) Exec ¶
func (exec *PruneImagesExecutable) Exec(ctx context.Context, opts ExecOption) error
func (*PruneImagesExecutable) String ¶
func (exec *PruneImagesExecutable) String() string
type PruneVolumesExecutable ¶
type PruneVolumesExecutable struct { ApiClient *dockerclient.Client // contains filtered or unexported fields }
func (*PruneVolumesExecutable) Exec ¶
func (exec *PruneVolumesExecutable) Exec(ctx context.Context, opts ExecOption) error
func (*PruneVolumesExecutable) String ¶
func (exec *PruneVolumesExecutable) String() string
type ShellExecutable ¶
func (ShellExecutable) Exec ¶
func (exec ShellExecutable) Exec(ctx context.Context, opts ExecOption) error
func (ShellExecutable) String ¶
func (exec ShellExecutable) String() string
func (ShellExecutable) WithCommands ¶
func (exec ShellExecutable) WithCommands(cmds ...string) *ShellExecutable
type TimeoutExecutableWrapper ¶
type TimeoutExecutableWrapper struct { Timeout time.Duration Delegate Executable }
func (TimeoutExecutableWrapper) Exec ¶
func (exec TimeoutExecutableWrapper) Exec(ctx context.Context, opts ExecOption) error
func (TimeoutExecutableWrapper) String ¶
func (exec TimeoutExecutableWrapper) String() string
Click to show internal directories.
Click to hide internal directories.