WebhookStore migration (#15042)
* Migration completed * Fix tests Co-authored-by: Jesús Espino <jespinog@gmail.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ed3c93716d
Коммит
1c5b6522e3
@@ -36,7 +36,7 @@ func (s LocalCacheWebhookStore) InvalidateWebhookCache(webhookId string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
if !allowFromCache {
|
||||
return s.WebhookStore.GetIncoming(id, allowFromCache)
|
||||
}
|
||||
@@ -56,7 +56,7 @@ func (s LocalCacheWebhookStore) GetIncoming(id string, allowFromCache bool) (*mo
|
||||
return incomingWebhook, nil
|
||||
}
|
||||
|
||||
func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
||||
func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||
err := s.WebhookStore.DeleteIncoming(webhookId, time)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -66,7 +66,7 @@ func (s LocalCacheWebhookStore) DeleteIncoming(webhookId string, time int64) *mo
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||
err := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -76,7 +76,7 @@ func (s LocalCacheWebhookStore) PermanentDeleteIncomingByUser(userId string) *mo
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
||||
func (s LocalCacheWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||
err := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -8928,7 +8928,7 @@ func (s *OpenTracingLayerUserTermsOfServiceStore) Save(userTermsOfService *model
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsIncomingCount")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8946,7 +8946,7 @@ func (s *OpenTracingLayerWebhookStore) AnalyticsIncomingCount(teamId string) (in
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.AnalyticsOutgoingCount")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8977,7 +8977,7 @@ func (s *OpenTracingLayerWebhookStore) ClearCaches() {
|
||||
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteIncoming")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8995,7 +8995,7 @@ func (s *OpenTracingLayerWebhookStore) DeleteIncoming(webhookId string, time int
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.DeleteOutgoing")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9013,7 +9013,7 @@ func (s *OpenTracingLayerWebhookStore) DeleteOutgoing(webhookId string, time int
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncoming")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9031,7 +9031,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncoming(id string, allowFromCache boo
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9049,7 +9049,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByChannel(channelId string) ([
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeam")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9067,7 +9067,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByTeam(teamId string, offset i
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingByTeamByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9085,7 +9085,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingByTeamByUser(teamId string, us
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingList")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9103,7 +9103,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingList(offset int, limit int) ([
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetIncomingListByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9121,7 +9121,7 @@ func (s *OpenTracingLayerWebhookStore) GetIncomingListByUser(userId string, offs
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoing")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9139,7 +9139,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWe
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9157,7 +9157,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannel(channelId string, of
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByChannelByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9175,7 +9175,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByChannelByUser(channelId stri
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeam")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9193,7 +9193,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeam(teamId string, offset i
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingByTeamByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9211,7 +9211,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, us
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingList")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9229,7 +9229,7 @@ func (s *OpenTracingLayerWebhookStore) GetOutgoingList(offset int, limit int) ([
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.GetOutgoingListByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9260,7 +9260,7 @@ func (s *OpenTracingLayerWebhookStore) InvalidateWebhookCache(webhook string) {
|
||||
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9278,7 +9278,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByChannel(channelI
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteIncomingByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9296,7 +9296,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteIncomingByUser(userId stri
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByChannel")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9314,7 +9314,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelI
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
||||
func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.PermanentDeleteOutgoingByUser")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9332,7 +9332,7 @@ func (s *OpenTracingLayerWebhookStore) PermanentDeleteOutgoingByUser(userId stri
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveIncoming")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9350,7 +9350,7 @@ func (s *OpenTracingLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebho
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.SaveOutgoing")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9368,7 +9368,7 @@ func (s *OpenTracingLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebho
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateIncoming")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9386,7 +9386,7 @@ func (s *OpenTracingLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWeb
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *OpenTracingLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "WebhookStore.UpdateOutgoing")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
|
||||
@@ -5,7 +5,8 @@ package sqlstore
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
"net/http"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
|
||||
sq "github.com/Masterminds/squirrel"
|
||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||
@@ -72,10 +73,10 @@ func (s SqlWebhookStore) createIndexesIfNotExists() {
|
||||
func (s SqlWebhookStore) InvalidateWebhookCache(webhookId string) {
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
|
||||
if len(webhook.Id) > 0 {
|
||||
return nil, model.NewAppError("SqlWebhookStore.SaveIncoming", "store.sql_webhooks.save_incoming.existing.app_error", nil, "id="+webhook.Id, http.StatusBadRequest)
|
||||
return nil, store.NewErrInvalidInput("IncomingWebhook", "id", webhook.Id)
|
||||
}
|
||||
|
||||
webhook.PreSave()
|
||||
@@ -84,66 +85,66 @@ func (s SqlWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.In
|
||||
}
|
||||
|
||||
if err := s.GetMaster().Insert(webhook); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.SaveIncoming", "store.sql_webhooks.save_incoming.app_error", nil, "id="+webhook.Id+", "+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to save IncomingWebhook with id=%s", webhook.Id)
|
||||
}
|
||||
|
||||
return webhook, nil
|
||||
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) UpdateIncoming(hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) UpdateIncoming(hook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
hook.UpdateAt = model.GetMillis()
|
||||
|
||||
if _, err := s.GetMaster().Update(hook); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.UpdateIncoming", "store.sql_webhooks.update_incoming.app_error", nil, "id="+hook.Id+", "+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to update IncomingWebhook with id=%s", hook.Id)
|
||||
}
|
||||
return hook, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
var webhook model.IncomingWebhook
|
||||
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM IncomingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncoming", "store.sql_webhooks.get_incoming.app_error", nil, "id="+id+", err="+err.Error(), http.StatusNotFound)
|
||||
return nil, store.NewErrNotFound("IncomingWebhook", id)
|
||||
}
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncoming", "store.sql_webhooks.get_incoming.app_error", nil, "id="+id+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to get IncomingWebhook with id=%s", id)
|
||||
}
|
||||
|
||||
return &webhook, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
||||
func (s SqlWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||
_, err := s.GetMaster().Exec("Update IncomingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteIncoming", "store.sql_webhooks.delete_incoming.app_error", nil, "id="+webhookId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to update IncomingWebhook with id=%s", webhookId)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
||||
func (s SqlWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE UserId = :UserId", map[string]interface{}{"UserId": userId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteIncomingByUser", "store.sql_webhooks.permanent_delete_incoming_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to delete IncomingWebhook with userId=%s", userId)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
||||
func (s SqlWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM IncomingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteIncomingByChannel", "store.sql_webhooks.permanent_delete_incoming_by_channel.app_error", nil, "id="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to delete IncomingWebhook with channelId=%s", channelId)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||
return s.GetIncomingListByUser("", offset, limit)
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||
var webhooks []*model.IncomingWebhook
|
||||
|
||||
query := s.getQueryBuilder().
|
||||
@@ -157,18 +158,18 @@ func (s SqlWebhookStore) GetIncomingListByUser(userId string, offset, limit int)
|
||||
|
||||
queryString, args, err := query.ToSql()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingList", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "incoming_webhook_tosql")
|
||||
}
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingList", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to find IncomingWebhooks")
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||
var webhooks []*model.IncomingWebhook
|
||||
|
||||
query := s.getQueryBuilder().
|
||||
@@ -185,33 +186,33 @@ func (s SqlWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, o
|
||||
|
||||
queryString, args, err := query.ToSql()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByUser", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "incoming_webhook_tosql")
|
||||
}
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByUser", "store.sql_webhooks.get_incoming_by_user.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to find IncomingWebhoook with teamId=%s", teamId)
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, error) {
|
||||
return s.GetIncomingByTeamByUser(teamId, "", offset, limit)
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||
var webhooks []*model.IncomingWebhook
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, "SELECT * FROM IncomingWebhooks WHERE ChannelId = :ChannelId AND DeleteAt = 0", map[string]interface{}{"ChannelId": channelId}); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetIncomingByChannel", "store.sql_webhooks.get_incoming_by_channel.app_error", nil, "channelId="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to find IncomingWebhooks with channelId=%s", channelId)
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
if len(webhook.Id) > 0 {
|
||||
return nil, model.NewAppError("SqlWebhookStore.SaveOutgoing", "store.sql_webhooks.save_outgoing.override.app_error", nil, "id="+webhook.Id, http.StatusBadRequest)
|
||||
return nil, store.NewErrInvalidInput("OutgoingWebhook", "id", webhook.Id)
|
||||
}
|
||||
|
||||
webhook.PreSave()
|
||||
@@ -220,24 +221,28 @@ func (s SqlWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Ou
|
||||
}
|
||||
|
||||
if err := s.GetMaster().Insert(webhook); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.SaveOutgoing", "store.sql_webhooks.save_outgoing.app_error", nil, "id="+webhook.Id+", "+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to save OutgoingWebhook with id=%s", webhook.Id)
|
||||
}
|
||||
|
||||
return webhook, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
|
||||
var webhook model.OutgoingWebhook
|
||||
|
||||
if err := s.GetReplica().SelectOne(&webhook, "SELECT * FROM OutgoingWebhooks WHERE Id = :Id AND DeleteAt = 0", map[string]interface{}{"Id": id}); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoing", "store.sql_webhooks.get_outgoing.app_error", nil, "id="+id+", err="+err.Error(), http.StatusInternalServerError)
|
||||
if err == sql.ErrNoRows {
|
||||
return nil, store.NewErrNotFound("OutgoingWebhook", id)
|
||||
}
|
||||
|
||||
return nil, errors.Wrapf(err, "failed to get OutgoingWebhook with id=%s", id)
|
||||
}
|
||||
|
||||
return &webhook, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
var webhooks []*model.OutgoingWebhook
|
||||
|
||||
query := s.getQueryBuilder().
|
||||
@@ -253,22 +258,22 @@ func (s SqlWebhookStore) GetOutgoingListByUser(userId string, offset, limit int)
|
||||
|
||||
queryString, args, err := query.ToSql()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||
}
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingList", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, "err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
return s.GetOutgoingListByUser("", offset, limit)
|
||||
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
var webhooks []*model.OutgoingWebhook
|
||||
|
||||
query := s.getQueryBuilder().
|
||||
@@ -288,21 +293,21 @@ func (s SqlWebhookStore) GetOutgoingByChannelByUser(channelId string, userId str
|
||||
|
||||
queryString, args, err := query.ToSql()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||
}
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByChannel", "store.sql_webhooks.get_outgoing_by_channel.app_error", nil, "channelId="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
return s.GetOutgoingByChannelByUser(channelId, "", offset, limit)
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
var webhooks []*model.OutgoingWebhook
|
||||
|
||||
query := s.getQueryBuilder().
|
||||
@@ -322,42 +327,42 @@ func (s SqlWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, o
|
||||
|
||||
queryString, args, err := query.ToSql()
|
||||
if err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByTeam", "store.sql_webhooks.get_outgoing_by_team.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "outgoing_webhook_tosql")
|
||||
}
|
||||
|
||||
if _, err := s.GetReplica().Select(&webhooks, queryString, args...); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.GetOutgoingByTeam", "store.sql_webhooks.get_outgoing_by_team.app_error", nil, "teamId="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrap(err, "failed to find OutgoingWebhooks")
|
||||
}
|
||||
|
||||
return webhooks, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
return s.GetOutgoingByTeamByUser(teamId, "", offset, limit)
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
||||
func (s SqlWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||
_, err := s.GetMaster().Exec("Update OutgoingWebhooks SET DeleteAt = :DeleteAt, UpdateAt = :UpdateAt WHERE Id = :Id", map[string]interface{}{"DeleteAt": time, "UpdateAt": time, "Id": webhookId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoing", "store.sql_webhooks.delete_outgoing.app_error", nil, "id="+webhookId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to update OutgoingWebhook with id=%s", webhookId)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE CreatorId = :UserId", map[string]interface{}{"UserId": userId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoingByUser", "store.sql_webhooks.permanent_delete_outgoing_by_user.app_error", nil, "id="+userId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to delete OutgoingWebhook with creatorId=%s", userId)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
||||
func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||
_, err := s.GetMaster().Exec("DELETE FROM OutgoingWebhooks WHERE ChannelId = :ChannelId", map[string]interface{}{"ChannelId": channelId})
|
||||
if err != nil {
|
||||
return model.NewAppError("SqlWebhookStore.DeleteOutgoingByChannel", "store.sql_webhooks.permanent_delete_outgoing_by_channel.app_error", nil, "id="+channelId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return errors.Wrapf(err, "failed to delete OutgoingWebhook with channelId=%s", channelId)
|
||||
}
|
||||
|
||||
s.ClearCaches()
|
||||
@@ -365,19 +370,19 @@ func (s SqlWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *mod
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s SqlWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
hook.UpdateAt = model.GetMillis()
|
||||
|
||||
if _, err := s.GetMaster().Update(hook); err != nil {
|
||||
return nil, model.NewAppError("SqlWebhookStore.UpdateOutgoing", "store.sql_webhooks.update_outgoing.app_error", nil, "id="+hook.Id+", "+err.Error(), http.StatusInternalServerError)
|
||||
return nil, errors.Wrapf(err, "failed to update OutgoingWebhook with id=%s", hook.Id)
|
||||
}
|
||||
|
||||
return hook, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||
query :=
|
||||
`SELECT
|
||||
`SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
IncomingWebhooks
|
||||
@@ -390,15 +395,15 @@ func (s SqlWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.Ap
|
||||
|
||||
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
||||
if err != nil {
|
||||
return 0, model.NewAppError("SqlWebhookStore.AnalyticsIncomingCount", "store.sql_webhooks.analytics_incoming_count.app_error", nil, "team_id="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return 0, errors.Wrap(err, "failed to count IncomingWebhooks")
|
||||
}
|
||||
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||
query :=
|
||||
`SELECT
|
||||
`SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
OutgoingWebhooks
|
||||
@@ -411,7 +416,7 @@ func (s SqlWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.Ap
|
||||
|
||||
v, err := s.GetReplica().SelectInt(query, map[string]interface{}{"TeamId": teamId})
|
||||
if err != nil {
|
||||
return 0, model.NewAppError("SqlWebhookStore.AnalyticsOutgoingCount", "store.sql_webhooks.analytics_outgoing_count.app_error", nil, "team_id="+teamId+", err="+err.Error(), http.StatusInternalServerError)
|
||||
return 0, errors.Wrap(err, "failed to count OutgoingWebhooks")
|
||||
}
|
||||
|
||||
return v, nil
|
||||
|
||||
@@ -443,33 +443,33 @@ type SystemStore interface {
|
||||
}
|
||||
|
||||
type WebhookStore interface {
|
||||
SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
||||
GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, *model.AppError)
|
||||
UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError)
|
||||
GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError)
|
||||
DeleteIncoming(webhookId string, time int64) *model.AppError
|
||||
PermanentDeleteIncomingByChannel(channelId string) *model.AppError
|
||||
PermanentDeleteIncomingByUser(userId string) *model.AppError
|
||||
SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error)
|
||||
GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error)
|
||||
GetIncomingList(offset, limit int) ([]*model.IncomingWebhook, error)
|
||||
GetIncomingListByUser(userId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||
GetIncomingByTeam(teamId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||
GetIncomingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.IncomingWebhook, error)
|
||||
UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error)
|
||||
GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error)
|
||||
DeleteIncoming(webhookId string, time int64) error
|
||||
PermanentDeleteIncomingByChannel(channelId string) error
|
||||
PermanentDeleteIncomingByUser(userId string) error
|
||||
|
||||
SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, *model.AppError)
|
||||
DeleteOutgoing(webhookId string, time int64) *model.AppError
|
||||
PermanentDeleteOutgoingByChannel(channelId string) *model.AppError
|
||||
PermanentDeleteOutgoingByUser(userId string) *model.AppError
|
||||
UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError)
|
||||
SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error)
|
||||
GetOutgoing(id string) (*model.OutgoingWebhook, error)
|
||||
GetOutgoingByChannel(channelId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
GetOutgoingByChannelByUser(channelId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
GetOutgoingList(offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
GetOutgoingListByUser(userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
GetOutgoingByTeam(teamId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
GetOutgoingByTeamByUser(teamId string, userId string, offset, limit int) ([]*model.OutgoingWebhook, error)
|
||||
DeleteOutgoing(webhookId string, time int64) error
|
||||
PermanentDeleteOutgoingByChannel(channelId string) error
|
||||
PermanentDeleteOutgoingByUser(userId string) error
|
||||
UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error)
|
||||
|
||||
AnalyticsIncomingCount(teamId string) (int64, *model.AppError)
|
||||
AnalyticsOutgoingCount(teamId string) (int64, *model.AppError)
|
||||
AnalyticsIncomingCount(teamId string) (int64, error)
|
||||
AnalyticsOutgoingCount(teamId string) (int64, error)
|
||||
InvalidateWebhookCache(webhook string)
|
||||
ClearCaches()
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ type WebhookStore struct {
|
||||
}
|
||||
|
||||
// AnalyticsIncomingCount provides a mock function with given fields: teamId
|
||||
func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
||||
func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||
ret := _m.Called(teamId)
|
||||
|
||||
var r0 int64
|
||||
@@ -25,20 +25,18 @@ func (_m *WebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.App
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(teamId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// AnalyticsOutgoingCount provides a mock function with given fields: teamId
|
||||
func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
||||
func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||
ret := _m.Called(teamId)
|
||||
|
||||
var r0 int64
|
||||
@@ -48,13 +46,11 @@ func (_m *WebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.App
|
||||
r0 = ret.Get(0).(int64)
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(teamId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -66,39 +62,35 @@ func (_m *WebhookStore) ClearCaches() {
|
||||
}
|
||||
|
||||
// DeleteIncoming provides a mock function with given fields: webhookId, time
|
||||
func (_m *WebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
||||
func (_m *WebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||
ret := _m.Called(webhookId, time)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, int64) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(webhookId, time)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// DeleteOutgoing provides a mock function with given fields: webhookId, time
|
||||
func (_m *WebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
||||
func (_m *WebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||
ret := _m.Called(webhookId, time)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string, int64) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string, int64) error); ok {
|
||||
r0 = rf(webhookId, time)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// GetIncoming provides a mock function with given fields: id, allowFromCache
|
||||
func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(id, allowFromCache)
|
||||
|
||||
var r0 *model.IncomingWebhook
|
||||
@@ -110,20 +102,18 @@ func (_m *WebhookStore) GetIncoming(id string, allowFromCache bool) (*model.Inco
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, bool) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, bool) error); ok {
|
||||
r1 = rf(id, allowFromCache)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByChannel provides a mock function with given fields: channelId
|
||||
func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(channelId)
|
||||
|
||||
var r0 []*model.IncomingWebhook
|
||||
@@ -135,20 +125,18 @@ func (_m *WebhookStore) GetIncomingByChannel(channelId string) ([]*model.Incomin
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(channelId)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByTeam provides a mock function with given fields: teamId, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(teamId, offset, limit)
|
||||
|
||||
var r0 []*model.IncomingWebhook
|
||||
@@ -160,20 +148,18 @@ func (_m *WebhookStore) GetIncomingByTeam(teamId string, offset int, limit int)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(teamId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(teamId, userId, offset, limit)
|
||||
|
||||
var r0 []*model.IncomingWebhook
|
||||
@@ -185,20 +171,18 @@ func (_m *WebhookStore) GetIncomingByTeamByUser(teamId string, userId string, of
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(teamId, userId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingList provides a mock function with given fields: offset, limit
|
||||
func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
var r0 []*model.IncomingWebhook
|
||||
@@ -210,20 +194,18 @@ func (_m *WebhookStore) GetIncomingList(offset int, limit int) ([]*model.Incomin
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetIncomingListByUser provides a mock function with given fields: userId, offset, limit
|
||||
func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(userId, offset, limit)
|
||||
|
||||
var r0 []*model.IncomingWebhook
|
||||
@@ -235,20 +217,18 @@ func (_m *WebhookStore) GetIncomingListByUser(userId string, offset int, limit i
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoing provides a mock function with given fields: id
|
||||
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(id)
|
||||
|
||||
var r0 *model.OutgoingWebhook
|
||||
@@ -260,20 +240,18 @@ func (_m *WebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.A
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string) error); ok {
|
||||
r1 = rf(id)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByChannel provides a mock function with given fields: channelId, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(channelId, offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -285,20 +263,18 @@ func (_m *WebhookStore) GetOutgoingByChannel(channelId string, offset int, limit
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(channelId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByChannelByUser provides a mock function with given fields: channelId, userId, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(channelId, userId, offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -310,20 +286,18 @@ func (_m *WebhookStore) GetOutgoingByChannelByUser(channelId string, userId stri
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(channelId, userId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByTeam provides a mock function with given fields: teamId, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(teamId, offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -335,20 +309,18 @@ func (_m *WebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int)
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(teamId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingByTeamByUser provides a mock function with given fields: teamId, userId, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(teamId, userId, offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -360,20 +332,18 @@ func (_m *WebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, of
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, string, int, int) error); ok {
|
||||
r1 = rf(teamId, userId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingList provides a mock function with given fields: offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -385,20 +355,18 @@ func (_m *WebhookStore) GetOutgoingList(offset int, limit int) ([]*model.Outgoin
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(int, int) error); ok {
|
||||
r1 = rf(offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// GetOutgoingListByUser provides a mock function with given fields: userId, offset, limit
|
||||
func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(userId, offset, limit)
|
||||
|
||||
var r0 []*model.OutgoingWebhook
|
||||
@@ -410,13 +378,11 @@ func (_m *WebhookStore) GetOutgoingListByUser(userId string, offset int, limit i
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(string, int, int) error); ok {
|
||||
r1 = rf(userId, offset, limit)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
@@ -428,71 +394,63 @@ func (_m *WebhookStore) InvalidateWebhookCache(webhook string) {
|
||||
}
|
||||
|
||||
// PermanentDeleteIncomingByChannel provides a mock function with given fields: channelId
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||
ret := _m.Called(channelId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(channelId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteIncomingByUser provides a mock function with given fields: userId
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
||||
func (_m *WebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteOutgoingByChannel provides a mock function with given fields: channelId
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||
ret := _m.Called(channelId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(channelId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// PermanentDeleteOutgoingByUser provides a mock function with given fields: userId
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
||||
func (_m *WebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||
ret := _m.Called(userId)
|
||||
|
||||
var r0 *model.AppError
|
||||
if rf, ok := ret.Get(0).(func(string) *model.AppError); ok {
|
||||
var r0 error
|
||||
if rf, ok := ret.Get(0).(func(string) error); ok {
|
||||
r0 = rf(userId)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(*model.AppError)
|
||||
}
|
||||
r0 = ret.Error(0)
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// SaveIncoming provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
var r0 *model.IncomingWebhook
|
||||
@@ -504,20 +462,18 @@ func (_m *WebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.Inc
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// SaveOutgoing provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
var r0 *model.OutgoingWebhook
|
||||
@@ -529,20 +485,18 @@ func (_m *WebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.Out
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateIncoming provides a mock function with given fields: webhook
|
||||
func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
ret := _m.Called(webhook)
|
||||
|
||||
var r0 *model.IncomingWebhook
|
||||
@@ -554,20 +508,18 @@ func (_m *WebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.I
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.IncomingWebhook) error); ok {
|
||||
r1 = rf(webhook)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
}
|
||||
|
||||
// UpdateOutgoing provides a mock function with given fields: hook
|
||||
func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
ret := _m.Called(hook)
|
||||
|
||||
var r0 *model.OutgoingWebhook
|
||||
@@ -579,13 +531,11 @@ func (_m *WebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.Outg
|
||||
}
|
||||
}
|
||||
|
||||
var r1 *model.AppError
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) *model.AppError); ok {
|
||||
var r1 error
|
||||
if rf, ok := ret.Get(1).(func(*model.OutgoingWebhook) error); ok {
|
||||
r1 = rf(hook)
|
||||
} else {
|
||||
if ret.Get(1) != nil {
|
||||
r1 = ret.Get(1).(*model.AppError)
|
||||
}
|
||||
r1 = ret.Error(1)
|
||||
}
|
||||
|
||||
return r0, r1
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
package storetest
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"errors"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
@@ -21,6 +22,7 @@ func TestWebhookStore(t *testing.T, ss store.Store) {
|
||||
t.Run("GetIncomingListByUser", func(t *testing.T) { testWebhookStoreGetIncomingListByUser(t, ss) })
|
||||
t.Run("GetIncomingByTeam", func(t *testing.T) { testWebhookStoreGetIncomingByTeam(t, ss) })
|
||||
t.Run("GetIncomingByTeamByUser", func(t *testing.T) { TestWebhookStoreGetIncomingByTeamByUser(t, ss) })
|
||||
t.Run("GetIncomingByTeamByChannel", func(t *testing.T) { testWebhookStoreGetIncomingByChannel(t, ss) })
|
||||
t.Run("DeleteIncoming", func(t *testing.T) { testWebhookStoreDeleteIncoming(t, ss) })
|
||||
t.Run("DeleteIncomingByChannel", func(t *testing.T) { testWebhookStoreDeleteIncomingByChannel(t, ss) })
|
||||
t.Run("DeleteIncomingByUser", func(t *testing.T) { testWebhookStoreDeleteIncomingByUser(t, ss) })
|
||||
@@ -52,7 +54,7 @@ func testWebhookStoreSaveIncoming(t *testing.T, ss store.Store) {
|
||||
|
||||
func testWebhookStoreUpdateIncoming(t *testing.T, ss store.Store) {
|
||||
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -72,7 +74,7 @@ func testWebhookStoreUpdateIncoming(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreGetIncoming(t *testing.T, ss store.Store) {
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -94,7 +96,8 @@ func testWebhookStoreGetIncoming(t *testing.T, ss store.Store) {
|
||||
|
||||
_, err = ss.Webhook().GetIncoming("123", true)
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, err.StatusCode, http.StatusNotFound, "Should have set the status as not found for missing id")
|
||||
var nfErr *store.ErrNotFound
|
||||
require.True(t, errors.As(err, &nfErr), "Should have set the status as not found for missing id")
|
||||
}
|
||||
|
||||
func testWebhookStoreGetIncomingList(t *testing.T, ss store.Store) {
|
||||
@@ -103,7 +106,7 @@ func testWebhookStoreGetIncomingList(t *testing.T, ss store.Store) {
|
||||
o1.UserId = model.NewId()
|
||||
o1.TeamId = model.NewId()
|
||||
|
||||
var err *model.AppError
|
||||
var err error
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
require.Nil(t, err, "unable to save webhook")
|
||||
|
||||
@@ -147,7 +150,7 @@ func testWebhookStoreGetIncomingListByUser(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreGetIncomingByTeam(t *testing.T, ss store.Store) {
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -163,7 +166,7 @@ func testWebhookStoreGetIncomingByTeam(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func TestWebhookStoreGetIncomingByTeamByUser(t *testing.T, ss store.Store) {
|
||||
var appErr *model.AppError
|
||||
var appErr error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, appErr = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -194,7 +197,7 @@ func TestWebhookStoreGetIncomingByTeamByUser(t *testing.T, ss store.Store) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
||||
func testWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
||||
o1 := buildIncomingWebhook()
|
||||
|
||||
o1, err := ss.Webhook().SaveIncoming(o1)
|
||||
@@ -210,7 +213,7 @@ func TestWebhookStoreGetIncomingByChannel(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreDeleteIncoming(t *testing.T, ss store.Store) {
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -228,7 +231,7 @@ func testWebhookStoreDeleteIncoming(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreDeleteIncomingByChannel(t *testing.T, ss store.Store) {
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -246,7 +249,7 @@ func testWebhookStoreDeleteIncomingByChannel(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreDeleteIncomingByUser(t *testing.T, ss store.Store) {
|
||||
var err *model.AppError
|
||||
var err error
|
||||
|
||||
o1 := buildIncomingWebhook()
|
||||
o1, err = ss.Webhook().SaveIncoming(o1)
|
||||
@@ -448,7 +451,7 @@ func testWebhookStoreGetOutgoingByTeam(t *testing.T, ss store.Store) {
|
||||
}
|
||||
|
||||
func testWebhookStoreGetOutgoingByTeamByUser(t *testing.T, ss store.Store) {
|
||||
var appErr *model.AppError
|
||||
var appErr error
|
||||
|
||||
o1 := &model.OutgoingWebhook{}
|
||||
o1.ChannelId = model.NewId()
|
||||
@@ -587,7 +590,8 @@ func testWebhookStoreCountOutgoing(t *testing.T, ss store.Store) {
|
||||
o1.TeamId = model.NewId()
|
||||
o1.CallbackURLs = []string{"http://nowhere.com/"}
|
||||
|
||||
ss.Webhook().SaveOutgoing(o1)
|
||||
_, err := ss.Webhook().SaveOutgoing(o1)
|
||||
require.Nil(t, err)
|
||||
|
||||
r, err := ss.Webhook().AnalyticsOutgoingCount("")
|
||||
require.Nil(t, err)
|
||||
|
||||
@@ -8069,7 +8069,7 @@ func (s *TimerLayerUserTermsOfServiceStore) Save(userTermsOfService *model.UserT
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.AnalyticsIncomingCount(teamId)
|
||||
@@ -8085,7 +8085,7 @@ func (s *TimerLayerWebhookStore) AnalyticsIncomingCount(teamId string) (int64, *
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) AnalyticsOutgoingCount(teamId string) (int64, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.AnalyticsOutgoingCount(teamId)
|
||||
@@ -8116,7 +8116,7 @@ func (s *TimerLayerWebhookStore) ClearCaches() {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.DeleteIncoming(webhookId, time)
|
||||
@@ -8132,7 +8132,7 @@ func (s *TimerLayerWebhookStore) DeleteIncoming(webhookId string, time int64) *m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.DeleteOutgoing(webhookId, time)
|
||||
@@ -8148,7 +8148,7 @@ func (s *TimerLayerWebhookStore) DeleteOutgoing(webhookId string, time int64) *m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncoming(id, allowFromCache)
|
||||
@@ -8164,7 +8164,7 @@ func (s *TimerLayerWebhookStore) GetIncoming(id string, allowFromCache bool) (*m
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByChannel(channelId)
|
||||
@@ -8180,7 +8180,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByChannel(channelId string) ([]*mode
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeam(teamId, offset, limit)
|
||||
@@ -8196,7 +8196,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByTeam(teamId string, offset int, li
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingByTeamByUser(teamId, userId, offset, limit)
|
||||
@@ -8212,7 +8212,7 @@ func (s *TimerLayerWebhookStore) GetIncomingByTeamByUser(teamId string, userId s
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingList(offset, limit)
|
||||
@@ -8228,7 +8228,7 @@ func (s *TimerLayerWebhookStore) GetIncomingList(offset int, limit int) ([]*mode
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int, limit int) ([]*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetIncomingListByUser(userId, offset, limit)
|
||||
@@ -8244,7 +8244,7 @@ func (s *TimerLayerWebhookStore) GetIncomingListByUser(userId string, offset int
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoing(id)
|
||||
@@ -8260,7 +8260,7 @@ func (s *TimerLayerWebhookStore) GetOutgoing(id string) (*model.OutgoingWebhook,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannel(channelId, offset, limit)
|
||||
@@ -8276,7 +8276,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByChannel(channelId string, offset i
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByChannelByUser(channelId, userId, offset, limit)
|
||||
@@ -8292,7 +8292,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByChannelByUser(channelId string, us
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeam(teamId, offset, limit)
|
||||
@@ -8308,7 +8308,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByTeam(teamId string, offset int, li
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingByTeamByUser(teamId, userId, offset, limit)
|
||||
@@ -8324,7 +8324,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingByTeamByUser(teamId string, userId s
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingList(offset, limit)
|
||||
@@ -8340,7 +8340,7 @@ func (s *TimerLayerWebhookStore) GetOutgoingList(offset int, limit int) ([]*mode
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) GetOutgoingListByUser(userId string, offset int, limit int) ([]*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.GetOutgoingListByUser(userId, offset, limit)
|
||||
@@ -8371,7 +8371,7 @@ func (s *TimerLayerWebhookStore) InvalidateWebhookCache(webhook string) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId string) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByChannel(channelId)
|
||||
@@ -8387,7 +8387,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByChannel(channelId stri
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.PermanentDeleteIncomingByUser(userId)
|
||||
@@ -8403,7 +8403,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteIncomingByUser(userId string) *m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId string) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByChannel(channelId)
|
||||
@@ -8419,7 +8419,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByChannel(channelId stri
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *model.AppError {
|
||||
func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) error {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0 := s.WebhookStore.PermanentDeleteOutgoingByUser(userId)
|
||||
@@ -8435,7 +8435,7 @@ func (s *TimerLayerWebhookStore) PermanentDeleteOutgoingByUser(userId string) *m
|
||||
return resultVar0
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.SaveIncoming(webhook)
|
||||
@@ -8451,7 +8451,7 @@ func (s *TimerLayerWebhookStore) SaveIncoming(webhook *model.IncomingWebhook) (*
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.SaveOutgoing(webhook)
|
||||
@@ -8467,7 +8467,7 @@ func (s *TimerLayerWebhookStore) SaveOutgoing(webhook *model.OutgoingWebhook) (*
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook) (*model.IncomingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.UpdateIncoming(webhook)
|
||||
@@ -8483,7 +8483,7 @@ func (s *TimerLayerWebhookStore) UpdateIncoming(webhook *model.IncomingWebhook)
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) {
|
||||
func (s *TimerLayerWebhookStore) UpdateOutgoing(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.WebhookStore.UpdateOutgoing(hook)
|
||||
|
||||
Ссылка в новой задаче
Block a user