From eb1a00ef5f93b19c2d49b26de057ee2c51c09e45 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 16 Nov 2017 15:04:27 -0600 Subject: Reorganize file util functionality (#7848) * reorganize file util functionality * fix api test compilation * fix rebase issue --- app/app.go | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 4be897f59..49ac620e8 100644 --- a/app/app.go +++ b/app/app.go @@ -43,6 +43,7 @@ type App struct { Compliance einterfaces.ComplianceInterface DataRetention einterfaces.DataRetentionInterface Elasticsearch einterfaces.ElasticsearchInterface + Emoji einterfaces.EmojiInterface Ldap einterfaces.LdapInterface Metrics einterfaces.MetricsInterface Mfa einterfaces.MfaInterface @@ -133,6 +134,12 @@ func RegisterAccountMigrationInterface(f func(*App) einterfaces.AccountMigration accountMigrationInterface = f } +var brandInterface func(*App) einterfaces.BrandInterface + +func RegisterBrandInterface(f func(*App) einterfaces.BrandInterface) { + brandInterface = f +} + var clusterInterface func(*App) einterfaces.ClusterInterface func RegisterClusterInterface(f func(*App) einterfaces.ClusterInterface) { @@ -151,6 +158,18 @@ func RegisterDataRetentionInterface(f func(*App) einterfaces.DataRetentionInterf dataRetentionInterface = f } +var elasticsearchInterface func(*App) einterfaces.ElasticsearchInterface + +func RegisterElasticsearchInterface(f func(*App) einterfaces.ElasticsearchInterface) { + elasticsearchInterface = f +} + +var emojiInterface func(*App) einterfaces.EmojiInterface + +func RegisterEmojiInterface(f func(*App) einterfaces.EmojiInterface) { + emojiInterface = f +} + var jobsDataRetentionJobInterface func(*App) ejobs.DataRetentionJobInterface func RegisterJobsDataRetentionJobInterface(f func(*App) ejobs.DataRetentionJobInterface) { @@ -203,14 +222,21 @@ func (a *App) initEnterprise() { if accountMigrationInterface != nil { a.AccountMigration = accountMigrationInterface(a) } - a.Brand = einterfaces.GetBrandInterface() + if brandInterface != nil { + a.Brand = brandInterface(a) + } if clusterInterface != nil { a.Cluster = clusterInterface(a) } if complianceInterface != nil { a.Compliance = complianceInterface(a) } - a.Elasticsearch = einterfaces.GetElasticsearchInterface() + if elasticsearchInterface != nil { + a.Elasticsearch = elasticsearchInterface(a) + } + if emojiInterface != nil { + a.Emoji = emojiInterface(a) + } if ldapInterface != nil { a.Ldap = ldapInterface(a) utils.AddConfigListener(func(_, cfg *model.Config) { -- cgit v1.2.3-1-g7c22