...

Package devstate

Overview ▾

Index ▾

Constants
func GetDefault(command v1alpha2.Command) bool
func GetGroup(command v1alpha2.Command) string
func IsQuantityValid(quantity string) bool
func SetDefault(command *v1alpha2.Command, def bool)
func SetGroup(command *v1alpha2.Command, group string)
type DevfileState
    func NewDevfileState() DevfileState
    func (o *DevfileState) AddApplyCommand(name string, component string) (DevfileContent, error)
    func (o *DevfileState) AddCompositeCommand(name string, parallel bool, commands []string) (DevfileContent, error)
    func (o *DevfileState) AddContainer(name string, image string, command []string, args []string, envs []Env, memRequest string, memLimit string, cpuRequest string, cpuLimit string, volumeMounts []VolumeMount, configureSources bool, mountSources bool, sourceMapping string, annotation Annotation, endpoints []Endpoint) (DevfileContent, error)
    func (o *DevfileState) AddExecCommand(name string, component string, commandLine string, workingDir string, hotReloadCapable bool) (DevfileContent, error)
    func (o *DevfileState) AddImage(name string, imageName string, args []string, buildContext string, rootRequired bool, uri string, autoBuild string) (DevfileContent, error)
    func (o *DevfileState) AddResource(name string, inlined string, uri string, deployByDefault string) (DevfileContent, error)
    func (o *DevfileState) AddVolume(name string, ephemeral bool, size string) (DevfileContent, error)
    func (o *DevfileState) DeleteCommand(name string) (DevfileContent, error)
    func (o *DevfileState) DeleteContainer(name string) (DevfileContent, error)
    func (o *DevfileState) DeleteImage(name string) (DevfileContent, error)
    func (o *DevfileState) DeleteResource(name string) (DevfileContent, error)
    func (o *DevfileState) DeleteVolume(name string) (DevfileContent, error)
    func (o *DevfileState) GetContent() (DevfileContent, error)
    func (o *DevfileState) GetFlowChart() (string, error)
    func (o *DevfileState) MoveCommand(previousGroup, newGroup string, previousIndex, newIndex int) (DevfileContent, error)
    func (o *DevfileState) PatchApplyCommand(name string, component string) (DevfileContent, error)
    func (o *DevfileState) PatchCompositeCommand(name string, parallel bool, commands []string) (DevfileContent, error)
    func (o *DevfileState) PatchContainer(name string, image string, command []string, args []string, envs []Env, memRequest string, memLimit string, cpuRequest string, cpuLimit string, volumeMounts []VolumeMount, configureSources bool, mountSources bool, sourceMapping string, annotation Annotation, endpoints []Endpoint) (DevfileContent, error)
    func (o *DevfileState) PatchExecCommand(name string, component string, commandLine string, workingDir string, hotReloadCapable bool) (DevfileContent, error)
    func (o *DevfileState) PatchImage(name string, imageName string, args []string, buildContext string, rootRequired bool, uri string, autoBuild string) (DevfileContent, error)
    func (o *DevfileState) PatchResource(name string, inlined string, uri string, deployByDefault string) (DevfileContent, error)
    func (o *DevfileState) PatchVolume(name string, ephemeral bool, size string) (DevfileContent, error)
    func (o *DevfileState) SetDefaultCommand(commandName string, group string) (DevfileContent, error)
    func (o *DevfileState) SetDevfileContent(content string) (DevfileContent, error)
    func (o *DevfileState) SetMetadata(name string, version string, displayName string, description string, tags string, architectures string, icon string, globalMemoryLimit string, projectType string, language string, website string, provider string, supportUrl string) (DevfileContent, error)
    func (o *DevfileState) UnsetDefaultCommand(commandName string) (DevfileContent, error)
    func (o *DevfileState) UpdateEvents(event string, commands []string) (DevfileContent, error)

Package files

chart.go commands.go components.go content.go events.go groups.go quantity.go state.go

Constants

const (
    SEPARATOR = ","
)

func GetDefault

func GetDefault(command v1alpha2.Command) bool

func GetGroup

func GetGroup(command v1alpha2.Command) string

func IsQuantityValid

func IsQuantityValid(quantity string) bool

func SetDefault

func SetDefault(command *v1alpha2.Command, def bool)

func SetGroup

func SetGroup(command *v1alpha2.Command, group string)

type DevfileState

type DevfileState struct {
    Devfile parser.DevfileObj
    FS      filesystem.Filesystem
}

func NewDevfileState

func NewDevfileState() DevfileState

func (*DevfileState) AddApplyCommand

func (o *DevfileState) AddApplyCommand(name string, component string) (DevfileContent, error)

func (*DevfileState) AddCompositeCommand

func (o *DevfileState) AddCompositeCommand(name string, parallel bool, commands []string) (DevfileContent, error)

func (*DevfileState) AddContainer

func (o *DevfileState) AddContainer(
    name string,
    image string,
    command []string,
    args []string,
    envs []Env,
    memRequest string,
    memLimit string,
    cpuRequest string,
    cpuLimit string,
    volumeMounts []VolumeMount,
    configureSources bool,
    mountSources bool,
    sourceMapping string,
    annotation Annotation,
    endpoints []Endpoint,
) (DevfileContent, error)

func (*DevfileState) AddExecCommand

func (o *DevfileState) AddExecCommand(name string, component string, commandLine string, workingDir string, hotReloadCapable bool) (DevfileContent, error)

func (*DevfileState) AddImage

func (o *DevfileState) AddImage(name string, imageName string, args []string, buildContext string, rootRequired bool, uri string, autoBuild string) (DevfileContent, error)

func (*DevfileState) AddResource

func (o *DevfileState) AddResource(name string, inlined string, uri string, deployByDefault string) (DevfileContent, error)

func (*DevfileState) AddVolume

func (o *DevfileState) AddVolume(name string, ephemeral bool, size string) (DevfileContent, error)

func (*DevfileState) DeleteCommand

func (o *DevfileState) DeleteCommand(name string) (DevfileContent, error)

func (*DevfileState) DeleteContainer

func (o *DevfileState) DeleteContainer(name string) (DevfileContent, error)

func (*DevfileState) DeleteImage

func (o *DevfileState) DeleteImage(name string) (DevfileContent, error)

func (*DevfileState) DeleteResource

func (o *DevfileState) DeleteResource(name string) (DevfileContent, error)

func (*DevfileState) DeleteVolume

func (o *DevfileState) DeleteVolume(name string) (DevfileContent, error)

func (*DevfileState) GetContent

func (o *DevfileState) GetContent() (DevfileContent, error)

getContent returns the YAML content of the global devfile as string

func (*DevfileState) GetFlowChart

func (o *DevfileState) GetFlowChart() (string, error)

func (*DevfileState) MoveCommand

func (o *DevfileState) MoveCommand(previousGroup, newGroup string, previousIndex, newIndex int) (DevfileContent, error)

func (*DevfileState) PatchApplyCommand

func (o *DevfileState) PatchApplyCommand(name string, component string) (DevfileContent, error)

func (*DevfileState) PatchCompositeCommand

func (o *DevfileState) PatchCompositeCommand(name string, parallel bool, commands []string) (DevfileContent, error)

func (*DevfileState) PatchContainer

func (o *DevfileState) PatchContainer(
    name string,
    image string,
    command []string,
    args []string,
    envs []Env,
    memRequest string,
    memLimit string,
    cpuRequest string,
    cpuLimit string,
    volumeMounts []VolumeMount,
    configureSources bool,
    mountSources bool,
    sourceMapping string,
    annotation Annotation,
    endpoints []Endpoint,
) (DevfileContent, error)

func (*DevfileState) PatchExecCommand

func (o *DevfileState) PatchExecCommand(name string, component string, commandLine string, workingDir string, hotReloadCapable bool) (DevfileContent, error)

func (*DevfileState) PatchImage

func (o *DevfileState) PatchImage(name string, imageName string, args []string, buildContext string, rootRequired bool, uri string, autoBuild string) (DevfileContent, error)

func (*DevfileState) PatchResource

func (o *DevfileState) PatchResource(name string, inlined string, uri string, deployByDefault string) (DevfileContent, error)

func (*DevfileState) PatchVolume

func (o *DevfileState) PatchVolume(name string, ephemeral bool, size string) (DevfileContent, error)

func (*DevfileState) SetDefaultCommand

func (o *DevfileState) SetDefaultCommand(commandName string, group string) (DevfileContent, error)

func (*DevfileState) SetDevfileContent

func (o *DevfileState) SetDevfileContent(content string) (DevfileContent, error)

SetDevfileContent replaces the devfile with a new content If an error occurs, the Devfile is not modified

func (*DevfileState) SetMetadata

func (o *DevfileState) SetMetadata(
    name string,
    version string,
    displayName string,
    description string,
    tags string,
    architectures string,
    icon string,
    globalMemoryLimit string,
    projectType string,
    language string,
    website string,
    provider string,
    supportUrl string,
) (DevfileContent, error)

func (*DevfileState) UnsetDefaultCommand

func (o *DevfileState) UnsetDefaultCommand(commandName string) (DevfileContent, error)

func (*DevfileState) UpdateEvents

func (o *DevfileState) UpdateEvents(event string, commands []string) (DevfileContent, error)