cmd

package
v2.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultConfigName is the default config name.
	DefaultConfigName = "kamel-config"

	// DefaultConfigLocation is the main place where the kamel content is stored.
	DefaultConfigLocation = DefaultConfigName + ".yaml"

	// KamelTagName ---.
	KamelTagName = "kamel"

	// MapstructureTagName ---.
	MapstructureTagName = "mapstructure"
)

Variables

View Source
var VersionVariant = ""

VersionVariant may be overridden at build time.

Functions

func DeleteIntegration

func DeleteIntegration(ctx context.Context, c client.Client, name string, namespace string) error

DeleteIntegration --.

func NewKamelCommand

func NewKamelCommand(ctx context.Context) (*cobra.Command, error)

NewKamelCommand --.

func NewKamelWithModelineCommand

func NewKamelWithModelineCommand(ctx context.Context, osArgs []string) (*cobra.Command, []string, error)

NewKamelWithModelineCommand ---.

Types

type Config

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

Config is a helper class to manipulate kamel configuration files.

func LoadConfiguration

func LoadConfiguration() (*Config, error)

LoadConfiguration loads a kamel configuration file.

func LoadConfigurationFrom

func LoadConfigurationFrom(location string) (*Config, error)

LoadConfigurationFrom loads a kamel configuration file from a specific location.

func (*Config) Delete

func (cfg *Config) Delete(path string)

Delete allows to remove a sub tree from the kamel content.

func (*Config) Save

func (cfg *Config) Save() error

Save ---.

func (*Config) SetNode

func (cfg *Config) SetNode(nodeID string, nodeValues map[string]interface{})

SetNode allows to replace a subtree with a given content.

func (*Config) Update

func (cfg *Config) Update(cmd *cobra.Command, nodeID string, data interface{}, changedOnly bool)

Update ---.

type ConfigFolder

type ConfigFolder string

ConfigFolder defines the different types of folder containing the configuration file.

const (
	// The path of the folder containing the configuration file is retrieved from the environment
	// variable KAMEL_CONFIG_PATH.
	ConfigFolderEnvVar ConfigFolder = "env"
	// The path of the folder containing the configuration file is $HOME/.kamel.
	ConfigFolderHome ConfigFolder = "home"
	// The folder containing the configuration file is .kamel located in the working directory.
	ConfigFolderSubDirectory ConfigFolder = "sub"
	// The folder containing the configuration file is the working directory.
	ConfigFolderWorking ConfigFolder = "working"
	// The folder containing the configuration file is the directory currently used by Kamel.
	ConfigFolderUsed ConfigFolder = "used"
)

type RootCmdOptions

type RootCmdOptions struct {
	RootContext   context.Context    `mapstructure:"-"`
	Context       context.Context    `mapstructure:"-"`
	ContextCancel context.CancelFunc `mapstructure:"-"`

	Flags      *viper.Viper `mapstructure:"-"`
	KubeConfig string       `mapstructure:"kube-config"`
	Namespace  string       `mapstructure:"namespace"`
	Verbose    bool         `mapstructure:"verbose" yaml:",omitempty"`
	// contains filtered or unexported fields
}

RootCmdOptions --. nolint: containedctx

func (*RootCmdOptions) GetCamelCmdClient

func (command *RootCmdOptions) GetCamelCmdClient() (*v1.CamelV1Client, error)

GetCamelCmdClient returns a client to access the Camel resources.

func (*RootCmdOptions) GetCmdClient

func (command *RootCmdOptions) GetCmdClient() (client.Client, error)

GetCmdClient returns the client that can be used from command line tools.

func (*RootCmdOptions) NewCmdClient

func (command *RootCmdOptions) NewCmdClient() (client.Client, error)

NewCmdClient returns a new client that can be used from command line tools.

func (*RootCmdOptions) PrintVerboseOut

func (command *RootCmdOptions) PrintVerboseOut(cmd *cobra.Command, a ...interface{})

func (*RootCmdOptions) PrintfVerboseErrf

func (command *RootCmdOptions) PrintfVerboseErrf(cmd *cobra.Command, format string, a ...interface{})

func (*RootCmdOptions) PrintfVerboseOutf

func (command *RootCmdOptions) PrintfVerboseOutf(cmd *cobra.Command, format string, a ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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