commandparser

package
v0.0.0-...-fd40943 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsArtifactInDirectory

func IsArtifactInDirectory(directory string, artifactFileName string) (bool, error)

func NewStembuildHelp

func NewStembuildHelp(commander *subcommands.Commander, topLevelFlags *flag.FlagSet, commands *[]subcommands.Command) *stembuildHelp

Types

type ConstructCmd

type ConstructCmd struct {
	GlobalFlags *GlobalFlags
	// contains filtered or unexported fields
}

func NewConstructCmd

func NewConstructCmd(ctx context.Context, prepFactory VMPreparerFactory, managerFactory ManagerFactory, validator ConstructCmdValidator, messenger ConstructMessenger) *ConstructCmd

func (*ConstructCmd) Execute

func (p *ConstructCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*ConstructCmd) Name

func (*ConstructCmd) Name() string

func (*ConstructCmd) SetFlags

func (p *ConstructCmd) SetFlags(f *flag.FlagSet)

func (*ConstructCmd) Synopsis

func (*ConstructCmd) Synopsis() string

func (*ConstructCmd) Usage

func (*ConstructCmd) Usage() string

type ConstructCmdMessenger

type ConstructCmdMessenger struct {
	OutputChannel io.Writer
}

func (*ConstructCmdMessenger) ArgumentsNotProvided

func (m *ConstructCmdMessenger) ArgumentsNotProvided()

func (*ConstructCmdMessenger) CannotConnectToVM

func (m *ConstructCmdMessenger) CannotConnectToVM(err error)

func (*ConstructCmdMessenger) CannotPrepareVM

func (m *ConstructCmdMessenger) CannotPrepareVM(err error)

func (*ConstructCmdMessenger) LGPONotFound

func (m *ConstructCmdMessenger) LGPONotFound()

type ConstructCmdValidator

type ConstructCmdValidator interface {
	PopulatedArgs(...string) bool
	LGPOInDirectory() bool
}

type ConstructMessenger

type ConstructMessenger interface {
	ArgumentsNotProvided()
	LGPONotFound()
	CannotConnectToVM(err error)
	CannotPrepareVM(err error)
}

type ConstructValidator

type ConstructValidator struct{}

func (*ConstructValidator) LGPOInDirectory

func (c *ConstructValidator) LGPOInDirectory() bool

func (*ConstructValidator) PopulatedArgs

func (c *ConstructValidator) PopulatedArgs(args ...string) bool

type GlobalFlags

type GlobalFlags struct {
	Debug       bool
	Color       bool
	ShowVersion bool
}

type ManagerFactory

type ManagerFactory interface {
	VCenterManager(ctx context.Context) (*vcenter_manager.VCenterManager, error)
	SetConfig(config vcenter_manager.FactoryConfig)
}

type OSAndVersionGetter

type OSAndVersionGetter interface {
	GetVersion() string
	GetVersionWithPatchNumber(string) string
	GetOs() string
}

type PackageCmd

type PackageCmd struct {
	GlobalFlags *GlobalFlags
	// contains filtered or unexported fields
}

func (*PackageCmd) Execute

func (p *PackageCmd) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{}) subcommands.ExitStatus

func (*PackageCmd) Name

func (*PackageCmd) Name() string

func (*PackageCmd) SetFlags

func (p *PackageCmd) SetFlags(f *flag.FlagSet)

func (*PackageCmd) Synopsis

func (*PackageCmd) Synopsis() string

func (*PackageCmd) Usage

func (*PackageCmd) Usage() string

type PackageMessenger

type PackageMessenger struct {
	Output io.Writer
}

func (*PackageMessenger) CannotCreatePackager

func (m *PackageMessenger) CannotCreatePackager(e error)

func (*PackageMessenger) DoesNotHaveEnoughSpace

func (m *PackageMessenger) DoesNotHaveEnoughSpace(e error)

func (*PackageMessenger) InvalidOutputConfig

func (m *PackageMessenger) InvalidOutputConfig(e error)

func (*PackageMessenger) PackageFailed

func (m *PackageMessenger) PackageFailed(e error)

func (*PackageMessenger) SourceParametersAreInvalid

func (m *PackageMessenger) SourceParametersAreInvalid(e error)

type Packager

type Packager interface {
	Package() error
	ValidateFreeSpaceForPackage(fs filesystem.FileSystem) error
	ValidateSourceParameters() error
}

type PackagerFactory

type PackagerFactory interface {
	NewPackager(sourceConfig config.SourceConfig, outputConfig config.OutputConfig, logger colorlogger.Logger) (Packager, error)
}

type PackagerMessenger

type PackagerMessenger interface {
	InvalidOutputConfig(error)
	CannotCreatePackager(error)
	DoesNotHaveEnoughSpace(error)
	SourceParametersAreInvalid(error)
	PackageFailed(error)
}

type VCenterManager

type VCenterManager interface {
	OperationsManager(ctx context.Context, vm *object.VirtualMachine) *guest.OperationsManager
	GuestManager(ctx context.Context, opsManager vcenter_manager.OpsManager, username, password string) (*guest_manager.GuestManager, error)
	FindVM(ctx context.Context, inventoryPath string) (*object.VirtualMachine, error)
	Login(ctx context.Context) error
}

type VMPreparerFactory

type VMPreparerFactory interface {
	New(config config.SourceConfig, vCenterManager VCenterManager) (VmConstruct, error)
}

type VmConstruct

type VmConstruct interface {
	PrepareVM() error
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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