mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This change makes interacting with port mappings more clear - folks might previously set the port mapping to the proxy type or vice-versa. The existing proxy:ports* commands still exist but will show a deprecation warning for a single minor release.
41 lines
995 B
Go
41 lines
995 B
Go
package proxy
|
|
|
|
import (
|
|
"github.com/dokku/dokku/plugins/common"
|
|
)
|
|
|
|
// ReportSingleApp is an internal function that displays the proxy report for one or more apps
|
|
func ReportSingleApp(appName string, format string, infoFlag string) error {
|
|
if err := common.VerifyAppName(appName); err != nil {
|
|
return err
|
|
}
|
|
|
|
flags := map[string]common.ReportFunc{
|
|
"--proxy-enabled": reportEnabled,
|
|
"--proxy-type": reportType,
|
|
}
|
|
|
|
flagKeys := []string{}
|
|
for flagKey := range flags {
|
|
flagKeys = append(flagKeys, flagKey)
|
|
}
|
|
|
|
trimPrefix := false
|
|
uppercaseFirstCharacter := true
|
|
infoFlags := common.CollectReport(appName, infoFlag, flags)
|
|
return common.ReportSingleApp("proxy", appName, infoFlag, infoFlags, flagKeys, format, trimPrefix, uppercaseFirstCharacter)
|
|
}
|
|
|
|
func reportEnabled(appName string) string {
|
|
proxyEnabled := "false"
|
|
if IsAppProxyEnabled(appName) {
|
|
proxyEnabled = "true"
|
|
}
|
|
|
|
return proxyEnabled
|
|
}
|
|
|
|
func reportType(appName string) string {
|
|
return getAppProxyType(appName)
|
|
}
|