completion

package
v2.43.3 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BooleanFalse bool = false
View Source
var BooleanTrue bool = true
View Source
var ErrNotFound = errors.New("not found")

Functions

func GetFlagStringValues

func GetFlagStringValues(cmd *cobra.Command, name string) ([]string, error)

GetFlagStringValues get string slice from either a string slice or string flag

func MatchString

func MatchString(pattern, name string) bool

func WithOptions

func WithOptions(cmd *cobra.Command, opts ...Option) *cobra.Command

WithOptions applies given options to the command

Types

type Option

type Option func(*cobra.Command) *cobra.Command

Option adds flags to a given command

func MarkLocalFlag

func MarkLocalFlag(exclude ...string) Option

MarkLocalFlag marks a flag as local flag so it get prioritized in the completions

func WithAgent

func WithAgent(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithAgent agent completion

func WithApplication

func WithApplication(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithApplication application completion

func WithApplicationContext

func WithApplicationContext(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithApplicationContext application context completion

func WithApplicationWithVersions added in v2.40.0

func WithApplicationWithVersions(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithApplicationWithVersions applications with versions completion

func WithConfiguration

func WithConfiguration(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithConfiguration configuration (managedObject) completion

func WithCustomValidateSet

func WithCustomValidateSet(flagName string, customFunc func() []string) Option

func WithDevice

func WithDevice(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDevice device completion

func WithDeviceCertificate added in v2.13.0

func WithDeviceCertificate(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceCertificate trusted device certificate completion

func WithDeviceGroup

func WithDeviceGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceGroup device group completion

func WithDeviceMeasurementSeries

func WithDeviceMeasurementSeries(flagName string, flagNameDevice string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementSeries supported measurement series completion (requires device)

func WithDeviceMeasurementValueFragmentSeries

func WithDeviceMeasurementValueFragmentSeries(flagName string, flagNameDevice string, flagNameValueFragmentType string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementValueFragmentSeries supported measurement value fragment types completion (requires device)

func WithDeviceMeasurementValueFragmentType

func WithDeviceMeasurementValueFragmentType(flagName string, flagNameDevice string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceMeasurementValueFragmentType supported measurement value fragment types completion (requires device)

func WithDeviceProfile

func WithDeviceProfile(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceProfile device profile (managedObject) completion

func WithDeviceRegistrationRequest

func WithDeviceRegistrationRequest(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceRegistrationRequest device registration request completion

func WithDeviceService added in v2.16.0

func WithDeviceService(flagService string, flagDevice string, clientFunc func() (*c8y.Client, error)) Option

WithDeviceService device service completion (requires device)

func WithExternalCompletion added in v2.30.0

func WithExternalCompletion(flagName string, externalCommand []string) Option

WithExternalCompletion completion by executing an external command or another c8y command

func WithFirmware

func WithFirmware(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithFirmware firmware (managedObject) completion

func WithFirmwarePatch

func WithFirmwarePatch(flagVersion string, flagNameFirmware string, clientFunc func() (*c8y.Client, error)) Option

WithFirmwarePatch firmware patch version completion (requires category)

func WithFirmwareVersion

func WithFirmwareVersion(flagVersion string, flagNameFirmware string, clientFunc func() (*c8y.Client, error)) Option

WithFirmwareVersion firmware version completion (requires category)

func WithHostedApplication

func WithHostedApplication(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithHostedApplication hosted application completion

func WithLazyRequired

func WithLazyRequired(flagName string, values ...string) Option

WithLazyRequired marks a flag as required but does not enforce it.

func WithMicroservice

func WithMicroservice(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithMicroservice microservice completion

func WithMicroserviceInstance

func WithMicroserviceInstance(flagName string, flagApplicationID string, clientFunc func() (*c8y.Client, error)) Option

WithMicroserviceInstance microservice instances completion

func WithMicroserviceLoggers added in v2.15.0

func WithMicroserviceLoggers(flagName string, flagNameMicroserviceName string, clientFunc func() (*c8y.Client, error)) Option

WithMicroservice completion

func WithNotification2SubscriptionId added in v2.16.0

func WithNotification2SubscriptionId(flagName string, clientFunc func() (*c8y.Client, error)) Option

func WithNotification2SubscriptionName added in v2.16.0

func WithNotification2SubscriptionName(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithNotification2SubscriptionName subscription name completion

func WithRemoteAccessConfiguration added in v2.41.0

func WithRemoteAccessConfiguration(flagConfiguration string, flagDevice string, clientFunc func() (*c8y.Client, error)) Option

WithRemoteAccessConfiguration remote access configuration completion (requires device)

func WithRemoteAccessPassthroughConfiguration added in v2.41.0

func WithRemoteAccessPassthroughConfiguration(flagConfiguration string, flagDevice string, clientFunc func() (*c8y.Client, error)) Option

WithRemoteAccessPassthroughConfiguration complete passthrough remote access completions (requires device)

func WithSessionFile

func WithSessionFile(flagName string, extensions []string, pathFunc func() string) Option

WithSessionFile session file completion

func WithSmartGroup

func WithSmartGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSmartGroup smart group completion

func WithSoftware

func WithSoftware(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSoftware software (managedObject) completion

func WithSoftwareVersion

func WithSoftwareVersion(flagVersion string, flagNameSoftware string, clientFunc func() (*c8y.Client, error)) Option

WithSoftwareVersion software version completion (requires category)

func WithSystemOptionCategory

func WithSystemOptionCategory(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithSystemOptionCategory system option category completion

func WithSystemOptionKey

func WithSystemOptionKey(flagName string, flagNameCategory string, clientFunc func() (*c8y.Client, error)) Option

WithSystemOptionKey system option key completion (requires category)

func WithTenantID

func WithTenantID(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithTenantID tenant id completion

func WithTenantOptionCategory

func WithTenantOptionCategory(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithTenantOptionCategory tenant option category completion

func WithTenantOptionKey

func WithTenantOptionKey(flagName string, flagNameCategory string, clientFunc func() (*c8y.Client, error)) Option

WithTenantOptionKey tenant option key completion (requires category)

func WithUIPlugin added in v2.40.0

func WithUIPlugin(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUIPlugin UI extension completion

func WithUIPluginVersion added in v2.40.0

func WithUIPluginVersion(flagVersion string, flagExtension string, clientFunc func() (*c8y.Client, error)) Option

Complete UI extension versions

func WithUIPluginWithVersions added in v2.40.0

func WithUIPluginWithVersions(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUIPluginWithVersions UI plugin with version completion Values are returned in the format of name@version

func WithUser

func WithUser(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUser user completion

func WithUserGroup

func WithUserGroup(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUserGroup usergroup completion

func WithUserRole

func WithUserRole(flagName string, clientFunc func() (*c8y.Client, error)) Option

WithUserRole user role completion

func WithValidateSet

func WithValidateSet(flagName string, values ...string) Option

WithValidateSet adds a completion function with the given values

Jump to

Keyboard shortcuts

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