common

package
v0.18.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 32 Imported by: 1

Documentation

Index

Constants

View Source
const ComponentVersionTag = "<componentversion>"

Variables

This section is empty.

Functions

func CompleteOptionsWithSession

func CompleteOptionsWithSession(ctx clictx.Context, session ocm.Session, all ...bool) options.OptionsProcessor

CompleteOptionsWithSession provides an options.OptionsProcessor completing options by passing a session object using the OptionWithSessionCompleter interface. If an optional argument true is given, it also tries the other standard completion methods possible for an options object.

func ConsumeIdentities

func ConsumeIdentities(pattern bool, args []string, stop ...string) ([]metav1.Identity, []string, error)

func FilterSettings

func FilterSettings(args ...string) (attrs map[string]string, addArgs []string)

func IsVersionSet

func IsVersionSet(vers string) bool

func MapArgsToIdentities

func MapArgsToIdentities(args ...string) ([]metav1.Identity, error)

func MapArgsToIdentityPattern

func MapArgsToIdentityPattern(args ...string) (metav1.Identity, error)

func MapLabelSpecs

func MapLabelSpecs(d interface{}) (interface{}, error)

func NewElementFileSource

func NewElementFileSource(path string, fss ...vfs.FileSystem) addhdlrs.ElementSource

func NewModifiedResourceSpecificationsFile

func NewModifiedResourceSpecificationsFile(data string, path string, fss ...vfs.FileSystem) addhdlrs.ElementSource

func ParseSettings

func ParseSettings(args []string, kinds ...string) (map[string]string, error)

func ProcessElements

func ProcessElements(ictx inputs.Context, cv ocm.ComponentVersionAccess, elems []addhdlrs.Element, h ResourceSpecHandler) error

ProcessElements add a list of evaluated elements to a component version.

Types

type ContentResourceSpecificationsProvider

type ContentResourceSpecificationsProvider struct {
	*ElementMetaDataSpecificationsProvider

	DefaultType string
	// contains filtered or unexported fields
}

func NewContentResourceSpecificationProvider

func NewContentResourceSpecificationProvider(ctx clictx.Context, name string, adder flagsets.ConfigAdder, deftype string, types ...flagsets.ConfigOptionType) *ContentResourceSpecificationsProvider

func (*ContentResourceSpecificationsProvider) AddFlags

func (*ContentResourceSpecificationsProvider) Complete

func (*ContentResourceSpecificationsProvider) Description

func (*ContentResourceSpecificationsProvider) Get

func (*ContentResourceSpecificationsProvider) IsSpecified

func (*ContentResourceSpecificationsProvider) ParsedMeta

func (*ContentResourceSpecificationsProvider) Resources

type ElementFileSource

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

func (*ElementFileSource) Get

func (r *ElementFileSource) Get() (string, error)

func (*ElementFileSource) Origin

type ElementMetaDataSpecificationsProvider

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

func (*ElementMetaDataSpecificationsProvider) AddFlags

func (*ElementMetaDataSpecificationsProvider) Complete

func (*ElementMetaDataSpecificationsProvider) Description

func (*ElementMetaDataSpecificationsProvider) ElementType

func (*ElementMetaDataSpecificationsProvider) IsSpecified

func (*ElementMetaDataSpecificationsProvider) Origin

func (*ElementMetaDataSpecificationsProvider) ParsedMeta

type ElementSpecificationsProvider

type ElementSpecificationsProvider interface {
	AddFlags(fs *pflag.FlagSet)
	Complete() error
	Resources() ([]addhdlrs.ElementSource, error)
	Description() string
	IsSpecified() bool
}

type ModifiedResourceSpecificationsFile

type ModifiedResourceSpecificationsFile struct {
	ElementFileSource
	// contains filtered or unexported fields
}

func (*ModifiedResourceSpecificationsFile) Get

type OptionWithSessionCompleter

type OptionWithSessionCompleter interface {
	CompleteWithSession(ctx clictx.OCM, session ocm.Session) error
}

OptionWithSessionCompleter describes the interface for option objects requiring a completion with a session.

type ResourceAdderCommand

type ResourceAdderCommand struct {
	utils.BaseCommand

	Adder ElementSpecificationsProvider

	Resources []addhdlrs.ElementSource
	Envs      []string

	Archive string

	Handler ResourceSpecHandler
}

func (*ResourceAdderCommand) AddFlags

func (o *ResourceAdderCommand) AddFlags(fs *pflag.FlagSet)

func (*ResourceAdderCommand) Complete

func (o *ResourceAdderCommand) Complete(args []string) error

func (*ResourceAdderCommand) ProcessResourceDescriptions

func (o *ResourceAdderCommand) ProcessResourceDescriptions() error

type ResourceConfigAdderCommand

type ResourceConfigAdderCommand struct {
	utils.BaseCommand

	Adder ElementSpecificationsProvider

	ConfigFile string
	Resources  []addhdlrs.ElementSource
	Envs       []string
}

func NewResourceConfigAdderCommand

func NewResourceConfigAdderCommand(ctx clictx.Context, adder ElementSpecificationsProvider, opts ...options.Options) ResourceConfigAdderCommand

NewCommand creates a new ctf command.

func (*ResourceConfigAdderCommand) AddFlags

func (o *ResourceConfigAdderCommand) AddFlags(fs *pflag.FlagSet)

func (*ResourceConfigAdderCommand) Complete

func (o *ResourceConfigAdderCommand) Complete(args []string) error

func (*ResourceConfigAdderCommand) ProcessResourceDescriptions

func (o *ResourceConfigAdderCommand) ProcessResourceDescriptions(h ResourceSpecHandler) error

Jump to

Keyboard shortcuts

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