cmdutil

package
v2.22.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableAuthCheck

func DisableAuthCheck(cmd *cobra.Command) *cobra.Command

func DisableEncryptionCheck

func DisableEncryptionCheck(cmd *cobra.Command) *cobra.Command

DisableEncryptionCheck disable encryption check when reading the configuration

func IsAuthCheckEnabled

func IsAuthCheckEnabled(cmd *cobra.Command) bool

func IsConfigEncryptionCheckEnabled

func IsConfigEncryptionCheckEnabled(cmd *cobra.Command) bool

IsConfigEncryptionCheckEnabled check if the encryption in the configuration should be validated or not

func NewRequestInputIterators

func NewRequestInputIterators(cmd *cobra.Command, cfg *config.Config) (*flags.RequestInputIterators, error)

NewRequestInputIterators create a request iterator based on pipe line configuration

func WithTemplateValue

func WithTemplateValue(cfg *config.Config) flags.GetOption

WithTemplateValue get the template value using the path resolver controlled by the configuration

func WithViewCompletion

func WithViewCompletion(flagName string, dataviewFunc func() (*dataview.DataView, error)) completion.Option

WithViewCompletion view completion

Types

type Browser

type Browser interface {
	Browse(string) error
}

func NewBrowser

func NewBrowser(launcher string, stdout, stderr io.Writer) Browser

type Factory

type Factory struct {
	IOStreams      *iostreams.IOStreams
	Browser        Browser
	Client         func() (*c8y.Client, error)
	Config         func() (*config.Config, error)
	Logger         func() (*logger.Logger, error)
	ActivityLogger func() (*activitylogger.ActivityLogger, error)
	Console        func() (*console.Console, error)
	DataView       func() (*dataview.DataView, error)

	BuildVersion string
	BuildBranch  string

	// Executable is the path to the currently invoked binary
	Executable string
}

func (*Factory) CheckPostCommandError

func (f *Factory) CheckPostCommandError(err error) error

func (*Factory) CreateModeEnabled

func (f *Factory) CreateModeEnabled() error

CreateModeEnabled create mode is enabled

func (*Factory) DeleteModeEnabled

func (f *Factory) DeleteModeEnabled() error

ValidateDeleteMode delete mode is enabled

func (*Factory) GetRequestHandler

func (f *Factory) GetRequestHandler() (*request.RequestHandler, error)

func (*Factory) GetViewProperties

func (f *Factory) GetViewProperties(cfg *config.Config, cmd *cobra.Command, output []byte) ([]string, error)

GetViewProperties Look up the view properties to display

func (*Factory) RunWithWorkers

func (f *Factory) RunWithWorkers(client *c8y.Client, cmd *cobra.Command, req *c8y.RequestOptions, inputIterators *flags.RequestInputIterators) error

func (*Factory) UpdateModeEnabled

func (f *Factory) UpdateModeEnabled() error

ValidateUpdateMode update mode is enabled

func (*Factory) WithTemplateFlag

func (f *Factory) WithTemplateFlag(cmd *cobra.Command) flags.Option

WithTemplateFlag add template flag with completion

func (*Factory) WriteJSONToConsole

func (f *Factory) WriteJSONToConsole(cfg *config.Config, cmd *cobra.Command, property string, output []byte) error

WriteJSONToConsole writes given json output to the console supporting the common options of select, output etc.

type TemplatePathResolver

type TemplatePathResolver struct {
	Paths []string
}

func NewTemplateResolver added in v2.14.0

func NewTemplateResolver(cfg *config.Config) *TemplatePathResolver

func (*TemplatePathResolver) Resolve

func (t *TemplatePathResolver) Resolve(name string) (string, error)

type TestBrowser

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

func (*TestBrowser) Browse

func (b *TestBrowser) Browse(url string) error

func (*TestBrowser) BrowsedURL

func (b *TestBrowser) BrowsedURL() string

func (*TestBrowser) Verify

func (b *TestBrowser) Verify(t _testing, url string)

Jump to

Keyboard shortcuts

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