package main import ( "fmt" "github.com/fatih/color" "github.com/urfave/cli/v2" ) // ActionApi API应用列表 func ActionApi(c *cli.Context) error { if err := Init(c); err != nil { return err } apiList := c.Args().Slice() color.Green("API应用列表:") for _, api := range config.Api.HasApp(apiList) { color.Green("\t%s", api.Name) color.Green("\t\t路径:\t%s", api.Root) color.Green("\t\t类型:\t%s", api.Type) color.Green("\t\t端口:\t%s", api.Port) c := color.New(color.Bold) c.EnableColor() _, err := c.Println(healthApi(api)) if err != nil { return err } fmt.Print("\n") } return nil } // ActionNewApi 创建API应用 func ActionNewApi(c *cli.Context) error { return nil }