Documentation ¶
Index ¶
- Variables
- func Execute()
- func PrepareCtx(cmd *cobra.Command, args []string) error
- func SetProjectConfig(file string, conf *ProjectInfo) error
- type ApplicationInfo
- type Arg
- type BaseResponse
- type BoolFlag
- type Command
- type CommonArg
- type Context
- func (ctx *Context) Delete() *httpclient.Request
- func (ctx *Context) Error(format string, a ...interface{})
- func (ctx *Context) Fail(format string, a ...interface{})
- func (ctx *Context) FetchOpenapi() error
- func (ctx *Context) FetchOrgs() error
- func (ctx *Context) Get() *httpclient.Request
- func (ctx *Context) GetUserID() string
- func (ctx *Context) Info(format string, a ...interface{})
- func (ctx *Context) Patch() *httpclient.Request
- func (ctx *Context) Post() *httpclient.Request
- func (ctx *Context) Put() *httpclient.Request
- func (ctx *Context) Succ(format string, a ...interface{})
- func (ctx *Context) UseDomain() *Context
- func (ctx *Context) UseHepaApi() *Context
- func (ctx *Context) UseOpenapi() *Context
- func (ctx *Context) Warn(format string, a ...interface{})
- type Flag
- type FloatArg
- type FloatFlag
- type IPArg
- type IPFlag
- type IntArg
- type IntFlag
- type Level2
- type Level2Arg
- type Level3
- type Level3Arg
- type Level4
- type Level4Arg
- type Level5
- type Level5Arg
- type Level6
- type Level6Arg
- type MetadataResponse
- type MetadataResponseVersion
- type OrgInfo
- type OrgsResponseData
- type ProjectInfo
- type StringArg
- type StringFlag
- type StringListFlag
- type Uint64Flag
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Remote string // git remote name for erda repo Interactive bool IsCompletion bool )
View Source
var ConfigVersion string = "v0.0.1"
View Source
var RootCmd = &cobra.Command{ Use: "erda-cli", Short: "Erda commandline client", Long: ` _/_/_/_/ _/_/_/ _/_/_/ _/_/ _/ _/ _/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/_/_/ _/ _/ `, SilenceUsage: true, PersistentPreRunE: PrepareCtx, }
rootCmd represents the base command when called without any subcommands
Functions ¶
func Execute ¶
func Execute()
Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.
func SetProjectConfig ¶
func SetProjectConfig(file string, conf *ProjectInfo) error
Types ¶
type ApplicationInfo ¶
type BaseResponse ¶
type BaseResponse struct { Success bool `json:"success"` Data json.RawMessage `json:"data"` Err interface{} `json:"err"` }
type Command ¶
type Command struct { // default: rootcmd ParentName string Name string ShortHelp string LongHelp string Example string // dont show up in list of cmds Hidden bool DontHideCursor bool /* args: []Arg { IPArg{}, StringArg{}, BoolArg{}, } */ Args []Arg /* flags: []Flag{ StringFlag{"H", "host", "1.2.3.4", "doc"}, BoolFlag{"A", "another", true, "doc"}, IntFlag{"O", "ohyoyo", 1, "doc"}, } */ MarkFlagRequired []string RegisterFlagCompletionFunc map[string]interface{} ValidArgsFunction interface{} Flags []Flag /* actually type: func(ctx Context, arg1 IPArg, arg2 string, arg3 bool, host string, anotherone bool, ohyoyo int) error `host`, `anotherone`, `ohyoyo` is generated by `Flags` */ Run interface{} }
type Context ¶
type Context struct { Sessions map[string]status.StatusInfo CurrentHost string Domain *url.URL Openapi *url.URL Hepaapi *url.URL CurrentOrg OrgInfo CurrentProject ProjectInfo CurrentApplication ApplicationInfo Applications []ApplicationInfo Debug bool Token string // uc token HttpClient *httpclient.HTTPClient }
func GetContext ¶
func GetContext() *Context
func (*Context) Delete ¶
func (ctx *Context) Delete() *httpclient.Request
func (*Context) FetchOpenapi ¶
func (*Context) Get ¶
func (ctx *Context) Get() *httpclient.Request
func (*Context) Patch ¶
func (ctx *Context) Patch() *httpclient.Request
func (*Context) Post ¶
func (ctx *Context) Post() *httpclient.Request
func (*Context) Put ¶
func (ctx *Context) Put() *httpclient.Request
func (*Context) UseHepaApi ¶
func (*Context) UseOpenapi ¶
type Level2 ¶
type Level2 struct {
V [2]string
}
func (Level2) DicePathAble ¶
func (Level2) DicePathAble()
type Level3 ¶
type Level3 struct {
V [3]string
}
func (Level3) DicePathAble ¶
func (Level3) DicePathAble()
type Level4 ¶
type Level4 struct {
V [4]string
}
func (Level4) DicePathAble ¶
func (Level4) DicePathAble()
type Level5 ¶
type Level5 struct {
V [5]string
}
func (Level5) DicePathAble ¶
func (Level5) DicePathAble()
type MetadataResponse ¶
type MetadataResponse struct { OpenapiPublicUrl string `json:"openapi_public_url,omitempty"` Version MetadataResponseVersion `json:"version,omitempty"` }
type MetadataResponseVersion ¶
type OrgsResponseData ¶
type ProjectInfo ¶
type ProjectInfo struct { Version string `yaml:"version"` Server string `yaml:"server"` Org string `yaml:"org"` OrgID uint64 `yaml:"org_id"` Project string `yaml:"project"` ProjectID uint64 `yaml:"project_id"` Applications []ApplicationInfo `yaml:"applications"` }
func GetProjectConfig ¶
func GetProjectConfig() (string, *ProjectInfo, error)
func GetProjectConfigFrom ¶
func GetProjectConfigFrom(configfile string) (*ProjectInfo, error)
type StringFlag ¶
func (StringFlag) DefaultV ¶
func (v StringFlag) DefaultV() string
func (StringFlag) Flag ¶
func (StringFlag) Flag()
type StringListFlag ¶
func (StringListFlag) Flag ¶
func (StringListFlag) Flag()
type Uint64Flag ¶
func (Uint64Flag) DefaultV ¶
func (v Uint64Flag) DefaultV() string
func (Uint64Flag) Flag ¶
func (Uint64Flag) Flag()
Click to show internal directories.
Click to hide internal directories.