cmdutil

package
v0.0.0-...-af0b780 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0, Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToYugaware

func ConnectToYugaware(ctx *YWClientContext) (*client.YugawareClient, error)

func GetLogger

func GetLogger(module string, debug bool) (logr.Logger, error)

func WaitForTaskCompletion

func WaitForTaskCompletion(ctx context.Context, ywclient *client.YugawareClient, waitTask *models.YBPTask) error

Types

type CommandOptions

type CommandOptions interface {
	AddFlags(cmd *cobra.Command)
	Validate(ctx *YWClientContext) error
}

type YWClientContext

type YWClientContext struct {
	context.Context
	Log            logr.Logger
	Cmd            *cobra.Command
	GlobalOptions  *YWGlobalOptions
	CommandOptions CommandOptions
	Fs             vfs.Filesystem

	Client *client.YugawareClient
}

func NewCommandContext

func NewCommandContext() *YWClientContext

func (*YWClientContext) Setup

func (ctx *YWClientContext) Setup() error

func (*YWClientContext) SetupNoClient

func (ctx *YWClientContext) SetupNoClient() error

func (*YWClientContext) WithCmd

func (ctx *YWClientContext) WithCmd(cmd *cobra.Command) *YWClientContext

func (*YWClientContext) WithGlobalOptions

func (ctx *YWClientContext) WithGlobalOptions(options *YWGlobalOptions) *YWClientContext

func (*YWClientContext) WithOptions

func (ctx *YWClientContext) WithOptions(options CommandOptions) *YWClientContext

func (*YWClientContext) WithVFS

func (ctx *YWClientContext) WithVFS(fs vfs.Filesystem) *YWClientContext

type YWGlobalOptions

type YWGlobalOptions struct {
	Debug                bool   `mapstructure:"debug"`
	Output               string `mapstructure:"output"`
	Hostname             string `mapstructure:"hostname"`
	DialTimeout          int    `mapstructure:"dialtimeout"`
	SkipHostVerification bool   `mapstructure:"skiphostverification"`
	CACert               string `mapstructure:"cacert"`
	ClientCert           string `mapstructure:"client_cert"`
	ClientKey            string `mapstructure:"client_key"`
	APIToken             string `mapstructure:"api_token"`
}

func (*YWGlobalOptions) AddFlags

func (o *YWGlobalOptions) AddFlags(cmd *cobra.Command)

func (*YWGlobalOptions) Validate

func (o *YWGlobalOptions) Validate(_ *YWClientContext) error

Jump to

Keyboard shortcuts

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