当前位置: 首页>>代码示例>>Golang>>正文


Golang flags.NewInt32函数代码示例

本文整理汇总了Golang中github.com/vmware/govmomi/govc/flags.NewInt32函数的典型用法代码示例。如果您正苦于以下问题:Golang NewInt32函数的具体用法?Golang NewInt32怎么用?Golang NewInt32使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了NewInt32函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: Register

func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	cmd.spec.NumPorts = 128 // default
	f.Var(flags.NewInt32(&cmd.spec.NumPorts), "ports", "Number of ports")
	f.Var(flags.NewInt32(&cmd.spec.Mtu), "mtu", "MTU")
	f.StringVar(&cmd.nic, "nic", "", "Bridge nic device")
}
开发者ID:vmware,项目名称:vic,代码行数:9,代码来源:add.go

示例2: Register

func (cmd *configure) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.AutostartFlag, ctx = newAutostartFlag(ctx)
	cmd.AutostartFlag.Register(ctx, f)

	f.Var(flags.NewOptionalBool(&cmd.Enabled), "enabled", "")
	f.Var(flags.NewInt32(&cmd.StartDelay), "start-delay", "")
	f.StringVar(&cmd.StopAction, "stop-action", "", "")
	f.Var(flags.NewInt32(&cmd.StopDelay), "stop-delay", "")
	f.Var(flags.NewOptionalBool(&cmd.WaitForHeartbeat), "wait-for-heartbeat", "")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:10,代码来源:configure.go

示例3: Register

func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	f.StringVar(&cmd.spec.VswitchName, "vswitch", "", "vSwitch Name")
	f.Var(flags.NewInt32(&cmd.spec.VlanId), "vlan", "VLAN ID")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:7,代码来源:add.go

示例4: Register

func (cmd *enter) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout")
	f.BoolVar(&cmd.evacuate, "evacuate", false, "Evacuate powered off VMs")
}
开发者ID:vmware,项目名称:vic,代码行数:7,代码来源:enter.go

示例5: Register

func (cmd *logs) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	cmd.Max = 25 // default
	f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N logs")
	f.StringVar(&cmd.Key, "log", "", "Log file key")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:8,代码来源:command.go

示例6: Register

func (cmd *events) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx)
	cmd.DatacenterFlag.Register(ctx, f)

	cmd.Max = 25 // default
	f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N events")
	f.BoolVar(&cmd.Tail, "f", false, "Follow event stream")
	f.BoolVar(&cmd.Force, "force", false, "Disable number objects to monitor limit")
}
开发者ID:vmware,项目名称:vic,代码行数:9,代码来源:command.go

示例7: Register

func (spec *DVPortgroupConfigSpec) Register(ctx context.Context, f *flag.FlagSet) {
	ptypes := []string{
		string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding),
		string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding),
		string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral),
	}

	f.StringVar(&spec.Type, "type", ptypes[0],
		fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|")))

	f.Var(flags.NewInt32(&spec.NumPorts), "nports", "Number of ports")

	config := new(types.VMwareDVSPortSetting)
	vlan := new(types.VmwareDistributedVirtualSwitchVlanIdSpec)
	spec.DefaultPortConfig = config
	config.Vlan = vlan

	f.Var(flags.NewInt32(&vlan.VlanId), "vlan", "VLAN ID")
}
开发者ID:vmware,项目名称:vic,代码行数:19,代码来源:spec.go

示例8: Register

func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
	cmd.VirtualMachineFlag.Register(ctx, f)

	f.Int64Var(&cmd.MemoryMB, "m", 0, "Size in MB of memory")
	f.Var(flags.NewInt32(&cmd.NumCPUs), "c", "Number of CPUs")
	f.StringVar(&cmd.GuestId, "g", "", "Guest OS")
	f.StringVar(&cmd.Name, "name", "", "Display name")
	f.Var(&cmd.extraConfig, "e", "ExtraConfig. <key>=<value>")

	f.Var(flags.NewOptionalBool(&cmd.NestedHVEnabled), "nested-hv-enabled", "Enable nested hardware-assisted virtualization")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:12,代码来源:change.go

示例9: Register

func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
	cmd.ClientFlag.Register(ctx, f)
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	cmd.VlanId = -1
	f.Var(flags.NewInt32(&cmd.VlanId), "vlan-id", "VLAN ID")
	f.StringVar(&cmd.Name, "name", "", "Portgroup name")
	f.StringVar(&cmd.VswitchName, "vswitch-name", "", "vSwitch name")

	f.Var(flags.NewOptionalBool(&cmd.AllowPromiscuous), "allow-promiscuous", "Allow promiscuous mode")
	f.Var(flags.NewOptionalBool(&cmd.ForgedTransmits), "forged-transmits", "Allow forged transmits")
	f.Var(flags.NewOptionalBool(&cmd.MacChanges), "mac-changes", "Allow MAC changes")
}
开发者ID:vmware,项目名称:vic,代码行数:15,代码来源:change.go

示例10: Register

func (cmd *find) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
	cmd.ClientFlag.Register(ctx, f)
	cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx)
	cmd.OutputFlag.Register(ctx, f)
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	f.BoolVar(&cmd.check, "c", true, "Check if esx firewall is enabled")
	f.BoolVar(&cmd.enabled, "enabled", true, "Find enabled rule sets if true, disabled if false")
	f.StringVar((*string)(&cmd.Direction), "direction", string(types.HostFirewallRuleDirectionOutbound), "Direction")
	f.StringVar((*string)(&cmd.PortType), "type", string(types.HostFirewallRulePortTypeDst), "Port type")
	f.StringVar((*string)(&cmd.Protocol), "proto", string(types.HostFirewallRuleProtocolTcp), "Protocol")
	f.Var(flags.NewInt32(&cmd.Port), "port", "Port")
}
开发者ID:vmware,项目名称:vic,代码行数:15,代码来源:find.go

示例11: Register

func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx)
	cmd.DatacenterFlag.Register(ctx, f)

	f.StringVar(&cmd.path, "dvs", "", "DVS path")

	ptypes := []string{
		string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding),
		string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding),
		string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral),
	}

	f.StringVar(&cmd.DVPortgroupConfigSpec.Type, "type", ptypes[0],
		fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|")))

	cmd.DVPortgroupConfigSpec.NumPorts = 128 // default
	f.Var(flags.NewInt32(&cmd.DVPortgroupConfigSpec.NumPorts), "nports", "Number of ports")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:18,代码来源:add.go

示例12: Register

func (flag *FileAttrFlag) Register(ctx context.Context, f *flag.FlagSet) {
	f.Var(flags.NewInt32(&flag.OwnerId), "uid", "User ID")
	f.Var(flags.NewInt32(&flag.GroupId), "gid", "Group ID")
	f.Int64Var(&flag.Permissions, "perm", 0, "File permissions")
}
开发者ID:vmware,项目名称:vic,代码行数:5,代码来源:file_attr.go

示例13: Register

func (cmd *exit) Register(ctx context.Context, f *flag.FlagSet) {
	cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
	cmd.HostSystemFlag.Register(ctx, f)

	f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:6,代码来源:exit.go


注:本文中的github.com/vmware/govmomi/govc/flags.NewInt32函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。