Help us shape the future of Go! Take the 2026 Go Developer Survey

component

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const CreateRecommendedCommandName = "create"

CreateRecommendedCommandName is the recommended watch command name

View Source
const DeleteRecommendedCommandName = "delete"

DeleteRecommendedCommandName is the recommended delete command name

View Source
const DescribeRecommendedCommandName = "describe"

DescribeRecommendedCommandName is the recommended describe command name

View Source
const ExecRecommendedCommandName = "exec"

ExecRecommendedCommandName is the recommended exec command name

View Source
const GetRecommendedCommandName = "get"

GetRecommendedCommandName is the recommended get command name

View Source
const LinkRecommendedCommandName = "link"

LinkRecommendedCommandName is the recommended link command name

View Source
const ListRecommendedCommandName = "list"

ListRecommendedCommandName is the recommended watch command name

View Source
const LocalDirectoryDefaultLocation = "./"

LocalDirectoryDefaultLocation is the default location of where --local files should always be.. since the application will always be in the same directory as `.odo`, we will always set this as: ./

View Source
const LogRecommendedCommandName = "log"

LogRecommendedCommandName is the recommended watch command name

View Source
const PushRecommendedCommandName = "push"

PushRecommendedCommandName is the recommended push command name

View Source
const PushedCompState = "Pushed"
View Source
const RecommendedCommandName = "component"

RecommendedCommandName is the recommended component command name

View Source
const TestRecommendedCommandName = "test"

TestRecommendedCommandName is the recommended test command name

View Source
const UnlinkRecommendedCommandName = "unlink"

UnlinkRecommendedCommandName is the recommended unlink command name

View Source
const UnpushedCompState = "Unpushed"
View Source
const UpdateRecommendedCommandName = "update"

UpdateRecommendedCommandName is the recommended update command name

View Source
const WatchRecommendedCommandName = "watch"

WatchRecommendedCommandName is the recommended watch command name

Variables

View Source
var ConfigFilePath = filepath.Join(LocalDirectoryDefaultLocation, configFile)

ConfigFilePath is the path of config.yaml for s2i component

DevfilePath is the devfile path that is used by odo, which means odo can: 1. Directly use the devfile in DevfilePath 2. Download devfile from registry to DevfilePath then use the devfile in DevfilePath 3. Copy user's own devfile (path is specified via --devfile flag) to DevfilePath then use the devfile in DevfilePath

EnvFilePath is the path of env file for devfile component

Functions

func AddComponentFlag

func AddComponentFlag(cmd *cobra.Command)

AddComponentFlag adds a `component` flag to the given cobra command Also adds a completion handler to the flag

func NewCmdComponent

func NewCmdComponent(name, fullName string) *cobra.Command

NewCmdComponent implements the component odo command

func NewCmdCreate

func NewCmdCreate(name, fullName string) *cobra.Command

NewCmdCreate implements the create odo command

func NewCmdDelete

func NewCmdDelete(name, fullName string) *cobra.Command

NewCmdDelete implements the delete odo command

func NewCmdDescribe

func NewCmdDescribe(name, fullName string) *cobra.Command

NewCmdDescribe implements the describe odo command

func NewCmdExec

func NewCmdExec(name, fullName string) *cobra.Command

NewCmdExec implements the exec odo command

func NewCmdGet

func NewCmdGet(name, fullName string) *cobra.Command

NewCmdGet implements odo component get command

func NewCmdLink(name, fullName string) *cobra.Command

NewCmdLink implements the link odo command

func NewCmdList

func NewCmdList(name, fullName string) *cobra.Command

NewCmdList implements the list odo command

func NewCmdLog

func NewCmdLog(name, fullName string) *cobra.Command

NewCmdLog implements the log odo command

func NewCmdPush

func NewCmdPush(name, fullName string) *cobra.Command

NewCmdPush implements the push odo command

func NewCmdTest

func NewCmdTest(name, fullName string) *cobra.Command

NewCmdTest implements the odo test command

func NewCmdUnlink(name, fullName string) *cobra.Command

NewCmdUnlink implements the link odo command

func NewCmdUpdate

func NewCmdUpdate(name, fullName string) *cobra.Command

NewCmdUpdate implements the Update odo command

func NewCmdWatch

func NewCmdWatch(name, fullName string) *cobra.Command

NewCmdWatch implements the watch odo command

Types

type CommonPushOptions

type CommonPushOptions struct {
	EnvSpecificInfo *envinfo.EnvSpecificInfo

	*genericclioptions.Context
	// contains filtered or unexported fields
}

CommonPushOptions has data needed for all pushes

func NewCommonPushOptions

func NewCommonPushOptions() *CommonPushOptions

NewCommonPushOptions instantiates a commonPushOptions object

func (*CommonPushOptions) AddContextFlag

func (cpo *CommonPushOptions) AddContextFlag(cmd *cobra.Command)

AddContextFlag adds the context flag to specified command storing value of flag in options.componentContext

func (*CommonPushOptions) InitConfigFromContext

func (cpo *CommonPushOptions) InitConfigFromContext() error

InitConfigFromContext initializes localconfiginfo from the context

func (*CommonPushOptions) InitEnvInfoFromContext

func (cpo *CommonPushOptions) InitEnvInfoFromContext() (err error)

InitEnvInfoFromContext initializes envinfo from the context

func (*CommonPushOptions) Push

func (cpo *CommonPushOptions) Push() (err error)

Push pushes changes as per set options

func (*CommonPushOptions) ResolveProject

func (cpo *CommonPushOptions) ResolveProject(prjName string) (err error)

ResolveProject completes the push options as needed

func (*CommonPushOptions) ResolveSrcAndConfigFlags

func (cpo *CommonPushOptions) ResolveSrcAndConfigFlags()

ResolveSrcAndConfigFlags sets all pushes if none is asked

func (*CommonPushOptions) SetSourceInfo

func (cpo *CommonPushOptions) SetSourceInfo() (err error)

SetSourceInfo sets up source information

func (*CommonPushOptions) ValidateComponentCreate

func (cpo *CommonPushOptions) ValidateComponentCreate() error

ValidateComponentCreate validates if the request to create component is valid

type ComponentOptions

type ComponentOptions struct {
	*genericclioptions.Context
	// contains filtered or unexported fields
}

ComponentOptions encapsulates basic component options

func (*ComponentOptions) Complete

func (co *ComponentOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes component options

type CreateOptions

type CreateOptions struct {
	*CommonPushOptions
	// contains filtered or unexported fields
}

CreateOptions encapsulates create options

func NewCreateOptions

func NewCreateOptions() *CreateOptions

NewCreateOptions returns new instance of CreateOptions

func (*CreateOptions) Complete

func (co *CreateOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes create args

func (*CreateOptions) Run

func (co *CreateOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*CreateOptions) Validate

func (co *CreateOptions) Validate() (err error)

Validate validates the create parameters

type DeleteOptions

type DeleteOptions struct {
	*ComponentOptions

	EnvSpecificInfo *envinfo.EnvSpecificInfo
	// contains filtered or unexported fields
}

DeleteOptions is a container to attach complete, validate and run pattern

func NewDeleteOptions

func NewDeleteOptions() *DeleteOptions

NewDeleteOptions returns new instance of DeleteOptions

func (*DeleteOptions) Complete

func (do *DeleteOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes log args

func (*DeleteOptions) DevFileRun

func (do *DeleteOptions) DevFileRun() (err error)

DevFileRun has the logic to perform the required actions as part of command for devfiles

func (*DeleteOptions) DevfileComponentDelete

func (do *DeleteOptions) DevfileComponentDelete() error

DevfileComponentDelete deletes the devfile component

func (*DeleteOptions) Run

func (do *DeleteOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*DeleteOptions) Validate

func (do *DeleteOptions) Validate() (err error)

Validate validates the list parameters

type DescribeOptions

type DescribeOptions struct {
	*ComponentOptions
	// contains filtered or unexported fields
}

DescribeOptions is a dummy container to attach complete, validate and run pattern

func NewDescribeOptions

func NewDescribeOptions() *DescribeOptions

NewDescribeOptions returns new instance of ListOptions

func (*DescribeOptions) Complete

func (do *DescribeOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes describe args

func (*DescribeOptions) Run

func (do *DescribeOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*DescribeOptions) Validate

func (do *DescribeOptions) Validate() (err error)

Validate validates the describe parameters

type DevfileMetadata

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

DevfileMetadata includes devfile component metadata

type ExecOptions

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

ExecOptions contains exec options

func NewExecOptions

func NewExecOptions() *ExecOptions

NewExecOptions returns new instance of ExecOptions

func (*ExecOptions) Complete

func (eo *ExecOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes exec args

func (*ExecOptions) DevfileComponentExec

func (eo *ExecOptions) DevfileComponentExec(command []string) error

DevfileComponentExec executes the given user command inside the component

func (*ExecOptions) Run

func (eo *ExecOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*ExecOptions) Validate

func (eo *ExecOptions) Validate() (err error)

Validate validates the exec parameters

type GetOptions

type GetOptions struct {
	*genericclioptions.Context
	// contains filtered or unexported fields
}

GetOptions encapsulates component get options

func NewGetOptions

func NewGetOptions() *GetOptions

NewGetOptions returns new instance of GetOptions

func (*GetOptions) Complete

func (gto *GetOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes get args

func (*GetOptions) Run

func (gto *GetOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*GetOptions) Validate

func (gto *GetOptions) Validate() (err error)

Validate validates the get parameters

type LinkOptions

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

LinkOptions encapsulates the options for the odo link command

func NewLinkOptions

func NewLinkOptions() *LinkOptions

NewLinkOptions creates a new LinkOptions instance

func (*LinkOptions) Complete

func (o *LinkOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes LinkOptions after they've been created

func (*LinkOptions) Run

func (o *LinkOptions) Run() (err error)

Run contains the logic for the odo link command

func (*LinkOptions) Validate

func (o *LinkOptions) Validate() (err error)

Validate validates the LinkOptions based on completed values

type ListOptions

type ListOptions struct {
	*genericclioptions.Context
	// contains filtered or unexported fields
}

ListOptions is a dummy container to attach complete, validate and run pattern

func NewListOptions

func NewListOptions() *ListOptions

NewListOptions returns new instance of ListOptions

func (*ListOptions) Complete

func (lo *ListOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes log args

func (*ListOptions) Run

func (lo *ListOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*ListOptions) Validate

func (lo *ListOptions) Validate() (err error)

Validate validates the list parameters

type LogOptions

type LogOptions struct {
	*ComponentOptions
	// contains filtered or unexported fields
}

LogOptions contains log options

func NewLogOptions

func NewLogOptions() *LogOptions

NewLogOptions returns new instance of LogOptions

func (*LogOptions) Complete

func (lo *LogOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes log args

func (LogOptions) DevfileComponentLog

func (lo LogOptions) DevfileComponentLog() error

DevfileComponentLog fetch and display log from devfile components

func (*LogOptions) Run

func (lo *LogOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*LogOptions) Validate

func (lo *LogOptions) Validate() (err error)

Validate validates the log parameters

type PushOptions

type PushOptions struct {
	*CommonPushOptions

	// devfile path
	DevfilePath string
	Devfile     parser.DevfileObj
	// contains filtered or unexported fields
}

PushOptions encapsulates options that push command uses

func NewPushOptions

func NewPushOptions() *PushOptions

NewPushOptions returns new instance of PushOptions with "default" values for certain values, for example, show is "false"

func (*PushOptions) Complete

func (po *PushOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes push args

func (*PushOptions) CompleteDevfilePath

func (po *PushOptions) CompleteDevfilePath()

CompleteDevfilePath completes the devfile path from context

func (*PushOptions) DevfilePush

func (po *PushOptions) DevfilePush() error

DevfilePush has the logic to perform the required actions for a given devfile

func (*PushOptions) Run

func (po *PushOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*PushOptions) Validate

func (po *PushOptions) Validate() (err error)

Validate validates the push parameters

type TestOptions

type TestOptions struct {
	*genericclioptions.Context
	// contains filtered or unexported fields
}

TestOptions encapsulates the options for the odo command

func NewTestOptions

func NewTestOptions() *TestOptions

NewTestOptions creates a new TestOptions instance

func (*TestOptions) Complete

func (to *TestOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes TestOptions after they've been created

func (*TestOptions) Run

func (to *TestOptions) Run() (err error)

Run contains the logic for the odo command

func (*TestOptions) RunTestCommand

func (to *TestOptions) RunTestCommand() error

RunTestCommand runs the specific test command in devfile

func (*TestOptions) Validate

func (to *TestOptions) Validate() (err error)

Validate validates the TestOptions based on completed values

type UnlinkOptions

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

UnlinkOptions encapsulates the options for the odo link command

func NewUnlinkOptions

func NewUnlinkOptions() *UnlinkOptions

NewUnlinkOptions creates a new UnlinkOptions instance

func (*UnlinkOptions) Complete

func (o *UnlinkOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes UnlinkOptions after they've been created

func (*UnlinkOptions) Run

func (o *UnlinkOptions) Run() (err error)

Run contains the logic for the odo link command

func (*UnlinkOptions) Validate

func (o *UnlinkOptions) Validate() (err error)

Validate validates the UnlinkOptions based on completed values

type UpdateOptions

type UpdateOptions struct {
	*CommonPushOptions
	// contains filtered or unexported fields
}

UpdateOptions encapsulates the update command options

func NewUpdateOptions

func NewUpdateOptions() *UpdateOptions

NewUpdateOptions returns new instance of UpdateOptions

func (*UpdateOptions) Complete

func (uo *UpdateOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes update args

func (*UpdateOptions) Run

func (uo *UpdateOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*UpdateOptions) Validate

func (uo *UpdateOptions) Validate() (err error)

Validate validates the update parameters

type WatchOptions

type WatchOptions struct {
	*genericclioptions.Context
	// contains filtered or unexported fields
}

WatchOptions contains attributes of the watch command

func NewWatchOptions

func NewWatchOptions() *WatchOptions

NewWatchOptions returns new instance of WatchOptions

func (*WatchOptions) Complete

func (wo *WatchOptions) Complete(name string, cmd *cobra.Command, args []string) (err error)

Complete completes watch args

func (*WatchOptions) Run

func (wo *WatchOptions) Run() (err error)

Run has the logic to perform the required actions as part of command

func (*WatchOptions) Validate

func (wo *WatchOptions) Validate() (err error)

Validate validates the watch parameters

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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