Documentation ¶
Index ¶
- Constants
- Variables
- type Client
- type Command
- type CommandConfig
- type CommandExecOptions
- type CommandInitOptions
- type CommandLinkOptions
- type CommandPathOptions
- type CommandProcessOptions
- type CommandStartOptions
- type CommandStopOptions
- type Config
- type ConfigSaveOptions
- type ConfigService
- type Container
- type ContainerAdapter
- type ContainerCreateOptions
- type ContainerCreateResult
- type ContainerCreateService
- type ContainerExecErr
- type ContainerExecOptions
- type ContainerExecService
- type ContainerFindOptions
- type ContainerFindService
- type ContainerInspectResult
- type ContainerStartOptions
- type ContainerStartResult
- type Docker
- type Image
- type ImageAdapter
- type Path
- type Stream
Constants ¶
View Source
const ( DefaultShell = "sh" DefaultTTY = false DefaultStdin = true DefaultAutoTTY = true DefaultAutoStdin = true )
Runtime settings
Variables ¶
View Source
var ErrContainerNotFound = errors.New("Can't find the container")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Container ContainerAdapter
}
type CommandConfig ¶
type CommandConfig struct { Compose string `yaml:"compose,omitempty"` TTY *bool `yaml:"tty,omitempty"` Stdin *bool `yaml:"stdin,omitempty"` Envs []string `yaml:"envs,omitempty"` User string `yaml:"user,omitempty"` WorkingDir *string `yaml:"workdir,omitempty"` Shell string `yaml:"shell,omitempty"` Options string `yaml:"options,omitempty"` }
CommandConfig represents command's configuration
func NewCommandConfig ¶
func NewCommandConfig() *CommandConfig
type CommandExecOptions ¶
type CommandInitOptions ¶
type CommandLinkOptions ¶
type CommandPathOptions ¶
type CommandPathOptions struct {
Delete bool
}
type CommandProcessOptions ¶
type CommandProcessOptions struct { }
type CommandStartOptions ¶
type CommandStopOptions ¶
type CommandStopOptions struct { }
type Config ¶
type Config struct { Image string `yaml:"image"` Name string `yaml:"name"` Compose string `yaml:"compose,omitempty"` Path string `yaml:"-"` Runs []string `yaml:"runs,omitempty"` Envs []string `yaml:"envs,omitempty"` Ports []string `yaml:"ports,omitempty"` Volumes []string `yaml:"volumes,omitempty"` // Command's config Defaults *CommandConfig `yaml:"defaults,omitempty"` Commands map[string]CommandConfig `yaml:"commands,omitempty"` }
Config represents global configuration
Loading orders during init & start:
- core.NewConfig() // without default settings (CommandConfig)
- command line args
Loading orders during exec:
- core.NewConfigWithDefaults()
- dpx.yml
- runtime defaults
- command line args
cli args > bin (dpx.yml) > global (dpx.yml) > default
func NewConfigWithDefaults ¶
func NewConfigWithDefaults() *Config
type ConfigSaveOptions ¶
type ConfigSaveOptions struct {
SaveDefaults bool
}
type ConfigService ¶
type ContainerAdapter ¶
type ContainerAdapter interface { ContainerCreateService ContainerFindService ContainerExecService }
type ContainerCreateOptions ¶
type ContainerCreateResult ¶
type ContainerCreateResult struct {
ID string
}
type ContainerCreateService ¶
type ContainerExecErr ¶
type ContainerExecErr struct {
Code int
}
func (*ContainerExecErr) Error ¶
func (e *ContainerExecErr) Error() string
type ContainerExecOptions ¶
type ContainerExecOptions struct { ID string Cmd []string Config *CommandConfig Output bool }
type ContainerExecService ¶
type ContainerExecService interface { Exec(ctx context.Context, options ContainerExecOptions) error Inspect(ctx context.Context, ID string) (ContainerInspectResult, error) }
type ContainerFindOptions ¶
type ContainerFindService ¶
type ContainerFindService interface { Find(ctx context.Context, options ContainerFindOptions) (Container, error) FindAll(ctx context.Context, options ContainerFindOptions) ([]Container, error) }
type ContainerInspectResult ¶
type ContainerStartOptions ¶
type ContainerStartOptions struct{}
type ContainerStartResult ¶
type ContainerStartResult struct{}
type Docker ¶
type Docker interface { // NewClient() *Docker ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *specs.Platform, containerName string) (container.ContainerCreateCreatedBody, error) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error ContainerStop(ctx context.Context, containerID string, timeout *time.Duration) error ContainerWait(ctx context.Context, containerID string, condition container.WaitCondition) (<-chan container.ContainerWaitOKBody, <-chan error) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) // ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error // ContainerCreate() string ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error) ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error }
type ImageAdapter ¶
Click to show internal directories.
Click to hide internal directories.