cmd

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 79 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ConfigOptionTypeConfigmap --
	ConfigOptionTypeConfigmap configOptionType = "configmap"
	// ConfigOptionTypeSecret --
	ConfigOptionTypeSecret configOptionType = "secret"
	// ConfigOptionTypeFile --
	ConfigOptionTypeFile configOptionType = "file"
)
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"
)
View Source
const (
	Megabyte = 1 << 20
	Kilobyte = 1 << 10
)

Variables

View Source
var VersionVariant = ""

VersionVariant may be overridden at build time

Functions

func ApplyConfigOption added in v1.5.0

func ApplyConfigOption(config *RunConfigOption, integrationSpec *v1.IntegrationSpec, c client.Client, namespace string, enableCompression bool) error

ApplyConfigOption will set the proper --config option behavior to the IntegrationSpec

func ApplyResourceOption added in v1.5.0

func ApplyResourceOption(config *RunConfigOption, integrationSpec *v1.IntegrationSpec, c client.Client, namespace string, enableCompression bool) error

ApplyResourceOption will set the proper --resource option behavior to the IntegrationSpec

func DeleteIntegration

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

DeleteIntegration --

func GetContainerIntegrationRunCommand added in v1.3.0

func GetContainerIntegrationRunCommand(ctx context.Context, properties []string, dependencies []string, routes []string, stdout, stderr io.Writer) (*exec.Cmd, error)

GetContainerIntegrationRunCommand --

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 ---

func RunLocalIntegrationRunCommand added in v1.3.0

func RunLocalIntegrationRunCommand(ctx context.Context, properties []string, dependencies []string, routes []string, propertiesDir string, stdout, stderr io.Writer) error

RunLocalIntegrationRunCommand --

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 (*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 RootCmdOptions

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

	KubeConfig string `mapstructure:"kube-config"`
	Namespace  string `mapstructure:"namespace"`
	// contains filtered or unexported fields
}

RootCmdOptions --

func (*RootCmdOptions) GetCamelCmdClient added in v1.3.0

func (command *RootCmdOptions) GetCamelCmdClient() (*camelv1.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

type RunConfigOption added in v1.5.0

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

RunConfigOption represents a config option

func ParseConfigOption added in v1.5.0

func ParseConfigOption(item string) (*RunConfigOption, error)

ParseConfigOption will parse and return a runConfigOption

func ParseResourceOption added in v1.5.0

func ParseResourceOption(item string) (*RunConfigOption, error)

ParseResourceOption will parse and return a runConfigOption

func (*RunConfigOption) DestinationPath added in v1.5.0

func (runConfigOption *RunConfigOption) DestinationPath() string

DestinationPath is the location where the resource will be stored on destination

func (*RunConfigOption) Key added in v1.5.0

func (runConfigOption *RunConfigOption) Key() string

Key is the key specified for the resource

func (*RunConfigOption) Name added in v1.5.0

func (runConfigOption *RunConfigOption) Name() string

Name is the name of the resource

func (*RunConfigOption) Type added in v1.5.0

func (runConfigOption *RunConfigOption) Type() string

Type is the type, converted as string

func (*RunConfigOption) Validate added in v1.5.0

func (runConfigOption *RunConfigOption) Validate() error

Validate checks if the DestinationPath is correctly configured

type Source added in v1.3.0

type Source struct {
	Origin   string
	Location string
	Name     string
	Content  string
	Compress bool
	Local    bool
}

Source ---

func ResolveLocalSource added in v1.3.0

func ResolveLocalSource(location string, compress bool) (Source, error)

ResolveLocalSource --

func ResolveSources added in v1.3.0

func ResolveSources(ctx context.Context, locations []string, compress bool) ([]Source, error)

ResolveSources ---

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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