Documentation ¶
Index ¶
- func MeshKridikHelpFunc(app string) cli.HelpFunc
- func NewCliCommands(ad ArgsData, plChan chan models.MeshCheckResults, completedChan chan bool, ...) []cli.Command
- func NewCommandArgs(ad ArgsData) []string
- func NewCompletionChan() chan bool
- func NewMeshResultChan() chan models.MeshCheckResults
- func StartCLI()
- func StartCLICommand(fm utils.FolderMgr, plChan chan models.MeshCheckResults, ...)
- type ArgsData
- type SanitizeArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MeshKridikHelpFunc ¶
MeshKridikHelpFunc mesh-kridik Help function with all supported commands
func NewCliCommands ¶
func NewCliCommands(ad ArgsData, plChan chan models.MeshCheckResults, completedChan chan bool, fi []utils.FilesInfo) []cli.Command
NewCliCommands return cli mesh obj commands accept cli args data , completion chan , result chan , spec files and return artay of cli commands
func NewCommandArgs ¶
NewCommandArgs return new cli command args accept cli args and return command args
func NewCompletionChan ¶
func NewCompletionChan() chan bool
NewCompletionChan return plugin Completion chan
func NewMeshResultChan ¶
func NewMeshResultChan() chan models.MeshCheckResults
NewMeshResultChan return plugin test result chan
func StartCLICommand ¶
func StartCLICommand(fm utils.FolderMgr, plChan chan models.MeshCheckResults, completedChan chan bool, ad ArgsData, cmdArgs []string, commands map[string]cli.CommandFactory, log *logger.MeshKridikLogger)
StartCLICommand invoke cli mesh command mesh-kridik cli
Types ¶
type SanitizeArgs ¶
SanitizeArgs sanitizer func
var ArgsSanitizer SanitizeArgs = func(str []string) ArgsData { ad := ArgsData{SpecType: "mesh"} args := make([]string, 0) if len(str) == 0 { args = append(args, "") } for _, arg := range str { arg = strings.Replace(arg, "--", "", -1) arg = strings.Replace(arg, "-", "", -1) switch { case arg == "help", arg == "h": ad.Help = true args = append(args, arg) case strings.HasPrefix(arg, "s="): ad.SpecType = arg[len("s="):] case strings.HasPrefix(arg, "spec="): ad.SpecType = arg[len("spec="):] case strings.HasPrefix(arg, "v="): ad.SpecVersion = fmt.Sprintf("v%s", arg[len("v="):]) case strings.HasPrefix(arg, "version="): ad.SpecVersion = fmt.Sprintf("v%s", arg[len("version="):]) default: args = append(args, arg) } } if ad.SpecType == "mesh" && len(ad.SpecVersion) == 0 { ad.SpecVersion = "istio" } ad.Filters = args return ad }
ArgsSanitizer sanitize CLI arguments
Click to show internal directories.
Click to hide internal directories.