diff options
Diffstat (limited to 'einterfaces')
-rw-r--r-- | einterfaces/elasticsearch.go | 18 | ||||
-rw-r--r-- | einterfaces/jobs/data_retention.go | 4 | ||||
-rw-r--r-- | einterfaces/jobs/elasticsearch.go | 22 |
3 files changed, 33 insertions, 11 deletions
diff --git a/einterfaces/elasticsearch.go b/einterfaces/elasticsearch.go index af89b38a5..f5babffe0 100644 --- a/einterfaces/elasticsearch.go +++ b/einterfaces/elasticsearch.go @@ -5,20 +5,20 @@ package einterfaces import "github.com/mattermost/platform/model" -type ElasticSearchInterface interface { +type ElasticsearchInterface interface { Start() *model.AppError - IndexPost(post *model.Post, teamId string) + IndexPost(post *model.Post, teamId string) *model.AppError SearchPosts(channels *model.ChannelList, searchParams []*model.SearchParams) ([]string, *model.AppError) - DeletePost(postId string) - TestConfig() *model.AppError + DeletePost(postId string) *model.AppError + TestConfig(cfg *model.Config) *model.AppError } -var theElasticSearchInterface ElasticSearchInterface +var theElasticsearchInterface ElasticsearchInterface -func RegisterElasticSearchInterface(newInterface ElasticSearchInterface) { - theElasticSearchInterface = newInterface +func RegisterElasticsearchInterface(newInterface ElasticsearchInterface) { + theElasticsearchInterface = newInterface } -func GetElasticSearchInterface() ElasticSearchInterface { - return theElasticSearchInterface +func GetElasticsearchInterface() ElasticsearchInterface { + return theElasticsearchInterface } diff --git a/einterfaces/jobs/data_retention.go b/einterfaces/jobs/data_retention.go index 340ed1b88..442f667fa 100644 --- a/einterfaces/jobs/data_retention.go +++ b/einterfaces/jobs/data_retention.go @@ -5,11 +5,11 @@ package jobs import ( "github.com/mattermost/platform/model" - "github.com/mattermost/platform/store" ) type DataRetentionInterface interface { - MakeJob(store store.Store) model.Job + MakeWorker() model.Worker + MakeScheduler() model.Scheduler } var theDataRetentionInterface DataRetentionInterface diff --git a/einterfaces/jobs/elasticsearch.go b/einterfaces/jobs/elasticsearch.go new file mode 100644 index 000000000..6d6dbe893 --- /dev/null +++ b/einterfaces/jobs/elasticsearch.go @@ -0,0 +1,22 @@ +// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package jobs + +import ( + "github.com/mattermost/platform/model" +) + +type ElasticsearchIndexerInterface interface { + MakeWorker() model.Worker +} + +var theElasticsearchIndexerInterface ElasticsearchIndexerInterface + +func RegisterElasticsearchIndexerInterface(newInterface ElasticsearchIndexerInterface) { + theElasticsearchIndexerInterface = newInterface +} + +func GetElasticsearchIndexerInterface() ElasticsearchIndexerInterface { + return theElasticsearchIndexerInterface +} |