本文整理汇总了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")
}
示例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", "")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}
示例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")
}