From ac74066f0e4f3d62f2d4645c3fa34b88c13958d1 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 19 Sep 2017 18:31:35 -0500 Subject: remove einterface gets (#7455) --- app/app.go | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'app/app.go') 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 } -- cgit v1.2.3-1-g7c22