cmd

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 27 Imported by: 1

Documentation

Index

Constants

View Source
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 Execute

func Execute()

Execute will exectue the command

func Format added in v0.0.9

func Format(obj interface{}, format string) (data []byte, err error)

Format format the object into byte array

func GetCategories added in v0.0.22

func GetCategories(jclient *client.JobClient) (
	typeMap map[string]string, types []string, err error)

GetCategories returns the categories of current Jenkins

Types

type BatchOption added in v0.0.18

type BatchOption struct {
	Batch bool
}

BatchOption represent the options for a batch operation

func (*BatchOption) Confirm added in v0.0.18

func (b *BatchOption) Confirm(message string) bool

Confirm prompte user if they really want to do this

func (*BatchOption) SetFlag added in v0.0.18

func (b *BatchOption) SetFlag(cmd *cobra.Command)

SetFlag the flag for batch option

type CenterDownloadOption added in v0.0.20

type CenterDownloadOption struct {
	LTS          bool
	Output       string
	ShowProgress bool

	RoundTripper http.RoundTripper
}

CenterDownloadOption as the options of download command

type CenterOption added in v0.0.18

type CenterOption struct {
	WatchOption

	RoundTripper  http.RoundTripper
	CeneterStatus string
}

CenterOption is the center cmd option

type CenterUpgradeOption added in v0.0.20

type CenterUpgradeOption struct {
	RoundTripper http.RoundTripper
}

CenterUpgradeOption option for upgrade Jenkins

type CenterWatchOption added in v0.0.19

type CenterWatchOption struct {
	WatchOption
	UtilNeedRestart     bool
	UtilInstallComplete bool

	RoundTripper  http.RoundTripper
	CeneterStatus string
}

CenterWatchOption as the options of watch command

type CommndHook added in v0.0.20

type CommndHook struct {
	Path    string `yaml:"path"`
	Command string `yaml:"cmd"`
}

CommndHook is a hook

type Config

type Config struct {
	Current        string          `yaml:"current"`
	Language       string          `yaml:"language"`
	JenkinsServers []JenkinsServer `yaml:"jenkins_servers"`
	PreHooks       []CommndHook    `yaml:"preHooks"`
	PostHooks      []CommndHook    `yaml:"postHooks"`
	PluginSuites   []PluginSuite   `yaml:"pluginSuites"`
}

Config is a global config struct

type ConfigAddOptions added in v0.0.10

type ConfigAddOptions struct {
	JenkinsServer
}

ConfigAddOptions is the config ad option

type ConfigGenerateOption added in v0.0.18

type ConfigGenerateOption struct {
	Copy bool
}

ConfigGenerateOption is the config generate cmd option

type ConfigOptions added in v0.0.9

type ConfigOptions struct {
	ConfigFileLocation string
}

ConfigOptions is the config cmd option

type CrumbIssuer

type CrumbIssuer struct {
	Crumb             string `json:"crumb"`
	CrumbRequestField string `json:"crumbRequestField"`
}

CrumbIssuer represents Jenkins crumb

type CrumbIssuerOptions

type CrumbIssuerOptions struct {
	Upload bool
}

CrumbIssuerOptions contains the command line options

type FormatOutput added in v0.0.18

type FormatOutput interface {
	Output(obj interface{}, format string) (data []byte, err error)
}

FormatOutput is the interface of format output

type HookOption added in v0.0.20

type HookOption struct {
	SkipPreHook  bool
	SkipPostHook bool
}

HookOption is the option whether skip command hook

type InteractiveOption added in v0.0.18

type InteractiveOption struct {
	Interactive bool
}

InteractiveOption allow user to choose whether the mode is interactive

func (*InteractiveOption) SetFlag added in v0.0.18

func (b *InteractiveOption) SetFlag(cmd *cobra.Command)

SetFlag set the option flag to this cmd

type JenkinsServer

type JenkinsServer struct {
	Name        string `yaml:"name"`
	URL         string `yaml:"url"`
	UserName    string `yaml:"username"`
	Token       string `yaml:"token"`
	Proxy       string `yaml:"proxy"`
	ProxyAuth   string `yaml:"proxyAuth"`
	Description string `yaml:"description"`
}

JenkinsServer holds the configuration of your Jenkins

type JobArtifactDownloadOption added in v0.0.21

type JobArtifactDownloadOption struct {
	ID           string
	ShowProgress bool
	DownloadDir  string

	Jenkins      *JenkinsServer
	RoundTripper http.RoundTripper
}

JobArtifactDownloadOption is the options of job artifact download command

type JobArtifactOption added in v0.0.21

type JobArtifactOption struct {
	OutputOption

	RoundTripper http.RoundTripper
}

JobArtifactOption is the options of job artifact command

func (*JobArtifactOption) Output added in v0.0.21

func (o *JobArtifactOption) Output(obj interface{}) (data []byte, err error)

Output render data into byte array

type JobBuildOption added in v0.0.18

type JobBuildOption struct {
	BatchOption

	Param string
	Debug bool

	RoundTripper http.RoundTripper
}

JobBuildOption is the job build option

type JobCreateOption added in v0.0.18

type JobCreateOption struct {
	Copy string
	Type string

	RoundTripper http.RoundTripper
}

JobCreateOption is the job create option

type JobDeleteOption added in v0.0.18

type JobDeleteOption struct {
	BatchOption

	RoundTripper http.RoundTripper
}

JobDeleteOption is the job delete option

type JobHistoryOption added in v0.0.18

type JobHistoryOption struct {
	OutputOption
}

JobHistoryOption is the job history option

func (*JobHistoryOption) Output added in v0.0.18

func (o *JobHistoryOption) Output(obj interface{}) (data []byte, err error)

Output print the output

type JobInputOption added in v0.0.21

type JobInputOption struct {
	BatchOption

	Action string

	RoundTripper http.RoundTripper
	Stdio        terminal.Stdio
}

JobInputOption is the job delete option

type JobLogOption added in v0.0.10

type JobLogOption struct {
	WatchOption
	History int

	LogText      string
	LastBuildID  int
	LastBuildURL string
}

JobLogOption is the job log option

type JobOption added in v0.0.10

type JobOption struct {
	OutputOption
}

JobOption is the job cmd option

type JobParamOption added in v0.0.18

type JobParamOption struct {
	OutputOption

	Indent bool
}

JobParamOption is the job param option

type JobSearchOption added in v0.0.10

type JobSearchOption struct {
	OutputOption
	PrintAll bool
	Max      int

	RoundTripper http.RoundTripper
}

JobSearchOption is the options of job search command

func (*JobSearchOption) Output added in v0.0.20

func (o *JobSearchOption) Output(obj interface{}) (data []byte, err error)

Output render data into byte array

type JobStopOption added in v0.0.18

type JobStopOption struct {
	BatchOption

	RoundTripper http.RoundTripper
}

JobStopOption is the job stop option

type JobTypeOption added in v0.0.18

type JobTypeOption struct {
	OutputOption

	RoundTripper http.RoundTripper
}

JobTypeOption is the job type cmd option

func (*JobTypeOption) Output added in v0.0.18

func (o *JobTypeOption) Output(obj interface{}) (data []byte, err error)

Output renders data into a table

type OpenOption added in v0.0.10

type OpenOption struct {
	InteractiveOption

	Name   string
	Config bool
}

OpenOption is the open cmd option

type OutputOption added in v0.0.9

type OutputOption struct {
	Format string
}

OutputOption represent the format of output

func (*OutputOption) Output added in v0.0.18

func (o *OutputOption) Output(obj interface{}) (data []byte, err error)

Output print the object into byte array

func (*OutputOption) SetFlag added in v0.0.18

func (o *OutputOption) SetFlag(cmd *cobra.Command)

SetFlag set flag of output format

type PluginListOption added in v0.0.18

type PluginListOption struct {
	OutputOption

	Filter []string

	RoundTripper http.RoundTripper
}

PluginListOption option for plugin list command

func (*PluginListOption) Output added in v0.0.18

func (o *PluginListOption) Output(obj interface{}) (data []byte, err error)

Output render data into byte array as a table format

type PluginOptions

type PluginOptions struct {
	Suite string
}

PluginOptions contains the command line options

type PluginSearchOption added in v0.0.18

type PluginSearchOption struct {
	OutputOption

	RoundTripper http.RoundTripper
}

PluginSearchOption is the plugin search option

func (*PluginSearchOption) Output added in v0.0.18

func (o *PluginSearchOption) Output(obj interface{}) (data []byte, err error)

Output output the data into buffer

type PluginSuite added in v0.0.19

type PluginSuite struct {
	Name        string   `yaml:"name"`
	Plugins     []string `yaml:"plugins"`
	Description string   `yaml:"description"`
}

PluginSuite define a suite of plugins

type PluginTreadOption added in v0.0.21

type PluginTreadOption struct {
	RoundTripper http.RoundTripper
}

PluginTreadOption is the option of plugin trend command

type PluginUninstallOption added in v0.0.20

type PluginUninstallOption struct {
	RoundTripper http.RoundTripper
}

PluginUninstallOption the option of uninstall a plugin

type PluginUpgradeOption added in v0.0.20

type PluginUpgradeOption struct {
	Filter []string

	RoundTripper http.RoundTripper
}

PluginUpgradeOption option for plugin list command

type PluginUploadOption added in v0.0.18

type PluginUploadOption struct {
	Remote         string
	RemoteUser     string
	RemotePassword string
	RemoteJenkins  string
	ShowProgress   bool

	RoundTripper http.RoundTripper

	HookOption
	// contains filtered or unexported fields
}

PluginUploadOption will hold the options of plugin cmd

type QueueCancelOption added in v0.0.20

type QueueCancelOption struct {
	RoundTripper http.RoundTripper
}

QueueCancelOption represents the option of queue cancel command

type QueueListOption added in v0.0.20

type QueueListOption struct {
	OutputOption

	RoundTripper http.RoundTripper
}

QueueListOption represents the option of queue list command

type RestartOption added in v0.0.18

type RestartOption struct {
	BatchOption

	RoundTripper http.RoundTripper
}

RestartOption holds the options for restart cmd

type RootOptions added in v0.0.9

type RootOptions struct {
	ConfigFile string
	Jenkins    string
	Version    bool
	Debug      bool
}

RootOptions is a global option for whole cli

type UserCreateOption added in v0.0.18

type UserCreateOption struct {
	RoundTripper http.RoundTripper
}

UserCreateOption is user create cmd option

type UserDeleteOption added in v0.0.18

type UserDeleteOption struct {
	BatchOption

	RoundTripper http.RoundTripper
}

UserDeleteOption is user delete cmd option

type UserEditOption added in v0.0.18

type UserEditOption struct {
	Description bool
}

UserEditOption is the user edit cmd option

type UserOption added in v0.0.18

type UserOption struct {
	OutputOption

	RoundTripper http.RoundTripper
}

UserOption is the user cmd option

type UserTokenOption added in v0.0.18

type UserTokenOption struct {
	Generate bool
	Name     string

	RoundTripper http.RoundTripper
}

UserTokenOption represents a user token cmd option

type WatchOption added in v0.0.18

type WatchOption struct {
	Watch    bool
	Interval int
	Count    int
}

WatchOption for the resources which can be watched

func (*WatchOption) SetFlag added in v0.0.20

func (o *WatchOption) SetFlag(cmd *cobra.Command)

SetFlag for WatchOption

Jump to

Keyboard shortcuts

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