Full Mattermost server source with integrated Community Enterprise features. Includes vendor directory for offline/air-gapped builds. Structure: - enterprise-impl/: Enterprise feature implementations - enterprise-community/: Init files that register implementations - enterprise/: Bridge imports (community_imports.go) - vendor/: All dependencies for offline builds Build (online): go build ./cmd/mattermost Build (offline/air-gapped): go build -mod=vendor ./cmd/mattermost 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
37 lines
1.6 KiB
Go
37 lines
1.6 KiB
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.enterprise for license information.
|
|
|
|
package elasticsearch
|
|
|
|
import (
|
|
"github.com/mattermost/mattermost/server/v8/enterprise/elasticsearch/elasticsearch"
|
|
"github.com/mattermost/mattermost/server/v8/enterprise/elasticsearch/opensearch"
|
|
|
|
"github.com/mattermost/mattermost/server/public/model"
|
|
"github.com/mattermost/mattermost/server/v8/channels/app"
|
|
"github.com/mattermost/mattermost/server/v8/channels/app/platform"
|
|
ejobs "github.com/mattermost/mattermost/server/v8/einterfaces/jobs"
|
|
"github.com/mattermost/mattermost/server/v8/platform/services/searchengine"
|
|
)
|
|
|
|
func init() {
|
|
platform.RegisterElasticsearchInterface(func(s *platform.PlatformService) searchengine.SearchEngineInterface {
|
|
if *s.Config().ElasticsearchSettings.Backend == model.ElasticsearchSettingsESBackend {
|
|
return &elasticsearch.ElasticsearchInterfaceImpl{Platform: s}
|
|
}
|
|
return &opensearch.OpensearchInterfaceImpl{Platform: s}
|
|
})
|
|
app.RegisterJobsElasticsearchIndexerInterface(func(s *app.Server) ejobs.IndexerJobInterface {
|
|
if *s.Config().ElasticsearchSettings.Backend == model.ElasticsearchSettingsESBackend {
|
|
return &elasticsearch.ElasticsearchIndexerInterfaceImpl{Server: s}
|
|
}
|
|
return &opensearch.OpensearchIndexerInterfaceImpl{Server: s}
|
|
})
|
|
app.RegisterJobsElasticsearchAggregatorInterface(func(s *app.Server) ejobs.ElasticsearchAggregatorInterface {
|
|
if *s.Config().ElasticsearchSettings.Backend == model.ElasticsearchSettingsESBackend {
|
|
return &elasticsearch.ElasticsearchAggregatorInterfaceImpl{Server: s}
|
|
}
|
|
return &opensearch.OpensearchAggregatorInterfaceImpl{Server: s}
|
|
})
|
|
}
|