Moving store layers into independent packages (#15004)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
935ddaa251
Коммит
2de5f75f47
@@ -48,6 +48,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v5/store/localcachelayer"
|
||||
"github.com/mattermost/mattermost-server/v5/store/searchlayer"
|
||||
"github.com/mattermost/mattermost-server/v5/store/sqlstore"
|
||||
"github.com/mattermost/mattermost-server/v5/store/timerlayer"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
)
|
||||
|
||||
@@ -310,7 +311,7 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
s.sqlStore.UpdateLicense(newLicense)
|
||||
})
|
||||
|
||||
return store.NewTimerLayer(
|
||||
return timerlayer.New(
|
||||
searchStore,
|
||||
s.Metrics,
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ func buildTimerLayer() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(path.Join("timer_layer.go"), formatedCode, 0644)
|
||||
return ioutil.WriteFile(path.Join("timerlayer", "timerlayer.go"), formatedCode, 0644)
|
||||
}
|
||||
|
||||
func buildOpenTracingLayer() error {
|
||||
@@ -60,7 +60,7 @@ func buildOpenTracingLayer() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return ioutil.WriteFile(path.Join("opentracing_layer.go"), formatedCode, 0644)
|
||||
return ioutil.WriteFile(path.Join("opentracinglayer", "opentracinglayer.go"), formatedCode, 0644)
|
||||
}
|
||||
|
||||
type methodParam struct {
|
||||
@@ -252,7 +252,13 @@ func generateLayer(name, templateFile string) ([]byte, error) {
|
||||
"joinParamsWithType": func(params []methodParam) string {
|
||||
paramsWithType := []string{}
|
||||
for _, param := range params {
|
||||
paramsWithType = append(paramsWithType, fmt.Sprintf("%s %s", param.Name, param.Type))
|
||||
if param.Type == "ChannelSearchOpts" || param.Type == "UserGetByIdsOpts" {
|
||||
paramsWithType = append(paramsWithType, fmt.Sprintf("%s store.%s", param.Name, param.Type))
|
||||
} else if param.Type == "*UserGetByIdsOpts" {
|
||||
paramsWithType = append(paramsWithType, fmt.Sprintf("%s *store.UserGetByIdsOpts", param.Name))
|
||||
} else {
|
||||
paramsWithType = append(paramsWithType, fmt.Sprintf("%s %s", param.Name, param.Type))
|
||||
}
|
||||
}
|
||||
return strings.Join(paramsWithType, ", ")
|
||||
},
|
||||
|
||||
@@ -4,31 +4,32 @@
|
||||
// Code generated by "make store-layers"
|
||||
// DO NOT EDIT
|
||||
|
||||
package store
|
||||
package opentracinglayer
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/services/tracing"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
spanlog "github.com/opentracing/opentracing-go/log"
|
||||
)
|
||||
|
||||
type {{.Name}} struct {
|
||||
Store
|
||||
{{range $index, $element := .SubStores}} {{$index}}Store {{$index}}Store
|
||||
store.Store
|
||||
{{range $index, $element := .SubStores}} {{$index}}Store store.{{$index}}Store
|
||||
{{end}}
|
||||
}
|
||||
|
||||
{{range $index, $element := .SubStores}}func (s *{{$.Name}}) {{$index}}() {{$index}}Store {
|
||||
{{range $index, $element := .SubStores}}func (s *{{$.Name}}) {{$index}}() store.{{$index}}Store {
|
||||
return s.{{$index}}Store
|
||||
}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{range $index, $element := .SubStores}}type {{$.Name}}{{$index}}Store struct {
|
||||
{{$index}}Store
|
||||
store.{{$index}}Store
|
||||
Root *{{$.Name}}
|
||||
}
|
||||
|
||||
@@ -72,7 +73,7 @@ func (s *{{$.Name}}) {{$index}}({{$element.Params | joinParamsWithType}}) {{$ele
|
||||
{{end}}}
|
||||
{{end}}
|
||||
|
||||
func New{{.Name}}(childStore Store, ctx context.Context) *{{.Name}} {
|
||||
func New(childStore store.Store, ctx context.Context) *{{.Name}} {
|
||||
newStore := {{.Name}}{
|
||||
Store: childStore,
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by "make store-layers"
|
||||
// DO NOT EDIT
|
||||
|
||||
package store
|
||||
package timerlayer
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -12,23 +12,24 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
)
|
||||
|
||||
type {{.Name}} struct {
|
||||
Store
|
||||
store.Store
|
||||
Metrics einterfaces.MetricsInterface
|
||||
{{range $index, $element := .SubStores}} {{$index}}Store {{$index}}Store
|
||||
{{range $index, $element := .SubStores}} {{$index}}Store store.{{$index}}Store
|
||||
{{end}}
|
||||
}
|
||||
|
||||
{{range $index, $element := .SubStores}}func (s *{{$.Name}}) {{$index}}() {{$index}}Store {
|
||||
{{range $index, $element := .SubStores}}func (s *{{$.Name}}) {{$index}}() store.{{$index}}Store {
|
||||
return s.{{$index}}Store
|
||||
}
|
||||
|
||||
{{end}}
|
||||
|
||||
{{range $index, $element := .SubStores}}type {{$.Name}}{{$index}}Store struct {
|
||||
{{$index}}Store
|
||||
store.{{$index}}Store
|
||||
Root *{{$.Name}}
|
||||
}
|
||||
|
||||
@@ -67,7 +68,7 @@ func (s *{{$.Name}}) {{$index}}({{$element.Params | joinParamsWithType}}) {{$ele
|
||||
{{end}}}
|
||||
{{end}}
|
||||
|
||||
func New{{.Name}}(childStore Store, metrics einterfaces.MetricsInterface) *{{.Name}} {
|
||||
func New(childStore store.Store, metrics einterfaces.MetricsInterface) *{{.Name}} {
|
||||
newStore := {{.Name}}{
|
||||
Store: childStore,
|
||||
Metrics: metrics,
|
||||
|
||||
@@ -4,328 +4,329 @@
|
||||
// Code generated by "make store-layers"
|
||||
// DO NOT EDIT
|
||||
|
||||
package store
|
||||
package opentracinglayer
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/services/tracing"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
spanlog "github.com/opentracing/opentracing-go/log"
|
||||
)
|
||||
|
||||
type OpenTracingLayer struct {
|
||||
Store
|
||||
AuditStore AuditStore
|
||||
BotStore BotStore
|
||||
ChannelStore ChannelStore
|
||||
ChannelMemberHistoryStore ChannelMemberHistoryStore
|
||||
ClusterDiscoveryStore ClusterDiscoveryStore
|
||||
CommandStore CommandStore
|
||||
CommandWebhookStore CommandWebhookStore
|
||||
ComplianceStore ComplianceStore
|
||||
EmojiStore EmojiStore
|
||||
FileInfoStore FileInfoStore
|
||||
GroupStore GroupStore
|
||||
JobStore JobStore
|
||||
LicenseStore LicenseStore
|
||||
LinkMetadataStore LinkMetadataStore
|
||||
OAuthStore OAuthStore
|
||||
PluginStore PluginStore
|
||||
PostStore PostStore
|
||||
PreferenceStore PreferenceStore
|
||||
ReactionStore ReactionStore
|
||||
RoleStore RoleStore
|
||||
SchemeStore SchemeStore
|
||||
SessionStore SessionStore
|
||||
StatusStore StatusStore
|
||||
SystemStore SystemStore
|
||||
TeamStore TeamStore
|
||||
TermsOfServiceStore TermsOfServiceStore
|
||||
TokenStore TokenStore
|
||||
UserStore UserStore
|
||||
UserAccessTokenStore UserAccessTokenStore
|
||||
UserTermsOfServiceStore UserTermsOfServiceStore
|
||||
WebhookStore WebhookStore
|
||||
store.Store
|
||||
AuditStore store.AuditStore
|
||||
BotStore store.BotStore
|
||||
ChannelStore store.ChannelStore
|
||||
ChannelMemberHistoryStore store.ChannelMemberHistoryStore
|
||||
ClusterDiscoveryStore store.ClusterDiscoveryStore
|
||||
CommandStore store.CommandStore
|
||||
CommandWebhookStore store.CommandWebhookStore
|
||||
ComplianceStore store.ComplianceStore
|
||||
EmojiStore store.EmojiStore
|
||||
FileInfoStore store.FileInfoStore
|
||||
GroupStore store.GroupStore
|
||||
JobStore store.JobStore
|
||||
LicenseStore store.LicenseStore
|
||||
LinkMetadataStore store.LinkMetadataStore
|
||||
OAuthStore store.OAuthStore
|
||||
PluginStore store.PluginStore
|
||||
PostStore store.PostStore
|
||||
PreferenceStore store.PreferenceStore
|
||||
ReactionStore store.ReactionStore
|
||||
RoleStore store.RoleStore
|
||||
SchemeStore store.SchemeStore
|
||||
SessionStore store.SessionStore
|
||||
StatusStore store.StatusStore
|
||||
SystemStore store.SystemStore
|
||||
TeamStore store.TeamStore
|
||||
TermsOfServiceStore store.TermsOfServiceStore
|
||||
TokenStore store.TokenStore
|
||||
UserStore store.UserStore
|
||||
UserAccessTokenStore store.UserAccessTokenStore
|
||||
UserTermsOfServiceStore store.UserTermsOfServiceStore
|
||||
WebhookStore store.WebhookStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Audit() AuditStore {
|
||||
func (s *OpenTracingLayer) Audit() store.AuditStore {
|
||||
return s.AuditStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Bot() BotStore {
|
||||
func (s *OpenTracingLayer) Bot() store.BotStore {
|
||||
return s.BotStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Channel() ChannelStore {
|
||||
func (s *OpenTracingLayer) Channel() store.ChannelStore {
|
||||
return s.ChannelStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) ChannelMemberHistory() ChannelMemberHistoryStore {
|
||||
func (s *OpenTracingLayer) ChannelMemberHistory() store.ChannelMemberHistoryStore {
|
||||
return s.ChannelMemberHistoryStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) ClusterDiscovery() ClusterDiscoveryStore {
|
||||
func (s *OpenTracingLayer) ClusterDiscovery() store.ClusterDiscoveryStore {
|
||||
return s.ClusterDiscoveryStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Command() CommandStore {
|
||||
func (s *OpenTracingLayer) Command() store.CommandStore {
|
||||
return s.CommandStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) CommandWebhook() CommandWebhookStore {
|
||||
func (s *OpenTracingLayer) CommandWebhook() store.CommandWebhookStore {
|
||||
return s.CommandWebhookStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Compliance() ComplianceStore {
|
||||
func (s *OpenTracingLayer) Compliance() store.ComplianceStore {
|
||||
return s.ComplianceStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Emoji() EmojiStore {
|
||||
func (s *OpenTracingLayer) Emoji() store.EmojiStore {
|
||||
return s.EmojiStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) FileInfo() FileInfoStore {
|
||||
func (s *OpenTracingLayer) FileInfo() store.FileInfoStore {
|
||||
return s.FileInfoStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Group() GroupStore {
|
||||
func (s *OpenTracingLayer) Group() store.GroupStore {
|
||||
return s.GroupStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Job() JobStore {
|
||||
func (s *OpenTracingLayer) Job() store.JobStore {
|
||||
return s.JobStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) License() LicenseStore {
|
||||
func (s *OpenTracingLayer) License() store.LicenseStore {
|
||||
return s.LicenseStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) LinkMetadata() LinkMetadataStore {
|
||||
func (s *OpenTracingLayer) LinkMetadata() store.LinkMetadataStore {
|
||||
return s.LinkMetadataStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) OAuth() OAuthStore {
|
||||
func (s *OpenTracingLayer) OAuth() store.OAuthStore {
|
||||
return s.OAuthStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Plugin() PluginStore {
|
||||
func (s *OpenTracingLayer) Plugin() store.PluginStore {
|
||||
return s.PluginStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Post() PostStore {
|
||||
func (s *OpenTracingLayer) Post() store.PostStore {
|
||||
return s.PostStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Preference() PreferenceStore {
|
||||
func (s *OpenTracingLayer) Preference() store.PreferenceStore {
|
||||
return s.PreferenceStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Reaction() ReactionStore {
|
||||
func (s *OpenTracingLayer) Reaction() store.ReactionStore {
|
||||
return s.ReactionStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Role() RoleStore {
|
||||
func (s *OpenTracingLayer) Role() store.RoleStore {
|
||||
return s.RoleStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Scheme() SchemeStore {
|
||||
func (s *OpenTracingLayer) Scheme() store.SchemeStore {
|
||||
return s.SchemeStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Session() SessionStore {
|
||||
func (s *OpenTracingLayer) Session() store.SessionStore {
|
||||
return s.SessionStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Status() StatusStore {
|
||||
func (s *OpenTracingLayer) Status() store.StatusStore {
|
||||
return s.StatusStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) System() SystemStore {
|
||||
func (s *OpenTracingLayer) System() store.SystemStore {
|
||||
return s.SystemStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Team() TeamStore {
|
||||
func (s *OpenTracingLayer) Team() store.TeamStore {
|
||||
return s.TeamStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) TermsOfService() TermsOfServiceStore {
|
||||
func (s *OpenTracingLayer) TermsOfService() store.TermsOfServiceStore {
|
||||
return s.TermsOfServiceStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Token() TokenStore {
|
||||
func (s *OpenTracingLayer) Token() store.TokenStore {
|
||||
return s.TokenStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) User() UserStore {
|
||||
func (s *OpenTracingLayer) User() store.UserStore {
|
||||
return s.UserStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) UserAccessToken() UserAccessTokenStore {
|
||||
func (s *OpenTracingLayer) UserAccessToken() store.UserAccessTokenStore {
|
||||
return s.UserAccessTokenStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) UserTermsOfService() UserTermsOfServiceStore {
|
||||
func (s *OpenTracingLayer) UserTermsOfService() store.UserTermsOfServiceStore {
|
||||
return s.UserTermsOfServiceStore
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayer) Webhook() WebhookStore {
|
||||
func (s *OpenTracingLayer) Webhook() store.WebhookStore {
|
||||
return s.WebhookStore
|
||||
}
|
||||
|
||||
type OpenTracingLayerAuditStore struct {
|
||||
AuditStore
|
||||
store.AuditStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerBotStore struct {
|
||||
BotStore
|
||||
store.BotStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerChannelStore struct {
|
||||
ChannelStore
|
||||
store.ChannelStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerChannelMemberHistoryStore struct {
|
||||
ChannelMemberHistoryStore
|
||||
store.ChannelMemberHistoryStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerClusterDiscoveryStore struct {
|
||||
ClusterDiscoveryStore
|
||||
store.ClusterDiscoveryStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerCommandStore struct {
|
||||
CommandStore
|
||||
store.CommandStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerCommandWebhookStore struct {
|
||||
CommandWebhookStore
|
||||
store.CommandWebhookStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerComplianceStore struct {
|
||||
ComplianceStore
|
||||
store.ComplianceStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerEmojiStore struct {
|
||||
EmojiStore
|
||||
store.EmojiStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerFileInfoStore struct {
|
||||
FileInfoStore
|
||||
store.FileInfoStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerGroupStore struct {
|
||||
GroupStore
|
||||
store.GroupStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerJobStore struct {
|
||||
JobStore
|
||||
store.JobStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerLicenseStore struct {
|
||||
LicenseStore
|
||||
store.LicenseStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerLinkMetadataStore struct {
|
||||
LinkMetadataStore
|
||||
store.LinkMetadataStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerOAuthStore struct {
|
||||
OAuthStore
|
||||
store.OAuthStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerPluginStore struct {
|
||||
PluginStore
|
||||
store.PluginStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerPostStore struct {
|
||||
PostStore
|
||||
store.PostStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerPreferenceStore struct {
|
||||
PreferenceStore
|
||||
store.PreferenceStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerReactionStore struct {
|
||||
ReactionStore
|
||||
store.ReactionStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerRoleStore struct {
|
||||
RoleStore
|
||||
store.RoleStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerSchemeStore struct {
|
||||
SchemeStore
|
||||
store.SchemeStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerSessionStore struct {
|
||||
SessionStore
|
||||
store.SessionStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerStatusStore struct {
|
||||
StatusStore
|
||||
store.StatusStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerSystemStore struct {
|
||||
SystemStore
|
||||
store.SystemStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerTeamStore struct {
|
||||
TeamStore
|
||||
store.TeamStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerTermsOfServiceStore struct {
|
||||
TermsOfServiceStore
|
||||
store.TermsOfServiceStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerTokenStore struct {
|
||||
TokenStore
|
||||
store.TokenStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerUserStore struct {
|
||||
UserStore
|
||||
store.UserStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerUserAccessTokenStore struct {
|
||||
UserAccessTokenStore
|
||||
store.UserAccessTokenStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerUserTermsOfServiceStore struct {
|
||||
UserTermsOfServiceStore
|
||||
store.UserTermsOfServiceStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
type OpenTracingLayerWebhookStore struct {
|
||||
WebhookStore
|
||||
store.WebhookStore
|
||||
Root *OpenTracingLayer
|
||||
}
|
||||
|
||||
@@ -792,7 +793,7 @@ func (s *OpenTracingLayerChannelStore) GetAllChannelMembersNotifyPropsForChannel
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetAllChannels(page int, perPage int, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetAllChannels(page int, perPage int, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetAllChannels")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -810,7 +811,7 @@ func (s *OpenTracingLayerChannelStore) GetAllChannels(page int, perPage int, opt
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) GetAllChannelsCount(opts ChannelSearchOpts) (int64, error) {
|
||||
func (s *OpenTracingLayerChannelStore) GetAllChannelsCount(opts store.ChannelSearchOpts) (int64, error) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.GetAllChannelsCount")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -1899,7 +1900,7 @@ func (s *OpenTracingLayerChannelStore) SaveMultipleMembers(members []*model.Chan
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerChannelStore) SearchAllChannels(term string, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
|
||||
func (s *OpenTracingLayerChannelStore) SearchAllChannels(term string, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "ChannelStore.SearchAllChannels")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -8042,7 +8043,7 @@ func (s *OpenTracingLayerUserStore) GetProfileByGroupChannelIdsForUser(userId st
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *OpenTracingLayerUserStore) GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
|
||||
func (s *OpenTracingLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
|
||||
origCtx := s.Root.Store.Context()
|
||||
span, newCtx := tracing.StartSpanWithParentByContext(s.Root.Store.Context(), "UserStore.GetProfileByIds")
|
||||
s.Root.Store.SetContext(newCtx)
|
||||
@@ -9443,7 +9444,7 @@ func (s *OpenTracingLayer) UnlockFromMaster() {
|
||||
s.Store.UnlockFromMaster()
|
||||
}
|
||||
|
||||
func NewOpenTracingLayer(childStore Store, ctx context.Context) *OpenTracingLayer {
|
||||
func New(childStore store.Store, ctx context.Context) *OpenTracingLayer {
|
||||
newStore := OpenTracingLayer{
|
||||
Store: childStore,
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
// Code generated by "make store-layers"
|
||||
// DO NOT EDIT
|
||||
|
||||
package store
|
||||
package timerlayer
|
||||
|
||||
import (
|
||||
"context"
|
||||
@@ -12,320 +12,321 @@ import (
|
||||
|
||||
"github.com/mattermost/mattermost-server/v5/einterfaces"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
)
|
||||
|
||||
type TimerLayer struct {
|
||||
Store
|
||||
store.Store
|
||||
Metrics einterfaces.MetricsInterface
|
||||
AuditStore AuditStore
|
||||
BotStore BotStore
|
||||
ChannelStore ChannelStore
|
||||
ChannelMemberHistoryStore ChannelMemberHistoryStore
|
||||
ClusterDiscoveryStore ClusterDiscoveryStore
|
||||
CommandStore CommandStore
|
||||
CommandWebhookStore CommandWebhookStore
|
||||
ComplianceStore ComplianceStore
|
||||
EmojiStore EmojiStore
|
||||
FileInfoStore FileInfoStore
|
||||
GroupStore GroupStore
|
||||
JobStore JobStore
|
||||
LicenseStore LicenseStore
|
||||
LinkMetadataStore LinkMetadataStore
|
||||
OAuthStore OAuthStore
|
||||
PluginStore PluginStore
|
||||
PostStore PostStore
|
||||
PreferenceStore PreferenceStore
|
||||
ReactionStore ReactionStore
|
||||
RoleStore RoleStore
|
||||
SchemeStore SchemeStore
|
||||
SessionStore SessionStore
|
||||
StatusStore StatusStore
|
||||
SystemStore SystemStore
|
||||
TeamStore TeamStore
|
||||
TermsOfServiceStore TermsOfServiceStore
|
||||
TokenStore TokenStore
|
||||
UserStore UserStore
|
||||
UserAccessTokenStore UserAccessTokenStore
|
||||
UserTermsOfServiceStore UserTermsOfServiceStore
|
||||
WebhookStore WebhookStore
|
||||
AuditStore store.AuditStore
|
||||
BotStore store.BotStore
|
||||
ChannelStore store.ChannelStore
|
||||
ChannelMemberHistoryStore store.ChannelMemberHistoryStore
|
||||
ClusterDiscoveryStore store.ClusterDiscoveryStore
|
||||
CommandStore store.CommandStore
|
||||
CommandWebhookStore store.CommandWebhookStore
|
||||
ComplianceStore store.ComplianceStore
|
||||
EmojiStore store.EmojiStore
|
||||
FileInfoStore store.FileInfoStore
|
||||
GroupStore store.GroupStore
|
||||
JobStore store.JobStore
|
||||
LicenseStore store.LicenseStore
|
||||
LinkMetadataStore store.LinkMetadataStore
|
||||
OAuthStore store.OAuthStore
|
||||
PluginStore store.PluginStore
|
||||
PostStore store.PostStore
|
||||
PreferenceStore store.PreferenceStore
|
||||
ReactionStore store.ReactionStore
|
||||
RoleStore store.RoleStore
|
||||
SchemeStore store.SchemeStore
|
||||
SessionStore store.SessionStore
|
||||
StatusStore store.StatusStore
|
||||
SystemStore store.SystemStore
|
||||
TeamStore store.TeamStore
|
||||
TermsOfServiceStore store.TermsOfServiceStore
|
||||
TokenStore store.TokenStore
|
||||
UserStore store.UserStore
|
||||
UserAccessTokenStore store.UserAccessTokenStore
|
||||
UserTermsOfServiceStore store.UserTermsOfServiceStore
|
||||
WebhookStore store.WebhookStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Audit() AuditStore {
|
||||
func (s *TimerLayer) Audit() store.AuditStore {
|
||||
return s.AuditStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Bot() BotStore {
|
||||
func (s *TimerLayer) Bot() store.BotStore {
|
||||
return s.BotStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Channel() ChannelStore {
|
||||
func (s *TimerLayer) Channel() store.ChannelStore {
|
||||
return s.ChannelStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) ChannelMemberHistory() ChannelMemberHistoryStore {
|
||||
func (s *TimerLayer) ChannelMemberHistory() store.ChannelMemberHistoryStore {
|
||||
return s.ChannelMemberHistoryStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) ClusterDiscovery() ClusterDiscoveryStore {
|
||||
func (s *TimerLayer) ClusterDiscovery() store.ClusterDiscoveryStore {
|
||||
return s.ClusterDiscoveryStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Command() CommandStore {
|
||||
func (s *TimerLayer) Command() store.CommandStore {
|
||||
return s.CommandStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) CommandWebhook() CommandWebhookStore {
|
||||
func (s *TimerLayer) CommandWebhook() store.CommandWebhookStore {
|
||||
return s.CommandWebhookStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Compliance() ComplianceStore {
|
||||
func (s *TimerLayer) Compliance() store.ComplianceStore {
|
||||
return s.ComplianceStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Emoji() EmojiStore {
|
||||
func (s *TimerLayer) Emoji() store.EmojiStore {
|
||||
return s.EmojiStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) FileInfo() FileInfoStore {
|
||||
func (s *TimerLayer) FileInfo() store.FileInfoStore {
|
||||
return s.FileInfoStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Group() GroupStore {
|
||||
func (s *TimerLayer) Group() store.GroupStore {
|
||||
return s.GroupStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Job() JobStore {
|
||||
func (s *TimerLayer) Job() store.JobStore {
|
||||
return s.JobStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) License() LicenseStore {
|
||||
func (s *TimerLayer) License() store.LicenseStore {
|
||||
return s.LicenseStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) LinkMetadata() LinkMetadataStore {
|
||||
func (s *TimerLayer) LinkMetadata() store.LinkMetadataStore {
|
||||
return s.LinkMetadataStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) OAuth() OAuthStore {
|
||||
func (s *TimerLayer) OAuth() store.OAuthStore {
|
||||
return s.OAuthStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Plugin() PluginStore {
|
||||
func (s *TimerLayer) Plugin() store.PluginStore {
|
||||
return s.PluginStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Post() PostStore {
|
||||
func (s *TimerLayer) Post() store.PostStore {
|
||||
return s.PostStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Preference() PreferenceStore {
|
||||
func (s *TimerLayer) Preference() store.PreferenceStore {
|
||||
return s.PreferenceStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Reaction() ReactionStore {
|
||||
func (s *TimerLayer) Reaction() store.ReactionStore {
|
||||
return s.ReactionStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Role() RoleStore {
|
||||
func (s *TimerLayer) Role() store.RoleStore {
|
||||
return s.RoleStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Scheme() SchemeStore {
|
||||
func (s *TimerLayer) Scheme() store.SchemeStore {
|
||||
return s.SchemeStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Session() SessionStore {
|
||||
func (s *TimerLayer) Session() store.SessionStore {
|
||||
return s.SessionStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Status() StatusStore {
|
||||
func (s *TimerLayer) Status() store.StatusStore {
|
||||
return s.StatusStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) System() SystemStore {
|
||||
func (s *TimerLayer) System() store.SystemStore {
|
||||
return s.SystemStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Team() TeamStore {
|
||||
func (s *TimerLayer) Team() store.TeamStore {
|
||||
return s.TeamStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) TermsOfService() TermsOfServiceStore {
|
||||
func (s *TimerLayer) TermsOfService() store.TermsOfServiceStore {
|
||||
return s.TermsOfServiceStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Token() TokenStore {
|
||||
func (s *TimerLayer) Token() store.TokenStore {
|
||||
return s.TokenStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) User() UserStore {
|
||||
func (s *TimerLayer) User() store.UserStore {
|
||||
return s.UserStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) UserAccessToken() UserAccessTokenStore {
|
||||
func (s *TimerLayer) UserAccessToken() store.UserAccessTokenStore {
|
||||
return s.UserAccessTokenStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) UserTermsOfService() UserTermsOfServiceStore {
|
||||
func (s *TimerLayer) UserTermsOfService() store.UserTermsOfServiceStore {
|
||||
return s.UserTermsOfServiceStore
|
||||
}
|
||||
|
||||
func (s *TimerLayer) Webhook() WebhookStore {
|
||||
func (s *TimerLayer) Webhook() store.WebhookStore {
|
||||
return s.WebhookStore
|
||||
}
|
||||
|
||||
type TimerLayerAuditStore struct {
|
||||
AuditStore
|
||||
store.AuditStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerBotStore struct {
|
||||
BotStore
|
||||
store.BotStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerChannelStore struct {
|
||||
ChannelStore
|
||||
store.ChannelStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerChannelMemberHistoryStore struct {
|
||||
ChannelMemberHistoryStore
|
||||
store.ChannelMemberHistoryStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerClusterDiscoveryStore struct {
|
||||
ClusterDiscoveryStore
|
||||
store.ClusterDiscoveryStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerCommandStore struct {
|
||||
CommandStore
|
||||
store.CommandStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerCommandWebhookStore struct {
|
||||
CommandWebhookStore
|
||||
store.CommandWebhookStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerComplianceStore struct {
|
||||
ComplianceStore
|
||||
store.ComplianceStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerEmojiStore struct {
|
||||
EmojiStore
|
||||
store.EmojiStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerFileInfoStore struct {
|
||||
FileInfoStore
|
||||
store.FileInfoStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerGroupStore struct {
|
||||
GroupStore
|
||||
store.GroupStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerJobStore struct {
|
||||
JobStore
|
||||
store.JobStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerLicenseStore struct {
|
||||
LicenseStore
|
||||
store.LicenseStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerLinkMetadataStore struct {
|
||||
LinkMetadataStore
|
||||
store.LinkMetadataStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerOAuthStore struct {
|
||||
OAuthStore
|
||||
store.OAuthStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerPluginStore struct {
|
||||
PluginStore
|
||||
store.PluginStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerPostStore struct {
|
||||
PostStore
|
||||
store.PostStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerPreferenceStore struct {
|
||||
PreferenceStore
|
||||
store.PreferenceStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerReactionStore struct {
|
||||
ReactionStore
|
||||
store.ReactionStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerRoleStore struct {
|
||||
RoleStore
|
||||
store.RoleStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerSchemeStore struct {
|
||||
SchemeStore
|
||||
store.SchemeStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerSessionStore struct {
|
||||
SessionStore
|
||||
store.SessionStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerStatusStore struct {
|
||||
StatusStore
|
||||
store.StatusStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerSystemStore struct {
|
||||
SystemStore
|
||||
store.SystemStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerTeamStore struct {
|
||||
TeamStore
|
||||
store.TeamStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerTermsOfServiceStore struct {
|
||||
TermsOfServiceStore
|
||||
store.TermsOfServiceStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerTokenStore struct {
|
||||
TokenStore
|
||||
store.TokenStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerUserStore struct {
|
||||
UserStore
|
||||
store.UserStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerUserAccessTokenStore struct {
|
||||
UserAccessTokenStore
|
||||
store.UserAccessTokenStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerUserTermsOfServiceStore struct {
|
||||
UserTermsOfServiceStore
|
||||
store.UserTermsOfServiceStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
type TimerLayerWebhookStore struct {
|
||||
WebhookStore
|
||||
store.WebhookStore
|
||||
Root *TimerLayer
|
||||
}
|
||||
|
||||
@@ -744,7 +745,7 @@ func (s *TimerLayerChannelStore) GetAllChannelMembersNotifyPropsForChannel(chann
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetAllChannels(page int, perPage int, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, error) {
|
||||
func (s *TimerLayerChannelStore) GetAllChannels(page int, perPage int, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ChannelStore.GetAllChannels(page, perPage, opts)
|
||||
@@ -760,7 +761,7 @@ func (s *TimerLayerChannelStore) GetAllChannels(page int, perPage int, opts Chan
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) GetAllChannelsCount(opts ChannelSearchOpts) (int64, error) {
|
||||
func (s *TimerLayerChannelStore) GetAllChannelsCount(opts store.ChannelSearchOpts) (int64, error) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.ChannelStore.GetAllChannelsCount(opts)
|
||||
@@ -1761,7 +1762,7 @@ func (s *TimerLayerChannelStore) SaveMultipleMembers(members []*model.ChannelMem
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerChannelStore) SearchAllChannels(term string, opts ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
|
||||
func (s *TimerLayerChannelStore) SearchAllChannels(term string, opts store.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1, resultVar2 := s.ChannelStore.SearchAllChannels(term, opts)
|
||||
@@ -7271,7 +7272,7 @@ func (s *TimerLayerUserStore) GetProfileByGroupChannelIdsForUser(userId string,
|
||||
return resultVar0, resultVar1
|
||||
}
|
||||
|
||||
func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
|
||||
func (s *TimerLayerUserStore) GetProfileByIds(userIds []string, options *store.UserGetByIdsOpts, allowFromCache bool) ([]*model.User, *model.AppError) {
|
||||
start := timemodule.Now()
|
||||
|
||||
resultVar0, resultVar1 := s.UserStore.GetProfileByIds(userIds, options, allowFromCache)
|
||||
@@ -8538,7 +8539,7 @@ func (s *TimerLayer) UnlockFromMaster() {
|
||||
s.Store.UnlockFromMaster()
|
||||
}
|
||||
|
||||
func NewTimerLayer(childStore Store, metrics einterfaces.MetricsInterface) *TimerLayer {
|
||||
func New(childStore store.Store, metrics einterfaces.MetricsInterface) *TimerLayer {
|
||||
newStore := TimerLayer{
|
||||
Store: childStore,
|
||||
Metrics: metrics,
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"github.com/mattermost/mattermost-server/v5/mlog"
|
||||
"github.com/mattermost/mattermost-server/v5/model"
|
||||
"github.com/mattermost/mattermost-server/v5/services/tracing"
|
||||
"github.com/mattermost/mattermost-server/v5/store"
|
||||
"github.com/mattermost/mattermost-server/v5/store/opentracinglayer"
|
||||
"github.com/mattermost/mattermost-server/v5/utils"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
"github.com/opentracing/opentracing-go/ext"
|
||||
@@ -138,7 +138,7 @@ func (h Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
tmpSrv := app.Server{}
|
||||
tmpSrv = *c.App.Srv()
|
||||
tmpSrv.Store = store.NewOpenTracingLayer(c.App.Srv().Store, ctx)
|
||||
tmpSrv.Store = opentracinglayer.New(c.App.Srv().Store, ctx)
|
||||
c.App.SetServer(&tmpSrv)
|
||||
c.App = app_opentracing.NewOpenTracingAppLayer(c.App, ctx)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user