Documentation ¶
Index ¶
- type AutoTask
- func (at *AutoTask) ContainerExists(callBack func())
- func (at *AutoTask) Delete(cname string) (err error)
- func (at *AutoTask) DeleteCreatedContainer()
- func (at *AutoTask) EchoError(name string, err error, flag bool)
- func (at *AutoTask) PullImage(imgName string) error
- func (at *AutoTask) Run()
- func (at *AutoTask) Start(cname string) (err error)
- func (at *AutoTask) Stop() (err error)
- func (at *AutoTask) WithCommand(Command []string) *AutoTask
- func (at *AutoTask) WithContainerName(containerName string) *AutoTask
- func (at *AutoTask) WithEnv(env []string) *AutoTask
- func (at *AutoTask) WithImage(image string) *AutoTask
- func (at *AutoTask) WithNetwork(networkName string) *AutoTask
- func (at *AutoTask) WithPortMappings(portMappings map[string]string) *AutoTask
- func (at *AutoTask) WithStaticIp(IPAddress string) *AutoTask
- func (at *AutoTask) WithSubnet(subnet, gateway string) *AutoTask
- func (at *AutoTask) WithVolumeMappings(volumeMappings []VolumeMapping) *AutoTask
- type Option
- type VolumeMapping
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoTask ¶ added in v0.1.5
type AutoTask struct {
// contains filtered or unexported fields
}
AutoTask 结构体封装了创建 Docker 容器的通用操作
func NewAutoTask ¶ added in v0.1.5
NewAutoTask 创建一个 AutoTask 结构体的实例
func (*AutoTask) ContainerExists ¶ added in v0.1.5
func (at *AutoTask) ContainerExists(callBack func())
ContainerExists 检测是否存在指定容器名称
func (*AutoTask) DeleteCreatedContainer ¶ added in v1.2.0
func (at *AutoTask) DeleteCreatedContainer()
func (*AutoTask) WithCommand ¶ added in v0.1.7
func (*AutoTask) WithContainerName ¶ added in v0.1.5
WithContainerName 设置容器名称
func (*AutoTask) WithNetwork ¶ added in v0.1.5
WithNetwork 设置自定义网络的名称
func (*AutoTask) WithPortMappings ¶ added in v0.1.5
WithPortMappings 设置端口映射配置
func (*AutoTask) WithStaticIp ¶ added in v0.1.5
WithStaticIp 设置容器静态IP
func (*AutoTask) WithSubnet ¶ added in v0.1.5
WithSubnet 设置子网配置
func (*AutoTask) WithVolumeMappings ¶ added in v0.1.5
func (at *AutoTask) WithVolumeMappings(volumeMappings []VolumeMapping) *AutoTask
添加 WithVolumeMappings 方法用于设置数据卷映射
type Option ¶ added in v0.1.5
type Option struct { NetworkName string // 自定义网络的名称 IPAddress string // 指定IP地址 Subnet string // 子网配置 Gateway string // 网关配置 Image string // Docker 镜像名称 Command []string // 命令参数 Env []string // 容器环境变量 PortMappings map[string]string // 端口映射配置 ContainerName string // 容器名称 VolumeMappings []VolumeMapping // 数据映射 }
Option 结构体用于配置 Docker 容器创建的选项
type VolumeMapping ¶ added in v0.1.5
添加 VolumeMapping 结构体用于配置数据卷映射
Click to show internal directories.
Click to hide internal directories.