@@ -32,6 +32,11 @@ func BuildConfig(appName string) error {
|
||||
return common.PlugnTrigger("proxy-build-config", []string{appName}...)
|
||||
}
|
||||
|
||||
// ClearConfig clears the proxy config for the specified app
|
||||
func ClearConfig(appName string) error {
|
||||
return common.PlugnTrigger("proxy-clear-config", []string{appName}...)
|
||||
}
|
||||
|
||||
// Disable disables proxy implementations for the specified app
|
||||
func Disable(appName string) error {
|
||||
if !IsAppProxyEnabled(appName) {
|
||||
|
||||
@@ -25,6 +25,12 @@ func main() {
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
err = proxy.CommandBuildConfig(appName, *allApps, *parallelCount)
|
||||
case "clear-config":
|
||||
args := flag.NewFlagSet("proxy:clear-config", flag.ExitOnError)
|
||||
allApps := args.Bool("all", false, "--all: build-config for all apps")
|
||||
args.Parse(os.Args[2:])
|
||||
appName := args.Arg(0)
|
||||
err = proxy.CommandClearConfig(appName, *allApps)
|
||||
case "disable":
|
||||
args := flag.NewFlagSet("proxy:disable", flag.ExitOnError)
|
||||
allApps := args.Bool("all", false, "--all: disable proxy for all apps")
|
||||
|
||||
@@ -21,6 +21,19 @@ func CommandBuildConfig(appName string, allApps bool, parallelCount int) error {
|
||||
return BuildConfig(appName)
|
||||
}
|
||||
|
||||
// CommandClearConfig clears config for a given app
|
||||
func CommandClearConfig(appName string, allApps bool) error {
|
||||
if allApps {
|
||||
return ClearConfig("--all")
|
||||
}
|
||||
|
||||
if err := common.VerifyAppName(appName); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return ClearConfig(appName)
|
||||
}
|
||||
|
||||
// CommandDisable disables the proxy for app via command line
|
||||
func CommandDisable(appName string, allApps bool, parallelCount int) error {
|
||||
if allApps {
|
||||
|
||||
Reference in New Issue
Block a user