MM-27147 - /cloud api endpoints (#15428)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f74b86ae95
Коммит
88aed7ec9e
@@ -630,6 +630,9 @@ func (a *App) Notification() einterfaces.NotificationInterface {
|
||||
func (a *App) Saml() einterfaces.SamlInterface {
|
||||
return a.srv.Saml
|
||||
}
|
||||
func (a *App) Cloud() einterfaces.CloudInterface {
|
||||
return a.srv.Cloud
|
||||
}
|
||||
func (a *App) HTTPService() httpservice.HTTPService {
|
||||
return a.srv.HTTPService
|
||||
}
|
||||
|
||||
@@ -397,6 +397,7 @@ type AppIface interface {
|
||||
ClearTeamMembersCache(teamID string)
|
||||
ClientConfig() map[string]string
|
||||
ClientConfigHash() string
|
||||
Cloud() einterfaces.CloudInterface
|
||||
Cluster() einterfaces.ClusterInterface
|
||||
CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError)
|
||||
CompareAndSetPluginKey(pluginId string, key string, oldValue, newValue []byte) (bool, *model.AppError)
|
||||
|
||||
@@ -120,6 +120,12 @@ func RegisterMessageExportInterface(f func(*Server) einterfaces.MessageExportInt
|
||||
messageExportInterface = f
|
||||
}
|
||||
|
||||
var cloudInterface func(*App) einterfaces.CloudInterface
|
||||
|
||||
func RegisterCloudInterface(f func(*App) einterfaces.CloudInterface) {
|
||||
cloudInterface = f
|
||||
}
|
||||
|
||||
var metricsInterface func(*Server) einterfaces.MetricsInterface
|
||||
|
||||
func RegisterMetricsInterface(f func(*Server) einterfaces.MetricsInterface) {
|
||||
@@ -195,4 +201,7 @@ func (a *App) initEnterprise() {
|
||||
}
|
||||
})
|
||||
}
|
||||
if cloudInterface != nil {
|
||||
a.srv.Cloud = cloudInterface(a)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1322,6 +1322,23 @@ func (a *OpenTracingAppLayer) ClientConfigWithComputed() map[string]string {
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) Cloud() einterfaces.CloudInterface {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Cloud")
|
||||
|
||||
a.ctx = newCtx
|
||||
a.app.Srv().Store.SetContext(newCtx)
|
||||
defer func() {
|
||||
a.app.Srv().Store.SetContext(origCtx)
|
||||
a.ctx = origCtx
|
||||
}()
|
||||
|
||||
defer span.Finish()
|
||||
resultVar0 := a.app.Cloud()
|
||||
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (a *OpenTracingAppLayer) CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError) {
|
||||
origCtx := a.ctx
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndDeletePluginKey")
|
||||
|
||||
@@ -163,6 +163,7 @@ type Server struct {
|
||||
DataRetention einterfaces.DataRetentionInterface
|
||||
Ldap einterfaces.LdapInterface
|
||||
MessageExport einterfaces.MessageExportInterface
|
||||
Cloud einterfaces.CloudInterface
|
||||
Metrics einterfaces.MetricsInterface
|
||||
Notification einterfaces.NotificationInterface
|
||||
Saml einterfaces.SamlInterface
|
||||
|
||||
Ссылка в новой задаче
Block a user