本文整理汇总了Golang中github.com/docker/machine/libmachine/drivers.DriverOptions.String方法的典型用法代码示例。如果您正苦于以下问题:Golang DriverOptions.String方法的具体用法?Golang DriverOptions.String怎么用?Golang DriverOptions.String使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/docker/machine/libmachine/drivers.DriverOptions
的用法示例。
在下文中一共展示了DriverOptions.String方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.Memory = flags.Int("vmwarefusion-memory-size")
d.CPU = flags.Int("vmwarefusion-cpu-count")
d.DiskSize = flags.Int("vmwarefusion-disk-size")
d.Boot2DockerURL = flags.String("vmwarefusion-boot2docker-url")
d.ConfigDriveURL = flags.String("vmwarefusion-configdrive-url")
d.ISO = d.ResolveStorePath(isoFilename)
d.SwarmMaster = flags.Bool("swarm-master")
d.SwarmHost = flags.String("swarm-host")
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SSHUser = flags.String("vmwarefusion-ssh-user")
d.SSHPassword = flags.String("vmwarefusion-ssh-password")
d.SSHPort = 22
// We support a maximum of 16 cpu to be consistent with Virtual Hardware 10
// specs.
if d.CPU < 1 {
d.CPU = int(runtime.NumCPU())
}
if d.CPU > 16 {
d.CPU = 16
}
return nil
}
示例2: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.Boot2DockerURL = flags.String("hyperv-boot2docker-url")
d.VSwitch = flags.String("hyperv-virtual-switch")
d.DiskSize = flags.Int("hyperv-disk-size")
d.MemSize = flags.Int("hyperv-memory")
d.CPU = flags.Int("hyperv-cpu-count")
d.SSHUser = "docker"
d.SetSwarmConfigFromFlags(flags)
return nil
}
示例3: SetConfigFromFlags
// SetConfigFromFlags configures the driver with the object that was returned
// by RegisterCreateFlags
func (d *Driver) SetConfigFromFlags(opts drivers.DriverOptions) error {
d.CPU = opts.Int("parallels-cpu-count")
d.Memory = opts.Int("parallels-memory")
d.DiskSize = opts.Int("parallels-disk-size")
d.Boot2DockerURL = opts.String("parallels-boot2docker-url")
d.SetSwarmConfigFromFlags(opts)
d.SSHUser = defaultSSHUser
d.SSHPort = defaultSSHPort
d.NoShare = opts.Bool("parallels-no-share")
return nil
}
示例4: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.boot2DockerURL = flags.String("hyper-v-boot2docker-url")
d.boot2DockerLoc = flags.String("hyper-v-boot2docker-location")
d.vSwitch = flags.String("hyper-v-virtual-switch")
d.DiskSize = flags.Int("hyper-v-disk-size")
d.MemSize = flags.Int("hyper-v-memory")
d.SwarmMaster = flags.Bool("swarm-master")
d.SwarmHost = flags.String("swarm-host")
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SSHUser = "docker"
d.SSHPort = 22
return nil
}
示例5: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
if drivers.EngineInstallURLFlagSet(flags) {
return errors.New("--engine-install-url cannot be used with the hyperv driver, use --hyperv-boot2docker-url instead")
}
d.Boot2DockerURL = flags.String("hyperv-boot2docker-url")
d.VSwitch = flags.String("hyperv-virtual-switch")
d.DiskSize = flags.Int("hyperv-disk-size")
d.MemSize = flags.Int("hyperv-memory")
d.CPU = flags.Int("hyperv-cpu-count")
d.SSHUser = "docker"
d.SetSwarmConfigFromFlags(flags)
return nil
}
示例6: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
url := flags.String("url")
if url == "" {
return fmt.Errorf("--url option is required")
}
d.URL = url
u, err := neturl.Parse(url)
if err != nil {
return err
}
d.IPAddress = u.Host
return nil
}
示例7: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.CPU = flags.Int("virtualbox-cpu-count")
d.Memory = flags.Int("virtualbox-memory")
d.DiskSize = flags.Int("virtualbox-disk-size")
d.Boot2DockerURL = flags.String("virtualbox-boot2docker-url")
d.SetSwarmConfigFromFlags(flags)
d.SSHUser = "docker"
d.Boot2DockerImportVM = flags.String("virtualbox-import-boot2docker-vm")
d.HostDNSResolver = flags.Bool("virtualbox-host-dns-resolver")
d.HostOnlyCIDR = flags.String("virtualbox-hostonly-cidr")
d.HostOnlyNicType = flags.String("virtualbox-hostonly-nictype")
d.HostOnlyPromiscMode = flags.String("virtualbox-hostonly-nicpromisc")
d.NoShare = flags.Bool("virtualbox-no-share")
d.DNSProxy = flags.Bool("virtualbox-dns-proxy")
d.NoVTXCheck = flags.Bool("virtualbox-no-vtx-check")
return nil
}
示例8: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.ClientID = flags.Int("ubiquity-client-id")
d.Username = flags.String("ubiquity-api-username")
d.Token = flags.String("ubiquity-api-token")
d.ZoneID = flags.Int("ubiquity-zone-id")
d.FlavorID = flags.Int("ubiquity-flavor-id")
d.ImageID = flags.Int("ubiquity-image-id")
if d.ClientID <= 0 {
return fmt.Errorf("ubiquity driver requires the --ubiquity-client-id option")
}
if d.Username == "" {
return fmt.Errorf("ubiquity driver requires the --ubiquity-api-username option")
}
if d.Token == "" {
return fmt.Errorf("ubiquity driver requires the --ubiquity-api-token option")
}
return nil
}
示例9: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
if drivers.EngineInstallURLFlagSet(flags) {
return errors.New("--engine-install-url cannot be used with the virtualbox driver, use --virtualbox-boot2docker-url instead")
}
d.CPU = flags.Int("virtualbox-cpu-count")
d.Memory = flags.Int("virtualbox-memory")
d.DiskSize = flags.Int("virtualbox-disk-size")
d.Boot2DockerURL = flags.String("virtualbox-boot2docker-url")
d.SetSwarmConfigFromFlags(flags)
d.SSHUser = "docker"
d.Boot2DockerImportVM = flags.String("virtualbox-import-boot2docker-vm")
d.HostDNSResolver = flags.Bool("virtualbox-host-dns-resolver")
d.HostOnlyCIDR = flags.String("virtualbox-hostonly-cidr")
d.HostOnlyNicType = flags.String("virtualbox-hostonly-nictype")
d.HostOnlyPromiscMode = flags.String("virtualbox-hostonly-nicpromisc")
d.NoShare = flags.Bool("virtualbox-no-share")
d.DNSProxy = !flags.Bool("virtualbox-no-dns-proxy")
d.NoVTXCheck = flags.Bool("virtualbox-no-vtx-check")
return nil
}
示例10: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.APIKey = flags.String("vultr-api-key")
d.OSID = flags.Int("vultr-os-id")
d.RegionID = flags.Int("vultr-region-id")
d.PlanID = flags.Int("vultr-plan-id")
d.ScriptID = flags.Int("vultr-pxe-script")
d.IPv6 = flags.Bool("vultr-ipv6")
d.PrivateNetworking = flags.Bool("vultr-private-networking")
d.Backups = flags.Bool("vultr-backups")
d.UserDataFile = flags.String("vultr-userdata")
d.SwarmMaster = flags.Bool("swarm-master")
d.SwarmHost = flags.String("swarm-host")
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SSHUser = flags.String("vultr-ssh-user")
d.SSHPort = 22
if d.APIKey == "" {
return fmt.Errorf("Vultr driver requires the --vultr-api-key option")
}
return nil
}
示例11: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.Boot2DockerURL = flags.String("xhyve-boot2docker-url")
d.CPU = flags.Int("xhyve-cpu-count")
d.Memory = flags.Int("xhyve-memory")
d.DiskSize = int64(flags.Int("xhyve-disk-size"))
d.BootCmd = flags.String("xhyve-boot-cmd")
d.SwarmMaster = flags.Bool("swarm-master")
d.SwarmHost = flags.String("swarm-host")
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SSHUser = "docker"
d.SSHPort = 22
return nil
}
示例12: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(opts drivers.DriverOptions) error {
spew.Dump(opts)
d.DindImage = opts.String("dind-image")
d.DockerHost = opts.String("dind-host")
d.CertPath = opts.String("dind-cert-path")
return nil
}
示例13: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
if drivers.EngineInstallURLFlagSet(flags) {
return errors.New("--engine-install-url cannot be used with the vmwarefusion driver, use --vmwarefusion-boot2docker-url instead")
}
d.Memory = flags.Int("vmwarefusion-memory-size")
d.CPU = flags.Int("vmwarefusion-cpu-count")
d.DiskSize = flags.Int("vmwarefusion-disk-size")
d.Boot2DockerURL = flags.String("vmwarefusion-boot2docker-url")
d.ConfigDriveURL = flags.String("vmwarefusion-configdrive-url")
d.ISO = d.ResolveStorePath(isoFilename)
d.ConfigDriveISO = d.ResolveStorePath(isoConfigDrive)
d.SetSwarmConfigFromFlags(flags)
d.SSHUser = flags.String("vmwarefusion-ssh-user")
d.SSHPassword = flags.String("vmwarefusion-ssh-password")
d.SSHPort = 22
d.NoShare = flags.Bool("vmwarefusion-no-share")
// We support a maximum of 16 cpu to be consistent with Virtual Hardware 10
// specs.
if d.CPU < 1 {
d.CPU = int(runtime.NumCPU())
}
if d.CPU > 16 {
d.CPU = 16
}
return nil
}
示例14: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.UserID = flags.String("scaleway-user-id")
d.Token = flags.String("scaleway-token")
d.Organization = flags.String("scaleway-organization")
d.Image = flags.String("scaleway-image")
d.Volumes = flags.String("scaleway-volumes")
d.SSHUser = "docker"
d.SSHPort = 22
if d.UserID == "" {
return fmt.Errorf("scaleway driver requires the --scaleway-userid option")
}
if d.Token == "" {
return fmt.Errorf("scaleway driver requires the --scaleway-token option")
}
if d.Organization == "" {
return fmt.Errorf("scaleway driver requires the --scaleway-organization option")
}
if d.Image == "" {
return fmt.Errorf("scaleway driver requires the --scaleway-image option")
}
return nil
}
示例15: SetConfigFromFlags
func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error {
d.Boot2DockerURL = flags.String("xhyve-boot2docker-url")
d.BootCmd = flags.String("xhyve-boot-cmd")
d.CPU = flags.Int("xhyve-cpu-count")
if d.CPU < 1 {
d.CPU = int(runtime.NumCPU())
}
d.DiskSize = int64(flags.Int("xhyve-disk-size"))
d.Memory = flags.Int("xhyve-memory-size")
d.NFSShare = flags.Bool("xhyve-experimental-nfs-share")
d.Qcow2 = flags.Bool("xhyve-qcow2")
d.SSHPort = 22
d.SSHUser = "docker"
d.SwarmDiscovery = flags.String("swarm-discovery")
d.SwarmHost = flags.String("swarm-host")
d.SwarmMaster = flags.Bool("swarm-master")
d.UUID = flags.String("xhyve-uuid")
d.Virtio9p = flags.Bool("xhyve-virtio-9p")
d.Virtio9pFolder = "/Users"
return nil
}