common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2021 License: Apache-2.0 Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterDevfileObject

func FilterDevfileObject(attributes apiAttributes.Attributes, options DevfileOptions) (bool, error)

FilterDevfileObject filters devfile attributes with the given options

func GetApplyComponent

func GetApplyComponent(dc v1.Command) string

GetApplyComponent returns the component of the apply command

func GetCommandType

func GetCommandType(command v1.Command) (v1.CommandType, error)

GetCommandType returns the command type of a given command

func GetCommandsFromEvent

func GetCommandsFromEvent(commandsMap map[string]v1.Command, eventName string) []string

GetCommandsFromEvent returns the list of commands from the event name. If the event is a composite command, it returns the sub-commands from the tree

func GetCommandsMap

func GetCommandsMap(commands []v1.Command) map[string]v1.Command

GetCommandsMap returns a map of the command Id to the command

func GetComponentType

func GetComponentType(component v1.Component) (v1.ComponentType, error)

GetComponentType returns the component type of a given component

func GetDefaultSource

func GetDefaultSource(ps v1.GitLikeProjectSource) (remoteName string, remoteURL string, revision string, err error)

GetDefaultSource get information about primary source returns 3 strings: remote name, remote URL, reference(revision)

func GetExecCommandLine

func GetExecCommandLine(dc v1.Command) string

GetExecCommandLine returns the command line of the exec command

func GetExecComponent

func GetExecComponent(dc v1.Command) string

GetExecComponent returns the component of the exec command

func GetExecWorkingDir

func GetExecWorkingDir(dc v1.Command) string

GetExecWorkingDir returns the working dir of the exec command

func GetGroup

func GetGroup(dc v1.Command) *v1.CommandGroup

GetGroup returns the group the command belongs to

func GetProjectSourceType

func GetProjectSourceType(projectSrc v1.ProjectSource) (v1.ProjectSourceType, error)

GetProjectSourceType returns the source type of a given project source

func IsContainer

func IsContainer(component v1.Component) bool

IsContainer checks if the component is a container

func IsVolume

func IsVolume(component v1.Component) bool

IsVolume checks if the component is a volume

Types

type CommandOptions

type CommandOptions struct {
	// CommandGroupKind is an option that allows to filter command based on their kind
	CommandGroupKind v1.CommandGroupKind

	// CommandType is an option that allows to filter command based on their type
	CommandType v1.CommandType
}

CommandOptions specifies the various options available to filter commands

type ComponentOptions

type ComponentOptions struct {

	// ComponentType is an option that allows to filter component based on their type
	ComponentType v1.ComponentType
}

ComponentOptions specifies the various options available to filter components

type DevfileOptions

type DevfileOptions struct {
	// Filter is a map that lets filter devfile object against their attributes. Interface can be string, float, boolean or a map
	Filter map[string]interface{}

	// CommandOptions specifies the various options available to filter commands
	CommandOptions CommandOptions

	// ComponentOptions specifies the various options available to filter components
	ComponentOptions ComponentOptions

	// ProjectOptions specifies the various options available to filter projects/starterProjects
	ProjectOptions ProjectOptions
}

DevfileOptions provides options for Devfile operations

type FieldAlreadyExistError

type FieldAlreadyExistError struct {
	// field which already exist
	Field string
	// field name
	Name string
}

FieldAlreadyExistError error returned if tried to add already exisitng field

func (*FieldAlreadyExistError) Error

func (e *FieldAlreadyExistError) Error() string

type FieldNotFoundError

type FieldNotFoundError struct {
	// field which doesn't exist
	Field string
	// field name
	Name string
}

FieldNotFoundError error returned if the field with the name is not found

func (*FieldNotFoundError) Error

func (e *FieldNotFoundError) Error() string

type ProjectOptions

type ProjectOptions struct {

	// ProjectSourceType is an option that allows to filter project based on their source type
	ProjectSourceType v1.ProjectSourceType
}

ProjectOptions specifies the various options available to filter projects/starterProjects

Jump to

Keyboard shortcuts

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