1 Star 0 Fork 0

litian/machine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
notsupported.go 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
package drivers
import (
"fmt"
"github.com/docker/machine/libmachine/mcnflag"
"github.com/docker/machine/libmachine/state"
)
type DriverNotSupported struct {
*BaseDriver
Name string
}
type NotSupported struct {
DriverName string
}
func (e NotSupported) Error() string {
return fmt.Sprintf("Driver %q not supported on this platform.", e.DriverName)
}
// NewDriverNotSupported creates a placeholder Driver that replaces
// a driver that is not supported on a given platform. eg fusion on linux.
func NewDriverNotSupported(driverName, hostName, storePath string) Driver {
return &DriverNotSupported{
BaseDriver: &BaseDriver{
MachineName: hostName,
StorePath: storePath,
},
Name: driverName,
}
}
func (d *DriverNotSupported) DriverName() string {
return d.Name
}
func (d *DriverNotSupported) PreCreateCheck() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) GetCreateFlags() []mcnflag.Flag {
return nil
}
func (d *DriverNotSupported) SetConfigFromFlags(flags DriverOptions) error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) GetURL() (string, error) {
return "", NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) GetSSHHostname() (string, error) {
return "", NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) GetState() (state.State, error) {
return state.Error, NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Create() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Remove() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Start() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Stop() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Restart() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Kill() error {
return NotSupported{d.DriverName()}
}
func (d *DriverNotSupported) Upgrade() error {
return NotSupported{d.DriverName()}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/litian33/machine.git
git@gitee.com:litian33/machine.git
litian33
machine
machine
v0.12.0-rc2

搜索帮助