flags

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2016 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SearchVirtualMachines = iota + 1
	SearchHosts
	SearchVirtualApps
)

Variables

This section is empty.

Functions

func NewOptionalBool added in v0.3.0

func NewOptionalBool(v **bool) flag.Value

NewOptionalBool returns a flag.Value implementation where there is no default value. This avoids sending a default value over the wire as using flag.BoolVar() would.

func ParseVersion

func ParseVersion(s string) (version, error)

Types

type ClientFlag

type ClientFlag struct {
	*DebugFlag
	// contains filtered or unexported fields
}

func NewClientFlag added in v0.3.0

func NewClientFlag(ctx context.Context) (*ClientFlag, context.Context)

func (*ClientFlag) Client

func (flag *ClientFlag) Client() (*vim25.Client, error)

func (*ClientFlag) Process

func (flag *ClientFlag) Process(ctx context.Context) error

func (*ClientFlag) ProcessOnce added in v0.3.0

func (c *ClientFlag) ProcessOnce(fn func() error) (err error)

func (*ClientFlag) Register

func (flag *ClientFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*ClientFlag) RegisterOnce added in v0.3.0

func (c *ClientFlag) RegisterOnce(fn func())

func (*ClientFlag) Set

func (flag *ClientFlag) Set(s string) error

func (*ClientFlag) String

func (flag *ClientFlag) String() string

func (*ClientFlag) URLWithoutPassword

func (flag *ClientFlag) URLWithoutPassword() *url.URL

type DatacenterFlag

type DatacenterFlag struct {
	*ClientFlag
	*OutputFlag
	// contains filtered or unexported fields
}

func NewDatacenterFlag added in v0.3.0

func NewDatacenterFlag(ctx context.Context) (*DatacenterFlag, context.Context)

func (*DatacenterFlag) Datacenter

func (flag *DatacenterFlag) Datacenter() (*object.Datacenter, error)

func (*DatacenterFlag) Finder

func (flag *DatacenterFlag) Finder() (*find.Finder, error)

func (*DatacenterFlag) ManagedObjects added in v0.3.0

func (flag *DatacenterFlag) ManagedObjects(ctx context.Context, args []string) ([]types.ManagedObjectReference, error)

func (*DatacenterFlag) Process

func (flag *DatacenterFlag) Process(ctx context.Context) error

func (*DatacenterFlag) ProcessOnce added in v0.3.0

func (c *DatacenterFlag) ProcessOnce(fn func() error) (err error)

func (*DatacenterFlag) Register

func (flag *DatacenterFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*DatacenterFlag) RegisterOnce added in v0.3.0

func (c *DatacenterFlag) RegisterOnce(fn func())

type DatastoreFlag

type DatastoreFlag struct {
	*DatacenterFlag
	// contains filtered or unexported fields
}

func NewDatastoreFlag added in v0.3.0

func NewDatastoreFlag(ctx context.Context) (*DatastoreFlag, context.Context)

func (*DatastoreFlag) Datastore

func (flag *DatastoreFlag) Datastore() (*object.Datastore, error)

func (*DatastoreFlag) DatastorePath

func (flag *DatastoreFlag) DatastorePath(name string) (string, error)

func (*DatastoreFlag) DatastoreURL

func (flag *DatastoreFlag) DatastoreURL(path string) (*url.URL, error)

func (*DatastoreFlag) Process

func (flag *DatastoreFlag) Process(ctx context.Context) error

func (*DatastoreFlag) ProcessOnce added in v0.3.0

func (c *DatastoreFlag) ProcessOnce(fn func() error) (err error)

func (*DatastoreFlag) Register

func (flag *DatastoreFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*DatastoreFlag) RegisterOnce added in v0.3.0

func (c *DatastoreFlag) RegisterOnce(fn func())

type DebugFlag

type DebugFlag struct {
	// contains filtered or unexported fields
}

func NewDebugFlag added in v0.3.0

func NewDebugFlag(ctx context.Context) (*DebugFlag, context.Context)

func (*DebugFlag) Process

func (flag *DebugFlag) Process(ctx context.Context) error

func (*DebugFlag) ProcessOnce added in v0.3.0

func (c *DebugFlag) ProcessOnce(fn func() error) (err error)

func (*DebugFlag) Register

func (flag *DebugFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*DebugFlag) RegisterOnce added in v0.3.0

func (c *DebugFlag) RegisterOnce(fn func())

type EmptyFlag

type EmptyFlag struct{}

func (*EmptyFlag) Process

func (flag *EmptyFlag) Process(ctx context.Context) error

func (*EmptyFlag) Register

func (flag *EmptyFlag) Register(ctx context.Context, f *flag.FlagSet)

type HostConnectFlag added in v0.3.0

type HostConnectFlag struct {
	types.HostConnectSpec
	// contains filtered or unexported fields
}

func NewHostConnectFlag added in v0.3.0

func NewHostConnectFlag(ctx context.Context) (*HostConnectFlag, context.Context)

func (*HostConnectFlag) AcceptThumbprint added in v0.3.0

func (flag *HostConnectFlag) AcceptThumbprint(err error) error

AcceptThumbprint returns nil if the given error is an SSLVerifyFault and -noverify is true. In which case, flag.SslThumbprint is set to fault.Thumbprint and the caller should retry the task.

func (*HostConnectFlag) Process added in v0.3.0

func (flag *HostConnectFlag) Process(ctx context.Context) error

func (*HostConnectFlag) ProcessOnce added in v0.3.0

func (c *HostConnectFlag) ProcessOnce(fn func() error) (err error)

func (*HostConnectFlag) Register added in v0.3.0

func (flag *HostConnectFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*HostConnectFlag) RegisterOnce added in v0.3.0

func (c *HostConnectFlag) RegisterOnce(fn func())

type HostSystemFlag

type HostSystemFlag struct {
	*ClientFlag
	*DatacenterFlag
	*SearchFlag
	// contains filtered or unexported fields
}

func NewHostSystemFlag added in v0.3.0

func NewHostSystemFlag(ctx context.Context) (*HostSystemFlag, context.Context)

func (*HostSystemFlag) HostNetworkSystem

func (flag *HostSystemFlag) HostNetworkSystem() (*object.HostNetworkSystem, error)

func (*HostSystemFlag) HostSystem

func (flag *HostSystemFlag) HostSystem() (*object.HostSystem, error)

func (*HostSystemFlag) HostSystemIfSpecified

func (flag *HostSystemFlag) HostSystemIfSpecified() (*object.HostSystem, error)

func (*HostSystemFlag) Process

func (flag *HostSystemFlag) Process(ctx context.Context) error

func (*HostSystemFlag) ProcessOnce added in v0.3.0

func (c *HostSystemFlag) ProcessOnce(fn func() error) (err error)

func (*HostSystemFlag) Register

func (flag *HostSystemFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*HostSystemFlag) RegisterOnce added in v0.3.0

func (c *HostSystemFlag) RegisterOnce(fn func())

type NetworkFlag

type NetworkFlag struct {
	*DatacenterFlag
	// contains filtered or unexported fields
}

func NewNetworkFlag

func NewNetworkFlag(ctx context.Context) (*NetworkFlag, context.Context)

func (*NetworkFlag) Device

func (flag *NetworkFlag) Device() (types.BaseVirtualDevice, error)

func (*NetworkFlag) Network

func (flag *NetworkFlag) Network() (object.NetworkReference, error)

func (*NetworkFlag) Process

func (flag *NetworkFlag) Process(ctx context.Context) error

func (*NetworkFlag) ProcessOnce added in v0.3.0

func (c *NetworkFlag) ProcessOnce(fn func() error) (err error)

func (*NetworkFlag) Register

func (flag *NetworkFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*NetworkFlag) RegisterOnce added in v0.3.0

func (c *NetworkFlag) RegisterOnce(fn func())

func (*NetworkFlag) Set

func (flag *NetworkFlag) Set(name string) error

func (*NetworkFlag) String

func (flag *NetworkFlag) String() string

type OutputFlag

type OutputFlag struct {
	JSON bool
	TTY  bool
	// contains filtered or unexported fields
}

func NewOutputFlag added in v0.3.0

func NewOutputFlag(ctx context.Context) (*OutputFlag, context.Context)

func (*OutputFlag) Log

func (flag *OutputFlag) Log(s string) (int, error)

Log outputs the specified string, prefixed with the current time. A newline is not automatically added. If the specified string starts with a '\r', the current line is cleared first.

func (*OutputFlag) Process

func (flag *OutputFlag) Process(ctx context.Context) error

func (*OutputFlag) ProcessOnce added in v0.3.0

func (c *OutputFlag) ProcessOnce(fn func() error) (err error)

func (*OutputFlag) ProgressLogger

func (flag *OutputFlag) ProgressLogger(prefix string) *progressLogger

func (*OutputFlag) Register

func (flag *OutputFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*OutputFlag) RegisterOnce added in v0.3.0

func (c *OutputFlag) RegisterOnce(fn func())

func (*OutputFlag) Write

func (flag *OutputFlag) Write(b []byte) (int, error)

func (*OutputFlag) WriteResult

func (flag *OutputFlag) WriteResult(result OutputWriter) error

func (*OutputFlag) WriteString

func (flag *OutputFlag) WriteString(s string) (int, error)

type OutputWriter

type OutputWriter interface {
	Write(io.Writer) error
}

type ResourcePoolFlag

type ResourcePoolFlag struct {
	*DatacenterFlag
	// contains filtered or unexported fields
}

func NewResourcePoolFlag added in v0.3.0

func NewResourcePoolFlag(ctx context.Context) (*ResourcePoolFlag, context.Context)

func (*ResourcePoolFlag) Process

func (flag *ResourcePoolFlag) Process(ctx context.Context) error

func (*ResourcePoolFlag) ProcessOnce added in v0.3.0

func (c *ResourcePoolFlag) ProcessOnce(fn func() error) (err error)

func (*ResourcePoolFlag) Register

func (flag *ResourcePoolFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*ResourcePoolFlag) RegisterOnce added in v0.3.0

func (c *ResourcePoolFlag) RegisterOnce(fn func())

func (*ResourcePoolFlag) ResourcePool

func (flag *ResourcePoolFlag) ResourcePool() (*object.ResourcePool, error)

type SearchFlag

type SearchFlag struct {
	*ClientFlag
	*DatacenterFlag
	// contains filtered or unexported fields
}

func NewSearchFlag

func NewSearchFlag(ctx context.Context, t int) (*SearchFlag, context.Context)

func (*SearchFlag) HostSystem

func (flag *SearchFlag) HostSystem() (*object.HostSystem, error)

func (*SearchFlag) HostSystems

func (flag *SearchFlag) HostSystems(args []string) ([]*object.HostSystem, error)

func (*SearchFlag) IsSet

func (flag *SearchFlag) IsSet() bool

func (*SearchFlag) Process

func (flag *SearchFlag) Process(ctx context.Context) error

func (*SearchFlag) ProcessOnce added in v0.3.0

func (c *SearchFlag) ProcessOnce(fn func() error) (err error)

func (*SearchFlag) Register

func (flag *SearchFlag) Register(ctx context.Context, fs *flag.FlagSet)

func (*SearchFlag) RegisterOnce added in v0.3.0

func (c *SearchFlag) RegisterOnce(fn func())

func (*SearchFlag) VirtualApp added in v0.3.0

func (flag *SearchFlag) VirtualApp() (*object.VirtualApp, error)

func (*SearchFlag) VirtualApps added in v0.3.0

func (flag *SearchFlag) VirtualApps(args []string) ([]*object.VirtualApp, error)

func (*SearchFlag) VirtualMachine

func (flag *SearchFlag) VirtualMachine() (*object.VirtualMachine, error)

func (*SearchFlag) VirtualMachines

func (flag *SearchFlag) VirtualMachines(args []string) ([]*object.VirtualMachine, error)

type VirtualAppFlag added in v0.3.0

type VirtualAppFlag struct {
	*DatacenterFlag
	*SearchFlag
	// contains filtered or unexported fields
}

func NewVirtualAppFlag added in v0.3.0

func NewVirtualAppFlag(ctx context.Context) (*VirtualAppFlag, context.Context)

func (*VirtualAppFlag) Process added in v0.3.0

func (flag *VirtualAppFlag) Process(ctx context.Context) error

func (*VirtualAppFlag) ProcessOnce added in v0.3.0

func (c *VirtualAppFlag) ProcessOnce(fn func() error) (err error)

func (*VirtualAppFlag) Register added in v0.3.0

func (flag *VirtualAppFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*VirtualAppFlag) RegisterOnce added in v0.3.0

func (c *VirtualAppFlag) RegisterOnce(fn func())

func (*VirtualAppFlag) VirtualApp added in v0.3.0

func (flag *VirtualAppFlag) VirtualApp() (*object.VirtualApp, error)

type VirtualMachineFlag

type VirtualMachineFlag struct {
	*ClientFlag
	*DatacenterFlag
	*SearchFlag
	// contains filtered or unexported fields
}

func NewVirtualMachineFlag added in v0.3.0

func NewVirtualMachineFlag(ctx context.Context) (*VirtualMachineFlag, context.Context)

func (*VirtualMachineFlag) Process

func (flag *VirtualMachineFlag) Process(ctx context.Context) error

func (*VirtualMachineFlag) ProcessOnce added in v0.3.0

func (c *VirtualMachineFlag) ProcessOnce(fn func() error) (err error)

func (*VirtualMachineFlag) Register

func (flag *VirtualMachineFlag) Register(ctx context.Context, f *flag.FlagSet)

func (*VirtualMachineFlag) RegisterOnce added in v0.3.0

func (c *VirtualMachineFlag) RegisterOnce(fn func())

func (*VirtualMachineFlag) VirtualMachine

func (flag *VirtualMachineFlag) VirtualMachine() (*object.VirtualMachine, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL