Documentation ¶
Index ¶
- Constants
- Variables
- func AddCluster(clusterName string) error
- func CheckAllConfig()
- func CheckConfig(path string) bool
- func CopyConfig(srcPath, desPath string) error
- func FileCount(fileInfos []os.FileInfo) int
- func GetClient(path string) (*restclient.Config, error)
- func GetClusterNames() map[string]bool
- func GetConfigDir(clusterName string) string
- func GetConfigNameByClusterName(name string) (string, error)
- func GetKubeConfigPath() (string, error)
- func GetSubCmd(subCmdName string) reflect.Type
- func IsCluster(subCmd string) bool
- func IsSubCmd(subCmd string) bool
- func MKDir(path string) error
- func RegisterExternalCmd(elem interface{})
- func RegisterSubCmd(elem interface{})
- func Run(cmd *CmdShim) error
- func RunExternalCmd(cmd *CmdShim) error
- func Trace(c *CmdShim) error
- func WarnConfig(path, clusteName string, fileCount int)
- type CmdShim
- type SubCommand
Constants ¶
View Source
const DEFAULTMETHOD = "Exec"
DEFAULTMETHOD sub achieve Exec func
Variables ¶
View Source
var Exec = func(c *CmdShim) { c.SubCmd = strings.TrimSpace(c.SubCmd) if strings.EqualFold(c.SubCmd, "") { fmt.Fprintln(os.Stderr, "subcmd is not allowed to be empty") return } c.SubCmd = strings.ToLower(c.SubCmd) if err := Trace(c); err != nil { fmt.Fprintln(os.Stderr, err.Error()) os.Exit(1) } }
Exec cmd
Functions ¶
func GetConfigDir ¶
GetConfigDir get cluster config path
func GetConfigNameByClusterName ¶
GetConfigNameByClusterName get cluster config by cluster name
func GetKubeConfigPath ¶
GetKubeConfigPath get kube config path
func RegisterExternalCmd ¶
func RegisterExternalCmd(elem interface{})
RegisterExternalCmd register external cmd
func Trace ¶
Trace sub cmd forward If it is not an internal command or an external command(kubectl).
func WarnConfig ¶
WarnConfig config warnnging
Types ¶
Click to show internal directories.
Click to hide internal directories.