refactor: rewrite network plugin in golang

This commit is contained in:
Jose Diaz-Gonzalez
2017-04-24 09:03:30 -06:00
committed by Michael Hobbs
parent e74346f0dc
commit c788659b63
69 changed files with 3710 additions and 274 deletions

21
plugins/proxy/proxy.go Normal file
View File

@@ -0,0 +1,21 @@
package proxy
import (
common "github.com/dokku/dokku/plugins/common"
config "github.com/dokku/dokku/plugins/config"
)
// IsAppProxyEnabled returns true if proxy is enabled; otherwise return false
func IsAppProxyEnabled(appName string) bool {
err := common.VerifyAppName(appName)
if err != nil {
common.LogFail(err.Error())
}
proxyEnabled := true
disableProxy := config.GetWithDefault(appName, "DOKKU_DISABLE_PROXY", "")
if disableProxy != "" {
proxyEnabled = false
}
return proxyEnabled
}