summaryrefslogtreecommitdiffstats
path: root/app/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go28
1 files changed, 27 insertions, 1 deletions
diff --git a/app/app.go b/app/app.go
index 667c425bd..bf4a6b1b6 100644
--- a/app/app.go
+++ b/app/app.go
@@ -6,19 +6,45 @@ package app
import (
"io/ioutil"
"net/http"
+ "sync"
+ "github.com/mattermost/mattermost-server/einterfaces"
"github.com/mattermost/mattermost-server/plugin/pluginenv"
)
type App struct {
- Srv *Server
+ Srv *Server
+
PluginEnv *pluginenv.Environment
PluginConfigListenerId string
+
+ AccountMigration einterfaces.AccountMigrationInterface
+ Brand einterfaces.BrandInterface
+ Cluster einterfaces.ClusterInterface
+ Compliance einterfaces.ComplianceInterface
+ Elasticsearch einterfaces.ElasticsearchInterface
+ Ldap einterfaces.LdapInterface
+ Metrics einterfaces.MetricsInterface
+ Mfa einterfaces.MfaInterface
+ Saml einterfaces.SamlInterface
}
var globalApp App
+var initEnterprise sync.Once
+
func Global() *App {
+ initEnterprise.Do(func() {
+ globalApp.AccountMigration = einterfaces.GetAccountMigrationInterface()
+ globalApp.Brand = einterfaces.GetBrandInterface()
+ globalApp.Cluster = einterfaces.GetClusterInterface()
+ globalApp.Compliance = einterfaces.GetComplianceInterface()
+ globalApp.Elasticsearch = einterfaces.GetElasticsearchInterface()
+ globalApp.Ldap = einterfaces.GetLdapInterface()
+ globalApp.Metrics = einterfaces.GetMetricsInterface()
+ globalApp.Mfa = einterfaces.GetMfaInterface()
+ globalApp.Saml = einterfaces.GetSamlInterface()
+ })
return &globalApp
}