1 Star 0 Fork 0

powerpaas/machine

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
notsupported.go 1.96 KB
Copy Edit Raw Blame History
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/powerpaas/machine.git
git@gitee.com:powerpaas/machine.git
powerpaas
machine
machine
v0.12.0-rc2

Search