Documentation
¶
Index ¶
- Constants
- func GetJCLIPluginPath(userHome, name string, binary bool) string
- func LoadPlugins(cmd *cobra.Command)
- func SetProxy(proxy, proxyAuth string, tr *http.Transport) (err error)
- type FormatOutput
- type HTTPDownloader
- 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 Plugin
- type PluginError
- type ProgressIndicator
- type RenderCell
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" )
Variables ¶
This section is empty.
Functions ¶
func GetJCLIPluginPath ¶
GetJCLIPluginPath returns the path of a jcli plugin
Types ¶
type FormatOutput ¶
FormatOutput is the interface of format output
type HTTPDownloader ¶
type HTTPDownloader struct {
TargetFilePath string
URL string
ShowProgress bool
InsecureSkipVerify bool
UserName string
Password string
Proxy string
ProxyAuth string
Debug bool
RoundTripper http.RoundTripper
}
HTTPDownloader is the downloader for http request
func (*HTTPDownloader) DownloadFile ¶
func (h *HTTPDownloader) DownloadFile() error
DownloadFile download a file with the progress
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 Plugin ¶
type Plugin struct {
Use string `yaml:"use"`
Short string
Long string
Main string
Version string
DownloadLink string `yaml:"downloadLink"`
Installed bool
}
func FindPlugins ¶
type PluginError ¶
type PluginError struct {
// contains filtered or unexported fields
}
type ProgressIndicator ¶
type ProgressIndicator struct {
Writer io.Writer
Reader io.Reader
Title string
// bytes.Buffer
Total float64
// contains filtered or unexported fields
}
ProgressIndicator hold the progress of io operation
func (*ProgressIndicator) Init ¶
func (i *ProgressIndicator) Init()
Init set the default value for progress indicator
type RenderCell ¶
RenderCell render a specific cell in a table