Documentation
¶
Index ¶
- Constants
- func GetAliasesDel() []string
- func GetEditorHelpText() string
- func GetSystemStdio() terminal.Stdio
- type BatchOption
- type CommonOption
- type EditContent
- type FormatOutput
- type HookOption
- type InteractiveOption
- type JenkinsClient
- type JenkinsConfigMgr
- type MsgConfirm
- type OutputOption
- func (o *OutputOption) GetLine(obj reflect.Value) []string
- func (o *OutputOption) ListFilter(obj interface{}) interface{}
- func (o *OutputOption) Match(item reflect.Value) bool
- func (o *OutputOption) Output(obj interface{}) (data []byte, err error)
- func (o *OutputOption) OutputV2(obj interface{}) (err error)
- func (o *OutputOption) SetFlag(cmd *cobra.Command)
- func (o *OutputOption) SetFlagWithHeaders(cmd *cobra.Command, headers string)
- type RenderCell
- type Selector
- type WatchOption
Constants ¶
const ( // JSONOutputFormat is the format of json JSONOutputFormat string = "json" // YAMLOutputFormat is the format of yaml YAMLOutputFormat string = "yaml" // TableOutputFormat is the format of table TableOutputFormat string = "table" )
const ( // VersionSince0028 represents v0.0.28 VersionSince0028 = "v0.0.28" // VersionSince0024 represents v0.0.24 VersionSince0024 = "v0.0.24" )
const (
Since = "since"
)
Variables ¶
This section is empty.
Functions ¶
func GetAliasesDel ¶
func GetAliasesDel() []string
GetAliasesDel returns the aliases for delete command
func GetEditorHelpText ¶
func GetEditorHelpText() string
GetEditorHelpText returns the help text related a text editor
func GetSystemStdio ¶
GetSystemStdio returns the stdio from system
Types ¶
type BatchOption ¶
BatchOption represent the options for a batch operation
func (*BatchOption) Confirm ¶
func (b *BatchOption) Confirm(message string) bool
Confirm promote user if they really want to do this
func (*BatchOption) SetFlag ¶
func (b *BatchOption) SetFlag(cmd *cobra.Command)
SetFlag the flag for batch option
type CommonOption ¶
type CommonOption struct { ExecContext util.ExecContext SystemCallExec util.SystemCallExec LookPathContext util.LookPathContext RoundTripper http.RoundTripper Logger *zap.Logger GitHubClient *github.Client Stdio terminal.Stdio // EditFileName allow editor has a better performance base on this EditFileName string }
CommonOption contains the common options
type EditContent ¶
EditContent is the interface for editing content from a file
type FormatOutput ¶
FormatOutput is the interface of format output
type HookOption ¶
HookOption is the option whether skip command hook
type InteractiveOption ¶
type InteractiveOption struct {
Interactive bool
}
InteractiveOption allow user to choose whether the mode is interactive
func (*InteractiveOption) SetFlag ¶
func (b *InteractiveOption) SetFlag(cmd *cobra.Command)
SetFlag set the option flag to this cmd
type JenkinsClient ¶ added in v0.0.30
type JenkinsClient interface { GetCurrentJenkinsFromOptions() (jenkinsServer *config.JenkinsServer) GetCurrentJenkinsAndClient(jClient *client.JenkinsCore) *config.JenkinsServer }
JenkinsClient is the interface of get Jenkins client
type JenkinsConfigMgr ¶ added in v0.0.30
type JenkinsConfigMgr interface { GetMirror(string) string GetGitHubClient() *github.Client SetGitHubClient(gitHubClient *github.Client) }
JenkinsConfigMgr is the interface of getting configuration
type MsgConfirm ¶
MsgConfirm is the interface for confirming a message
type OutputOption ¶
type OutputOption struct { Format string Columns string WithoutHeaders bool Filter []string Writer io.Writer CellRenderMap map[string]RenderCell }
OutputOption represent the format of output
func (*OutputOption) GetLine ¶
func (o *OutputOption) GetLine(obj reflect.Value) []string
GetLine returns the line of a table
func (*OutputOption) ListFilter ¶
func (o *OutputOption) ListFilter(obj interface{}) interface{}
ListFilter filter the data list by fields
func (*OutputOption) Match ¶
func (o *OutputOption) Match(item reflect.Value) bool
Match filter an item
func (*OutputOption) Output ¶
func (o *OutputOption) Output(obj interface{}) (data []byte, err error)
Output print the object into byte array Deprecated see also OutputV2
func (*OutputOption) OutputV2 ¶
func (o *OutputOption) OutputV2(obj interface{}) (err error)
OutputV2 print the data line by line
func (*OutputOption) SetFlag ¶
func (o *OutputOption) SetFlag(cmd *cobra.Command)
SetFlag set flag of output format Deprecated, see also SetFlagWithHeaders
func (*OutputOption) SetFlagWithHeaders ¶
func (o *OutputOption) SetFlagWithHeaders(cmd *cobra.Command, headers string)
SetFlagWithHeaders set the flags of output
type RenderCell ¶
RenderCell render a specific cell in a table
type Selector ¶
type Selector interface {
Select(options []string, message, defaultOpt string) (target string, err error)
}
Selector is the interface for selecting an option
type WatchOption ¶
WatchOption for the resources which can be watched
func (*WatchOption) SetFlag ¶
func (o *WatchOption) SetFlag(cmd *cobra.Command)
SetFlag for WatchOption