Files
dokku/plugins/network/subcommands.go
Jose Diaz-Gonzalez 6a7d2e5252 refactor: decrease compile time for golang plugins
This change refactors the compiled golang plugins into 3 distinct binaries:

- commands: already existing
- subcommands/subcommands: entrypoint into all subcommands
- triggers: entrypoint into all triggers

It then further symlinks triggers and subcommands to the built binaries. This results in both a much faster build process as well as smaller package size.
2019-09-15 19:15:08 -04:00

49 lines
968 B
Go

package network
import (
"strings"
"github.com/dokku/dokku/plugins/common"
)
// rebuilds network settings for all apps
func CommandRebuildall() {
apps, err := common.DokkuApps()
if err != nil {
common.LogFail(err.Error())
}
for _, appName := range apps {
BuildConfig(appName)
}
}
// displays a network report for one or more apps
func CommandReport(appName string, infoFlag string) {
if strings.HasPrefix(appName, "--") {
infoFlag = appName
appName = ""
}
if len(appName) == 0 {
apps, err := common.DokkuApps()
if err != nil {
return
}
for _, appName := range apps {
ReportSingleApp(appName, infoFlag)
}
return
}
ReportSingleApp(appName, infoFlag)
}
// set or clear a network property for an app
func CommandSet(appName string, property string, value string) {
if property == "bind-all-interfaces" && value == "" {
value = "false"
}
common.CommandPropertySet("network", appName, property, value, DefaultProperties)
}