Documentation
¶
Index ¶
- func EnsureDir(ctx context.Context, host *inventory.Host, dir string) error
- type ComposeAction
- type ExecOptions
- type LocalRunner
- func (r *LocalRunner) ComposeRun(ctx context.Context, opts RunOptions) (string, error)
- func (r *LocalRunner) CopyStack(_ context.Context, opts RunOptions) error
- func (r *LocalRunner) Exec(ctx context.Context, opts ExecOptions) error
- func (r *LocalRunner) Logs(ctx context.Context, opts LogOptions) error
- func (r *LocalRunner) Ping(_ context.Context) error
- type LogOptions
- type RemoteRunner
- func (r *RemoteRunner) ComposeRun(ctx context.Context, opts RunOptions) (string, error)
- func (r *RemoteRunner) CopyStack(ctx context.Context, opts RunOptions) error
- func (r *RemoteRunner) Exec(ctx context.Context, opts ExecOptions) error
- func (r *RemoteRunner) Logs(ctx context.Context, opts LogOptions) error
- func (r *RemoteRunner) Ping(ctx context.Context) error
- type RunOptions
- type Runner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ComposeAction ¶
type ComposeAction string
const ( ActionUp ComposeAction = "up -d" ActionDown ComposeAction = "down" ActionRestart ComposeAction = "restart" )
type ExecOptions ¶
type LocalRunner ¶
type LocalRunner struct{}
func (*LocalRunner) ComposeRun ¶
func (r *LocalRunner) ComposeRun(ctx context.Context, opts RunOptions) (string, error)
func (*LocalRunner) CopyStack ¶
func (r *LocalRunner) CopyStack(_ context.Context, opts RunOptions) error
func (*LocalRunner) Exec ¶
func (r *LocalRunner) Exec(ctx context.Context, opts ExecOptions) error
func (*LocalRunner) Logs ¶
func (r *LocalRunner) Logs(ctx context.Context, opts LogOptions) error
type LogOptions ¶
type RemoteRunner ¶
type RemoteRunner struct {
// contains filtered or unexported fields
}
func (*RemoteRunner) ComposeRun ¶
func (r *RemoteRunner) ComposeRun(ctx context.Context, opts RunOptions) (string, error)
func (*RemoteRunner) CopyStack ¶
func (r *RemoteRunner) CopyStack(ctx context.Context, opts RunOptions) error
func (*RemoteRunner) Exec ¶
func (r *RemoteRunner) Exec(ctx context.Context, opts ExecOptions) error
func (*RemoteRunner) Logs ¶
func (r *RemoteRunner) Logs(ctx context.Context, opts LogOptions) error
type RunOptions ¶
type Runner ¶
type Runner interface {
// CopyStack transfers the stack directory to the target.
CopyStack(ctx context.Context, opts RunOptions) error
// ComposeRun executes a docker compose action and returns combined output.
ComposeRun(ctx context.Context, opts RunOptions) (string, error)
// Logs streams docker compose logs to opts.Writer.
Logs(ctx context.Context, opts LogOptions) error
// Exec runs a command inside a running service container.
Exec(ctx context.Context, opts ExecOptions) error
// Ping verifies the runner target is reachable.
Ping(ctx context.Context) error
}
Runner abstracts local vs remote compose operations.
Click to show internal directories.
Click to hide internal directories.