github.com/masterhung0112/hk_server/v5@v5.0.0-20220302090640-ec71aef15e1c/app/opentracing/opentracing_layer.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 // Code generated by "make app-layers" 5 // DO NOT EDIT 6 7 package opentracing 8 9 import ( 10 "archive/zip" 11 "bytes" 12 "context" 13 "crypto/ecdsa" 14 "io" 15 "mime/multipart" 16 "net/http" 17 "net/url" 18 "reflect" 19 "time" 20 21 "github.com/dyatlov/go-opengraph/opengraph" 22 "github.com/masterhung0112/hk_server/v5/app" 23 "github.com/masterhung0112/hk_server/v5/app/request" 24 "github.com/masterhung0112/hk_server/v5/audit" 25 "github.com/masterhung0112/hk_server/v5/einterfaces" 26 "github.com/masterhung0112/hk_server/v5/model" 27 "github.com/masterhung0112/hk_server/v5/plugin" 28 "github.com/masterhung0112/hk_server/v5/services/httpservice" 29 "github.com/masterhung0112/hk_server/v5/services/imageproxy" 30 "github.com/masterhung0112/hk_server/v5/services/remotecluster" 31 "github.com/masterhung0112/hk_server/v5/services/searchengine" 32 "github.com/masterhung0112/hk_server/v5/services/timezones" 33 "github.com/masterhung0112/hk_server/v5/services/tracing" 34 "github.com/masterhung0112/hk_server/v5/shared/filestore" 35 "github.com/masterhung0112/hk_server/v5/shared/i18n" 36 "github.com/masterhung0112/hk_server/v5/shared/mlog" 37 "github.com/masterhung0112/hk_server/v5/store" 38 "github.com/opentracing/opentracing-go/ext" 39 spanlog "github.com/opentracing/opentracing-go/log" 40 ) 41 42 type OpenTracingAppLayer struct { 43 app app.AppIface 44 45 srv *app.Server 46 47 log *mlog.Logger 48 notificationsLog *mlog.Logger 49 50 accountMigration einterfaces.AccountMigrationInterface 51 cluster einterfaces.ClusterInterface 52 compliance einterfaces.ComplianceInterface 53 dataRetention einterfaces.DataRetentionInterface 54 searchEngine *searchengine.Broker 55 ldap einterfaces.LdapInterface 56 messageExport einterfaces.MessageExportInterface 57 metrics einterfaces.MetricsInterface 58 notification einterfaces.NotificationInterface 59 saml einterfaces.SamlInterface 60 61 httpService httpservice.HTTPService 62 imageProxy *imageproxy.ImageProxy 63 timezones *timezones.Timezones 64 65 ctx context.Context 66 } 67 68 func (a *OpenTracingAppLayer) ActivateMfa(userID string, token string) *model.AppError { 69 origCtx := a.ctx 70 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ActivateMfa") 71 72 a.ctx = newCtx 73 a.app.Srv().Store.SetContext(newCtx) 74 defer func() { 75 a.app.Srv().Store.SetContext(origCtx) 76 a.ctx = origCtx 77 }() 78 79 defer span.Finish() 80 resultVar0 := a.app.ActivateMfa(userID, token) 81 82 if resultVar0 != nil { 83 span.LogFields(spanlog.Error(resultVar0)) 84 ext.Error.Set(span, true) 85 } 86 87 return resultVar0 88 } 89 90 func (a *OpenTracingAppLayer) AddChannelMember(c *request.Context, userID string, channel *model.Channel, opts app.ChannelMemberOpts) (*model.ChannelMember, *model.AppError) { 91 origCtx := a.ctx 92 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddChannelMember") 93 94 a.ctx = newCtx 95 a.app.Srv().Store.SetContext(newCtx) 96 defer func() { 97 a.app.Srv().Store.SetContext(origCtx) 98 a.ctx = origCtx 99 }() 100 101 defer span.Finish() 102 resultVar0, resultVar1 := a.app.AddChannelMember(c, userID, channel, opts) 103 104 if resultVar1 != nil { 105 span.LogFields(spanlog.Error(resultVar1)) 106 ext.Error.Set(span, true) 107 } 108 109 return resultVar0, resultVar1 110 } 111 112 func (a *OpenTracingAppLayer) AddChannelsToRetentionPolicy(policyID string, channelIDs []string) *model.AppError { 113 origCtx := a.ctx 114 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddChannelsToRetentionPolicy") 115 116 a.ctx = newCtx 117 a.app.Srv().Store.SetContext(newCtx) 118 defer func() { 119 a.app.Srv().Store.SetContext(origCtx) 120 a.ctx = origCtx 121 }() 122 123 defer span.Finish() 124 resultVar0 := a.app.AddChannelsToRetentionPolicy(policyID, channelIDs) 125 126 if resultVar0 != nil { 127 span.LogFields(spanlog.Error(resultVar0)) 128 ext.Error.Set(span, true) 129 } 130 131 return resultVar0 132 } 133 134 func (a *OpenTracingAppLayer) AddConfigListener(listener func(*model.Config, *model.Config)) string { 135 origCtx := a.ctx 136 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddConfigListener") 137 138 a.ctx = newCtx 139 a.app.Srv().Store.SetContext(newCtx) 140 defer func() { 141 a.app.Srv().Store.SetContext(origCtx) 142 a.ctx = origCtx 143 }() 144 145 defer span.Finish() 146 resultVar0 := a.app.AddConfigListener(listener) 147 148 return resultVar0 149 } 150 151 func (a *OpenTracingAppLayer) AddCursorIdsForPostList(originalList *model.PostList, afterPost string, beforePost string, since int64, page int, perPage int, collapsedThreads bool) { 152 origCtx := a.ctx 153 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddCursorIdsForPostList") 154 155 a.ctx = newCtx 156 a.app.Srv().Store.SetContext(newCtx) 157 defer func() { 158 a.app.Srv().Store.SetContext(origCtx) 159 a.ctx = origCtx 160 }() 161 162 defer span.Finish() 163 a.app.AddCursorIdsForPostList(originalList, afterPost, beforePost, since, page, perPage, collapsedThreads) 164 } 165 166 func (a *OpenTracingAppLayer) AddDirectChannels(teamID string, user *model.User) *model.AppError { 167 origCtx := a.ctx 168 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddDirectChannels") 169 170 a.ctx = newCtx 171 a.app.Srv().Store.SetContext(newCtx) 172 defer func() { 173 a.app.Srv().Store.SetContext(origCtx) 174 a.ctx = origCtx 175 }() 176 177 defer span.Finish() 178 resultVar0 := a.app.AddDirectChannels(teamID, user) 179 180 if resultVar0 != nil { 181 span.LogFields(spanlog.Error(resultVar0)) 182 ext.Error.Set(span, true) 183 } 184 185 return resultVar0 186 } 187 188 func (a *OpenTracingAppLayer) AddLdapPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 189 origCtx := a.ctx 190 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddLdapPrivateCertificate") 191 192 a.ctx = newCtx 193 a.app.Srv().Store.SetContext(newCtx) 194 defer func() { 195 a.app.Srv().Store.SetContext(origCtx) 196 a.ctx = origCtx 197 }() 198 199 defer span.Finish() 200 resultVar0 := a.app.AddLdapPrivateCertificate(fileData) 201 202 if resultVar0 != nil { 203 span.LogFields(spanlog.Error(resultVar0)) 204 ext.Error.Set(span, true) 205 } 206 207 return resultVar0 208 } 209 210 func (a *OpenTracingAppLayer) AddLdapPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 211 origCtx := a.ctx 212 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddLdapPublicCertificate") 213 214 a.ctx = newCtx 215 a.app.Srv().Store.SetContext(newCtx) 216 defer func() { 217 a.app.Srv().Store.SetContext(origCtx) 218 a.ctx = origCtx 219 }() 220 221 defer span.Finish() 222 resultVar0 := a.app.AddLdapPublicCertificate(fileData) 223 224 if resultVar0 != nil { 225 span.LogFields(spanlog.Error(resultVar0)) 226 ext.Error.Set(span, true) 227 } 228 229 return resultVar0 230 } 231 232 func (a *OpenTracingAppLayer) AddPublicKey(name string, key io.Reader) *model.AppError { 233 origCtx := a.ctx 234 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddPublicKey") 235 236 a.ctx = newCtx 237 a.app.Srv().Store.SetContext(newCtx) 238 defer func() { 239 a.app.Srv().Store.SetContext(origCtx) 240 a.ctx = origCtx 241 }() 242 243 defer span.Finish() 244 resultVar0 := a.app.AddPublicKey(name, key) 245 246 if resultVar0 != nil { 247 span.LogFields(spanlog.Error(resultVar0)) 248 ext.Error.Set(span, true) 249 } 250 251 return resultVar0 252 } 253 254 func (a *OpenTracingAppLayer) AddRemoteCluster(rc *model.RemoteCluster) (*model.RemoteCluster, *model.AppError) { 255 origCtx := a.ctx 256 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddRemoteCluster") 257 258 a.ctx = newCtx 259 a.app.Srv().Store.SetContext(newCtx) 260 defer func() { 261 a.app.Srv().Store.SetContext(origCtx) 262 a.ctx = origCtx 263 }() 264 265 defer span.Finish() 266 resultVar0, resultVar1 := a.app.AddRemoteCluster(rc) 267 268 if resultVar1 != nil { 269 span.LogFields(spanlog.Error(resultVar1)) 270 ext.Error.Set(span, true) 271 } 272 273 return resultVar0, resultVar1 274 } 275 276 func (a *OpenTracingAppLayer) AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError { 277 origCtx := a.ctx 278 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlIdpCertificate") 279 280 a.ctx = newCtx 281 a.app.Srv().Store.SetContext(newCtx) 282 defer func() { 283 a.app.Srv().Store.SetContext(origCtx) 284 a.ctx = origCtx 285 }() 286 287 defer span.Finish() 288 resultVar0 := a.app.AddSamlIdpCertificate(fileData) 289 290 if resultVar0 != nil { 291 span.LogFields(spanlog.Error(resultVar0)) 292 ext.Error.Set(span, true) 293 } 294 295 return resultVar0 296 } 297 298 func (a *OpenTracingAppLayer) AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 299 origCtx := a.ctx 300 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPrivateCertificate") 301 302 a.ctx = newCtx 303 a.app.Srv().Store.SetContext(newCtx) 304 defer func() { 305 a.app.Srv().Store.SetContext(origCtx) 306 a.ctx = origCtx 307 }() 308 309 defer span.Finish() 310 resultVar0 := a.app.AddSamlPrivateCertificate(fileData) 311 312 if resultVar0 != nil { 313 span.LogFields(spanlog.Error(resultVar0)) 314 ext.Error.Set(span, true) 315 } 316 317 return resultVar0 318 } 319 320 func (a *OpenTracingAppLayer) AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 321 origCtx := a.ctx 322 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPublicCertificate") 323 324 a.ctx = newCtx 325 a.app.Srv().Store.SetContext(newCtx) 326 defer func() { 327 a.app.Srv().Store.SetContext(origCtx) 328 a.ctx = origCtx 329 }() 330 331 defer span.Finish() 332 resultVar0 := a.app.AddSamlPublicCertificate(fileData) 333 334 if resultVar0 != nil { 335 span.LogFields(spanlog.Error(resultVar0)) 336 ext.Error.Set(span, true) 337 } 338 339 return resultVar0 340 } 341 342 func (a *OpenTracingAppLayer) AddSessionToCache(session *model.Session) { 343 origCtx := a.ctx 344 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSessionToCache") 345 346 a.ctx = newCtx 347 a.app.Srv().Store.SetContext(newCtx) 348 defer func() { 349 a.app.Srv().Store.SetContext(origCtx) 350 a.ctx = origCtx 351 }() 352 353 defer span.Finish() 354 a.app.AddSessionToCache(session) 355 } 356 357 func (a *OpenTracingAppLayer) AddStatusCache(status *model.Status) { 358 origCtx := a.ctx 359 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCache") 360 361 a.ctx = newCtx 362 a.app.Srv().Store.SetContext(newCtx) 363 defer func() { 364 a.app.Srv().Store.SetContext(origCtx) 365 a.ctx = origCtx 366 }() 367 368 defer span.Finish() 369 a.app.AddStatusCache(status) 370 } 371 372 func (a *OpenTracingAppLayer) AddStatusCacheSkipClusterSend(status *model.Status) { 373 origCtx := a.ctx 374 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCacheSkipClusterSend") 375 376 a.ctx = newCtx 377 a.app.Srv().Store.SetContext(newCtx) 378 defer func() { 379 a.app.Srv().Store.SetContext(origCtx) 380 a.ctx = origCtx 381 }() 382 383 defer span.Finish() 384 a.app.AddStatusCacheSkipClusterSend(status) 385 } 386 387 func (a *OpenTracingAppLayer) AddTeamMember(c *request.Context, teamID string, userID string) (*model.TeamMember, *model.AppError) { 388 origCtx := a.ctx 389 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMember") 390 391 a.ctx = newCtx 392 a.app.Srv().Store.SetContext(newCtx) 393 defer func() { 394 a.app.Srv().Store.SetContext(origCtx) 395 a.ctx = origCtx 396 }() 397 398 defer span.Finish() 399 resultVar0, resultVar1 := a.app.AddTeamMember(c, teamID, userID) 400 401 if resultVar1 != nil { 402 span.LogFields(spanlog.Error(resultVar1)) 403 ext.Error.Set(span, true) 404 } 405 406 return resultVar0, resultVar1 407 } 408 409 func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(c *request.Context, inviteId string, userID string) (*model.TeamMember, *model.AppError) { 410 origCtx := a.ctx 411 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByInviteId") 412 413 a.ctx = newCtx 414 a.app.Srv().Store.SetContext(newCtx) 415 defer func() { 416 a.app.Srv().Store.SetContext(origCtx) 417 a.ctx = origCtx 418 }() 419 420 defer span.Finish() 421 resultVar0, resultVar1 := a.app.AddTeamMemberByInviteId(c, inviteId, userID) 422 423 if resultVar1 != nil { 424 span.LogFields(spanlog.Error(resultVar1)) 425 ext.Error.Set(span, true) 426 } 427 428 return resultVar0, resultVar1 429 } 430 431 func (a *OpenTracingAppLayer) AddTeamMemberByToken(c *request.Context, userID string, tokenID string) (*model.TeamMember, *model.AppError) { 432 origCtx := a.ctx 433 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByToken") 434 435 a.ctx = newCtx 436 a.app.Srv().Store.SetContext(newCtx) 437 defer func() { 438 a.app.Srv().Store.SetContext(origCtx) 439 a.ctx = origCtx 440 }() 441 442 defer span.Finish() 443 resultVar0, resultVar1 := a.app.AddTeamMemberByToken(c, userID, tokenID) 444 445 if resultVar1 != nil { 446 span.LogFields(spanlog.Error(resultVar1)) 447 ext.Error.Set(span, true) 448 } 449 450 return resultVar0, resultVar1 451 } 452 453 func (a *OpenTracingAppLayer) AddTeamMembers(c *request.Context, teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { 454 origCtx := a.ctx 455 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMembers") 456 457 a.ctx = newCtx 458 a.app.Srv().Store.SetContext(newCtx) 459 defer func() { 460 a.app.Srv().Store.SetContext(origCtx) 461 a.ctx = origCtx 462 }() 463 464 defer span.Finish() 465 resultVar0, resultVar1 := a.app.AddTeamMembers(c, teamID, userIDs, userRequestorId, graceful) 466 467 if resultVar1 != nil { 468 span.LogFields(spanlog.Error(resultVar1)) 469 ext.Error.Set(span, true) 470 } 471 472 return resultVar0, resultVar1 473 } 474 475 func (a *OpenTracingAppLayer) AddTeamsToRetentionPolicy(policyID string, teamIDs []string) *model.AppError { 476 origCtx := a.ctx 477 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamsToRetentionPolicy") 478 479 a.ctx = newCtx 480 a.app.Srv().Store.SetContext(newCtx) 481 defer func() { 482 a.app.Srv().Store.SetContext(origCtx) 483 a.ctx = origCtx 484 }() 485 486 defer span.Finish() 487 resultVar0 := a.app.AddTeamsToRetentionPolicy(policyID, teamIDs) 488 489 if resultVar0 != nil { 490 span.LogFields(spanlog.Error(resultVar0)) 491 ext.Error.Set(span, true) 492 } 493 494 return resultVar0 495 } 496 497 func (a *OpenTracingAppLayer) AddUserToChannel(user *model.User, channel *model.Channel, skipTeamMemberIntegrityCheck bool) (*model.ChannelMember, *model.AppError) { 498 origCtx := a.ctx 499 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToChannel") 500 501 a.ctx = newCtx 502 a.app.Srv().Store.SetContext(newCtx) 503 defer func() { 504 a.app.Srv().Store.SetContext(origCtx) 505 a.ctx = origCtx 506 }() 507 508 defer span.Finish() 509 resultVar0, resultVar1 := a.app.AddUserToChannel(user, channel, skipTeamMemberIntegrityCheck) 510 511 if resultVar1 != nil { 512 span.LogFields(spanlog.Error(resultVar1)) 513 ext.Error.Set(span, true) 514 } 515 516 return resultVar0, resultVar1 517 } 518 519 func (a *OpenTracingAppLayer) AddUserToTeam(c *request.Context, teamID string, userID string, userRequestorId string) (*model.Team, *model.TeamMember, *model.AppError) { 520 origCtx := a.ctx 521 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeam") 522 523 a.ctx = newCtx 524 a.app.Srv().Store.SetContext(newCtx) 525 defer func() { 526 a.app.Srv().Store.SetContext(origCtx) 527 a.ctx = origCtx 528 }() 529 530 defer span.Finish() 531 resultVar0, resultVar1, resultVar2 := a.app.AddUserToTeam(c, teamID, userID, userRequestorId) 532 533 if resultVar2 != nil { 534 span.LogFields(spanlog.Error(resultVar2)) 535 ext.Error.Set(span, true) 536 } 537 538 return resultVar0, resultVar1, resultVar2 539 } 540 541 func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(c *request.Context, inviteId string, userID string) (*model.Team, *model.TeamMember, *model.AppError) { 542 origCtx := a.ctx 543 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByInviteId") 544 545 a.ctx = newCtx 546 a.app.Srv().Store.SetContext(newCtx) 547 defer func() { 548 a.app.Srv().Store.SetContext(origCtx) 549 a.ctx = origCtx 550 }() 551 552 defer span.Finish() 553 resultVar0, resultVar1, resultVar2 := a.app.AddUserToTeamByInviteId(c, inviteId, userID) 554 555 if resultVar2 != nil { 556 span.LogFields(spanlog.Error(resultVar2)) 557 ext.Error.Set(span, true) 558 } 559 560 return resultVar0, resultVar1, resultVar2 561 } 562 563 func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(c *request.Context, teamID string, user *model.User) *model.AppError { 564 origCtx := a.ctx 565 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByTeamId") 566 567 a.ctx = newCtx 568 a.app.Srv().Store.SetContext(newCtx) 569 defer func() { 570 a.app.Srv().Store.SetContext(origCtx) 571 a.ctx = origCtx 572 }() 573 574 defer span.Finish() 575 resultVar0 := a.app.AddUserToTeamByTeamId(c, teamID, user) 576 577 if resultVar0 != nil { 578 span.LogFields(spanlog.Error(resultVar0)) 579 ext.Error.Set(span, true) 580 } 581 582 return resultVar0 583 } 584 585 func (a *OpenTracingAppLayer) AddUserToTeamByToken(c *request.Context, userID string, tokenID string) (*model.Team, *model.TeamMember, *model.AppError) { 586 origCtx := a.ctx 587 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByToken") 588 589 a.ctx = newCtx 590 a.app.Srv().Store.SetContext(newCtx) 591 defer func() { 592 a.app.Srv().Store.SetContext(origCtx) 593 a.ctx = origCtx 594 }() 595 596 defer span.Finish() 597 resultVar0, resultVar1, resultVar2 := a.app.AddUserToTeamByToken(c, userID, tokenID) 598 599 if resultVar2 != nil { 600 span.LogFields(spanlog.Error(resultVar2)) 601 ext.Error.Set(span, true) 602 } 603 604 return resultVar0, resultVar1, resultVar2 605 } 606 607 func (a *OpenTracingAppLayer) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) { 608 origCtx := a.ctx 609 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AdjustImage") 610 611 a.ctx = newCtx 612 a.app.Srv().Store.SetContext(newCtx) 613 defer func() { 614 a.app.Srv().Store.SetContext(origCtx) 615 a.ctx = origCtx 616 }() 617 618 defer span.Finish() 619 resultVar0, resultVar1 := a.app.AdjustImage(file) 620 621 if resultVar1 != nil { 622 span.LogFields(spanlog.Error(resultVar1)) 623 ext.Error.Set(span, true) 624 } 625 626 return resultVar0, resultVar1 627 } 628 629 func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 630 origCtx := a.ctx 631 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser") 632 633 a.ctx = newCtx 634 a.app.Srv().Store.SetContext(newCtx) 635 defer func() { 636 a.app.Srv().Store.SetContext(origCtx) 637 a.ctx = origCtx 638 }() 639 640 defer span.Finish() 641 resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userID, authRequest) 642 643 if resultVar1 != nil { 644 span.LogFields(spanlog.Error(resultVar1)) 645 ext.Error.Set(span, true) 646 } 647 648 return resultVar0, resultVar1 649 } 650 651 func (a *OpenTracingAppLayer) AppendFile(fr io.Reader, path string) (int64, *model.AppError) { 652 origCtx := a.ctx 653 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AppendFile") 654 655 a.ctx = newCtx 656 a.app.Srv().Store.SetContext(newCtx) 657 defer func() { 658 a.app.Srv().Store.SetContext(origCtx) 659 a.ctx = origCtx 660 }() 661 662 defer span.Finish() 663 resultVar0, resultVar1 := a.app.AppendFile(fr, path) 664 665 if resultVar1 != nil { 666 span.LogFields(spanlog.Error(resultVar1)) 667 ext.Error.Set(span, true) 668 } 669 670 return resultVar0, resultVar1 671 } 672 673 func (a *OpenTracingAppLayer) AsymmetricSigningKey() *ecdsa.PrivateKey { 674 origCtx := a.ctx 675 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AsymmetricSigningKey") 676 677 a.ctx = newCtx 678 a.app.Srv().Store.SetContext(newCtx) 679 defer func() { 680 a.app.Srv().Store.SetContext(origCtx) 681 a.ctx = origCtx 682 }() 683 684 defer span.Finish() 685 resultVar0 := a.app.AsymmetricSigningKey() 686 687 return resultVar0 688 } 689 690 func (a *OpenTracingAppLayer) AttachDeviceId(sessionID string, deviceID string, expiresAt int64) *model.AppError { 691 origCtx := a.ctx 692 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachDeviceId") 693 694 a.ctx = newCtx 695 a.app.Srv().Store.SetContext(newCtx) 696 defer func() { 697 a.app.Srv().Store.SetContext(origCtx) 698 a.ctx = origCtx 699 }() 700 701 defer span.Finish() 702 resultVar0 := a.app.AttachDeviceId(sessionID, deviceID, expiresAt) 703 704 if resultVar0 != nil { 705 span.LogFields(spanlog.Error(resultVar0)) 706 ext.Error.Set(span, true) 707 } 708 709 return resultVar0 710 } 711 712 func (a *OpenTracingAppLayer) AttachSessionCookies(c *request.Context, w http.ResponseWriter, r *http.Request) { 713 origCtx := a.ctx 714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachSessionCookies") 715 716 a.ctx = newCtx 717 a.app.Srv().Store.SetContext(newCtx) 718 defer func() { 719 a.app.Srv().Store.SetContext(origCtx) 720 a.ctx = origCtx 721 }() 722 723 defer span.Finish() 724 a.app.AttachSessionCookies(c, w, r) 725 } 726 727 func (a *OpenTracingAppLayer) AuthenticateUserForLogin(c *request.Context, id string, loginId string, password string, mfaToken string, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) { 728 origCtx := a.ctx 729 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthenticateUserForLogin") 730 731 a.ctx = newCtx 732 a.app.Srv().Store.SetContext(newCtx) 733 defer func() { 734 a.app.Srv().Store.SetContext(origCtx) 735 a.ctx = origCtx 736 }() 737 738 defer span.Finish() 739 resultVar0, resultVar1 := a.app.AuthenticateUserForLogin(c, id, loginId, password, mfaToken, cwsToken, ldapOnly) 740 741 if resultVar1 != nil { 742 span.LogFields(spanlog.Error(resultVar1)) 743 ext.Error.Set(span, true) 744 } 745 746 return resultVar0, resultVar1 747 } 748 749 func (a *OpenTracingAppLayer) AuthorizeOAuthUser(w http.ResponseWriter, r *http.Request, service string, code string, state string, redirectUri string) (io.ReadCloser, string, map[string]string, *model.User, *model.AppError) { 750 origCtx := a.ctx 751 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthorizeOAuthUser") 752 753 a.ctx = newCtx 754 a.app.Srv().Store.SetContext(newCtx) 755 defer func() { 756 a.app.Srv().Store.SetContext(origCtx) 757 a.ctx = origCtx 758 }() 759 760 defer span.Finish() 761 resultVar0, resultVar1, resultVar2, resultVar3, resultVar4 := a.app.AuthorizeOAuthUser(w, r, service, code, state, redirectUri) 762 763 if resultVar4 != nil { 764 span.LogFields(spanlog.Error(resultVar4)) 765 ext.Error.Set(span, true) 766 } 767 768 return resultVar0, resultVar1, resultVar2, resultVar3, resultVar4 769 } 770 771 func (a *OpenTracingAppLayer) AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { 772 origCtx := a.ctx 773 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannels") 774 775 a.ctx = newCtx 776 a.app.Srv().Store.SetContext(newCtx) 777 defer func() { 778 a.app.Srv().Store.SetContext(origCtx) 779 a.ctx = origCtx 780 }() 781 782 defer span.Finish() 783 resultVar0, resultVar1 := a.app.AutocompleteChannels(teamID, term) 784 785 if resultVar1 != nil { 786 span.LogFields(spanlog.Error(resultVar1)) 787 ext.Error.Set(span, true) 788 } 789 790 return resultVar0, resultVar1 791 } 792 793 func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { 794 origCtx := a.ctx 795 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannelsForSearch") 796 797 a.ctx = newCtx 798 a.app.Srv().Store.SetContext(newCtx) 799 defer func() { 800 a.app.Srv().Store.SetContext(origCtx) 801 a.ctx = origCtx 802 }() 803 804 defer span.Finish() 805 resultVar0, resultVar1 := a.app.AutocompleteChannelsForSearch(teamID, userID, term) 806 807 if resultVar1 != nil { 808 span.LogFields(spanlog.Error(resultVar1)) 809 ext.Error.Set(span, true) 810 } 811 812 return resultVar0, resultVar1 813 } 814 815 func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamID string, channelID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { 816 origCtx := a.ctx 817 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInChannel") 818 819 a.ctx = newCtx 820 a.app.Srv().Store.SetContext(newCtx) 821 defer func() { 822 a.app.Srv().Store.SetContext(origCtx) 823 a.ctx = origCtx 824 }() 825 826 defer span.Finish() 827 resultVar0, resultVar1 := a.app.AutocompleteUsersInChannel(teamID, channelID, term, options) 828 829 if resultVar1 != nil { 830 span.LogFields(spanlog.Error(resultVar1)) 831 ext.Error.Set(span, true) 832 } 833 834 return resultVar0, resultVar1 835 } 836 837 func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { 838 origCtx := a.ctx 839 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInTeam") 840 841 a.ctx = newCtx 842 a.app.Srv().Store.SetContext(newCtx) 843 defer func() { 844 a.app.Srv().Store.SetContext(origCtx) 845 a.ctx = origCtx 846 }() 847 848 defer span.Finish() 849 resultVar0, resultVar1 := a.app.AutocompleteUsersInTeam(teamID, term, options) 850 851 if resultVar1 != nil { 852 span.LogFields(spanlog.Error(resultVar1)) 853 ext.Error.Set(span, true) 854 } 855 856 return resultVar0, resultVar1 857 } 858 859 func (a *OpenTracingAppLayer) BroadcastStatus(status *model.Status) { 860 origCtx := a.ctx 861 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BroadcastStatus") 862 863 a.ctx = newCtx 864 a.app.Srv().Store.SetContext(newCtx) 865 defer func() { 866 a.app.Srv().Store.SetContext(origCtx) 867 a.ctx = origCtx 868 }() 869 870 defer span.Finish() 871 a.app.BroadcastStatus(status) 872 } 873 874 func (a *OpenTracingAppLayer) BuildPostReactions(postID string) (*[]app.ReactionImportData, *model.AppError) { 875 origCtx := a.ctx 876 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPostReactions") 877 878 a.ctx = newCtx 879 a.app.Srv().Store.SetContext(newCtx) 880 defer func() { 881 a.app.Srv().Store.SetContext(origCtx) 882 a.ctx = origCtx 883 }() 884 885 defer span.Finish() 886 resultVar0, resultVar1 := a.app.BuildPostReactions(postID) 887 888 if resultVar1 != nil { 889 span.LogFields(spanlog.Error(resultVar1)) 890 ext.Error.Set(span, true) 891 } 892 893 return resultVar0, resultVar1 894 } 895 896 func (a *OpenTracingAppLayer) BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, channel *model.Channel, channelName string, senderName string, explicitMention bool, channelWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError) { 897 origCtx := a.ctx 898 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPushNotificationMessage") 899 900 a.ctx = newCtx 901 a.app.Srv().Store.SetContext(newCtx) 902 defer func() { 903 a.app.Srv().Store.SetContext(origCtx) 904 a.ctx = origCtx 905 }() 906 907 defer span.Finish() 908 resultVar0, resultVar1 := a.app.BuildPushNotificationMessage(contentsConfig, post, user, channel, channelName, senderName, explicitMention, channelWideMention, replyToThreadType) 909 910 if resultVar1 != nil { 911 span.LogFields(spanlog.Error(resultVar1)) 912 ext.Error.Set(span, true) 913 } 914 915 return resultVar0, resultVar1 916 } 917 918 func (a *OpenTracingAppLayer) BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError) { 919 origCtx := a.ctx 920 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildSamlMetadataObject") 921 922 a.ctx = newCtx 923 a.app.Srv().Store.SetContext(newCtx) 924 defer func() { 925 a.app.Srv().Store.SetContext(origCtx) 926 a.ctx = origCtx 927 }() 928 929 defer span.Finish() 930 resultVar0, resultVar1 := a.app.BuildSamlMetadataObject(idpMetadata) 931 932 if resultVar1 != nil { 933 span.LogFields(spanlog.Error(resultVar1)) 934 ext.Error.Set(span, true) 935 } 936 937 return resultVar0, resultVar1 938 } 939 940 func (a *OpenTracingAppLayer) BulkExport(writer io.Writer, outPath string, opts app.BulkExportOpts) *model.AppError { 941 origCtx := a.ctx 942 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkExport") 943 944 a.ctx = newCtx 945 a.app.Srv().Store.SetContext(newCtx) 946 defer func() { 947 a.app.Srv().Store.SetContext(origCtx) 948 a.ctx = origCtx 949 }() 950 951 defer span.Finish() 952 resultVar0 := a.app.BulkExport(writer, outPath, opts) 953 954 if resultVar0 != nil { 955 span.LogFields(spanlog.Error(resultVar0)) 956 ext.Error.Set(span, true) 957 } 958 959 return resultVar0 960 } 961 962 func (a *OpenTracingAppLayer) BulkImport(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int) (*model.AppError, int) { 963 origCtx := a.ctx 964 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImport") 965 966 a.ctx = newCtx 967 a.app.Srv().Store.SetContext(newCtx) 968 defer func() { 969 a.app.Srv().Store.SetContext(origCtx) 970 a.ctx = origCtx 971 }() 972 973 defer span.Finish() 974 resultVar0, resultVar1 := a.app.BulkImport(c, jsonlReader, attachmentsReader, dryRun, workers) 975 976 if resultVar0 != nil { 977 span.LogFields(spanlog.Error(resultVar0)) 978 ext.Error.Set(span, true) 979 } 980 981 return resultVar0, resultVar1 982 } 983 984 func (a *OpenTracingAppLayer) BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) { 985 origCtx := a.ctx 986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImportWithPath") 987 988 a.ctx = newCtx 989 a.app.Srv().Store.SetContext(newCtx) 990 defer func() { 991 a.app.Srv().Store.SetContext(origCtx) 992 a.ctx = origCtx 993 }() 994 995 defer span.Finish() 996 resultVar0, resultVar1 := a.app.BulkImportWithPath(c, jsonlReader, attachmentsReader, dryRun, workers, importPath) 997 998 if resultVar0 != nil { 999 span.LogFields(spanlog.Error(resultVar0)) 1000 ext.Error.Set(span, true) 1001 } 1002 1003 return resultVar0, resultVar1 1004 } 1005 1006 func (a *OpenTracingAppLayer) CancelJob(jobId string) *model.AppError { 1007 origCtx := a.ctx 1008 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CancelJob") 1009 1010 a.ctx = newCtx 1011 a.app.Srv().Store.SetContext(newCtx) 1012 defer func() { 1013 a.app.Srv().Store.SetContext(origCtx) 1014 a.ctx = origCtx 1015 }() 1016 1017 defer span.Finish() 1018 resultVar0 := a.app.CancelJob(jobId) 1019 1020 if resultVar0 != nil { 1021 span.LogFields(spanlog.Error(resultVar0)) 1022 ext.Error.Set(span, true) 1023 } 1024 1025 return resultVar0 1026 } 1027 1028 func (a *OpenTracingAppLayer) ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 1029 origCtx := a.ctx 1030 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersMinusGroupMembers") 1031 1032 a.ctx = newCtx 1033 a.app.Srv().Store.SetContext(newCtx) 1034 defer func() { 1035 a.app.Srv().Store.SetContext(origCtx) 1036 a.ctx = origCtx 1037 }() 1038 1039 defer span.Finish() 1040 resultVar0, resultVar1, resultVar2 := a.app.ChannelMembersMinusGroupMembers(channelID, groupIDs, page, perPage) 1041 1042 if resultVar2 != nil { 1043 span.LogFields(spanlog.Error(resultVar2)) 1044 ext.Error.Set(span, true) 1045 } 1046 1047 return resultVar0, resultVar1, resultVar2 1048 } 1049 1050 func (a *OpenTracingAppLayer) ChannelMembersToAdd(since int64, channelID *string, includeRemovedMembers bool) ([]*model.UserChannelIDPair, *model.AppError) { 1051 origCtx := a.ctx 1052 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToAdd") 1053 1054 a.ctx = newCtx 1055 a.app.Srv().Store.SetContext(newCtx) 1056 defer func() { 1057 a.app.Srv().Store.SetContext(origCtx) 1058 a.ctx = origCtx 1059 }() 1060 1061 defer span.Finish() 1062 resultVar0, resultVar1 := a.app.ChannelMembersToAdd(since, channelID, includeRemovedMembers) 1063 1064 if resultVar1 != nil { 1065 span.LogFields(spanlog.Error(resultVar1)) 1066 ext.Error.Set(span, true) 1067 } 1068 1069 return resultVar0, resultVar1 1070 } 1071 1072 func (a *OpenTracingAppLayer) ChannelMembersToRemove(teamID *string) ([]*model.ChannelMember, *model.AppError) { 1073 origCtx := a.ctx 1074 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToRemove") 1075 1076 a.ctx = newCtx 1077 a.app.Srv().Store.SetContext(newCtx) 1078 defer func() { 1079 a.app.Srv().Store.SetContext(origCtx) 1080 a.ctx = origCtx 1081 }() 1082 1083 defer span.Finish() 1084 resultVar0, resultVar1 := a.app.ChannelMembersToRemove(teamID) 1085 1086 if resultVar1 != nil { 1087 span.LogFields(spanlog.Error(resultVar1)) 1088 ext.Error.Set(span, true) 1089 } 1090 1091 return resultVar0, resultVar1 1092 } 1093 1094 func (a *OpenTracingAppLayer) CheckAndSendUserLimitWarningEmails(c *request.Context) *model.AppError { 1095 origCtx := a.ctx 1096 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckAndSendUserLimitWarningEmails") 1097 1098 a.ctx = newCtx 1099 a.app.Srv().Store.SetContext(newCtx) 1100 defer func() { 1101 a.app.Srv().Store.SetContext(origCtx) 1102 a.ctx = origCtx 1103 }() 1104 1105 defer span.Finish() 1106 resultVar0 := a.app.CheckAndSendUserLimitWarningEmails(c) 1107 1108 if resultVar0 != nil { 1109 span.LogFields(spanlog.Error(resultVar0)) 1110 ext.Error.Set(span, true) 1111 } 1112 1113 return resultVar0 1114 } 1115 1116 func (a *OpenTracingAppLayer) CheckCanInviteToSharedChannel(channelId string) error { 1117 origCtx := a.ctx 1118 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckCanInviteToSharedChannel") 1119 1120 a.ctx = newCtx 1121 a.app.Srv().Store.SetContext(newCtx) 1122 defer func() { 1123 a.app.Srv().Store.SetContext(origCtx) 1124 a.ctx = origCtx 1125 }() 1126 1127 defer span.Finish() 1128 resultVar0 := a.app.CheckCanInviteToSharedChannel(channelId) 1129 1130 if resultVar0 != nil { 1131 span.LogFields(spanlog.Error(resultVar0)) 1132 ext.Error.Set(span, true) 1133 } 1134 1135 return resultVar0 1136 } 1137 1138 func (a *OpenTracingAppLayer) CheckCloudAccountAtLimit() (bool, *model.AppError) { 1139 origCtx := a.ctx 1140 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckCloudAccountAtLimit") 1141 1142 a.ctx = newCtx 1143 a.app.Srv().Store.SetContext(newCtx) 1144 defer func() { 1145 a.app.Srv().Store.SetContext(origCtx) 1146 a.ctx = origCtx 1147 }() 1148 1149 defer span.Finish() 1150 resultVar0, resultVar1 := a.app.CheckCloudAccountAtLimit() 1151 1152 if resultVar1 != nil { 1153 span.LogFields(spanlog.Error(resultVar1)) 1154 ext.Error.Set(span, true) 1155 } 1156 1157 return resultVar0, resultVar1 1158 } 1159 1160 func (a *OpenTracingAppLayer) CheckForClientSideCert(r *http.Request) (string, string, string) { 1161 origCtx := a.ctx 1162 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckForClientSideCert") 1163 1164 a.ctx = newCtx 1165 a.app.Srv().Store.SetContext(newCtx) 1166 defer func() { 1167 a.app.Srv().Store.SetContext(origCtx) 1168 a.ctx = origCtx 1169 }() 1170 1171 defer span.Finish() 1172 resultVar0, resultVar1, resultVar2 := a.app.CheckForClientSideCert(r) 1173 1174 return resultVar0, resultVar1, resultVar2 1175 } 1176 1177 func (a *OpenTracingAppLayer) CheckIntegrity() <-chan model.IntegrityCheckResult { 1178 origCtx := a.ctx 1179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckIntegrity") 1180 1181 a.ctx = newCtx 1182 a.app.Srv().Store.SetContext(newCtx) 1183 defer func() { 1184 a.app.Srv().Store.SetContext(origCtx) 1185 a.ctx = origCtx 1186 }() 1187 1188 defer span.Finish() 1189 resultVar0 := a.app.CheckIntegrity() 1190 1191 return resultVar0 1192 } 1193 1194 func (a *OpenTracingAppLayer) CheckMandatoryS3Fields(settings *model.FileSettings) *model.AppError { 1195 origCtx := a.ctx 1196 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckMandatoryS3Fields") 1197 1198 a.ctx = newCtx 1199 a.app.Srv().Store.SetContext(newCtx) 1200 defer func() { 1201 a.app.Srv().Store.SetContext(origCtx) 1202 a.ctx = origCtx 1203 }() 1204 1205 defer span.Finish() 1206 resultVar0 := a.app.CheckMandatoryS3Fields(settings) 1207 1208 if resultVar0 != nil { 1209 span.LogFields(spanlog.Error(resultVar0)) 1210 ext.Error.Set(span, true) 1211 } 1212 1213 return resultVar0 1214 } 1215 1216 func (a *OpenTracingAppLayer) CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError { 1217 origCtx := a.ctx 1218 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckPasswordAndAllCriteria") 1219 1220 a.ctx = newCtx 1221 a.app.Srv().Store.SetContext(newCtx) 1222 defer func() { 1223 a.app.Srv().Store.SetContext(origCtx) 1224 a.ctx = origCtx 1225 }() 1226 1227 defer span.Finish() 1228 resultVar0 := a.app.CheckPasswordAndAllCriteria(user, password, mfaToken) 1229 1230 if resultVar0 != nil { 1231 span.LogFields(spanlog.Error(resultVar0)) 1232 ext.Error.Set(span, true) 1233 } 1234 1235 return resultVar0 1236 } 1237 1238 func (a *OpenTracingAppLayer) CheckProviderAttributes(user *model.User, patch *model.UserPatch) string { 1239 origCtx := a.ctx 1240 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckProviderAttributes") 1241 1242 a.ctx = newCtx 1243 a.app.Srv().Store.SetContext(newCtx) 1244 defer func() { 1245 a.app.Srv().Store.SetContext(origCtx) 1246 a.ctx = origCtx 1247 }() 1248 1249 defer span.Finish() 1250 resultVar0 := a.app.CheckProviderAttributes(user, patch) 1251 1252 return resultVar0 1253 } 1254 1255 func (a *OpenTracingAppLayer) CheckRolesExist(roleNames []string) *model.AppError { 1256 origCtx := a.ctx 1257 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckRolesExist") 1258 1259 a.ctx = newCtx 1260 a.app.Srv().Store.SetContext(newCtx) 1261 defer func() { 1262 a.app.Srv().Store.SetContext(origCtx) 1263 a.ctx = origCtx 1264 }() 1265 1266 defer span.Finish() 1267 resultVar0 := a.app.CheckRolesExist(roleNames) 1268 1269 if resultVar0 != nil { 1270 span.LogFields(spanlog.Error(resultVar0)) 1271 ext.Error.Set(span, true) 1272 } 1273 1274 return resultVar0 1275 } 1276 1277 func (a *OpenTracingAppLayer) CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1278 origCtx := a.ctx 1279 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserAllAuthenticationCriteria") 1280 1281 a.ctx = newCtx 1282 a.app.Srv().Store.SetContext(newCtx) 1283 defer func() { 1284 a.app.Srv().Store.SetContext(origCtx) 1285 a.ctx = origCtx 1286 }() 1287 1288 defer span.Finish() 1289 resultVar0 := a.app.CheckUserAllAuthenticationCriteria(user, mfaToken) 1290 1291 if resultVar0 != nil { 1292 span.LogFields(spanlog.Error(resultVar0)) 1293 ext.Error.Set(span, true) 1294 } 1295 1296 return resultVar0 1297 } 1298 1299 func (a *OpenTracingAppLayer) CheckUserMfa(user *model.User, token string) *model.AppError { 1300 origCtx := a.ctx 1301 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserMfa") 1302 1303 a.ctx = newCtx 1304 a.app.Srv().Store.SetContext(newCtx) 1305 defer func() { 1306 a.app.Srv().Store.SetContext(origCtx) 1307 a.ctx = origCtx 1308 }() 1309 1310 defer span.Finish() 1311 resultVar0 := a.app.CheckUserMfa(user, token) 1312 1313 if resultVar0 != nil { 1314 span.LogFields(spanlog.Error(resultVar0)) 1315 ext.Error.Set(span, true) 1316 } 1317 1318 return resultVar0 1319 } 1320 1321 func (a *OpenTracingAppLayer) CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError { 1322 origCtx := a.ctx 1323 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPostflightAuthenticationCriteria") 1324 1325 a.ctx = newCtx 1326 a.app.Srv().Store.SetContext(newCtx) 1327 defer func() { 1328 a.app.Srv().Store.SetContext(origCtx) 1329 a.ctx = origCtx 1330 }() 1331 1332 defer span.Finish() 1333 resultVar0 := a.app.CheckUserPostflightAuthenticationCriteria(user) 1334 1335 if resultVar0 != nil { 1336 span.LogFields(spanlog.Error(resultVar0)) 1337 ext.Error.Set(span, true) 1338 } 1339 1340 return resultVar0 1341 } 1342 1343 func (a *OpenTracingAppLayer) CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1344 origCtx := a.ctx 1345 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPreflightAuthenticationCriteria") 1346 1347 a.ctx = newCtx 1348 a.app.Srv().Store.SetContext(newCtx) 1349 defer func() { 1350 a.app.Srv().Store.SetContext(origCtx) 1351 a.ctx = origCtx 1352 }() 1353 1354 defer span.Finish() 1355 resultVar0 := a.app.CheckUserPreflightAuthenticationCriteria(user, mfaToken) 1356 1357 if resultVar0 != nil { 1358 span.LogFields(spanlog.Error(resultVar0)) 1359 ext.Error.Set(span, true) 1360 } 1361 1362 return resultVar0 1363 } 1364 1365 func (a *OpenTracingAppLayer) CheckValidDomains(team *model.Team) *model.AppError { 1366 origCtx := a.ctx 1367 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckValidDomains") 1368 1369 a.ctx = newCtx 1370 a.app.Srv().Store.SetContext(newCtx) 1371 defer func() { 1372 a.app.Srv().Store.SetContext(origCtx) 1373 a.ctx = origCtx 1374 }() 1375 1376 defer span.Finish() 1377 resultVar0 := a.app.CheckValidDomains(team) 1378 1379 if resultVar0 != nil { 1380 span.LogFields(spanlog.Error(resultVar0)) 1381 ext.Error.Set(span, true) 1382 } 1383 1384 return resultVar0 1385 } 1386 1387 func (a *OpenTracingAppLayer) CheckWebConn(userID string, connectionID string) *app.CheckConnResult { 1388 origCtx := a.ctx 1389 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckWebConn") 1390 1391 a.ctx = newCtx 1392 a.app.Srv().Store.SetContext(newCtx) 1393 defer func() { 1394 a.app.Srv().Store.SetContext(origCtx) 1395 a.ctx = origCtx 1396 }() 1397 1398 defer span.Finish() 1399 resultVar0 := a.app.CheckWebConn(userID, connectionID) 1400 1401 return resultVar0 1402 } 1403 1404 func (a *OpenTracingAppLayer) ClearChannelMembersCache(channelID string) { 1405 origCtx := a.ctx 1406 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearChannelMembersCache") 1407 1408 a.ctx = newCtx 1409 a.app.Srv().Store.SetContext(newCtx) 1410 defer func() { 1411 a.app.Srv().Store.SetContext(origCtx) 1412 a.ctx = origCtx 1413 }() 1414 1415 defer span.Finish() 1416 a.app.ClearChannelMembersCache(channelID) 1417 } 1418 1419 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsers() { 1420 origCtx := a.ctx 1421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsers") 1422 1423 a.ctx = newCtx 1424 a.app.Srv().Store.SetContext(newCtx) 1425 defer func() { 1426 a.app.Srv().Store.SetContext(origCtx) 1427 a.ctx = origCtx 1428 }() 1429 1430 defer span.Finish() 1431 a.app.ClearSessionCacheForAllUsers() 1432 } 1433 1434 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsersSkipClusterSend() { 1435 origCtx := a.ctx 1436 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsersSkipClusterSend") 1437 1438 a.ctx = newCtx 1439 a.app.Srv().Store.SetContext(newCtx) 1440 defer func() { 1441 a.app.Srv().Store.SetContext(origCtx) 1442 a.ctx = origCtx 1443 }() 1444 1445 defer span.Finish() 1446 a.app.ClearSessionCacheForAllUsersSkipClusterSend() 1447 } 1448 1449 func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userID string) { 1450 origCtx := a.ctx 1451 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUser") 1452 1453 a.ctx = newCtx 1454 a.app.Srv().Store.SetContext(newCtx) 1455 defer func() { 1456 a.app.Srv().Store.SetContext(origCtx) 1457 a.ctx = origCtx 1458 }() 1459 1460 defer span.Finish() 1461 a.app.ClearSessionCacheForUser(userID) 1462 } 1463 1464 func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userID string) { 1465 origCtx := a.ctx 1466 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUserSkipClusterSend") 1467 1468 a.ctx = newCtx 1469 a.app.Srv().Store.SetContext(newCtx) 1470 defer func() { 1471 a.app.Srv().Store.SetContext(origCtx) 1472 a.ctx = origCtx 1473 }() 1474 1475 defer span.Finish() 1476 a.app.ClearSessionCacheForUserSkipClusterSend(userID) 1477 } 1478 1479 func (a *OpenTracingAppLayer) ClearTeamMembersCache(teamID string) { 1480 origCtx := a.ctx 1481 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearTeamMembersCache") 1482 1483 a.ctx = newCtx 1484 a.app.Srv().Store.SetContext(newCtx) 1485 defer func() { 1486 a.app.Srv().Store.SetContext(origCtx) 1487 a.ctx = origCtx 1488 }() 1489 1490 defer span.Finish() 1491 a.app.ClearTeamMembersCache(teamID) 1492 } 1493 1494 func (a *OpenTracingAppLayer) ClientConfig() map[string]string { 1495 origCtx := a.ctx 1496 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfig") 1497 1498 a.ctx = newCtx 1499 a.app.Srv().Store.SetContext(newCtx) 1500 defer func() { 1501 a.app.Srv().Store.SetContext(origCtx) 1502 a.ctx = origCtx 1503 }() 1504 1505 defer span.Finish() 1506 resultVar0 := a.app.ClientConfig() 1507 1508 return resultVar0 1509 } 1510 1511 func (a *OpenTracingAppLayer) ClientConfigHash() string { 1512 origCtx := a.ctx 1513 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigHash") 1514 1515 a.ctx = newCtx 1516 a.app.Srv().Store.SetContext(newCtx) 1517 defer func() { 1518 a.app.Srv().Store.SetContext(origCtx) 1519 a.ctx = origCtx 1520 }() 1521 1522 defer span.Finish() 1523 resultVar0 := a.app.ClientConfigHash() 1524 1525 return resultVar0 1526 } 1527 1528 func (a *OpenTracingAppLayer) ClientConfigWithComputed() map[string]string { 1529 origCtx := a.ctx 1530 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigWithComputed") 1531 1532 a.ctx = newCtx 1533 a.app.Srv().Store.SetContext(newCtx) 1534 defer func() { 1535 a.app.Srv().Store.SetContext(origCtx) 1536 a.ctx = origCtx 1537 }() 1538 1539 defer span.Finish() 1540 resultVar0 := a.app.ClientConfigWithComputed() 1541 1542 return resultVar0 1543 } 1544 1545 func (a *OpenTracingAppLayer) Cloud() einterfaces.CloudInterface { 1546 origCtx := a.ctx 1547 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Cloud") 1548 1549 a.ctx = newCtx 1550 a.app.Srv().Store.SetContext(newCtx) 1551 defer func() { 1552 a.app.Srv().Store.SetContext(origCtx) 1553 a.ctx = origCtx 1554 }() 1555 1556 defer span.Finish() 1557 resultVar0 := a.app.Cloud() 1558 1559 return resultVar0 1560 } 1561 1562 func (a *OpenTracingAppLayer) CompareAndDeletePluginKey(pluginID string, key string, oldValue []byte) (bool, *model.AppError) { 1563 origCtx := a.ctx 1564 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndDeletePluginKey") 1565 1566 a.ctx = newCtx 1567 a.app.Srv().Store.SetContext(newCtx) 1568 defer func() { 1569 a.app.Srv().Store.SetContext(origCtx) 1570 a.ctx = origCtx 1571 }() 1572 1573 defer span.Finish() 1574 resultVar0, resultVar1 := a.app.CompareAndDeletePluginKey(pluginID, key, oldValue) 1575 1576 if resultVar1 != nil { 1577 span.LogFields(spanlog.Error(resultVar1)) 1578 ext.Error.Set(span, true) 1579 } 1580 1581 return resultVar0, resultVar1 1582 } 1583 1584 func (a *OpenTracingAppLayer) CompareAndSetPluginKey(pluginID string, key string, oldValue []byte, newValue []byte) (bool, *model.AppError) { 1585 origCtx := a.ctx 1586 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndSetPluginKey") 1587 1588 a.ctx = newCtx 1589 a.app.Srv().Store.SetContext(newCtx) 1590 defer func() { 1591 a.app.Srv().Store.SetContext(origCtx) 1592 a.ctx = origCtx 1593 }() 1594 1595 defer span.Finish() 1596 resultVar0, resultVar1 := a.app.CompareAndSetPluginKey(pluginID, key, oldValue, newValue) 1597 1598 if resultVar1 != nil { 1599 span.LogFields(spanlog.Error(resultVar1)) 1600 ext.Error.Set(span, true) 1601 } 1602 1603 return resultVar0, resultVar1 1604 } 1605 1606 func (a *OpenTracingAppLayer) CompleteOAuth(c *request.Context, service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { 1607 origCtx := a.ctx 1608 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth") 1609 1610 a.ctx = newCtx 1611 a.app.Srv().Store.SetContext(newCtx) 1612 defer func() { 1613 a.app.Srv().Store.SetContext(origCtx) 1614 a.ctx = origCtx 1615 }() 1616 1617 defer span.Finish() 1618 resultVar0, resultVar1 := a.app.CompleteOAuth(c, service, body, teamID, props, tokenUser) 1619 1620 if resultVar1 != nil { 1621 span.LogFields(spanlog.Error(resultVar1)) 1622 ext.Error.Set(span, true) 1623 } 1624 1625 return resultVar0, resultVar1 1626 } 1627 1628 func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) { 1629 origCtx := a.ctx 1630 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteSwitchWithOAuth") 1631 1632 a.ctx = newCtx 1633 a.app.Srv().Store.SetContext(newCtx) 1634 defer func() { 1635 a.app.Srv().Store.SetContext(origCtx) 1636 a.ctx = origCtx 1637 }() 1638 1639 defer span.Finish() 1640 resultVar0, resultVar1 := a.app.CompleteSwitchWithOAuth(service, userData, email, tokenUser) 1641 1642 if resultVar1 != nil { 1643 span.LogFields(spanlog.Error(resultVar1)) 1644 ext.Error.Set(span, true) 1645 } 1646 1647 return resultVar0, resultVar1 1648 } 1649 1650 func (a *OpenTracingAppLayer) Config() *model.Config { 1651 origCtx := a.ctx 1652 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Config") 1653 1654 a.ctx = newCtx 1655 a.app.Srv().Store.SetContext(newCtx) 1656 defer func() { 1657 a.app.Srv().Store.SetContext(origCtx) 1658 a.ctx = origCtx 1659 }() 1660 1661 defer span.Finish() 1662 resultVar0 := a.app.Config() 1663 1664 return resultVar0 1665 } 1666 1667 func (a *OpenTracingAppLayer) ConvertBotToUser(bot *model.Bot, userPatch *model.UserPatch, sysadmin bool) (*model.User, *model.AppError) { 1668 origCtx := a.ctx 1669 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertBotToUser") 1670 1671 a.ctx = newCtx 1672 a.app.Srv().Store.SetContext(newCtx) 1673 defer func() { 1674 a.app.Srv().Store.SetContext(origCtx) 1675 a.ctx = origCtx 1676 }() 1677 1678 defer span.Finish() 1679 resultVar0, resultVar1 := a.app.ConvertBotToUser(bot, userPatch, sysadmin) 1680 1681 if resultVar1 != nil { 1682 span.LogFields(spanlog.Error(resultVar1)) 1683 ext.Error.Set(span, true) 1684 } 1685 1686 return resultVar0, resultVar1 1687 } 1688 1689 func (a *OpenTracingAppLayer) ConvertUserToBot(user *model.User) (*model.Bot, *model.AppError) { 1690 origCtx := a.ctx 1691 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertUserToBot") 1692 1693 a.ctx = newCtx 1694 a.app.Srv().Store.SetContext(newCtx) 1695 defer func() { 1696 a.app.Srv().Store.SetContext(origCtx) 1697 a.ctx = origCtx 1698 }() 1699 1700 defer span.Finish() 1701 resultVar0, resultVar1 := a.app.ConvertUserToBot(user) 1702 1703 if resultVar1 != nil { 1704 span.LogFields(spanlog.Error(resultVar1)) 1705 ext.Error.Set(span, true) 1706 } 1707 1708 return resultVar0, resultVar1 1709 } 1710 1711 func (a *OpenTracingAppLayer) CopyFileInfos(userID string, fileIDs []string) ([]string, *model.AppError) { 1712 origCtx := a.ctx 1713 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CopyFileInfos") 1714 1715 a.ctx = newCtx 1716 a.app.Srv().Store.SetContext(newCtx) 1717 defer func() { 1718 a.app.Srv().Store.SetContext(origCtx) 1719 a.ctx = origCtx 1720 }() 1721 1722 defer span.Finish() 1723 resultVar0, resultVar1 := a.app.CopyFileInfos(userID, fileIDs) 1724 1725 if resultVar1 != nil { 1726 span.LogFields(spanlog.Error(resultVar1)) 1727 ext.Error.Set(span, true) 1728 } 1729 1730 return resultVar0, resultVar1 1731 } 1732 1733 func (a *OpenTracingAppLayer) CreateBot(c *request.Context, bot *model.Bot) (*model.Bot, *model.AppError) { 1734 origCtx := a.ctx 1735 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBot") 1736 1737 a.ctx = newCtx 1738 a.app.Srv().Store.SetContext(newCtx) 1739 defer func() { 1740 a.app.Srv().Store.SetContext(origCtx) 1741 a.ctx = origCtx 1742 }() 1743 1744 defer span.Finish() 1745 resultVar0, resultVar1 := a.app.CreateBot(c, bot) 1746 1747 if resultVar1 != nil { 1748 span.LogFields(spanlog.Error(resultVar1)) 1749 ext.Error.Set(span, true) 1750 } 1751 1752 return resultVar0, resultVar1 1753 } 1754 1755 func (a *OpenTracingAppLayer) CreateChannel(c *request.Context, channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) { 1756 origCtx := a.ctx 1757 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannel") 1758 1759 a.ctx = newCtx 1760 a.app.Srv().Store.SetContext(newCtx) 1761 defer func() { 1762 a.app.Srv().Store.SetContext(origCtx) 1763 a.ctx = origCtx 1764 }() 1765 1766 defer span.Finish() 1767 resultVar0, resultVar1 := a.app.CreateChannel(c, channel, addMember) 1768 1769 if resultVar1 != nil { 1770 span.LogFields(spanlog.Error(resultVar1)) 1771 ext.Error.Set(span, true) 1772 } 1773 1774 return resultVar0, resultVar1 1775 } 1776 1777 func (a *OpenTracingAppLayer) CreateChannelScheme(channel *model.Channel) (*model.Scheme, *model.AppError) { 1778 origCtx := a.ctx 1779 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelScheme") 1780 1781 a.ctx = newCtx 1782 a.app.Srv().Store.SetContext(newCtx) 1783 defer func() { 1784 a.app.Srv().Store.SetContext(origCtx) 1785 a.ctx = origCtx 1786 }() 1787 1788 defer span.Finish() 1789 resultVar0, resultVar1 := a.app.CreateChannelScheme(channel) 1790 1791 if resultVar1 != nil { 1792 span.LogFields(spanlog.Error(resultVar1)) 1793 ext.Error.Set(span, true) 1794 } 1795 1796 return resultVar0, resultVar1 1797 } 1798 1799 func (a *OpenTracingAppLayer) CreateChannelWithUser(c *request.Context, channel *model.Channel, userID string) (*model.Channel, *model.AppError) { 1800 origCtx := a.ctx 1801 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelWithUser") 1802 1803 a.ctx = newCtx 1804 a.app.Srv().Store.SetContext(newCtx) 1805 defer func() { 1806 a.app.Srv().Store.SetContext(origCtx) 1807 a.ctx = origCtx 1808 }() 1809 1810 defer span.Finish() 1811 resultVar0, resultVar1 := a.app.CreateChannelWithUser(c, channel, userID) 1812 1813 if resultVar1 != nil { 1814 span.LogFields(spanlog.Error(resultVar1)) 1815 ext.Error.Set(span, true) 1816 } 1817 1818 return resultVar0, resultVar1 1819 } 1820 1821 func (a *OpenTracingAppLayer) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) { 1822 origCtx := a.ctx 1823 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommand") 1824 1825 a.ctx = newCtx 1826 a.app.Srv().Store.SetContext(newCtx) 1827 defer func() { 1828 a.app.Srv().Store.SetContext(origCtx) 1829 a.ctx = origCtx 1830 }() 1831 1832 defer span.Finish() 1833 resultVar0, resultVar1 := a.app.CreateCommand(cmd) 1834 1835 if resultVar1 != nil { 1836 span.LogFields(spanlog.Error(resultVar1)) 1837 ext.Error.Set(span, true) 1838 } 1839 1840 return resultVar0, resultVar1 1841 } 1842 1843 func (a *OpenTracingAppLayer) CreateCommandPost(c *request.Context, post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { 1844 origCtx := a.ctx 1845 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandPost") 1846 1847 a.ctx = newCtx 1848 a.app.Srv().Store.SetContext(newCtx) 1849 defer func() { 1850 a.app.Srv().Store.SetContext(origCtx) 1851 a.ctx = origCtx 1852 }() 1853 1854 span.SetTag("teamID", teamID) 1855 1856 span.SetTag("skipSlackParsing", skipSlackParsing) 1857 1858 defer span.Finish() 1859 resultVar0, resultVar1 := a.app.CreateCommandPost(c, post, teamID, response, skipSlackParsing) 1860 1861 if resultVar1 != nil { 1862 span.LogFields(spanlog.Error(resultVar1)) 1863 ext.Error.Set(span, true) 1864 } 1865 1866 return resultVar0, resultVar1 1867 } 1868 1869 func (a *OpenTracingAppLayer) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { 1870 origCtx := a.ctx 1871 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandWebhook") 1872 1873 a.ctx = newCtx 1874 a.app.Srv().Store.SetContext(newCtx) 1875 defer func() { 1876 a.app.Srv().Store.SetContext(origCtx) 1877 a.ctx = origCtx 1878 }() 1879 1880 defer span.Finish() 1881 resultVar0, resultVar1 := a.app.CreateCommandWebhook(commandID, args) 1882 1883 if resultVar1 != nil { 1884 span.LogFields(spanlog.Error(resultVar1)) 1885 ext.Error.Set(span, true) 1886 } 1887 1888 return resultVar0, resultVar1 1889 } 1890 1891 func (a *OpenTracingAppLayer) CreateDefaultChannels(c *request.Context, teamID string) ([]*model.Channel, *model.AppError) { 1892 origCtx := a.ctx 1893 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultChannels") 1894 1895 a.ctx = newCtx 1896 a.app.Srv().Store.SetContext(newCtx) 1897 defer func() { 1898 a.app.Srv().Store.SetContext(origCtx) 1899 a.ctx = origCtx 1900 }() 1901 1902 defer span.Finish() 1903 resultVar0, resultVar1 := a.app.CreateDefaultChannels(c, teamID) 1904 1905 if resultVar1 != nil { 1906 span.LogFields(spanlog.Error(resultVar1)) 1907 ext.Error.Set(span, true) 1908 } 1909 1910 return resultVar0, resultVar1 1911 } 1912 1913 func (a *OpenTracingAppLayer) CreateDefaultMemberships(c *request.Context, since int64, includeRemovedMembers bool) error { 1914 origCtx := a.ctx 1915 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultMemberships") 1916 1917 a.ctx = newCtx 1918 a.app.Srv().Store.SetContext(newCtx) 1919 defer func() { 1920 a.app.Srv().Store.SetContext(origCtx) 1921 a.ctx = origCtx 1922 }() 1923 1924 defer span.Finish() 1925 resultVar0 := a.app.CreateDefaultMemberships(c, since, includeRemovedMembers) 1926 1927 if resultVar0 != nil { 1928 span.LogFields(spanlog.Error(resultVar0)) 1929 ext.Error.Set(span, true) 1930 } 1931 1932 return resultVar0 1933 } 1934 1935 func (a *OpenTracingAppLayer) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) { 1936 origCtx := a.ctx 1937 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateEmoji") 1938 1939 a.ctx = newCtx 1940 a.app.Srv().Store.SetContext(newCtx) 1941 defer func() { 1942 a.app.Srv().Store.SetContext(origCtx) 1943 a.ctx = origCtx 1944 }() 1945 1946 defer span.Finish() 1947 resultVar0, resultVar1 := a.app.CreateEmoji(sessionUserId, emoji, multiPartImageData) 1948 1949 if resultVar1 != nil { 1950 span.LogFields(spanlog.Error(resultVar1)) 1951 ext.Error.Set(span, true) 1952 } 1953 1954 return resultVar0, resultVar1 1955 } 1956 1957 func (a *OpenTracingAppLayer) CreateGroup(group *model.Group) (*model.Group, *model.AppError) { 1958 origCtx := a.ctx 1959 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroup") 1960 1961 a.ctx = newCtx 1962 a.app.Srv().Store.SetContext(newCtx) 1963 defer func() { 1964 a.app.Srv().Store.SetContext(origCtx) 1965 a.ctx = origCtx 1966 }() 1967 1968 defer span.Finish() 1969 resultVar0, resultVar1 := a.app.CreateGroup(group) 1970 1971 if resultVar1 != nil { 1972 span.LogFields(spanlog.Error(resultVar1)) 1973 ext.Error.Set(span, true) 1974 } 1975 1976 return resultVar0, resultVar1 1977 } 1978 1979 func (a *OpenTracingAppLayer) CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError) { 1980 origCtx := a.ctx 1981 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroupChannel") 1982 1983 a.ctx = newCtx 1984 a.app.Srv().Store.SetContext(newCtx) 1985 defer func() { 1986 a.app.Srv().Store.SetContext(origCtx) 1987 a.ctx = origCtx 1988 }() 1989 1990 defer span.Finish() 1991 resultVar0, resultVar1 := a.app.CreateGroupChannel(userIDs, creatorId) 1992 1993 if resultVar1 != nil { 1994 span.LogFields(spanlog.Error(resultVar1)) 1995 ext.Error.Set(span, true) 1996 } 1997 1998 return resultVar0, resultVar1 1999 } 2000 2001 func (a *OpenTracingAppLayer) CreateGuest(c *request.Context, user *model.User) (*model.User, *model.AppError) { 2002 origCtx := a.ctx 2003 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGuest") 2004 2005 a.ctx = newCtx 2006 a.app.Srv().Store.SetContext(newCtx) 2007 defer func() { 2008 a.app.Srv().Store.SetContext(origCtx) 2009 a.ctx = origCtx 2010 }() 2011 2012 defer span.Finish() 2013 resultVar0, resultVar1 := a.app.CreateGuest(c, user) 2014 2015 if resultVar1 != nil { 2016 span.LogFields(spanlog.Error(resultVar1)) 2017 ext.Error.Set(span, true) 2018 } 2019 2020 return resultVar0, resultVar1 2021 } 2022 2023 func (a *OpenTracingAppLayer) CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 2024 origCtx := a.ctx 2025 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateIncomingWebhookForChannel") 2026 2027 a.ctx = newCtx 2028 a.app.Srv().Store.SetContext(newCtx) 2029 defer func() { 2030 a.app.Srv().Store.SetContext(origCtx) 2031 a.ctx = origCtx 2032 }() 2033 2034 defer span.Finish() 2035 resultVar0, resultVar1 := a.app.CreateIncomingWebhookForChannel(creatorId, channel, hook) 2036 2037 if resultVar1 != nil { 2038 span.LogFields(spanlog.Error(resultVar1)) 2039 ext.Error.Set(span, true) 2040 } 2041 2042 return resultVar0, resultVar1 2043 } 2044 2045 func (a *OpenTracingAppLayer) CreateJob(job *model.Job) (*model.Job, *model.AppError) { 2046 origCtx := a.ctx 2047 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateJob") 2048 2049 a.ctx = newCtx 2050 a.app.Srv().Store.SetContext(newCtx) 2051 defer func() { 2052 a.app.Srv().Store.SetContext(origCtx) 2053 a.ctx = origCtx 2054 }() 2055 2056 defer span.Finish() 2057 resultVar0, resultVar1 := a.app.CreateJob(job) 2058 2059 if resultVar1 != nil { 2060 span.LogFields(spanlog.Error(resultVar1)) 2061 ext.Error.Set(span, true) 2062 } 2063 2064 return resultVar0, resultVar1 2065 } 2066 2067 func (a *OpenTracingAppLayer) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 2068 origCtx := a.ctx 2069 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthApp") 2070 2071 a.ctx = newCtx 2072 a.app.Srv().Store.SetContext(newCtx) 2073 defer func() { 2074 a.app.Srv().Store.SetContext(origCtx) 2075 a.ctx = origCtx 2076 }() 2077 2078 defer span.Finish() 2079 resultVar0, resultVar1 := a.app.CreateOAuthApp(app) 2080 2081 if resultVar1 != nil { 2082 span.LogFields(spanlog.Error(resultVar1)) 2083 ext.Error.Set(span, true) 2084 } 2085 2086 return resultVar0, resultVar1 2087 } 2088 2089 func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) { 2090 origCtx := a.ctx 2091 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthStateToken") 2092 2093 a.ctx = newCtx 2094 a.app.Srv().Store.SetContext(newCtx) 2095 defer func() { 2096 a.app.Srv().Store.SetContext(origCtx) 2097 a.ctx = origCtx 2098 }() 2099 2100 defer span.Finish() 2101 resultVar0, resultVar1 := a.app.CreateOAuthStateToken(extra) 2102 2103 if resultVar1 != nil { 2104 span.LogFields(spanlog.Error(resultVar1)) 2105 ext.Error.Set(span, true) 2106 } 2107 2108 return resultVar0, resultVar1 2109 } 2110 2111 func (a *OpenTracingAppLayer) CreateOAuthUser(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { 2112 origCtx := a.ctx 2113 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser") 2114 2115 a.ctx = newCtx 2116 a.app.Srv().Store.SetContext(newCtx) 2117 defer func() { 2118 a.app.Srv().Store.SetContext(origCtx) 2119 a.ctx = origCtx 2120 }() 2121 2122 defer span.Finish() 2123 resultVar0, resultVar1 := a.app.CreateOAuthUser(c, service, userData, teamID, tokenUser) 2124 2125 if resultVar1 != nil { 2126 span.LogFields(spanlog.Error(resultVar1)) 2127 ext.Error.Set(span, true) 2128 } 2129 2130 return resultVar0, resultVar1 2131 } 2132 2133 func (a *OpenTracingAppLayer) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 2134 origCtx := a.ctx 2135 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOutgoingWebhook") 2136 2137 a.ctx = newCtx 2138 a.app.Srv().Store.SetContext(newCtx) 2139 defer func() { 2140 a.app.Srv().Store.SetContext(origCtx) 2141 a.ctx = origCtx 2142 }() 2143 2144 defer span.Finish() 2145 resultVar0, resultVar1 := a.app.CreateOutgoingWebhook(hook) 2146 2147 if resultVar1 != nil { 2148 span.LogFields(spanlog.Error(resultVar1)) 2149 ext.Error.Set(span, true) 2150 } 2151 2152 return resultVar0, resultVar1 2153 } 2154 2155 func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userID string, email string) (*model.Token, *model.AppError) { 2156 origCtx := a.ctx 2157 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePasswordRecoveryToken") 2158 2159 a.ctx = newCtx 2160 a.app.Srv().Store.SetContext(newCtx) 2161 defer func() { 2162 a.app.Srv().Store.SetContext(origCtx) 2163 a.ctx = origCtx 2164 }() 2165 2166 defer span.Finish() 2167 resultVar0, resultVar1 := a.app.CreatePasswordRecoveryToken(userID, email) 2168 2169 if resultVar1 != nil { 2170 span.LogFields(spanlog.Error(resultVar1)) 2171 ext.Error.Set(span, true) 2172 } 2173 2174 return resultVar0, resultVar1 2175 } 2176 2177 func (a *OpenTracingAppLayer) CreatePost(c *request.Context, post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError) { 2178 origCtx := a.ctx 2179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePost") 2180 2181 a.ctx = newCtx 2182 a.app.Srv().Store.SetContext(newCtx) 2183 defer func() { 2184 a.app.Srv().Store.SetContext(origCtx) 2185 a.ctx = origCtx 2186 }() 2187 2188 defer span.Finish() 2189 resultVar0, resultVar1 := a.app.CreatePost(c, post, channel, triggerWebhooks, setOnline) 2190 2191 if resultVar1 != nil { 2192 span.LogFields(spanlog.Error(resultVar1)) 2193 ext.Error.Set(span, true) 2194 } 2195 2196 return resultVar0, resultVar1 2197 } 2198 2199 func (a *OpenTracingAppLayer) CreatePostAsUser(c *request.Context, post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError) { 2200 origCtx := a.ctx 2201 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostAsUser") 2202 2203 a.ctx = newCtx 2204 a.app.Srv().Store.SetContext(newCtx) 2205 defer func() { 2206 a.app.Srv().Store.SetContext(origCtx) 2207 a.ctx = origCtx 2208 }() 2209 2210 defer span.Finish() 2211 resultVar0, resultVar1 := a.app.CreatePostAsUser(c, post, currentSessionId, setOnline) 2212 2213 if resultVar1 != nil { 2214 span.LogFields(spanlog.Error(resultVar1)) 2215 ext.Error.Set(span, true) 2216 } 2217 2218 return resultVar0, resultVar1 2219 } 2220 2221 func (a *OpenTracingAppLayer) CreatePostMissingChannel(c *request.Context, post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) { 2222 origCtx := a.ctx 2223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostMissingChannel") 2224 2225 a.ctx = newCtx 2226 a.app.Srv().Store.SetContext(newCtx) 2227 defer func() { 2228 a.app.Srv().Store.SetContext(origCtx) 2229 a.ctx = origCtx 2230 }() 2231 2232 defer span.Finish() 2233 resultVar0, resultVar1 := a.app.CreatePostMissingChannel(c, post, triggerWebhooks) 2234 2235 if resultVar1 != nil { 2236 span.LogFields(spanlog.Error(resultVar1)) 2237 ext.Error.Set(span, true) 2238 } 2239 2240 return resultVar0, resultVar1 2241 } 2242 2243 func (a *OpenTracingAppLayer) CreateRetentionPolicy(policy *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError) { 2244 origCtx := a.ctx 2245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateRetentionPolicy") 2246 2247 a.ctx = newCtx 2248 a.app.Srv().Store.SetContext(newCtx) 2249 defer func() { 2250 a.app.Srv().Store.SetContext(origCtx) 2251 a.ctx = origCtx 2252 }() 2253 2254 defer span.Finish() 2255 resultVar0, resultVar1 := a.app.CreateRetentionPolicy(policy) 2256 2257 if resultVar1 != nil { 2258 span.LogFields(spanlog.Error(resultVar1)) 2259 ext.Error.Set(span, true) 2260 } 2261 2262 return resultVar0, resultVar1 2263 } 2264 2265 func (a *OpenTracingAppLayer) CreateRole(role *model.Role) (*model.Role, *model.AppError) { 2266 origCtx := a.ctx 2267 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateRole") 2268 2269 a.ctx = newCtx 2270 a.app.Srv().Store.SetContext(newCtx) 2271 defer func() { 2272 a.app.Srv().Store.SetContext(origCtx) 2273 a.ctx = origCtx 2274 }() 2275 2276 defer span.Finish() 2277 resultVar0, resultVar1 := a.app.CreateRole(role) 2278 2279 if resultVar1 != nil { 2280 span.LogFields(spanlog.Error(resultVar1)) 2281 ext.Error.Set(span, true) 2282 } 2283 2284 return resultVar0, resultVar1 2285 } 2286 2287 func (a *OpenTracingAppLayer) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 2288 origCtx := a.ctx 2289 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateScheme") 2290 2291 a.ctx = newCtx 2292 a.app.Srv().Store.SetContext(newCtx) 2293 defer func() { 2294 a.app.Srv().Store.SetContext(origCtx) 2295 a.ctx = origCtx 2296 }() 2297 2298 defer span.Finish() 2299 resultVar0, resultVar1 := a.app.CreateScheme(scheme) 2300 2301 if resultVar1 != nil { 2302 span.LogFields(spanlog.Error(resultVar1)) 2303 ext.Error.Set(span, true) 2304 } 2305 2306 return resultVar0, resultVar1 2307 } 2308 2309 func (a *OpenTracingAppLayer) CreateSession(session *model.Session) (*model.Session, *model.AppError) { 2310 origCtx := a.ctx 2311 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSession") 2312 2313 a.ctx = newCtx 2314 a.app.Srv().Store.SetContext(newCtx) 2315 defer func() { 2316 a.app.Srv().Store.SetContext(origCtx) 2317 a.ctx = origCtx 2318 }() 2319 2320 defer span.Finish() 2321 resultVar0, resultVar1 := a.app.CreateSession(session) 2322 2323 if resultVar1 != nil { 2324 span.LogFields(spanlog.Error(resultVar1)) 2325 ext.Error.Set(span, true) 2326 } 2327 2328 return resultVar0, resultVar1 2329 } 2330 2331 func (a *OpenTracingAppLayer) CreateSidebarCategory(userID string, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { 2332 origCtx := a.ctx 2333 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSidebarCategory") 2334 2335 a.ctx = newCtx 2336 a.app.Srv().Store.SetContext(newCtx) 2337 defer func() { 2338 a.app.Srv().Store.SetContext(origCtx) 2339 a.ctx = origCtx 2340 }() 2341 2342 defer span.Finish() 2343 resultVar0, resultVar1 := a.app.CreateSidebarCategory(userID, teamID, newCategory) 2344 2345 if resultVar1 != nil { 2346 span.LogFields(spanlog.Error(resultVar1)) 2347 ext.Error.Set(span, true) 2348 } 2349 2350 return resultVar0, resultVar1 2351 } 2352 2353 func (a *OpenTracingAppLayer) CreateTeam(c *request.Context, team *model.Team) (*model.Team, *model.AppError) { 2354 origCtx := a.ctx 2355 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeam") 2356 2357 a.ctx = newCtx 2358 a.app.Srv().Store.SetContext(newCtx) 2359 defer func() { 2360 a.app.Srv().Store.SetContext(origCtx) 2361 a.ctx = origCtx 2362 }() 2363 2364 defer span.Finish() 2365 resultVar0, resultVar1 := a.app.CreateTeam(c, team) 2366 2367 if resultVar1 != nil { 2368 span.LogFields(spanlog.Error(resultVar1)) 2369 ext.Error.Set(span, true) 2370 } 2371 2372 return resultVar0, resultVar1 2373 } 2374 2375 func (a *OpenTracingAppLayer) CreateTeamWithUser(c *request.Context, team *model.Team, userID string) (*model.Team, *model.AppError) { 2376 origCtx := a.ctx 2377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeamWithUser") 2378 2379 a.ctx = newCtx 2380 a.app.Srv().Store.SetContext(newCtx) 2381 defer func() { 2382 a.app.Srv().Store.SetContext(origCtx) 2383 a.ctx = origCtx 2384 }() 2385 2386 defer span.Finish() 2387 resultVar0, resultVar1 := a.app.CreateTeamWithUser(c, team, userID) 2388 2389 if resultVar1 != nil { 2390 span.LogFields(spanlog.Error(resultVar1)) 2391 ext.Error.Set(span, true) 2392 } 2393 2394 return resultVar0, resultVar1 2395 } 2396 2397 func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userID string) (*model.TermsOfService, *model.AppError) { 2398 origCtx := a.ctx 2399 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTermsOfService") 2400 2401 a.ctx = newCtx 2402 a.app.Srv().Store.SetContext(newCtx) 2403 defer func() { 2404 a.app.Srv().Store.SetContext(origCtx) 2405 a.ctx = origCtx 2406 }() 2407 2408 defer span.Finish() 2409 resultVar0, resultVar1 := a.app.CreateTermsOfService(text, userID) 2410 2411 if resultVar1 != nil { 2412 span.LogFields(spanlog.Error(resultVar1)) 2413 ext.Error.Set(span, true) 2414 } 2415 2416 return resultVar0, resultVar1 2417 } 2418 2419 func (a *OpenTracingAppLayer) CreateTrackPoint(trackPoint *model.TrackPoint) (*model.TrackPoint, *model.AppError) { 2420 origCtx := a.ctx 2421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTrackPoint") 2422 2423 a.ctx = newCtx 2424 a.app.Srv().Store.SetContext(newCtx) 2425 defer func() { 2426 a.app.Srv().Store.SetContext(origCtx) 2427 a.ctx = origCtx 2428 }() 2429 2430 defer span.Finish() 2431 resultVar0, resultVar1 := a.app.CreateTrackPoint(trackPoint) 2432 2433 if resultVar1 != nil { 2434 span.LogFields(spanlog.Error(resultVar1)) 2435 ext.Error.Set(span, true) 2436 } 2437 2438 return resultVar0, resultVar1 2439 } 2440 2441 func (a *OpenTracingAppLayer) CreateTrackPointForTrackRecord(trackPoint *model.TrackPoint, trackRecordId string) (*model.TrackPoint, *model.AppError) { 2442 origCtx := a.ctx 2443 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTrackPointForTrackRecord") 2444 2445 a.ctx = newCtx 2446 a.app.Srv().Store.SetContext(newCtx) 2447 defer func() { 2448 a.app.Srv().Store.SetContext(origCtx) 2449 a.ctx = origCtx 2450 }() 2451 2452 defer span.Finish() 2453 resultVar0, resultVar1 := a.app.CreateTrackPointForTrackRecord(trackPoint, trackRecordId) 2454 2455 if resultVar1 != nil { 2456 span.LogFields(spanlog.Error(resultVar1)) 2457 ext.Error.Set(span, true) 2458 } 2459 2460 return resultVar0, resultVar1 2461 } 2462 2463 func (a *OpenTracingAppLayer) CreateTrackRecord(trackRecord *model.TrackRecord) (*model.TrackRecord, *model.AppError) { 2464 origCtx := a.ctx 2465 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTrackRecord") 2466 2467 a.ctx = newCtx 2468 a.app.Srv().Store.SetContext(newCtx) 2469 defer func() { 2470 a.app.Srv().Store.SetContext(origCtx) 2471 a.ctx = origCtx 2472 }() 2473 2474 defer span.Finish() 2475 resultVar0, resultVar1 := a.app.CreateTrackRecord(trackRecord) 2476 2477 if resultVar1 != nil { 2478 span.LogFields(spanlog.Error(resultVar1)) 2479 ext.Error.Set(span, true) 2480 } 2481 2482 return resultVar0, resultVar1 2483 } 2484 2485 func (a *OpenTracingAppLayer) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, *model.AppError) { 2486 origCtx := a.ctx 2487 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUploadSession") 2488 2489 a.ctx = newCtx 2490 a.app.Srv().Store.SetContext(newCtx) 2491 defer func() { 2492 a.app.Srv().Store.SetContext(origCtx) 2493 a.ctx = origCtx 2494 }() 2495 2496 defer span.Finish() 2497 resultVar0, resultVar1 := a.app.CreateUploadSession(us) 2498 2499 if resultVar1 != nil { 2500 span.LogFields(spanlog.Error(resultVar1)) 2501 ext.Error.Set(span, true) 2502 } 2503 2504 return resultVar0, resultVar1 2505 } 2506 2507 func (a *OpenTracingAppLayer) CreateUser(c *request.Context, user *model.User) (*model.User, *model.AppError) { 2508 origCtx := a.ctx 2509 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUser") 2510 2511 a.ctx = newCtx 2512 a.app.Srv().Store.SetContext(newCtx) 2513 defer func() { 2514 a.app.Srv().Store.SetContext(origCtx) 2515 a.ctx = origCtx 2516 }() 2517 2518 defer span.Finish() 2519 resultVar0, resultVar1 := a.app.CreateUser(c, user) 2520 2521 if resultVar1 != nil { 2522 span.LogFields(spanlog.Error(resultVar1)) 2523 ext.Error.Set(span, true) 2524 } 2525 2526 return resultVar0, resultVar1 2527 } 2528 2529 func (a *OpenTracingAppLayer) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) { 2530 origCtx := a.ctx 2531 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAccessToken") 2532 2533 a.ctx = newCtx 2534 a.app.Srv().Store.SetContext(newCtx) 2535 defer func() { 2536 a.app.Srv().Store.SetContext(origCtx) 2537 a.ctx = origCtx 2538 }() 2539 2540 defer span.Finish() 2541 resultVar0, resultVar1 := a.app.CreateUserAccessToken(token) 2542 2543 if resultVar1 != nil { 2544 span.LogFields(spanlog.Error(resultVar1)) 2545 ext.Error.Set(span, true) 2546 } 2547 2548 return resultVar0, resultVar1 2549 } 2550 2551 func (a *OpenTracingAppLayer) CreateUserAsAdmin(c *request.Context, user *model.User, redirect string) (*model.User, *model.AppError) { 2552 origCtx := a.ctx 2553 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAsAdmin") 2554 2555 a.ctx = newCtx 2556 a.app.Srv().Store.SetContext(newCtx) 2557 defer func() { 2558 a.app.Srv().Store.SetContext(origCtx) 2559 a.ctx = origCtx 2560 }() 2561 2562 defer span.Finish() 2563 resultVar0, resultVar1 := a.app.CreateUserAsAdmin(c, user, redirect) 2564 2565 if resultVar1 != nil { 2566 span.LogFields(spanlog.Error(resultVar1)) 2567 ext.Error.Set(span, true) 2568 } 2569 2570 return resultVar0, resultVar1 2571 } 2572 2573 func (a *OpenTracingAppLayer) CreateUserFromSignup(c *request.Context, user *model.User, redirect string) (*model.User, *model.AppError) { 2574 origCtx := a.ctx 2575 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserFromSignup") 2576 2577 a.ctx = newCtx 2578 a.app.Srv().Store.SetContext(newCtx) 2579 defer func() { 2580 a.app.Srv().Store.SetContext(origCtx) 2581 a.ctx = origCtx 2582 }() 2583 2584 defer span.Finish() 2585 resultVar0, resultVar1 := a.app.CreateUserFromSignup(c, user, redirect) 2586 2587 if resultVar1 != nil { 2588 span.LogFields(spanlog.Error(resultVar1)) 2589 ext.Error.Set(span, true) 2590 } 2591 2592 return resultVar0, resultVar1 2593 } 2594 2595 func (a *OpenTracingAppLayer) CreateUserWithInviteId(c *request.Context, user *model.User, inviteId string, redirect string) (*model.User, *model.AppError) { 2596 origCtx := a.ctx 2597 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithInviteId") 2598 2599 a.ctx = newCtx 2600 a.app.Srv().Store.SetContext(newCtx) 2601 defer func() { 2602 a.app.Srv().Store.SetContext(origCtx) 2603 a.ctx = origCtx 2604 }() 2605 2606 defer span.Finish() 2607 resultVar0, resultVar1 := a.app.CreateUserWithInviteId(c, user, inviteId, redirect) 2608 2609 if resultVar1 != nil { 2610 span.LogFields(spanlog.Error(resultVar1)) 2611 ext.Error.Set(span, true) 2612 } 2613 2614 return resultVar0, resultVar1 2615 } 2616 2617 func (a *OpenTracingAppLayer) CreateUserWithToken(c *request.Context, user *model.User, token *model.Token) (*model.User, *model.AppError) { 2618 origCtx := a.ctx 2619 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithToken") 2620 2621 a.ctx = newCtx 2622 a.app.Srv().Store.SetContext(newCtx) 2623 defer func() { 2624 a.app.Srv().Store.SetContext(origCtx) 2625 a.ctx = origCtx 2626 }() 2627 2628 defer span.Finish() 2629 resultVar0, resultVar1 := a.app.CreateUserWithToken(c, user, token) 2630 2631 if resultVar1 != nil { 2632 span.LogFields(spanlog.Error(resultVar1)) 2633 ext.Error.Set(span, true) 2634 } 2635 2636 return resultVar0, resultVar1 2637 } 2638 2639 func (a *OpenTracingAppLayer) CreateWebhookPost(c *request.Context, userID string, channel *model.Channel, text string, overrideUsername string, overrideIconURL string, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { 2640 origCtx := a.ctx 2641 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateWebhookPost") 2642 2643 a.ctx = newCtx 2644 a.app.Srv().Store.SetContext(newCtx) 2645 defer func() { 2646 a.app.Srv().Store.SetContext(origCtx) 2647 a.ctx = origCtx 2648 }() 2649 2650 defer span.Finish() 2651 resultVar0, resultVar1 := a.app.CreateWebhookPost(c, userID, channel, text, overrideUsername, overrideIconURL, overrideIconEmoji, props, postType, postRootId) 2652 2653 if resultVar1 != nil { 2654 span.LogFields(spanlog.Error(resultVar1)) 2655 ext.Error.Set(span, true) 2656 } 2657 2658 return resultVar0, resultVar1 2659 } 2660 2661 func (a *OpenTracingAppLayer) CreateZipFileAndAddFiles(fileBackend filestore.FileBackend, fileDatas []model.FileData, zipFileName string, directory string) error { 2662 origCtx := a.ctx 2663 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateZipFileAndAddFiles") 2664 2665 a.ctx = newCtx 2666 a.app.Srv().Store.SetContext(newCtx) 2667 defer func() { 2668 a.app.Srv().Store.SetContext(origCtx) 2669 a.ctx = origCtx 2670 }() 2671 2672 defer span.Finish() 2673 resultVar0 := a.app.CreateZipFileAndAddFiles(fileBackend, fileDatas, zipFileName, directory) 2674 2675 if resultVar0 != nil { 2676 span.LogFields(spanlog.Error(resultVar0)) 2677 ext.Error.Set(span, true) 2678 } 2679 2680 return resultVar0 2681 } 2682 2683 func (a *OpenTracingAppLayer) DBHealthCheckDelete() error { 2684 origCtx := a.ctx 2685 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DBHealthCheckDelete") 2686 2687 a.ctx = newCtx 2688 a.app.Srv().Store.SetContext(newCtx) 2689 defer func() { 2690 a.app.Srv().Store.SetContext(origCtx) 2691 a.ctx = origCtx 2692 }() 2693 2694 defer span.Finish() 2695 resultVar0 := a.app.DBHealthCheckDelete() 2696 2697 if resultVar0 != nil { 2698 span.LogFields(spanlog.Error(resultVar0)) 2699 ext.Error.Set(span, true) 2700 } 2701 2702 return resultVar0 2703 } 2704 2705 func (a *OpenTracingAppLayer) DBHealthCheckWrite() error { 2706 origCtx := a.ctx 2707 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DBHealthCheckWrite") 2708 2709 a.ctx = newCtx 2710 a.app.Srv().Store.SetContext(newCtx) 2711 defer func() { 2712 a.app.Srv().Store.SetContext(origCtx) 2713 a.ctx = origCtx 2714 }() 2715 2716 defer span.Finish() 2717 resultVar0 := a.app.DBHealthCheckWrite() 2718 2719 if resultVar0 != nil { 2720 span.LogFields(spanlog.Error(resultVar0)) 2721 ext.Error.Set(span, true) 2722 } 2723 2724 return resultVar0 2725 } 2726 2727 func (a *OpenTracingAppLayer) DeactivateGuests(c *request.Context) *model.AppError { 2728 origCtx := a.ctx 2729 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateGuests") 2730 2731 a.ctx = newCtx 2732 a.app.Srv().Store.SetContext(newCtx) 2733 defer func() { 2734 a.app.Srv().Store.SetContext(origCtx) 2735 a.ctx = origCtx 2736 }() 2737 2738 defer span.Finish() 2739 resultVar0 := a.app.DeactivateGuests(c) 2740 2741 if resultVar0 != nil { 2742 span.LogFields(spanlog.Error(resultVar0)) 2743 ext.Error.Set(span, true) 2744 } 2745 2746 return resultVar0 2747 } 2748 2749 func (a *OpenTracingAppLayer) DeactivateMfa(userID string) *model.AppError { 2750 origCtx := a.ctx 2751 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateMfa") 2752 2753 a.ctx = newCtx 2754 a.app.Srv().Store.SetContext(newCtx) 2755 defer func() { 2756 a.app.Srv().Store.SetContext(origCtx) 2757 a.ctx = origCtx 2758 }() 2759 2760 defer span.Finish() 2761 resultVar0 := a.app.DeactivateMfa(userID) 2762 2763 if resultVar0 != nil { 2764 span.LogFields(spanlog.Error(resultVar0)) 2765 ext.Error.Set(span, true) 2766 } 2767 2768 return resultVar0 2769 } 2770 2771 func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userID string, appID string) *model.AppError { 2772 origCtx := a.ctx 2773 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser") 2774 2775 a.ctx = newCtx 2776 a.app.Srv().Store.SetContext(newCtx) 2777 defer func() { 2778 a.app.Srv().Store.SetContext(origCtx) 2779 a.ctx = origCtx 2780 }() 2781 2782 defer span.Finish() 2783 resultVar0 := a.app.DeauthorizeOAuthAppForUser(userID, appID) 2784 2785 if resultVar0 != nil { 2786 span.LogFields(spanlog.Error(resultVar0)) 2787 ext.Error.Set(span, true) 2788 } 2789 2790 return resultVar0 2791 } 2792 2793 func (a *OpenTracingAppLayer) DefaultChannelNames() []string { 2794 origCtx := a.ctx 2795 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DefaultChannelNames") 2796 2797 a.ctx = newCtx 2798 a.app.Srv().Store.SetContext(newCtx) 2799 defer func() { 2800 a.app.Srv().Store.SetContext(origCtx) 2801 a.ctx = origCtx 2802 }() 2803 2804 defer span.Finish() 2805 resultVar0 := a.app.DefaultChannelNames() 2806 2807 return resultVar0 2808 } 2809 2810 func (a *OpenTracingAppLayer) DeleteAllExpiredPluginKeys() *model.AppError { 2811 origCtx := a.ctx 2812 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllExpiredPluginKeys") 2813 2814 a.ctx = newCtx 2815 a.app.Srv().Store.SetContext(newCtx) 2816 defer func() { 2817 a.app.Srv().Store.SetContext(origCtx) 2818 a.ctx = origCtx 2819 }() 2820 2821 defer span.Finish() 2822 resultVar0 := a.app.DeleteAllExpiredPluginKeys() 2823 2824 if resultVar0 != nil { 2825 span.LogFields(spanlog.Error(resultVar0)) 2826 ext.Error.Set(span, true) 2827 } 2828 2829 return resultVar0 2830 } 2831 2832 func (a *OpenTracingAppLayer) DeleteAllKeysForPlugin(pluginID string) *model.AppError { 2833 origCtx := a.ctx 2834 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllKeysForPlugin") 2835 2836 a.ctx = newCtx 2837 a.app.Srv().Store.SetContext(newCtx) 2838 defer func() { 2839 a.app.Srv().Store.SetContext(origCtx) 2840 a.ctx = origCtx 2841 }() 2842 2843 defer span.Finish() 2844 resultVar0 := a.app.DeleteAllKeysForPlugin(pluginID) 2845 2846 if resultVar0 != nil { 2847 span.LogFields(spanlog.Error(resultVar0)) 2848 ext.Error.Set(span, true) 2849 } 2850 2851 return resultVar0 2852 } 2853 2854 func (a *OpenTracingAppLayer) DeleteBotIconImage(botUserId string) *model.AppError { 2855 origCtx := a.ctx 2856 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBotIconImage") 2857 2858 a.ctx = newCtx 2859 a.app.Srv().Store.SetContext(newCtx) 2860 defer func() { 2861 a.app.Srv().Store.SetContext(origCtx) 2862 a.ctx = origCtx 2863 }() 2864 2865 defer span.Finish() 2866 resultVar0 := a.app.DeleteBotIconImage(botUserId) 2867 2868 if resultVar0 != nil { 2869 span.LogFields(spanlog.Error(resultVar0)) 2870 ext.Error.Set(span, true) 2871 } 2872 2873 return resultVar0 2874 } 2875 2876 func (a *OpenTracingAppLayer) DeleteBrandImage() *model.AppError { 2877 origCtx := a.ctx 2878 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBrandImage") 2879 2880 a.ctx = newCtx 2881 a.app.Srv().Store.SetContext(newCtx) 2882 defer func() { 2883 a.app.Srv().Store.SetContext(origCtx) 2884 a.ctx = origCtx 2885 }() 2886 2887 defer span.Finish() 2888 resultVar0 := a.app.DeleteBrandImage() 2889 2890 if resultVar0 != nil { 2891 span.LogFields(spanlog.Error(resultVar0)) 2892 ext.Error.Set(span, true) 2893 } 2894 2895 return resultVar0 2896 } 2897 2898 func (a *OpenTracingAppLayer) DeleteChannel(c *request.Context, channel *model.Channel, userID string) *model.AppError { 2899 origCtx := a.ctx 2900 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannel") 2901 2902 a.ctx = newCtx 2903 a.app.Srv().Store.SetContext(newCtx) 2904 defer func() { 2905 a.app.Srv().Store.SetContext(origCtx) 2906 a.ctx = origCtx 2907 }() 2908 2909 defer span.Finish() 2910 resultVar0 := a.app.DeleteChannel(c, channel, userID) 2911 2912 if resultVar0 != nil { 2913 span.LogFields(spanlog.Error(resultVar0)) 2914 ext.Error.Set(span, true) 2915 } 2916 2917 return resultVar0 2918 } 2919 2920 func (a *OpenTracingAppLayer) DeleteChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 2921 origCtx := a.ctx 2922 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannelScheme") 2923 2924 a.ctx = newCtx 2925 a.app.Srv().Store.SetContext(newCtx) 2926 defer func() { 2927 a.app.Srv().Store.SetContext(origCtx) 2928 a.ctx = origCtx 2929 }() 2930 2931 defer span.Finish() 2932 resultVar0, resultVar1 := a.app.DeleteChannelScheme(channel) 2933 2934 if resultVar1 != nil { 2935 span.LogFields(spanlog.Error(resultVar1)) 2936 ext.Error.Set(span, true) 2937 } 2938 2939 return resultVar0, resultVar1 2940 } 2941 2942 func (a *OpenTracingAppLayer) DeleteCommand(commandID string) *model.AppError { 2943 origCtx := a.ctx 2944 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteCommand") 2945 2946 a.ctx = newCtx 2947 a.app.Srv().Store.SetContext(newCtx) 2948 defer func() { 2949 a.app.Srv().Store.SetContext(origCtx) 2950 a.ctx = origCtx 2951 }() 2952 2953 defer span.Finish() 2954 resultVar0 := a.app.DeleteCommand(commandID) 2955 2956 if resultVar0 != nil { 2957 span.LogFields(spanlog.Error(resultVar0)) 2958 ext.Error.Set(span, true) 2959 } 2960 2961 return resultVar0 2962 } 2963 2964 func (a *OpenTracingAppLayer) DeleteEmoji(emoji *model.Emoji) *model.AppError { 2965 origCtx := a.ctx 2966 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEmoji") 2967 2968 a.ctx = newCtx 2969 a.app.Srv().Store.SetContext(newCtx) 2970 defer func() { 2971 a.app.Srv().Store.SetContext(origCtx) 2972 a.ctx = origCtx 2973 }() 2974 2975 defer span.Finish() 2976 resultVar0 := a.app.DeleteEmoji(emoji) 2977 2978 if resultVar0 != nil { 2979 span.LogFields(spanlog.Error(resultVar0)) 2980 ext.Error.Set(span, true) 2981 } 2982 2983 return resultVar0 2984 } 2985 2986 func (a *OpenTracingAppLayer) DeleteEphemeralPost(userID string, postID string) { 2987 origCtx := a.ctx 2988 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEphemeralPost") 2989 2990 a.ctx = newCtx 2991 a.app.Srv().Store.SetContext(newCtx) 2992 defer func() { 2993 a.app.Srv().Store.SetContext(origCtx) 2994 a.ctx = origCtx 2995 }() 2996 2997 defer span.Finish() 2998 a.app.DeleteEphemeralPost(userID, postID) 2999 } 3000 3001 func (a *OpenTracingAppLayer) DeleteExport(name string) *model.AppError { 3002 origCtx := a.ctx 3003 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteExport") 3004 3005 a.ctx = newCtx 3006 a.app.Srv().Store.SetContext(newCtx) 3007 defer func() { 3008 a.app.Srv().Store.SetContext(origCtx) 3009 a.ctx = origCtx 3010 }() 3011 3012 defer span.Finish() 3013 resultVar0 := a.app.DeleteExport(name) 3014 3015 if resultVar0 != nil { 3016 span.LogFields(spanlog.Error(resultVar0)) 3017 ext.Error.Set(span, true) 3018 } 3019 3020 return resultVar0 3021 } 3022 3023 func (a *OpenTracingAppLayer) DeleteFlaggedPosts(postID string) { 3024 origCtx := a.ctx 3025 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteFlaggedPosts") 3026 3027 a.ctx = newCtx 3028 a.app.Srv().Store.SetContext(newCtx) 3029 defer func() { 3030 a.app.Srv().Store.SetContext(origCtx) 3031 a.ctx = origCtx 3032 }() 3033 3034 defer span.Finish() 3035 a.app.DeleteFlaggedPosts(postID) 3036 } 3037 3038 func (a *OpenTracingAppLayer) DeleteGroup(groupID string) (*model.Group, *model.AppError) { 3039 origCtx := a.ctx 3040 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroup") 3041 3042 a.ctx = newCtx 3043 a.app.Srv().Store.SetContext(newCtx) 3044 defer func() { 3045 a.app.Srv().Store.SetContext(origCtx) 3046 a.ctx = origCtx 3047 }() 3048 3049 defer span.Finish() 3050 resultVar0, resultVar1 := a.app.DeleteGroup(groupID) 3051 3052 if resultVar1 != nil { 3053 span.LogFields(spanlog.Error(resultVar1)) 3054 ext.Error.Set(span, true) 3055 } 3056 3057 return resultVar0, resultVar1 3058 } 3059 3060 func (a *OpenTracingAppLayer) DeleteGroupConstrainedMemberships(c *request.Context) error { 3061 origCtx := a.ctx 3062 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupConstrainedMemberships") 3063 3064 a.ctx = newCtx 3065 a.app.Srv().Store.SetContext(newCtx) 3066 defer func() { 3067 a.app.Srv().Store.SetContext(origCtx) 3068 a.ctx = origCtx 3069 }() 3070 3071 defer span.Finish() 3072 resultVar0 := a.app.DeleteGroupConstrainedMemberships(c) 3073 3074 if resultVar0 != nil { 3075 span.LogFields(spanlog.Error(resultVar0)) 3076 ext.Error.Set(span, true) 3077 } 3078 3079 return resultVar0 3080 } 3081 3082 func (a *OpenTracingAppLayer) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 3083 origCtx := a.ctx 3084 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupMember") 3085 3086 a.ctx = newCtx 3087 a.app.Srv().Store.SetContext(newCtx) 3088 defer func() { 3089 a.app.Srv().Store.SetContext(origCtx) 3090 a.ctx = origCtx 3091 }() 3092 3093 defer span.Finish() 3094 resultVar0, resultVar1 := a.app.DeleteGroupMember(groupID, userID) 3095 3096 if resultVar1 != nil { 3097 span.LogFields(spanlog.Error(resultVar1)) 3098 ext.Error.Set(span, true) 3099 } 3100 3101 return resultVar0, resultVar1 3102 } 3103 3104 func (a *OpenTracingAppLayer) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 3105 origCtx := a.ctx 3106 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupSyncable") 3107 3108 a.ctx = newCtx 3109 a.app.Srv().Store.SetContext(newCtx) 3110 defer func() { 3111 a.app.Srv().Store.SetContext(origCtx) 3112 a.ctx = origCtx 3113 }() 3114 3115 defer span.Finish() 3116 resultVar0, resultVar1 := a.app.DeleteGroupSyncable(groupID, syncableID, syncableType) 3117 3118 if resultVar1 != nil { 3119 span.LogFields(spanlog.Error(resultVar1)) 3120 ext.Error.Set(span, true) 3121 } 3122 3123 return resultVar0, resultVar1 3124 } 3125 3126 func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookID string) *model.AppError { 3127 origCtx := a.ctx 3128 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteIncomingWebhook") 3129 3130 a.ctx = newCtx 3131 a.app.Srv().Store.SetContext(newCtx) 3132 defer func() { 3133 a.app.Srv().Store.SetContext(origCtx) 3134 a.ctx = origCtx 3135 }() 3136 3137 defer span.Finish() 3138 resultVar0 := a.app.DeleteIncomingWebhook(hookID) 3139 3140 if resultVar0 != nil { 3141 span.LogFields(spanlog.Error(resultVar0)) 3142 ext.Error.Set(span, true) 3143 } 3144 3145 return resultVar0 3146 } 3147 3148 func (a *OpenTracingAppLayer) DeleteOAuthApp(appID string) *model.AppError { 3149 origCtx := a.ctx 3150 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOAuthApp") 3151 3152 a.ctx = newCtx 3153 a.app.Srv().Store.SetContext(newCtx) 3154 defer func() { 3155 a.app.Srv().Store.SetContext(origCtx) 3156 a.ctx = origCtx 3157 }() 3158 3159 defer span.Finish() 3160 resultVar0 := a.app.DeleteOAuthApp(appID) 3161 3162 if resultVar0 != nil { 3163 span.LogFields(spanlog.Error(resultVar0)) 3164 ext.Error.Set(span, true) 3165 } 3166 3167 return resultVar0 3168 } 3169 3170 func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookID string) *model.AppError { 3171 origCtx := a.ctx 3172 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOutgoingWebhook") 3173 3174 a.ctx = newCtx 3175 a.app.Srv().Store.SetContext(newCtx) 3176 defer func() { 3177 a.app.Srv().Store.SetContext(origCtx) 3178 a.ctx = origCtx 3179 }() 3180 3181 defer span.Finish() 3182 resultVar0 := a.app.DeleteOutgoingWebhook(hookID) 3183 3184 if resultVar0 != nil { 3185 span.LogFields(spanlog.Error(resultVar0)) 3186 ext.Error.Set(span, true) 3187 } 3188 3189 return resultVar0 3190 } 3191 3192 func (a *OpenTracingAppLayer) DeletePluginKey(pluginID string, key string) *model.AppError { 3193 origCtx := a.ctx 3194 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePluginKey") 3195 3196 a.ctx = newCtx 3197 a.app.Srv().Store.SetContext(newCtx) 3198 defer func() { 3199 a.app.Srv().Store.SetContext(origCtx) 3200 a.ctx = origCtx 3201 }() 3202 3203 defer span.Finish() 3204 resultVar0 := a.app.DeletePluginKey(pluginID, key) 3205 3206 if resultVar0 != nil { 3207 span.LogFields(spanlog.Error(resultVar0)) 3208 ext.Error.Set(span, true) 3209 } 3210 3211 return resultVar0 3212 } 3213 3214 func (a *OpenTracingAppLayer) DeletePost(postID string, deleteByID string) (*model.Post, *model.AppError) { 3215 origCtx := a.ctx 3216 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePost") 3217 3218 a.ctx = newCtx 3219 a.app.Srv().Store.SetContext(newCtx) 3220 defer func() { 3221 a.app.Srv().Store.SetContext(origCtx) 3222 a.ctx = origCtx 3223 }() 3224 3225 defer span.Finish() 3226 resultVar0, resultVar1 := a.app.DeletePost(postID, deleteByID) 3227 3228 if resultVar1 != nil { 3229 span.LogFields(spanlog.Error(resultVar1)) 3230 ext.Error.Set(span, true) 3231 } 3232 3233 return resultVar0, resultVar1 3234 } 3235 3236 func (a *OpenTracingAppLayer) DeletePostFiles(post *model.Post) { 3237 origCtx := a.ctx 3238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePostFiles") 3239 3240 a.ctx = newCtx 3241 a.app.Srv().Store.SetContext(newCtx) 3242 defer func() { 3243 a.app.Srv().Store.SetContext(origCtx) 3244 a.ctx = origCtx 3245 }() 3246 3247 defer span.Finish() 3248 a.app.DeletePostFiles(post) 3249 } 3250 3251 func (a *OpenTracingAppLayer) DeletePreferences(userID string, preferences model.Preferences) *model.AppError { 3252 origCtx := a.ctx 3253 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePreferences") 3254 3255 a.ctx = newCtx 3256 a.app.Srv().Store.SetContext(newCtx) 3257 defer func() { 3258 a.app.Srv().Store.SetContext(origCtx) 3259 a.ctx = origCtx 3260 }() 3261 3262 defer span.Finish() 3263 resultVar0 := a.app.DeletePreferences(userID, preferences) 3264 3265 if resultVar0 != nil { 3266 span.LogFields(spanlog.Error(resultVar0)) 3267 ext.Error.Set(span, true) 3268 } 3269 3270 return resultVar0 3271 } 3272 3273 func (a *OpenTracingAppLayer) DeletePublicKey(name string) *model.AppError { 3274 origCtx := a.ctx 3275 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePublicKey") 3276 3277 a.ctx = newCtx 3278 a.app.Srv().Store.SetContext(newCtx) 3279 defer func() { 3280 a.app.Srv().Store.SetContext(origCtx) 3281 a.ctx = origCtx 3282 }() 3283 3284 defer span.Finish() 3285 resultVar0 := a.app.DeletePublicKey(name) 3286 3287 if resultVar0 != nil { 3288 span.LogFields(spanlog.Error(resultVar0)) 3289 ext.Error.Set(span, true) 3290 } 3291 3292 return resultVar0 3293 } 3294 3295 func (a *OpenTracingAppLayer) DeleteReactionForPost(c *request.Context, reaction *model.Reaction) *model.AppError { 3296 origCtx := a.ctx 3297 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteReactionForPost") 3298 3299 a.ctx = newCtx 3300 a.app.Srv().Store.SetContext(newCtx) 3301 defer func() { 3302 a.app.Srv().Store.SetContext(origCtx) 3303 a.ctx = origCtx 3304 }() 3305 3306 defer span.Finish() 3307 resultVar0 := a.app.DeleteReactionForPost(c, reaction) 3308 3309 if resultVar0 != nil { 3310 span.LogFields(spanlog.Error(resultVar0)) 3311 ext.Error.Set(span, true) 3312 } 3313 3314 return resultVar0 3315 } 3316 3317 func (a *OpenTracingAppLayer) DeleteRemoteCluster(remoteClusterId string) (bool, *model.AppError) { 3318 origCtx := a.ctx 3319 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteRemoteCluster") 3320 3321 a.ctx = newCtx 3322 a.app.Srv().Store.SetContext(newCtx) 3323 defer func() { 3324 a.app.Srv().Store.SetContext(origCtx) 3325 a.ctx = origCtx 3326 }() 3327 3328 defer span.Finish() 3329 resultVar0, resultVar1 := a.app.DeleteRemoteCluster(remoteClusterId) 3330 3331 if resultVar1 != nil { 3332 span.LogFields(spanlog.Error(resultVar1)) 3333 ext.Error.Set(span, true) 3334 } 3335 3336 return resultVar0, resultVar1 3337 } 3338 3339 func (a *OpenTracingAppLayer) DeleteRetentionPolicy(policyID string) *model.AppError { 3340 origCtx := a.ctx 3341 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteRetentionPolicy") 3342 3343 a.ctx = newCtx 3344 a.app.Srv().Store.SetContext(newCtx) 3345 defer func() { 3346 a.app.Srv().Store.SetContext(origCtx) 3347 a.ctx = origCtx 3348 }() 3349 3350 defer span.Finish() 3351 resultVar0 := a.app.DeleteRetentionPolicy(policyID) 3352 3353 if resultVar0 != nil { 3354 span.LogFields(spanlog.Error(resultVar0)) 3355 ext.Error.Set(span, true) 3356 } 3357 3358 return resultVar0 3359 } 3360 3361 func (a *OpenTracingAppLayer) DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) { 3362 origCtx := a.ctx 3363 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteScheme") 3364 3365 a.ctx = newCtx 3366 a.app.Srv().Store.SetContext(newCtx) 3367 defer func() { 3368 a.app.Srv().Store.SetContext(origCtx) 3369 a.ctx = origCtx 3370 }() 3371 3372 defer span.Finish() 3373 resultVar0, resultVar1 := a.app.DeleteScheme(schemeId) 3374 3375 if resultVar1 != nil { 3376 span.LogFields(spanlog.Error(resultVar1)) 3377 ext.Error.Set(span, true) 3378 } 3379 3380 return resultVar0, resultVar1 3381 } 3382 3383 func (a *OpenTracingAppLayer) DeleteSharedChannel(channelID string) (bool, error) { 3384 origCtx := a.ctx 3385 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSharedChannel") 3386 3387 a.ctx = newCtx 3388 a.app.Srv().Store.SetContext(newCtx) 3389 defer func() { 3390 a.app.Srv().Store.SetContext(origCtx) 3391 a.ctx = origCtx 3392 }() 3393 3394 defer span.Finish() 3395 resultVar0, resultVar1 := a.app.DeleteSharedChannel(channelID) 3396 3397 if resultVar1 != nil { 3398 span.LogFields(spanlog.Error(resultVar1)) 3399 ext.Error.Set(span, true) 3400 } 3401 3402 return resultVar0, resultVar1 3403 } 3404 3405 func (a *OpenTracingAppLayer) DeleteSharedChannelRemote(id string) (bool, error) { 3406 origCtx := a.ctx 3407 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSharedChannelRemote") 3408 3409 a.ctx = newCtx 3410 a.app.Srv().Store.SetContext(newCtx) 3411 defer func() { 3412 a.app.Srv().Store.SetContext(origCtx) 3413 a.ctx = origCtx 3414 }() 3415 3416 defer span.Finish() 3417 resultVar0, resultVar1 := a.app.DeleteSharedChannelRemote(id) 3418 3419 if resultVar1 != nil { 3420 span.LogFields(spanlog.Error(resultVar1)) 3421 ext.Error.Set(span, true) 3422 } 3423 3424 return resultVar0, resultVar1 3425 } 3426 3427 func (a *OpenTracingAppLayer) DeleteSidebarCategory(userID string, teamID string, categoryId string) *model.AppError { 3428 origCtx := a.ctx 3429 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSidebarCategory") 3430 3431 a.ctx = newCtx 3432 a.app.Srv().Store.SetContext(newCtx) 3433 defer func() { 3434 a.app.Srv().Store.SetContext(origCtx) 3435 a.ctx = origCtx 3436 }() 3437 3438 defer span.Finish() 3439 resultVar0 := a.app.DeleteSidebarCategory(userID, teamID, categoryId) 3440 3441 if resultVar0 != nil { 3442 span.LogFields(spanlog.Error(resultVar0)) 3443 ext.Error.Set(span, true) 3444 } 3445 3446 return resultVar0 3447 } 3448 3449 func (a *OpenTracingAppLayer) DeleteToken(token *model.Token) *model.AppError { 3450 origCtx := a.ctx 3451 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteToken") 3452 3453 a.ctx = newCtx 3454 a.app.Srv().Store.SetContext(newCtx) 3455 defer func() { 3456 a.app.Srv().Store.SetContext(origCtx) 3457 a.ctx = origCtx 3458 }() 3459 3460 defer span.Finish() 3461 resultVar0 := a.app.DeleteToken(token) 3462 3463 if resultVar0 != nil { 3464 span.LogFields(spanlog.Error(resultVar0)) 3465 ext.Error.Set(span, true) 3466 } 3467 3468 return resultVar0 3469 } 3470 3471 func (a *OpenTracingAppLayer) DemoteUserToGuest(user *model.User) *model.AppError { 3472 origCtx := a.ctx 3473 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DemoteUserToGuest") 3474 3475 a.ctx = newCtx 3476 a.app.Srv().Store.SetContext(newCtx) 3477 defer func() { 3478 a.app.Srv().Store.SetContext(origCtx) 3479 a.ctx = origCtx 3480 }() 3481 3482 defer span.Finish() 3483 resultVar0 := a.app.DemoteUserToGuest(user) 3484 3485 if resultVar0 != nil { 3486 span.LogFields(spanlog.Error(resultVar0)) 3487 ext.Error.Set(span, true) 3488 } 3489 3490 return resultVar0 3491 } 3492 3493 func (a *OpenTracingAppLayer) DisableAutoResponder(userID string, asAdmin bool) *model.AppError { 3494 origCtx := a.ctx 3495 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableAutoResponder") 3496 3497 a.ctx = newCtx 3498 a.app.Srv().Store.SetContext(newCtx) 3499 defer func() { 3500 a.app.Srv().Store.SetContext(origCtx) 3501 a.ctx = origCtx 3502 }() 3503 3504 defer span.Finish() 3505 resultVar0 := a.app.DisableAutoResponder(userID, asAdmin) 3506 3507 if resultVar0 != nil { 3508 span.LogFields(spanlog.Error(resultVar0)) 3509 ext.Error.Set(span, true) 3510 } 3511 3512 return resultVar0 3513 } 3514 3515 func (a *OpenTracingAppLayer) DisablePlugin(id string) *model.AppError { 3516 origCtx := a.ctx 3517 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisablePlugin") 3518 3519 a.ctx = newCtx 3520 a.app.Srv().Store.SetContext(newCtx) 3521 defer func() { 3522 a.app.Srv().Store.SetContext(origCtx) 3523 a.ctx = origCtx 3524 }() 3525 3526 defer span.Finish() 3527 resultVar0 := a.app.DisablePlugin(id) 3528 3529 if resultVar0 != nil { 3530 span.LogFields(spanlog.Error(resultVar0)) 3531 ext.Error.Set(span, true) 3532 } 3533 3534 return resultVar0 3535 } 3536 3537 func (a *OpenTracingAppLayer) DisableUserAccessToken(token *model.UserAccessToken) *model.AppError { 3538 origCtx := a.ctx 3539 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableUserAccessToken") 3540 3541 a.ctx = newCtx 3542 a.app.Srv().Store.SetContext(newCtx) 3543 defer func() { 3544 a.app.Srv().Store.SetContext(origCtx) 3545 a.ctx = origCtx 3546 }() 3547 3548 defer span.Finish() 3549 resultVar0 := a.app.DisableUserAccessToken(token) 3550 3551 if resultVar0 != nil { 3552 span.LogFields(spanlog.Error(resultVar0)) 3553 ext.Error.Set(span, true) 3554 } 3555 3556 return resultVar0 3557 } 3558 3559 func (a *OpenTracingAppLayer) DoActionRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) { 3560 origCtx := a.ctx 3561 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoActionRequest") 3562 3563 a.ctx = newCtx 3564 a.app.Srv().Store.SetContext(newCtx) 3565 defer func() { 3566 a.app.Srv().Store.SetContext(origCtx) 3567 a.ctx = origCtx 3568 }() 3569 3570 defer span.Finish() 3571 resultVar0, resultVar1 := a.app.DoActionRequest(c, rawURL, body) 3572 3573 if resultVar1 != nil { 3574 span.LogFields(spanlog.Error(resultVar1)) 3575 ext.Error.Set(span, true) 3576 } 3577 3578 return resultVar0, resultVar1 3579 } 3580 3581 func (a *OpenTracingAppLayer) DoAdvancedPermissionsMigration() { 3582 origCtx := a.ctx 3583 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAdvancedPermissionsMigration") 3584 3585 a.ctx = newCtx 3586 a.app.Srv().Store.SetContext(newCtx) 3587 defer func() { 3588 a.app.Srv().Store.SetContext(origCtx) 3589 a.ctx = origCtx 3590 }() 3591 3592 defer span.Finish() 3593 a.app.DoAdvancedPermissionsMigration() 3594 } 3595 3596 func (a *OpenTracingAppLayer) DoAppMigrations() { 3597 origCtx := a.ctx 3598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAppMigrations") 3599 3600 a.ctx = newCtx 3601 a.app.Srv().Store.SetContext(newCtx) 3602 defer func() { 3603 a.app.Srv().Store.SetContext(origCtx) 3604 a.ctx = origCtx 3605 }() 3606 3607 defer span.Finish() 3608 a.app.DoAppMigrations() 3609 } 3610 3611 func (a *OpenTracingAppLayer) DoCommandRequest(cmd *model.Command, p url.Values) (*model.Command, *model.CommandResponse, *model.AppError) { 3612 origCtx := a.ctx 3613 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoCommandRequest") 3614 3615 a.ctx = newCtx 3616 a.app.Srv().Store.SetContext(newCtx) 3617 defer func() { 3618 a.app.Srv().Store.SetContext(origCtx) 3619 a.ctx = origCtx 3620 }() 3621 3622 defer span.Finish() 3623 resultVar0, resultVar1, resultVar2 := a.app.DoCommandRequest(cmd, p) 3624 3625 if resultVar2 != nil { 3626 span.LogFields(spanlog.Error(resultVar2)) 3627 ext.Error.Set(span, true) 3628 } 3629 3630 return resultVar0, resultVar1, resultVar2 3631 } 3632 3633 func (a *OpenTracingAppLayer) DoEmojisPermissionsMigration() { 3634 origCtx := a.ctx 3635 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoEmojisPermissionsMigration") 3636 3637 a.ctx = newCtx 3638 a.app.Srv().Store.SetContext(newCtx) 3639 defer func() { 3640 a.app.Srv().Store.SetContext(origCtx) 3641 a.ctx = origCtx 3642 }() 3643 3644 defer span.Finish() 3645 a.app.DoEmojisPermissionsMigration() 3646 } 3647 3648 func (a *OpenTracingAppLayer) DoGuestRolesCreationMigration() { 3649 origCtx := a.ctx 3650 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoGuestRolesCreationMigration") 3651 3652 a.ctx = newCtx 3653 a.app.Srv().Store.SetContext(newCtx) 3654 defer func() { 3655 a.app.Srv().Store.SetContext(origCtx) 3656 a.ctx = origCtx 3657 }() 3658 3659 defer span.Finish() 3660 a.app.DoGuestRolesCreationMigration() 3661 } 3662 3663 func (a *OpenTracingAppLayer) DoLocalRequest(c *request.Context, rawURL string, body []byte) (*http.Response, *model.AppError) { 3664 origCtx := a.ctx 3665 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLocalRequest") 3666 3667 a.ctx = newCtx 3668 a.app.Srv().Store.SetContext(newCtx) 3669 defer func() { 3670 a.app.Srv().Store.SetContext(origCtx) 3671 a.ctx = origCtx 3672 }() 3673 3674 defer span.Finish() 3675 resultVar0, resultVar1 := a.app.DoLocalRequest(c, rawURL, body) 3676 3677 if resultVar1 != nil { 3678 span.LogFields(spanlog.Error(resultVar1)) 3679 ext.Error.Set(span, true) 3680 } 3681 3682 return resultVar0, resultVar1 3683 } 3684 3685 func (a *OpenTracingAppLayer) DoLogin(c *request.Context, w http.ResponseWriter, r *http.Request, user *model.User, deviceID string, isMobile bool, isOAuthUser bool, isSaml bool) *model.AppError { 3686 origCtx := a.ctx 3687 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLogin") 3688 3689 a.ctx = newCtx 3690 a.app.Srv().Store.SetContext(newCtx) 3691 defer func() { 3692 a.app.Srv().Store.SetContext(origCtx) 3693 a.ctx = origCtx 3694 }() 3695 3696 defer span.Finish() 3697 resultVar0 := a.app.DoLogin(c, w, r, user, deviceID, isMobile, isOAuthUser, isSaml) 3698 3699 if resultVar0 != nil { 3700 span.LogFields(spanlog.Error(resultVar0)) 3701 ext.Error.Set(span, true) 3702 } 3703 3704 return resultVar0 3705 } 3706 3707 func (a *OpenTracingAppLayer) DoPermissionsMigrations() error { 3708 origCtx := a.ctx 3709 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPermissionsMigrations") 3710 3711 a.ctx = newCtx 3712 a.app.Srv().Store.SetContext(newCtx) 3713 defer func() { 3714 a.app.Srv().Store.SetContext(origCtx) 3715 a.ctx = origCtx 3716 }() 3717 3718 defer span.Finish() 3719 resultVar0 := a.app.DoPermissionsMigrations() 3720 3721 if resultVar0 != nil { 3722 span.LogFields(spanlog.Error(resultVar0)) 3723 ext.Error.Set(span, true) 3724 } 3725 3726 return resultVar0 3727 } 3728 3729 func (a *OpenTracingAppLayer) DoPostAction(c *request.Context, postID string, actionId string, userID string, selectedOption string) (string, *model.AppError) { 3730 origCtx := a.ctx 3731 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostAction") 3732 3733 a.ctx = newCtx 3734 a.app.Srv().Store.SetContext(newCtx) 3735 defer func() { 3736 a.app.Srv().Store.SetContext(origCtx) 3737 a.ctx = origCtx 3738 }() 3739 3740 defer span.Finish() 3741 resultVar0, resultVar1 := a.app.DoPostAction(c, postID, actionId, userID, selectedOption) 3742 3743 if resultVar1 != nil { 3744 span.LogFields(spanlog.Error(resultVar1)) 3745 ext.Error.Set(span, true) 3746 } 3747 3748 return resultVar0, resultVar1 3749 } 3750 3751 func (a *OpenTracingAppLayer) DoPostActionWithCookie(c *request.Context, postID string, actionId string, userID string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { 3752 origCtx := a.ctx 3753 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostActionWithCookie") 3754 3755 a.ctx = newCtx 3756 a.app.Srv().Store.SetContext(newCtx) 3757 defer func() { 3758 a.app.Srv().Store.SetContext(origCtx) 3759 a.ctx = origCtx 3760 }() 3761 3762 defer span.Finish() 3763 resultVar0, resultVar1 := a.app.DoPostActionWithCookie(c, postID, actionId, userID, selectedOption, cookie) 3764 3765 if resultVar1 != nil { 3766 span.LogFields(spanlog.Error(resultVar1)) 3767 ext.Error.Set(span, true) 3768 } 3769 3770 return resultVar0, resultVar1 3771 } 3772 3773 func (a *OpenTracingAppLayer) DoSystemConsoleRolesCreationMigration() { 3774 origCtx := a.ctx 3775 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoSystemConsoleRolesCreationMigration") 3776 3777 a.ctx = newCtx 3778 a.app.Srv().Store.SetContext(newCtx) 3779 defer func() { 3780 a.app.Srv().Store.SetContext(origCtx) 3781 a.ctx = origCtx 3782 }() 3783 3784 defer span.Finish() 3785 a.app.DoSystemConsoleRolesCreationMigration() 3786 } 3787 3788 func (a *OpenTracingAppLayer) DoUploadFile(c *request.Context, now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) { 3789 origCtx := a.ctx 3790 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFile") 3791 3792 a.ctx = newCtx 3793 a.app.Srv().Store.SetContext(newCtx) 3794 defer func() { 3795 a.app.Srv().Store.SetContext(origCtx) 3796 a.ctx = origCtx 3797 }() 3798 3799 defer span.Finish() 3800 resultVar0, resultVar1 := a.app.DoUploadFile(c, now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3801 3802 if resultVar1 != nil { 3803 span.LogFields(spanlog.Error(resultVar1)) 3804 ext.Error.Set(span, true) 3805 } 3806 3807 return resultVar0, resultVar1 3808 } 3809 3810 func (a *OpenTracingAppLayer) DoUploadFileExpectModification(c *request.Context, now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) { 3811 origCtx := a.ctx 3812 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFileExpectModification") 3813 3814 a.ctx = newCtx 3815 a.app.Srv().Store.SetContext(newCtx) 3816 defer func() { 3817 a.app.Srv().Store.SetContext(origCtx) 3818 a.ctx = origCtx 3819 }() 3820 3821 defer span.Finish() 3822 resultVar0, resultVar1, resultVar2 := a.app.DoUploadFileExpectModification(c, now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3823 3824 if resultVar2 != nil { 3825 span.LogFields(spanlog.Error(resultVar2)) 3826 ext.Error.Set(span, true) 3827 } 3828 3829 return resultVar0, resultVar1, resultVar2 3830 } 3831 3832 func (a *OpenTracingAppLayer) DoubleCheckPassword(user *model.User, password string) *model.AppError { 3833 origCtx := a.ctx 3834 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoubleCheckPassword") 3835 3836 a.ctx = newCtx 3837 a.app.Srv().Store.SetContext(newCtx) 3838 defer func() { 3839 a.app.Srv().Store.SetContext(origCtx) 3840 a.ctx = origCtx 3841 }() 3842 3843 defer span.Finish() 3844 resultVar0 := a.app.DoubleCheckPassword(user, password) 3845 3846 if resultVar0 != nil { 3847 span.LogFields(spanlog.Error(resultVar0)) 3848 ext.Error.Set(span, true) 3849 } 3850 3851 return resultVar0 3852 } 3853 3854 func (a *OpenTracingAppLayer) DownloadFromURL(downloadURL string) ([]byte, error) { 3855 origCtx := a.ctx 3856 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DownloadFromURL") 3857 3858 a.ctx = newCtx 3859 a.app.Srv().Store.SetContext(newCtx) 3860 defer func() { 3861 a.app.Srv().Store.SetContext(origCtx) 3862 a.ctx = origCtx 3863 }() 3864 3865 defer span.Finish() 3866 resultVar0, resultVar1 := a.app.DownloadFromURL(downloadURL) 3867 3868 if resultVar1 != nil { 3869 span.LogFields(spanlog.Error(resultVar1)) 3870 ext.Error.Set(span, true) 3871 } 3872 3873 return resultVar0, resultVar1 3874 } 3875 3876 func (a *OpenTracingAppLayer) EnablePlugin(id string) *model.AppError { 3877 origCtx := a.ctx 3878 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnablePlugin") 3879 3880 a.ctx = newCtx 3881 a.app.Srv().Store.SetContext(newCtx) 3882 defer func() { 3883 a.app.Srv().Store.SetContext(origCtx) 3884 a.ctx = origCtx 3885 }() 3886 3887 defer span.Finish() 3888 resultVar0 := a.app.EnablePlugin(id) 3889 3890 if resultVar0 != nil { 3891 span.LogFields(spanlog.Error(resultVar0)) 3892 ext.Error.Set(span, true) 3893 } 3894 3895 return resultVar0 3896 } 3897 3898 func (a *OpenTracingAppLayer) EnableUserAccessToken(token *model.UserAccessToken) *model.AppError { 3899 origCtx := a.ctx 3900 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnableUserAccessToken") 3901 3902 a.ctx = newCtx 3903 a.app.Srv().Store.SetContext(newCtx) 3904 defer func() { 3905 a.app.Srv().Store.SetContext(origCtx) 3906 a.ctx = origCtx 3907 }() 3908 3909 defer span.Finish() 3910 resultVar0 := a.app.EnableUserAccessToken(token) 3911 3912 if resultVar0 != nil { 3913 span.LogFields(spanlog.Error(resultVar0)) 3914 ext.Error.Set(span, true) 3915 } 3916 3917 return resultVar0 3918 } 3919 3920 func (a *OpenTracingAppLayer) EndTrackRecord(trackRecordId string) (*model.TrackRecord, *model.AppError) { 3921 origCtx := a.ctx 3922 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EndTrackRecord") 3923 3924 a.ctx = newCtx 3925 a.app.Srv().Store.SetContext(newCtx) 3926 defer func() { 3927 a.app.Srv().Store.SetContext(origCtx) 3928 a.ctx = origCtx 3929 }() 3930 3931 defer span.Finish() 3932 resultVar0, resultVar1 := a.app.EndTrackRecord(trackRecordId) 3933 3934 if resultVar1 != nil { 3935 span.LogFields(spanlog.Error(resultVar1)) 3936 ext.Error.Set(span, true) 3937 } 3938 3939 return resultVar0, resultVar1 3940 } 3941 3942 func (a *OpenTracingAppLayer) EnvironmentConfig(filter func(reflect.StructField) bool) map[string]interface{} { 3943 origCtx := a.ctx 3944 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnvironmentConfig") 3945 3946 a.ctx = newCtx 3947 a.app.Srv().Store.SetContext(newCtx) 3948 defer func() { 3949 a.app.Srv().Store.SetContext(origCtx) 3950 a.ctx = origCtx 3951 }() 3952 3953 defer span.Finish() 3954 resultVar0 := a.app.EnvironmentConfig(filter) 3955 3956 return resultVar0 3957 } 3958 3959 func (a *OpenTracingAppLayer) ExecuteCommand(c *request.Context, args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { 3960 origCtx := a.ctx 3961 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExecuteCommand") 3962 3963 a.ctx = newCtx 3964 a.app.Srv().Store.SetContext(newCtx) 3965 defer func() { 3966 a.app.Srv().Store.SetContext(origCtx) 3967 a.ctx = origCtx 3968 }() 3969 3970 span.SetTag("args", args) 3971 3972 defer span.Finish() 3973 resultVar0, resultVar1 := a.app.ExecuteCommand(c, args) 3974 3975 if resultVar1 != nil { 3976 span.LogFields(spanlog.Error(resultVar1)) 3977 ext.Error.Set(span, true) 3978 } 3979 3980 return resultVar0, resultVar1 3981 } 3982 3983 func (a *OpenTracingAppLayer) ExportPermissions(w io.Writer) error { 3984 origCtx := a.ctx 3985 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExportPermissions") 3986 3987 a.ctx = newCtx 3988 a.app.Srv().Store.SetContext(newCtx) 3989 defer func() { 3990 a.app.Srv().Store.SetContext(origCtx) 3991 a.ctx = origCtx 3992 }() 3993 3994 defer span.Finish() 3995 resultVar0 := a.app.ExportPermissions(w) 3996 3997 if resultVar0 != nil { 3998 span.LogFields(spanlog.Error(resultVar0)) 3999 ext.Error.Set(span, true) 4000 } 4001 4002 return resultVar0 4003 } 4004 4005 func (a *OpenTracingAppLayer) ExtendSessionExpiryIfNeeded(session *model.Session) bool { 4006 origCtx := a.ctx 4007 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExtendSessionExpiryIfNeeded") 4008 4009 a.ctx = newCtx 4010 a.app.Srv().Store.SetContext(newCtx) 4011 defer func() { 4012 a.app.Srv().Store.SetContext(origCtx) 4013 a.ctx = origCtx 4014 }() 4015 4016 defer span.Finish() 4017 resultVar0 := a.app.ExtendSessionExpiryIfNeeded(session) 4018 4019 return resultVar0 4020 } 4021 4022 func (a *OpenTracingAppLayer) ExtractContentFromFileInfo(fileInfo *model.FileInfo) error { 4023 origCtx := a.ctx 4024 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExtractContentFromFileInfo") 4025 4026 a.ctx = newCtx 4027 a.app.Srv().Store.SetContext(newCtx) 4028 defer func() { 4029 a.app.Srv().Store.SetContext(origCtx) 4030 a.ctx = origCtx 4031 }() 4032 4033 defer span.Finish() 4034 resultVar0 := a.app.ExtractContentFromFileInfo(fileInfo) 4035 4036 if resultVar0 != nil { 4037 span.LogFields(spanlog.Error(resultVar0)) 4038 ext.Error.Set(span, true) 4039 } 4040 4041 return resultVar0 4042 } 4043 4044 func (a *OpenTracingAppLayer) FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) { 4045 origCtx := a.ctx 4046 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FetchSamlMetadataFromIdp") 4047 4048 a.ctx = newCtx 4049 a.app.Srv().Store.SetContext(newCtx) 4050 defer func() { 4051 a.app.Srv().Store.SetContext(origCtx) 4052 a.ctx = origCtx 4053 }() 4054 4055 defer span.Finish() 4056 resultVar0, resultVar1 := a.app.FetchSamlMetadataFromIdp(url) 4057 4058 if resultVar1 != nil { 4059 span.LogFields(spanlog.Error(resultVar1)) 4060 ext.Error.Set(span, true) 4061 } 4062 4063 return resultVar0, resultVar1 4064 } 4065 4066 func (a *OpenTracingAppLayer) FileBackend() (filestore.FileBackend, *model.AppError) { 4067 origCtx := a.ctx 4068 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileBackend") 4069 4070 a.ctx = newCtx 4071 a.app.Srv().Store.SetContext(newCtx) 4072 defer func() { 4073 a.app.Srv().Store.SetContext(origCtx) 4074 a.ctx = origCtx 4075 }() 4076 4077 defer span.Finish() 4078 resultVar0, resultVar1 := a.app.FileBackend() 4079 4080 if resultVar1 != nil { 4081 span.LogFields(spanlog.Error(resultVar1)) 4082 ext.Error.Set(span, true) 4083 } 4084 4085 return resultVar0, resultVar1 4086 } 4087 4088 func (a *OpenTracingAppLayer) FileExists(path string) (bool, *model.AppError) { 4089 origCtx := a.ctx 4090 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileExists") 4091 4092 a.ctx = newCtx 4093 a.app.Srv().Store.SetContext(newCtx) 4094 defer func() { 4095 a.app.Srv().Store.SetContext(origCtx) 4096 a.ctx = origCtx 4097 }() 4098 4099 defer span.Finish() 4100 resultVar0, resultVar1 := a.app.FileExists(path) 4101 4102 if resultVar1 != nil { 4103 span.LogFields(spanlog.Error(resultVar1)) 4104 ext.Error.Set(span, true) 4105 } 4106 4107 return resultVar0, resultVar1 4108 } 4109 4110 func (a *OpenTracingAppLayer) FileModTime(path string) (time.Time, *model.AppError) { 4111 origCtx := a.ctx 4112 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileModTime") 4113 4114 a.ctx = newCtx 4115 a.app.Srv().Store.SetContext(newCtx) 4116 defer func() { 4117 a.app.Srv().Store.SetContext(origCtx) 4118 a.ctx = origCtx 4119 }() 4120 4121 defer span.Finish() 4122 resultVar0, resultVar1 := a.app.FileModTime(path) 4123 4124 if resultVar1 != nil { 4125 span.LogFields(spanlog.Error(resultVar1)) 4126 ext.Error.Set(span, true) 4127 } 4128 4129 return resultVar0, resultVar1 4130 } 4131 4132 func (a *OpenTracingAppLayer) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) { 4133 origCtx := a.ctx 4134 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileReader") 4135 4136 a.ctx = newCtx 4137 a.app.Srv().Store.SetContext(newCtx) 4138 defer func() { 4139 a.app.Srv().Store.SetContext(origCtx) 4140 a.ctx = origCtx 4141 }() 4142 4143 defer span.Finish() 4144 resultVar0, resultVar1 := a.app.FileReader(path) 4145 4146 if resultVar1 != nil { 4147 span.LogFields(spanlog.Error(resultVar1)) 4148 ext.Error.Set(span, true) 4149 } 4150 4151 return resultVar0, resultVar1 4152 } 4153 4154 func (a *OpenTracingAppLayer) FileSize(path string) (int64, *model.AppError) { 4155 origCtx := a.ctx 4156 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileSize") 4157 4158 a.ctx = newCtx 4159 a.app.Srv().Store.SetContext(newCtx) 4160 defer func() { 4161 a.app.Srv().Store.SetContext(origCtx) 4162 a.ctx = origCtx 4163 }() 4164 4165 defer span.Finish() 4166 resultVar0, resultVar1 := a.app.FileSize(path) 4167 4168 if resultVar1 != nil { 4169 span.LogFields(spanlog.Error(resultVar1)) 4170 ext.Error.Set(span, true) 4171 } 4172 4173 return resultVar0, resultVar1 4174 } 4175 4176 func (a *OpenTracingAppLayer) FillInChannelProps(channel *model.Channel) *model.AppError { 4177 origCtx := a.ctx 4178 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelProps") 4179 4180 a.ctx = newCtx 4181 a.app.Srv().Store.SetContext(newCtx) 4182 defer func() { 4183 a.app.Srv().Store.SetContext(origCtx) 4184 a.ctx = origCtx 4185 }() 4186 4187 defer span.Finish() 4188 resultVar0 := a.app.FillInChannelProps(channel) 4189 4190 if resultVar0 != nil { 4191 span.LogFields(spanlog.Error(resultVar0)) 4192 ext.Error.Set(span, true) 4193 } 4194 4195 return resultVar0 4196 } 4197 4198 func (a *OpenTracingAppLayer) FillInChannelsProps(channelList *model.ChannelList) *model.AppError { 4199 origCtx := a.ctx 4200 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelsProps") 4201 4202 a.ctx = newCtx 4203 a.app.Srv().Store.SetContext(newCtx) 4204 defer func() { 4205 a.app.Srv().Store.SetContext(origCtx) 4206 a.ctx = origCtx 4207 }() 4208 4209 defer span.Finish() 4210 resultVar0 := a.app.FillInChannelsProps(channelList) 4211 4212 if resultVar0 != nil { 4213 span.LogFields(spanlog.Error(resultVar0)) 4214 ext.Error.Set(span, true) 4215 } 4216 4217 return resultVar0 4218 } 4219 4220 func (a *OpenTracingAppLayer) FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError { 4221 origCtx := a.ctx 4222 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInPostProps") 4223 4224 a.ctx = newCtx 4225 a.app.Srv().Store.SetContext(newCtx) 4226 defer func() { 4227 a.app.Srv().Store.SetContext(origCtx) 4228 a.ctx = origCtx 4229 }() 4230 4231 defer span.Finish() 4232 resultVar0 := a.app.FillInPostProps(post, channel) 4233 4234 if resultVar0 != nil { 4235 span.LogFields(spanlog.Error(resultVar0)) 4236 ext.Error.Set(span, true) 4237 } 4238 4239 return resultVar0 4240 } 4241 4242 func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error) { 4243 origCtx := a.ctx 4244 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupChannelMembers") 4245 4246 a.ctx = newCtx 4247 a.app.Srv().Store.SetContext(newCtx) 4248 defer func() { 4249 a.app.Srv().Store.SetContext(origCtx) 4250 a.ctx = origCtx 4251 }() 4252 4253 defer span.Finish() 4254 resultVar0, resultVar1 := a.app.FilterNonGroupChannelMembers(userIDs, channel) 4255 4256 if resultVar1 != nil { 4257 span.LogFields(spanlog.Error(resultVar1)) 4258 ext.Error.Set(span, true) 4259 } 4260 4261 return resultVar0, resultVar1 4262 } 4263 4264 func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error) { 4265 origCtx := a.ctx 4266 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupTeamMembers") 4267 4268 a.ctx = newCtx 4269 a.app.Srv().Store.SetContext(newCtx) 4270 defer func() { 4271 a.app.Srv().Store.SetContext(origCtx) 4272 a.ctx = origCtx 4273 }() 4274 4275 defer span.Finish() 4276 resultVar0, resultVar1 := a.app.FilterNonGroupTeamMembers(userIDs, team) 4277 4278 if resultVar1 != nil { 4279 span.LogFields(spanlog.Error(resultVar1)) 4280 ext.Error.Set(span, true) 4281 } 4282 4283 return resultVar0, resultVar1 4284 } 4285 4286 func (a *OpenTracingAppLayer) FilterUsersByVisible(viewer *model.User, otherUsers []*model.User) ([]*model.User, *model.AppError) { 4287 origCtx := a.ctx 4288 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterUsersByVisible") 4289 4290 a.ctx = newCtx 4291 a.app.Srv().Store.SetContext(newCtx) 4292 defer func() { 4293 a.app.Srv().Store.SetContext(origCtx) 4294 a.ctx = origCtx 4295 }() 4296 4297 defer span.Finish() 4298 resultVar0, resultVar1 := a.app.FilterUsersByVisible(viewer, otherUsers) 4299 4300 if resultVar1 != nil { 4301 span.LogFields(spanlog.Error(resultVar1)) 4302 ext.Error.Set(span, true) 4303 } 4304 4305 return resultVar0, resultVar1 4306 } 4307 4308 func (a *OpenTracingAppLayer) FindTeamByName(name string) bool { 4309 origCtx := a.ctx 4310 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FindTeamByName") 4311 4312 a.ctx = newCtx 4313 a.app.Srv().Store.SetContext(newCtx) 4314 defer func() { 4315 a.app.Srv().Store.SetContext(origCtx) 4316 a.ctx = origCtx 4317 }() 4318 4319 defer span.Finish() 4320 resultVar0 := a.app.FindTeamByName(name) 4321 4322 return resultVar0 4323 } 4324 4325 func (a *OpenTracingAppLayer) GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError) { 4326 origCtx := a.ctx 4327 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateMfaSecret") 4328 4329 a.ctx = newCtx 4330 a.app.Srv().Store.SetContext(newCtx) 4331 defer func() { 4332 a.app.Srv().Store.SetContext(origCtx) 4333 a.ctx = origCtx 4334 }() 4335 4336 defer span.Finish() 4337 resultVar0, resultVar1 := a.app.GenerateMfaSecret(userID) 4338 4339 if resultVar1 != nil { 4340 span.LogFields(spanlog.Error(resultVar1)) 4341 ext.Error.Set(span, true) 4342 } 4343 4344 return resultVar0, resultVar1 4345 } 4346 4347 func (a *OpenTracingAppLayer) GeneratePublicLink(siteURL string, info *model.FileInfo) string { 4348 origCtx := a.ctx 4349 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GeneratePublicLink") 4350 4351 a.ctx = newCtx 4352 a.app.Srv().Store.SetContext(newCtx) 4353 defer func() { 4354 a.app.Srv().Store.SetContext(origCtx) 4355 a.ctx = origCtx 4356 }() 4357 4358 defer span.Finish() 4359 resultVar0 := a.app.GeneratePublicLink(siteURL, info) 4360 4361 return resultVar0 4362 } 4363 4364 func (a *OpenTracingAppLayer) GenerateSupportPacket() []model.FileData { 4365 origCtx := a.ctx 4366 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateSupportPacket") 4367 4368 a.ctx = newCtx 4369 a.app.Srv().Store.SetContext(newCtx) 4370 defer func() { 4371 a.app.Srv().Store.SetContext(origCtx) 4372 a.ctx = origCtx 4373 }() 4374 4375 defer span.Finish() 4376 resultVar0 := a.app.GenerateSupportPacket() 4377 4378 return resultVar0 4379 } 4380 4381 func (a *OpenTracingAppLayer) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) { 4382 origCtx := a.ctx 4383 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetActivePluginManifests") 4384 4385 a.ctx = newCtx 4386 a.app.Srv().Store.SetContext(newCtx) 4387 defer func() { 4388 a.app.Srv().Store.SetContext(origCtx) 4389 a.ctx = origCtx 4390 }() 4391 4392 defer span.Finish() 4393 resultVar0, resultVar1 := a.app.GetActivePluginManifests() 4394 4395 if resultVar1 != nil { 4396 span.LogFields(spanlog.Error(resultVar1)) 4397 ext.Error.Set(span, true) 4398 } 4399 4400 return resultVar0, resultVar1 4401 } 4402 4403 func (a *OpenTracingAppLayer) GetAllChannels(page int, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) { 4404 origCtx := a.ctx 4405 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannels") 4406 4407 a.ctx = newCtx 4408 a.app.Srv().Store.SetContext(newCtx) 4409 defer func() { 4410 a.app.Srv().Store.SetContext(origCtx) 4411 a.ctx = origCtx 4412 }() 4413 4414 defer span.Finish() 4415 resultVar0, resultVar1 := a.app.GetAllChannels(page, perPage, opts) 4416 4417 if resultVar1 != nil { 4418 span.LogFields(spanlog.Error(resultVar1)) 4419 ext.Error.Set(span, true) 4420 } 4421 4422 return resultVar0, resultVar1 4423 } 4424 4425 func (a *OpenTracingAppLayer) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.AppError) { 4426 origCtx := a.ctx 4427 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannelsCount") 4428 4429 a.ctx = newCtx 4430 a.app.Srv().Store.SetContext(newCtx) 4431 defer func() { 4432 a.app.Srv().Store.SetContext(origCtx) 4433 a.ctx = origCtx 4434 }() 4435 4436 defer span.Finish() 4437 resultVar0, resultVar1 := a.app.GetAllChannelsCount(opts) 4438 4439 if resultVar1 != nil { 4440 span.LogFields(spanlog.Error(resultVar1)) 4441 ext.Error.Set(span, true) 4442 } 4443 4444 return resultVar0, resultVar1 4445 } 4446 4447 func (a *OpenTracingAppLayer) GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError) { 4448 origCtx := a.ctx 4449 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllLdapGroupsPage") 4450 4451 a.ctx = newCtx 4452 a.app.Srv().Store.SetContext(newCtx) 4453 defer func() { 4454 a.app.Srv().Store.SetContext(origCtx) 4455 a.ctx = origCtx 4456 }() 4457 4458 defer span.Finish() 4459 resultVar0, resultVar1, resultVar2 := a.app.GetAllLdapGroupsPage(page, perPage, opts) 4460 4461 if resultVar2 != nil { 4462 span.LogFields(spanlog.Error(resultVar2)) 4463 ext.Error.Set(span, true) 4464 } 4465 4466 return resultVar0, resultVar1, resultVar2 4467 } 4468 4469 func (a *OpenTracingAppLayer) GetAllPrivateTeams() ([]*model.Team, *model.AppError) { 4470 origCtx := a.ctx 4471 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeams") 4472 4473 a.ctx = newCtx 4474 a.app.Srv().Store.SetContext(newCtx) 4475 defer func() { 4476 a.app.Srv().Store.SetContext(origCtx) 4477 a.ctx = origCtx 4478 }() 4479 4480 defer span.Finish() 4481 resultVar0, resultVar1 := a.app.GetAllPrivateTeams() 4482 4483 if resultVar1 != nil { 4484 span.LogFields(spanlog.Error(resultVar1)) 4485 ext.Error.Set(span, true) 4486 } 4487 4488 return resultVar0, resultVar1 4489 } 4490 4491 func (a *OpenTracingAppLayer) GetAllPublicTeams() ([]*model.Team, *model.AppError) { 4492 origCtx := a.ctx 4493 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeams") 4494 4495 a.ctx = newCtx 4496 a.app.Srv().Store.SetContext(newCtx) 4497 defer func() { 4498 a.app.Srv().Store.SetContext(origCtx) 4499 a.ctx = origCtx 4500 }() 4501 4502 defer span.Finish() 4503 resultVar0, resultVar1 := a.app.GetAllPublicTeams() 4504 4505 if resultVar1 != nil { 4506 span.LogFields(spanlog.Error(resultVar1)) 4507 ext.Error.Set(span, true) 4508 } 4509 4510 return resultVar0, resultVar1 4511 } 4512 4513 func (a *OpenTracingAppLayer) GetAllRemoteClusters(filter model.RemoteClusterQueryFilter) ([]*model.RemoteCluster, *model.AppError) { 4514 origCtx := a.ctx 4515 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllRemoteClusters") 4516 4517 a.ctx = newCtx 4518 a.app.Srv().Store.SetContext(newCtx) 4519 defer func() { 4520 a.app.Srv().Store.SetContext(origCtx) 4521 a.ctx = origCtx 4522 }() 4523 4524 defer span.Finish() 4525 resultVar0, resultVar1 := a.app.GetAllRemoteClusters(filter) 4526 4527 if resultVar1 != nil { 4528 span.LogFields(spanlog.Error(resultVar1)) 4529 ext.Error.Set(span, true) 4530 } 4531 4532 return resultVar0, resultVar1 4533 } 4534 4535 func (a *OpenTracingAppLayer) GetAllStatuses() map[string]*model.Status { 4536 origCtx := a.ctx 4537 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllStatuses") 4538 4539 a.ctx = newCtx 4540 a.app.Srv().Store.SetContext(newCtx) 4541 defer func() { 4542 a.app.Srv().Store.SetContext(origCtx) 4543 a.ctx = origCtx 4544 }() 4545 4546 defer span.Finish() 4547 resultVar0 := a.app.GetAllStatuses() 4548 4549 return resultVar0 4550 } 4551 4552 func (a *OpenTracingAppLayer) GetAllTeams() ([]*model.Team, *model.AppError) { 4553 origCtx := a.ctx 4554 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeams") 4555 4556 a.ctx = newCtx 4557 a.app.Srv().Store.SetContext(newCtx) 4558 defer func() { 4559 a.app.Srv().Store.SetContext(origCtx) 4560 a.ctx = origCtx 4561 }() 4562 4563 defer span.Finish() 4564 resultVar0, resultVar1 := a.app.GetAllTeams() 4565 4566 if resultVar1 != nil { 4567 span.LogFields(spanlog.Error(resultVar1)) 4568 ext.Error.Set(span, true) 4569 } 4570 4571 return resultVar0, resultVar1 4572 } 4573 4574 func (a *OpenTracingAppLayer) GetAllTeamsPage(offset int, limit int, opts *model.TeamSearch) ([]*model.Team, *model.AppError) { 4575 origCtx := a.ctx 4576 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPage") 4577 4578 a.ctx = newCtx 4579 a.app.Srv().Store.SetContext(newCtx) 4580 defer func() { 4581 a.app.Srv().Store.SetContext(origCtx) 4582 a.ctx = origCtx 4583 }() 4584 4585 defer span.Finish() 4586 resultVar0, resultVar1 := a.app.GetAllTeamsPage(offset, limit, opts) 4587 4588 if resultVar1 != nil { 4589 span.LogFields(spanlog.Error(resultVar1)) 4590 ext.Error.Set(span, true) 4591 } 4592 4593 return resultVar0, resultVar1 4594 } 4595 4596 func (a *OpenTracingAppLayer) GetAllTeamsPageWithCount(offset int, limit int, opts *model.TeamSearch) (*model.TeamsWithCount, *model.AppError) { 4597 origCtx := a.ctx 4598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPageWithCount") 4599 4600 a.ctx = newCtx 4601 a.app.Srv().Store.SetContext(newCtx) 4602 defer func() { 4603 a.app.Srv().Store.SetContext(origCtx) 4604 a.ctx = origCtx 4605 }() 4606 4607 defer span.Finish() 4608 resultVar0, resultVar1 := a.app.GetAllTeamsPageWithCount(offset, limit, opts) 4609 4610 if resultVar1 != nil { 4611 span.LogFields(spanlog.Error(resultVar1)) 4612 ext.Error.Set(span, true) 4613 } 4614 4615 return resultVar0, resultVar1 4616 } 4617 4618 func (a *OpenTracingAppLayer) GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError) { 4619 origCtx := a.ctx 4620 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAnalytics") 4621 4622 a.ctx = newCtx 4623 a.app.Srv().Store.SetContext(newCtx) 4624 defer func() { 4625 a.app.Srv().Store.SetContext(origCtx) 4626 a.ctx = origCtx 4627 }() 4628 4629 defer span.Finish() 4630 resultVar0, resultVar1 := a.app.GetAnalytics(name, teamID) 4631 4632 if resultVar1 != nil { 4633 span.LogFields(spanlog.Error(resultVar1)) 4634 ext.Error.Set(span, true) 4635 } 4636 4637 return resultVar0, resultVar1 4638 } 4639 4640 func (a *OpenTracingAppLayer) GetAudits(userID string, limit int) (model.Audits, *model.AppError) { 4641 origCtx := a.ctx 4642 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAudits") 4643 4644 a.ctx = newCtx 4645 a.app.Srv().Store.SetContext(newCtx) 4646 defer func() { 4647 a.app.Srv().Store.SetContext(origCtx) 4648 a.ctx = origCtx 4649 }() 4650 4651 defer span.Finish() 4652 resultVar0, resultVar1 := a.app.GetAudits(userID, limit) 4653 4654 if resultVar1 != nil { 4655 span.LogFields(spanlog.Error(resultVar1)) 4656 ext.Error.Set(span, true) 4657 } 4658 4659 return resultVar0, resultVar1 4660 } 4661 4662 func (a *OpenTracingAppLayer) GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError) { 4663 origCtx := a.ctx 4664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuditsPage") 4665 4666 a.ctx = newCtx 4667 a.app.Srv().Store.SetContext(newCtx) 4668 defer func() { 4669 a.app.Srv().Store.SetContext(origCtx) 4670 a.ctx = origCtx 4671 }() 4672 4673 defer span.Finish() 4674 resultVar0, resultVar1 := a.app.GetAuditsPage(userID, page, perPage) 4675 4676 if resultVar1 != nil { 4677 span.LogFields(spanlog.Error(resultVar1)) 4678 ext.Error.Set(span, true) 4679 } 4680 4681 return resultVar0, resultVar1 4682 } 4683 4684 func (a *OpenTracingAppLayer) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) { 4685 origCtx := a.ctx 4686 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizationCode") 4687 4688 a.ctx = newCtx 4689 a.app.Srv().Store.SetContext(newCtx) 4690 defer func() { 4691 a.app.Srv().Store.SetContext(origCtx) 4692 a.ctx = origCtx 4693 }() 4694 4695 defer span.Finish() 4696 resultVar0, resultVar1 := a.app.GetAuthorizationCode(w, r, service, props, loginHint) 4697 4698 if resultVar1 != nil { 4699 span.LogFields(spanlog.Error(resultVar1)) 4700 ext.Error.Set(span, true) 4701 } 4702 4703 return resultVar0, resultVar1 4704 } 4705 4706 func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 4707 origCtx := a.ctx 4708 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizedAppsForUser") 4709 4710 a.ctx = newCtx 4711 a.app.Srv().Store.SetContext(newCtx) 4712 defer func() { 4713 a.app.Srv().Store.SetContext(origCtx) 4714 a.ctx = origCtx 4715 }() 4716 4717 defer span.Finish() 4718 resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userID, page, perPage) 4719 4720 if resultVar1 != nil { 4721 span.LogFields(spanlog.Error(resultVar1)) 4722 ext.Error.Set(span, true) 4723 } 4724 4725 return resultVar0, resultVar1 4726 } 4727 4728 func (a *OpenTracingAppLayer) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) { 4729 origCtx := a.ctx 4730 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBot") 4731 4732 a.ctx = newCtx 4733 a.app.Srv().Store.SetContext(newCtx) 4734 defer func() { 4735 a.app.Srv().Store.SetContext(origCtx) 4736 a.ctx = origCtx 4737 }() 4738 4739 defer span.Finish() 4740 resultVar0, resultVar1 := a.app.GetBot(botUserId, includeDeleted) 4741 4742 if resultVar1 != nil { 4743 span.LogFields(spanlog.Error(resultVar1)) 4744 ext.Error.Set(span, true) 4745 } 4746 4747 return resultVar0, resultVar1 4748 } 4749 4750 func (a *OpenTracingAppLayer) GetBotIconImage(botUserId string) ([]byte, *model.AppError) { 4751 origCtx := a.ctx 4752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBotIconImage") 4753 4754 a.ctx = newCtx 4755 a.app.Srv().Store.SetContext(newCtx) 4756 defer func() { 4757 a.app.Srv().Store.SetContext(origCtx) 4758 a.ctx = origCtx 4759 }() 4760 4761 defer span.Finish() 4762 resultVar0, resultVar1 := a.app.GetBotIconImage(botUserId) 4763 4764 if resultVar1 != nil { 4765 span.LogFields(spanlog.Error(resultVar1)) 4766 ext.Error.Set(span, true) 4767 } 4768 4769 return resultVar0, resultVar1 4770 } 4771 4772 func (a *OpenTracingAppLayer) GetBots(options *model.BotGetOptions) (model.BotList, *model.AppError) { 4773 origCtx := a.ctx 4774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBots") 4775 4776 a.ctx = newCtx 4777 a.app.Srv().Store.SetContext(newCtx) 4778 defer func() { 4779 a.app.Srv().Store.SetContext(origCtx) 4780 a.ctx = origCtx 4781 }() 4782 4783 defer span.Finish() 4784 resultVar0, resultVar1 := a.app.GetBots(options) 4785 4786 if resultVar1 != nil { 4787 span.LogFields(spanlog.Error(resultVar1)) 4788 ext.Error.Set(span, true) 4789 } 4790 4791 return resultVar0, resultVar1 4792 } 4793 4794 func (a *OpenTracingAppLayer) GetBrandImage() ([]byte, *model.AppError) { 4795 origCtx := a.ctx 4796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBrandImage") 4797 4798 a.ctx = newCtx 4799 a.app.Srv().Store.SetContext(newCtx) 4800 defer func() { 4801 a.app.Srv().Store.SetContext(origCtx) 4802 a.ctx = origCtx 4803 }() 4804 4805 defer span.Finish() 4806 resultVar0, resultVar1 := a.app.GetBrandImage() 4807 4808 if resultVar1 != nil { 4809 span.LogFields(spanlog.Error(resultVar1)) 4810 ext.Error.Set(span, true) 4811 } 4812 4813 return resultVar0, resultVar1 4814 } 4815 4816 func (a *OpenTracingAppLayer) GetBulkReactionsForPosts(postIDs []string) (map[string][]*model.Reaction, *model.AppError) { 4817 origCtx := a.ctx 4818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBulkReactionsForPosts") 4819 4820 a.ctx = newCtx 4821 a.app.Srv().Store.SetContext(newCtx) 4822 defer func() { 4823 a.app.Srv().Store.SetContext(origCtx) 4824 a.ctx = origCtx 4825 }() 4826 4827 defer span.Finish() 4828 resultVar0, resultVar1 := a.app.GetBulkReactionsForPosts(postIDs) 4829 4830 if resultVar1 != nil { 4831 span.LogFields(spanlog.Error(resultVar1)) 4832 ext.Error.Set(span, true) 4833 } 4834 4835 return resultVar0, resultVar1 4836 } 4837 4838 func (a *OpenTracingAppLayer) GetChannel(channelID string) (*model.Channel, *model.AppError) { 4839 origCtx := a.ctx 4840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannel") 4841 4842 a.ctx = newCtx 4843 a.app.Srv().Store.SetContext(newCtx) 4844 defer func() { 4845 a.app.Srv().Store.SetContext(origCtx) 4846 a.ctx = origCtx 4847 }() 4848 4849 defer span.Finish() 4850 resultVar0, resultVar1 := a.app.GetChannel(channelID) 4851 4852 if resultVar1 != nil { 4853 span.LogFields(spanlog.Error(resultVar1)) 4854 ext.Error.Set(span, true) 4855 } 4856 4857 return resultVar0, resultVar1 4858 } 4859 4860 func (a *OpenTracingAppLayer) GetChannelByName(channelName string, teamID string, includeDeleted bool) (*model.Channel, *model.AppError) { 4861 origCtx := a.ctx 4862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByName") 4863 4864 a.ctx = newCtx 4865 a.app.Srv().Store.SetContext(newCtx) 4866 defer func() { 4867 a.app.Srv().Store.SetContext(origCtx) 4868 a.ctx = origCtx 4869 }() 4870 4871 defer span.Finish() 4872 resultVar0, resultVar1 := a.app.GetChannelByName(channelName, teamID, includeDeleted) 4873 4874 if resultVar1 != nil { 4875 span.LogFields(spanlog.Error(resultVar1)) 4876 ext.Error.Set(span, true) 4877 } 4878 4879 return resultVar0, resultVar1 4880 } 4881 4882 func (a *OpenTracingAppLayer) GetChannelByNameForTeamName(channelName string, teamName string, includeDeleted bool) (*model.Channel, *model.AppError) { 4883 origCtx := a.ctx 4884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByNameForTeamName") 4885 4886 a.ctx = newCtx 4887 a.app.Srv().Store.SetContext(newCtx) 4888 defer func() { 4889 a.app.Srv().Store.SetContext(origCtx) 4890 a.ctx = origCtx 4891 }() 4892 4893 defer span.Finish() 4894 resultVar0, resultVar1 := a.app.GetChannelByNameForTeamName(channelName, teamName, includeDeleted) 4895 4896 if resultVar1 != nil { 4897 span.LogFields(spanlog.Error(resultVar1)) 4898 ext.Error.Set(span, true) 4899 } 4900 4901 return resultVar0, resultVar1 4902 } 4903 4904 func (a *OpenTracingAppLayer) GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError) { 4905 origCtx := a.ctx 4906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelCounts") 4907 4908 a.ctx = newCtx 4909 a.app.Srv().Store.SetContext(newCtx) 4910 defer func() { 4911 a.app.Srv().Store.SetContext(origCtx) 4912 a.ctx = origCtx 4913 }() 4914 4915 defer span.Finish() 4916 resultVar0, resultVar1 := a.app.GetChannelCounts(teamID, userID) 4917 4918 if resultVar1 != nil { 4919 span.LogFields(spanlog.Error(resultVar1)) 4920 ext.Error.Set(span, true) 4921 } 4922 4923 return resultVar0, resultVar1 4924 } 4925 4926 func (a *OpenTracingAppLayer) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) { 4927 origCtx := a.ctx 4928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGroupUsers") 4929 4930 a.ctx = newCtx 4931 a.app.Srv().Store.SetContext(newCtx) 4932 defer func() { 4933 a.app.Srv().Store.SetContext(origCtx) 4934 a.ctx = origCtx 4935 }() 4936 4937 defer span.Finish() 4938 resultVar0, resultVar1 := a.app.GetChannelGroupUsers(channelID) 4939 4940 if resultVar1 != nil { 4941 span.LogFields(spanlog.Error(resultVar1)) 4942 ext.Error.Set(span, true) 4943 } 4944 4945 return resultVar0, resultVar1 4946 } 4947 4948 func (a *OpenTracingAppLayer) GetChannelGuestCount(channelID string) (int64, *model.AppError) { 4949 origCtx := a.ctx 4950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGuestCount") 4951 4952 a.ctx = newCtx 4953 a.app.Srv().Store.SetContext(newCtx) 4954 defer func() { 4955 a.app.Srv().Store.SetContext(origCtx) 4956 a.ctx = origCtx 4957 }() 4958 4959 defer span.Finish() 4960 resultVar0, resultVar1 := a.app.GetChannelGuestCount(channelID) 4961 4962 if resultVar1 != nil { 4963 span.LogFields(spanlog.Error(resultVar1)) 4964 ext.Error.Set(span, true) 4965 } 4966 4967 return resultVar0, resultVar1 4968 } 4969 4970 func (a *OpenTracingAppLayer) GetChannelMember(ctx context.Context, channelID string, userID string) (*model.ChannelMember, *model.AppError) { 4971 origCtx := a.ctx 4972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMember") 4973 4974 a.ctx = newCtx 4975 a.app.Srv().Store.SetContext(newCtx) 4976 defer func() { 4977 a.app.Srv().Store.SetContext(origCtx) 4978 a.ctx = origCtx 4979 }() 4980 4981 defer span.Finish() 4982 resultVar0, resultVar1 := a.app.GetChannelMember(ctx, channelID, userID) 4983 4984 if resultVar1 != nil { 4985 span.LogFields(spanlog.Error(resultVar1)) 4986 ext.Error.Set(span, true) 4987 } 4988 4989 return resultVar0, resultVar1 4990 } 4991 4992 func (a *OpenTracingAppLayer) GetChannelMemberCount(channelID string) (int64, *model.AppError) { 4993 origCtx := a.ctx 4994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMemberCount") 4995 4996 a.ctx = newCtx 4997 a.app.Srv().Store.SetContext(newCtx) 4998 defer func() { 4999 a.app.Srv().Store.SetContext(origCtx) 5000 a.ctx = origCtx 5001 }() 5002 5003 defer span.Finish() 5004 resultVar0, resultVar1 := a.app.GetChannelMemberCount(channelID) 5005 5006 if resultVar1 != nil { 5007 span.LogFields(spanlog.Error(resultVar1)) 5008 ext.Error.Set(span, true) 5009 } 5010 5011 return resultVar0, resultVar1 5012 } 5013 5014 func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelID string, userIDs []string) (*model.ChannelMembers, *model.AppError) { 5015 origCtx := a.ctx 5016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersByIds") 5017 5018 a.ctx = newCtx 5019 a.app.Srv().Store.SetContext(newCtx) 5020 defer func() { 5021 a.app.Srv().Store.SetContext(origCtx) 5022 a.ctx = origCtx 5023 }() 5024 5025 defer span.Finish() 5026 resultVar0, resultVar1 := a.app.GetChannelMembersByIds(channelID, userIDs) 5027 5028 if resultVar1 != nil { 5029 span.LogFields(spanlog.Error(resultVar1)) 5030 ext.Error.Set(span, true) 5031 } 5032 5033 return resultVar0, resultVar1 5034 } 5035 5036 func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError) { 5037 origCtx := a.ctx 5038 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUser") 5039 5040 a.ctx = newCtx 5041 a.app.Srv().Store.SetContext(newCtx) 5042 defer func() { 5043 a.app.Srv().Store.SetContext(origCtx) 5044 a.ctx = origCtx 5045 }() 5046 5047 defer span.Finish() 5048 resultVar0, resultVar1 := a.app.GetChannelMembersForUser(teamID, userID) 5049 5050 if resultVar1 != nil { 5051 span.LogFields(spanlog.Error(resultVar1)) 5052 ext.Error.Set(span, true) 5053 } 5054 5055 return resultVar0, resultVar1 5056 } 5057 5058 func (a *OpenTracingAppLayer) GetChannelMembersForUserWithPagination(teamID string, userID string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) { 5059 origCtx := a.ctx 5060 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUserWithPagination") 5061 5062 a.ctx = newCtx 5063 a.app.Srv().Store.SetContext(newCtx) 5064 defer func() { 5065 a.app.Srv().Store.SetContext(origCtx) 5066 a.ctx = origCtx 5067 }() 5068 5069 defer span.Finish() 5070 resultVar0, resultVar1 := a.app.GetChannelMembersForUserWithPagination(teamID, userID, page, perPage) 5071 5072 if resultVar1 != nil { 5073 span.LogFields(spanlog.Error(resultVar1)) 5074 ext.Error.Set(span, true) 5075 } 5076 5077 return resultVar0, resultVar1 5078 } 5079 5080 func (a *OpenTracingAppLayer) GetChannelMembersPage(channelID string, page int, perPage int) (*model.ChannelMembers, *model.AppError) { 5081 origCtx := a.ctx 5082 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersPage") 5083 5084 a.ctx = newCtx 5085 a.app.Srv().Store.SetContext(newCtx) 5086 defer func() { 5087 a.app.Srv().Store.SetContext(origCtx) 5088 a.ctx = origCtx 5089 }() 5090 5091 defer span.Finish() 5092 resultVar0, resultVar1 := a.app.GetChannelMembersPage(channelID, page, perPage) 5093 5094 if resultVar1 != nil { 5095 span.LogFields(spanlog.Error(resultVar1)) 5096 ext.Error.Set(span, true) 5097 } 5098 5099 return resultVar0, resultVar1 5100 } 5101 5102 func (a *OpenTracingAppLayer) GetChannelMembersTimezones(channelID string) ([]string, *model.AppError) { 5103 origCtx := a.ctx 5104 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersTimezones") 5105 5106 a.ctx = newCtx 5107 a.app.Srv().Store.SetContext(newCtx) 5108 defer func() { 5109 a.app.Srv().Store.SetContext(origCtx) 5110 a.ctx = origCtx 5111 }() 5112 5113 defer span.Finish() 5114 resultVar0, resultVar1 := a.app.GetChannelMembersTimezones(channelID) 5115 5116 if resultVar1 != nil { 5117 span.LogFields(spanlog.Error(resultVar1)) 5118 ext.Error.Set(span, true) 5119 } 5120 5121 return resultVar0, resultVar1 5122 } 5123 5124 func (a *OpenTracingAppLayer) GetChannelModerationsForChannel(channel *model.Channel) ([]*model.ChannelModeration, *model.AppError) { 5125 origCtx := a.ctx 5126 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelModerationsForChannel") 5127 5128 a.ctx = newCtx 5129 a.app.Srv().Store.SetContext(newCtx) 5130 defer func() { 5131 a.app.Srv().Store.SetContext(origCtx) 5132 a.ctx = origCtx 5133 }() 5134 5135 defer span.Finish() 5136 resultVar0, resultVar1 := a.app.GetChannelModerationsForChannel(channel) 5137 5138 if resultVar1 != nil { 5139 span.LogFields(spanlog.Error(resultVar1)) 5140 ext.Error.Set(span, true) 5141 } 5142 5143 return resultVar0, resultVar1 5144 } 5145 5146 func (a *OpenTracingAppLayer) GetChannelPinnedPostCount(channelID string) (int64, *model.AppError) { 5147 origCtx := a.ctx 5148 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelPinnedPostCount") 5149 5150 a.ctx = newCtx 5151 a.app.Srv().Store.SetContext(newCtx) 5152 defer func() { 5153 a.app.Srv().Store.SetContext(origCtx) 5154 a.ctx = origCtx 5155 }() 5156 5157 defer span.Finish() 5158 resultVar0, resultVar1 := a.app.GetChannelPinnedPostCount(channelID) 5159 5160 if resultVar1 != nil { 5161 span.LogFields(spanlog.Error(resultVar1)) 5162 ext.Error.Set(span, true) 5163 } 5164 5165 return resultVar0, resultVar1 5166 } 5167 5168 func (a *OpenTracingAppLayer) GetChannelPoliciesForUser(userID string, offset int, limit int) (*model.RetentionPolicyForChannelList, *model.AppError) { 5169 origCtx := a.ctx 5170 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelPoliciesForUser") 5171 5172 a.ctx = newCtx 5173 a.app.Srv().Store.SetContext(newCtx) 5174 defer func() { 5175 a.app.Srv().Store.SetContext(origCtx) 5176 a.ctx = origCtx 5177 }() 5178 5179 defer span.Finish() 5180 resultVar0, resultVar1 := a.app.GetChannelPoliciesForUser(userID, offset, limit) 5181 5182 if resultVar1 != nil { 5183 span.LogFields(spanlog.Error(resultVar1)) 5184 ext.Error.Set(span, true) 5185 } 5186 5187 return resultVar0, resultVar1 5188 } 5189 5190 func (a *OpenTracingAppLayer) GetChannelUnread(channelID string, userID string) (*model.ChannelUnread, *model.AppError) { 5191 origCtx := a.ctx 5192 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelUnread") 5193 5194 a.ctx = newCtx 5195 a.app.Srv().Store.SetContext(newCtx) 5196 defer func() { 5197 a.app.Srv().Store.SetContext(origCtx) 5198 a.ctx = origCtx 5199 }() 5200 5201 defer span.Finish() 5202 resultVar0, resultVar1 := a.app.GetChannelUnread(channelID, userID) 5203 5204 if resultVar1 != nil { 5205 span.LogFields(spanlog.Error(resultVar1)) 5206 ext.Error.Set(span, true) 5207 } 5208 5209 return resultVar0, resultVar1 5210 } 5211 5212 func (a *OpenTracingAppLayer) GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError) { 5213 origCtx := a.ctx 5214 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsByNames") 5215 5216 a.ctx = newCtx 5217 a.app.Srv().Store.SetContext(newCtx) 5218 defer func() { 5219 a.app.Srv().Store.SetContext(origCtx) 5220 a.ctx = origCtx 5221 }() 5222 5223 defer span.Finish() 5224 resultVar0, resultVar1 := a.app.GetChannelsByNames(channelNames, teamID) 5225 5226 if resultVar1 != nil { 5227 span.LogFields(spanlog.Error(resultVar1)) 5228 ext.Error.Set(span, true) 5229 } 5230 5231 return resultVar0, resultVar1 5232 } 5233 5234 func (a *OpenTracingAppLayer) GetChannelsForRetentionPolicy(policyID string, offset int, limit int) (*model.ChannelsWithCount, *model.AppError) { 5235 origCtx := a.ctx 5236 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForRetentionPolicy") 5237 5238 a.ctx = newCtx 5239 a.app.Srv().Store.SetContext(newCtx) 5240 defer func() { 5241 a.app.Srv().Store.SetContext(origCtx) 5242 a.ctx = origCtx 5243 }() 5244 5245 defer span.Finish() 5246 resultVar0, resultVar1 := a.app.GetChannelsForRetentionPolicy(policyID, offset, limit) 5247 5248 if resultVar1 != nil { 5249 span.LogFields(spanlog.Error(resultVar1)) 5250 ext.Error.Set(span, true) 5251 } 5252 5253 return resultVar0, resultVar1 5254 } 5255 5256 func (a *OpenTracingAppLayer) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError) { 5257 origCtx := a.ctx 5258 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForScheme") 5259 5260 a.ctx = newCtx 5261 a.app.Srv().Store.SetContext(newCtx) 5262 defer func() { 5263 a.app.Srv().Store.SetContext(origCtx) 5264 a.ctx = origCtx 5265 }() 5266 5267 defer span.Finish() 5268 resultVar0, resultVar1 := a.app.GetChannelsForScheme(scheme, offset, limit) 5269 5270 if resultVar1 != nil { 5271 span.LogFields(spanlog.Error(resultVar1)) 5272 ext.Error.Set(span, true) 5273 } 5274 5275 return resultVar0, resultVar1 5276 } 5277 5278 func (a *OpenTracingAppLayer) GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError) { 5279 origCtx := a.ctx 5280 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForSchemePage") 5281 5282 a.ctx = newCtx 5283 a.app.Srv().Store.SetContext(newCtx) 5284 defer func() { 5285 a.app.Srv().Store.SetContext(origCtx) 5286 a.ctx = origCtx 5287 }() 5288 5289 defer span.Finish() 5290 resultVar0, resultVar1 := a.app.GetChannelsForSchemePage(scheme, page, perPage) 5291 5292 if resultVar1 != nil { 5293 span.LogFields(spanlog.Error(resultVar1)) 5294 ext.Error.Set(span, true) 5295 } 5296 5297 return resultVar0, resultVar1 5298 } 5299 5300 func (a *OpenTracingAppLayer) GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { 5301 origCtx := a.ctx 5302 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForUser") 5303 5304 a.ctx = newCtx 5305 a.app.Srv().Store.SetContext(newCtx) 5306 defer func() { 5307 a.app.Srv().Store.SetContext(origCtx) 5308 a.ctx = origCtx 5309 }() 5310 5311 defer span.Finish() 5312 resultVar0, resultVar1 := a.app.GetChannelsForUser(teamID, userID, includeDeleted, lastDeleteAt) 5313 5314 if resultVar1 != nil { 5315 span.LogFields(spanlog.Error(resultVar1)) 5316 ext.Error.Set(span, true) 5317 } 5318 5319 return resultVar0, resultVar1 5320 } 5321 5322 func (a *OpenTracingAppLayer) GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 5323 origCtx := a.ctx 5324 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsUserNotIn") 5325 5326 a.ctx = newCtx 5327 a.app.Srv().Store.SetContext(newCtx) 5328 defer func() { 5329 a.app.Srv().Store.SetContext(origCtx) 5330 a.ctx = origCtx 5331 }() 5332 5333 defer span.Finish() 5334 resultVar0, resultVar1 := a.app.GetChannelsUserNotIn(teamID, userID, offset, limit) 5335 5336 if resultVar1 != nil { 5337 span.LogFields(spanlog.Error(resultVar1)) 5338 ext.Error.Set(span, true) 5339 } 5340 5341 return resultVar0, resultVar1 5342 } 5343 5344 func (a *OpenTracingAppLayer) GetCloudSession(token string) (*model.Session, *model.AppError) { 5345 origCtx := a.ctx 5346 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCloudSession") 5347 5348 a.ctx = newCtx 5349 a.app.Srv().Store.SetContext(newCtx) 5350 defer func() { 5351 a.app.Srv().Store.SetContext(origCtx) 5352 a.ctx = origCtx 5353 }() 5354 5355 defer span.Finish() 5356 resultVar0, resultVar1 := a.app.GetCloudSession(token) 5357 5358 if resultVar1 != nil { 5359 span.LogFields(spanlog.Error(resultVar1)) 5360 ext.Error.Set(span, true) 5361 } 5362 5363 return resultVar0, resultVar1 5364 } 5365 5366 func (a *OpenTracingAppLayer) GetClusterId() string { 5367 origCtx := a.ctx 5368 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterId") 5369 5370 a.ctx = newCtx 5371 a.app.Srv().Store.SetContext(newCtx) 5372 defer func() { 5373 a.app.Srv().Store.SetContext(origCtx) 5374 a.ctx = origCtx 5375 }() 5376 5377 defer span.Finish() 5378 resultVar0 := a.app.GetClusterId() 5379 5380 return resultVar0 5381 } 5382 5383 func (a *OpenTracingAppLayer) GetClusterPluginStatuses() (model.PluginStatuses, *model.AppError) { 5384 origCtx := a.ctx 5385 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterPluginStatuses") 5386 5387 a.ctx = newCtx 5388 a.app.Srv().Store.SetContext(newCtx) 5389 defer func() { 5390 a.app.Srv().Store.SetContext(origCtx) 5391 a.ctx = origCtx 5392 }() 5393 5394 defer span.Finish() 5395 resultVar0, resultVar1 := a.app.GetClusterPluginStatuses() 5396 5397 if resultVar1 != nil { 5398 span.LogFields(spanlog.Error(resultVar1)) 5399 ext.Error.Set(span, true) 5400 } 5401 5402 return resultVar0, resultVar1 5403 } 5404 5405 func (a *OpenTracingAppLayer) GetClusterStatus() []*model.ClusterInfo { 5406 origCtx := a.ctx 5407 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterStatus") 5408 5409 a.ctx = newCtx 5410 a.app.Srv().Store.SetContext(newCtx) 5411 defer func() { 5412 a.app.Srv().Store.SetContext(origCtx) 5413 a.ctx = origCtx 5414 }() 5415 5416 defer span.Finish() 5417 resultVar0 := a.app.GetClusterStatus() 5418 5419 return resultVar0 5420 } 5421 5422 func (a *OpenTracingAppLayer) GetCommand(commandID string) (*model.Command, *model.AppError) { 5423 origCtx := a.ctx 5424 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommand") 5425 5426 a.ctx = newCtx 5427 a.app.Srv().Store.SetContext(newCtx) 5428 defer func() { 5429 a.app.Srv().Store.SetContext(origCtx) 5430 a.ctx = origCtx 5431 }() 5432 5433 defer span.Finish() 5434 resultVar0, resultVar1 := a.app.GetCommand(commandID) 5435 5436 if resultVar1 != nil { 5437 span.LogFields(spanlog.Error(resultVar1)) 5438 ext.Error.Set(span, true) 5439 } 5440 5441 return resultVar0, resultVar1 5442 } 5443 5444 func (a *OpenTracingAppLayer) GetCommonTeamIDsForTwoUsers(userID string, otherUserID string) ([]string, *model.AppError) { 5445 origCtx := a.ctx 5446 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommonTeamIDsForTwoUsers") 5447 5448 a.ctx = newCtx 5449 a.app.Srv().Store.SetContext(newCtx) 5450 defer func() { 5451 a.app.Srv().Store.SetContext(origCtx) 5452 a.ctx = origCtx 5453 }() 5454 5455 defer span.Finish() 5456 resultVar0, resultVar1 := a.app.GetCommonTeamIDsForTwoUsers(userID, otherUserID) 5457 5458 if resultVar1 != nil { 5459 span.LogFields(spanlog.Error(resultVar1)) 5460 ext.Error.Set(span, true) 5461 } 5462 5463 return resultVar0, resultVar1 5464 } 5465 5466 func (a *OpenTracingAppLayer) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) { 5467 origCtx := a.ctx 5468 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceFile") 5469 5470 a.ctx = newCtx 5471 a.app.Srv().Store.SetContext(newCtx) 5472 defer func() { 5473 a.app.Srv().Store.SetContext(origCtx) 5474 a.ctx = origCtx 5475 }() 5476 5477 defer span.Finish() 5478 resultVar0, resultVar1 := a.app.GetComplianceFile(job) 5479 5480 if resultVar1 != nil { 5481 span.LogFields(spanlog.Error(resultVar1)) 5482 ext.Error.Set(span, true) 5483 } 5484 5485 return resultVar0, resultVar1 5486 } 5487 5488 func (a *OpenTracingAppLayer) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) { 5489 origCtx := a.ctx 5490 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReport") 5491 5492 a.ctx = newCtx 5493 a.app.Srv().Store.SetContext(newCtx) 5494 defer func() { 5495 a.app.Srv().Store.SetContext(origCtx) 5496 a.ctx = origCtx 5497 }() 5498 5499 defer span.Finish() 5500 resultVar0, resultVar1 := a.app.GetComplianceReport(reportId) 5501 5502 if resultVar1 != nil { 5503 span.LogFields(spanlog.Error(resultVar1)) 5504 ext.Error.Set(span, true) 5505 } 5506 5507 return resultVar0, resultVar1 5508 } 5509 5510 func (a *OpenTracingAppLayer) GetComplianceReports(page int, perPage int) (model.Compliances, *model.AppError) { 5511 origCtx := a.ctx 5512 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReports") 5513 5514 a.ctx = newCtx 5515 a.app.Srv().Store.SetContext(newCtx) 5516 defer func() { 5517 a.app.Srv().Store.SetContext(origCtx) 5518 a.ctx = origCtx 5519 }() 5520 5521 defer span.Finish() 5522 resultVar0, resultVar1 := a.app.GetComplianceReports(page, perPage) 5523 5524 if resultVar1 != nil { 5525 span.LogFields(spanlog.Error(resultVar1)) 5526 ext.Error.Set(span, true) 5527 } 5528 5529 return resultVar0, resultVar1 5530 } 5531 5532 func (a *OpenTracingAppLayer) GetConfigFile(name string) ([]byte, error) { 5533 origCtx := a.ctx 5534 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetConfigFile") 5535 5536 a.ctx = newCtx 5537 a.app.Srv().Store.SetContext(newCtx) 5538 defer func() { 5539 a.app.Srv().Store.SetContext(origCtx) 5540 a.ctx = origCtx 5541 }() 5542 5543 defer span.Finish() 5544 resultVar0, resultVar1 := a.app.GetConfigFile(name) 5545 5546 if resultVar1 != nil { 5547 span.LogFields(spanlog.Error(resultVar1)) 5548 ext.Error.Set(span, true) 5549 } 5550 5551 return resultVar0, resultVar1 5552 } 5553 5554 func (a *OpenTracingAppLayer) GetCookieDomain() string { 5555 origCtx := a.ctx 5556 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCookieDomain") 5557 5558 a.ctx = newCtx 5559 a.app.Srv().Store.SetContext(newCtx) 5560 defer func() { 5561 a.app.Srv().Store.SetContext(origCtx) 5562 a.ctx = origCtx 5563 }() 5564 5565 defer span.Finish() 5566 resultVar0 := a.app.GetCookieDomain() 5567 5568 return resultVar0 5569 } 5570 5571 func (a *OpenTracingAppLayer) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) { 5572 origCtx := a.ctx 5573 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDefaultProfileImage") 5574 5575 a.ctx = newCtx 5576 a.app.Srv().Store.SetContext(newCtx) 5577 defer func() { 5578 a.app.Srv().Store.SetContext(origCtx) 5579 a.ctx = origCtx 5580 }() 5581 5582 defer span.Finish() 5583 resultVar0, resultVar1 := a.app.GetDefaultProfileImage(user) 5584 5585 if resultVar1 != nil { 5586 span.LogFields(spanlog.Error(resultVar1)) 5587 ext.Error.Set(span, true) 5588 } 5589 5590 return resultVar0, resultVar1 5591 } 5592 5593 func (a *OpenTracingAppLayer) GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError) { 5594 origCtx := a.ctx 5595 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDeletedChannels") 5596 5597 a.ctx = newCtx 5598 a.app.Srv().Store.SetContext(newCtx) 5599 defer func() { 5600 a.app.Srv().Store.SetContext(origCtx) 5601 a.ctx = origCtx 5602 }() 5603 5604 defer span.Finish() 5605 resultVar0, resultVar1 := a.app.GetDeletedChannels(teamID, offset, limit, userID) 5606 5607 if resultVar1 != nil { 5608 span.LogFields(spanlog.Error(resultVar1)) 5609 ext.Error.Set(span, true) 5610 } 5611 5612 return resultVar0, resultVar1 5613 } 5614 5615 func (a *OpenTracingAppLayer) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { 5616 origCtx := a.ctx 5617 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmoji") 5618 5619 a.ctx = newCtx 5620 a.app.Srv().Store.SetContext(newCtx) 5621 defer func() { 5622 a.app.Srv().Store.SetContext(origCtx) 5623 a.ctx = origCtx 5624 }() 5625 5626 defer span.Finish() 5627 resultVar0, resultVar1 := a.app.GetEmoji(emojiId) 5628 5629 if resultVar1 != nil { 5630 span.LogFields(spanlog.Error(resultVar1)) 5631 ext.Error.Set(span, true) 5632 } 5633 5634 return resultVar0, resultVar1 5635 } 5636 5637 func (a *OpenTracingAppLayer) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) { 5638 origCtx := a.ctx 5639 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiByName") 5640 5641 a.ctx = newCtx 5642 a.app.Srv().Store.SetContext(newCtx) 5643 defer func() { 5644 a.app.Srv().Store.SetContext(origCtx) 5645 a.ctx = origCtx 5646 }() 5647 5648 defer span.Finish() 5649 resultVar0, resultVar1 := a.app.GetEmojiByName(emojiName) 5650 5651 if resultVar1 != nil { 5652 span.LogFields(spanlog.Error(resultVar1)) 5653 ext.Error.Set(span, true) 5654 } 5655 5656 return resultVar0, resultVar1 5657 } 5658 5659 func (a *OpenTracingAppLayer) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { 5660 origCtx := a.ctx 5661 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiImage") 5662 5663 a.ctx = newCtx 5664 a.app.Srv().Store.SetContext(newCtx) 5665 defer func() { 5666 a.app.Srv().Store.SetContext(origCtx) 5667 a.ctx = origCtx 5668 }() 5669 5670 defer span.Finish() 5671 resultVar0, resultVar1, resultVar2 := a.app.GetEmojiImage(emojiId) 5672 5673 if resultVar2 != nil { 5674 span.LogFields(spanlog.Error(resultVar2)) 5675 ext.Error.Set(span, true) 5676 } 5677 5678 return resultVar0, resultVar1, resultVar2 5679 } 5680 5681 func (a *OpenTracingAppLayer) GetEmojiList(page int, perPage int, sort string) ([]*model.Emoji, *model.AppError) { 5682 origCtx := a.ctx 5683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiList") 5684 5685 a.ctx = newCtx 5686 a.app.Srv().Store.SetContext(newCtx) 5687 defer func() { 5688 a.app.Srv().Store.SetContext(origCtx) 5689 a.ctx = origCtx 5690 }() 5691 5692 defer span.Finish() 5693 resultVar0, resultVar1 := a.app.GetEmojiList(page, perPage, sort) 5694 5695 if resultVar1 != nil { 5696 span.LogFields(spanlog.Error(resultVar1)) 5697 ext.Error.Set(span, true) 5698 } 5699 5700 return resultVar0, resultVar1 5701 } 5702 5703 func (a *OpenTracingAppLayer) GetEmojiStaticUrl(emojiName string) (string, *model.AppError) { 5704 origCtx := a.ctx 5705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiStaticUrl") 5706 5707 a.ctx = newCtx 5708 a.app.Srv().Store.SetContext(newCtx) 5709 defer func() { 5710 a.app.Srv().Store.SetContext(origCtx) 5711 a.ctx = origCtx 5712 }() 5713 5714 defer span.Finish() 5715 resultVar0, resultVar1 := a.app.GetEmojiStaticUrl(emojiName) 5716 5717 if resultVar1 != nil { 5718 span.LogFields(spanlog.Error(resultVar1)) 5719 ext.Error.Set(span, true) 5720 } 5721 5722 return resultVar0, resultVar1 5723 } 5724 5725 func (a *OpenTracingAppLayer) GetEnvironmentConfig(filter func(reflect.StructField) bool) map[string]interface{} { 5726 origCtx := a.ctx 5727 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEnvironmentConfig") 5728 5729 a.ctx = newCtx 5730 a.app.Srv().Store.SetContext(newCtx) 5731 defer func() { 5732 a.app.Srv().Store.SetContext(origCtx) 5733 a.ctx = origCtx 5734 }() 5735 5736 defer span.Finish() 5737 resultVar0 := a.app.GetEnvironmentConfig(filter) 5738 5739 return resultVar0 5740 } 5741 5742 func (a *OpenTracingAppLayer) GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit int64) ([]string, []*model.EmailInviteWithError, *model.AppError) { 5743 origCtx := a.ctx 5744 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetErrorListForEmailsOverLimit") 5745 5746 a.ctx = newCtx 5747 a.app.Srv().Store.SetContext(newCtx) 5748 defer func() { 5749 a.app.Srv().Store.SetContext(origCtx) 5750 a.ctx = origCtx 5751 }() 5752 5753 defer span.Finish() 5754 resultVar0, resultVar1, resultVar2 := a.app.GetErrorListForEmailsOverLimit(emailList, cloudUserLimit) 5755 5756 if resultVar2 != nil { 5757 span.LogFields(spanlog.Error(resultVar2)) 5758 ext.Error.Set(span, true) 5759 } 5760 5761 return resultVar0, resultVar1, resultVar2 5762 } 5763 5764 func (a *OpenTracingAppLayer) GetFile(fileID string) ([]byte, *model.AppError) { 5765 origCtx := a.ctx 5766 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFile") 5767 5768 a.ctx = newCtx 5769 a.app.Srv().Store.SetContext(newCtx) 5770 defer func() { 5771 a.app.Srv().Store.SetContext(origCtx) 5772 a.ctx = origCtx 5773 }() 5774 5775 defer span.Finish() 5776 resultVar0, resultVar1 := a.app.GetFile(fileID) 5777 5778 if resultVar1 != nil { 5779 span.LogFields(spanlog.Error(resultVar1)) 5780 ext.Error.Set(span, true) 5781 } 5782 5783 return resultVar0, resultVar1 5784 } 5785 5786 func (a *OpenTracingAppLayer) GetFileInfo(fileID string) (*model.FileInfo, *model.AppError) { 5787 origCtx := a.ctx 5788 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfo") 5789 5790 a.ctx = newCtx 5791 a.app.Srv().Store.SetContext(newCtx) 5792 defer func() { 5793 a.app.Srv().Store.SetContext(origCtx) 5794 a.ctx = origCtx 5795 }() 5796 5797 defer span.Finish() 5798 resultVar0, resultVar1 := a.app.GetFileInfo(fileID) 5799 5800 if resultVar1 != nil { 5801 span.LogFields(spanlog.Error(resultVar1)) 5802 ext.Error.Set(span, true) 5803 } 5804 5805 return resultVar0, resultVar1 5806 } 5807 5808 func (a *OpenTracingAppLayer) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) { 5809 origCtx := a.ctx 5810 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfos") 5811 5812 a.ctx = newCtx 5813 a.app.Srv().Store.SetContext(newCtx) 5814 defer func() { 5815 a.app.Srv().Store.SetContext(origCtx) 5816 a.ctx = origCtx 5817 }() 5818 5819 defer span.Finish() 5820 resultVar0, resultVar1 := a.app.GetFileInfos(page, perPage, opt) 5821 5822 if resultVar1 != nil { 5823 span.LogFields(spanlog.Error(resultVar1)) 5824 ext.Error.Set(span, true) 5825 } 5826 5827 return resultVar0, resultVar1 5828 } 5829 5830 func (a *OpenTracingAppLayer) GetFileInfosForPost(postID string, fromMaster bool) ([]*model.FileInfo, *model.AppError) { 5831 origCtx := a.ctx 5832 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPost") 5833 5834 a.ctx = newCtx 5835 a.app.Srv().Store.SetContext(newCtx) 5836 defer func() { 5837 a.app.Srv().Store.SetContext(origCtx) 5838 a.ctx = origCtx 5839 }() 5840 5841 defer span.Finish() 5842 resultVar0, resultVar1 := a.app.GetFileInfosForPost(postID, fromMaster) 5843 5844 if resultVar1 != nil { 5845 span.LogFields(spanlog.Error(resultVar1)) 5846 ext.Error.Set(span, true) 5847 } 5848 5849 return resultVar0, resultVar1 5850 } 5851 5852 func (a *OpenTracingAppLayer) GetFileInfosForPostWithMigration(postID string) ([]*model.FileInfo, *model.AppError) { 5853 origCtx := a.ctx 5854 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPostWithMigration") 5855 5856 a.ctx = newCtx 5857 a.app.Srv().Store.SetContext(newCtx) 5858 defer func() { 5859 a.app.Srv().Store.SetContext(origCtx) 5860 a.ctx = origCtx 5861 }() 5862 5863 defer span.Finish() 5864 resultVar0, resultVar1 := a.app.GetFileInfosForPostWithMigration(postID) 5865 5866 if resultVar1 != nil { 5867 span.LogFields(spanlog.Error(resultVar1)) 5868 ext.Error.Set(span, true) 5869 } 5870 5871 return resultVar0, resultVar1 5872 } 5873 5874 func (a *OpenTracingAppLayer) GetFilteredUsersStats(options *model.UserCountOptions) (*model.UsersStats, *model.AppError) { 5875 origCtx := a.ctx 5876 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFilteredUsersStats") 5877 5878 a.ctx = newCtx 5879 a.app.Srv().Store.SetContext(newCtx) 5880 defer func() { 5881 a.app.Srv().Store.SetContext(origCtx) 5882 a.ctx = origCtx 5883 }() 5884 5885 defer span.Finish() 5886 resultVar0, resultVar1 := a.app.GetFilteredUsersStats(options) 5887 5888 if resultVar1 != nil { 5889 span.LogFields(spanlog.Error(resultVar1)) 5890 ext.Error.Set(span, true) 5891 } 5892 5893 return resultVar0, resultVar1 5894 } 5895 5896 func (a *OpenTracingAppLayer) GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError) { 5897 origCtx := a.ctx 5898 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPosts") 5899 5900 a.ctx = newCtx 5901 a.app.Srv().Store.SetContext(newCtx) 5902 defer func() { 5903 a.app.Srv().Store.SetContext(origCtx) 5904 a.ctx = origCtx 5905 }() 5906 5907 defer span.Finish() 5908 resultVar0, resultVar1 := a.app.GetFlaggedPosts(userID, offset, limit) 5909 5910 if resultVar1 != nil { 5911 span.LogFields(spanlog.Error(resultVar1)) 5912 ext.Error.Set(span, true) 5913 } 5914 5915 return resultVar0, resultVar1 5916 } 5917 5918 func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userID string, channelID string, offset int, limit int) (*model.PostList, *model.AppError) { 5919 origCtx := a.ctx 5920 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForChannel") 5921 5922 a.ctx = newCtx 5923 a.app.Srv().Store.SetContext(newCtx) 5924 defer func() { 5925 a.app.Srv().Store.SetContext(origCtx) 5926 a.ctx = origCtx 5927 }() 5928 5929 defer span.Finish() 5930 resultVar0, resultVar1 := a.app.GetFlaggedPostsForChannel(userID, channelID, offset, limit) 5931 5932 if resultVar1 != nil { 5933 span.LogFields(spanlog.Error(resultVar1)) 5934 ext.Error.Set(span, true) 5935 } 5936 5937 return resultVar0, resultVar1 5938 } 5939 5940 func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userID string, teamID string, offset int, limit int) (*model.PostList, *model.AppError) { 5941 origCtx := a.ctx 5942 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForTeam") 5943 5944 a.ctx = newCtx 5945 a.app.Srv().Store.SetContext(newCtx) 5946 defer func() { 5947 a.app.Srv().Store.SetContext(origCtx) 5948 a.ctx = origCtx 5949 }() 5950 5951 defer span.Finish() 5952 resultVar0, resultVar1 := a.app.GetFlaggedPostsForTeam(userID, teamID, offset, limit) 5953 5954 if resultVar1 != nil { 5955 span.LogFields(spanlog.Error(resultVar1)) 5956 ext.Error.Set(span, true) 5957 } 5958 5959 return resultVar0, resultVar1 5960 } 5961 5962 func (a *OpenTracingAppLayer) GetGlobalRetentionPolicy() (*model.GlobalRetentionPolicy, *model.AppError) { 5963 origCtx := a.ctx 5964 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGlobalRetentionPolicy") 5965 5966 a.ctx = newCtx 5967 a.app.Srv().Store.SetContext(newCtx) 5968 defer func() { 5969 a.app.Srv().Store.SetContext(origCtx) 5970 a.ctx = origCtx 5971 }() 5972 5973 defer span.Finish() 5974 resultVar0, resultVar1 := a.app.GetGlobalRetentionPolicy() 5975 5976 if resultVar1 != nil { 5977 span.LogFields(spanlog.Error(resultVar1)) 5978 ext.Error.Set(span, true) 5979 } 5980 5981 return resultVar0, resultVar1 5982 } 5983 5984 func (a *OpenTracingAppLayer) GetGroup(id string) (*model.Group, *model.AppError) { 5985 origCtx := a.ctx 5986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroup") 5987 5988 a.ctx = newCtx 5989 a.app.Srv().Store.SetContext(newCtx) 5990 defer func() { 5991 a.app.Srv().Store.SetContext(origCtx) 5992 a.ctx = origCtx 5993 }() 5994 5995 defer span.Finish() 5996 resultVar0, resultVar1 := a.app.GetGroup(id) 5997 5998 if resultVar1 != nil { 5999 span.LogFields(spanlog.Error(resultVar1)) 6000 ext.Error.Set(span, true) 6001 } 6002 6003 return resultVar0, resultVar1 6004 } 6005 6006 func (a *OpenTracingAppLayer) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) { 6007 origCtx := a.ctx 6008 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByName") 6009 6010 a.ctx = newCtx 6011 a.app.Srv().Store.SetContext(newCtx) 6012 defer func() { 6013 a.app.Srv().Store.SetContext(origCtx) 6014 a.ctx = origCtx 6015 }() 6016 6017 defer span.Finish() 6018 resultVar0, resultVar1 := a.app.GetGroupByName(name, opts) 6019 6020 if resultVar1 != nil { 6021 span.LogFields(spanlog.Error(resultVar1)) 6022 ext.Error.Set(span, true) 6023 } 6024 6025 return resultVar0, resultVar1 6026 } 6027 6028 func (a *OpenTracingAppLayer) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) { 6029 origCtx := a.ctx 6030 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByRemoteID") 6031 6032 a.ctx = newCtx 6033 a.app.Srv().Store.SetContext(newCtx) 6034 defer func() { 6035 a.app.Srv().Store.SetContext(origCtx) 6036 a.ctx = origCtx 6037 }() 6038 6039 defer span.Finish() 6040 resultVar0, resultVar1 := a.app.GetGroupByRemoteID(remoteID, groupSource) 6041 6042 if resultVar1 != nil { 6043 span.LogFields(spanlog.Error(resultVar1)) 6044 ext.Error.Set(span, true) 6045 } 6046 6047 return resultVar0, resultVar1 6048 } 6049 6050 func (a *OpenTracingAppLayer) GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { 6051 origCtx := a.ctx 6052 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupChannel") 6053 6054 a.ctx = newCtx 6055 a.app.Srv().Store.SetContext(newCtx) 6056 defer func() { 6057 a.app.Srv().Store.SetContext(origCtx) 6058 a.ctx = origCtx 6059 }() 6060 6061 defer span.Finish() 6062 resultVar0, resultVar1 := a.app.GetGroupChannel(userIDs) 6063 6064 if resultVar1 != nil { 6065 span.LogFields(spanlog.Error(resultVar1)) 6066 ext.Error.Set(span, true) 6067 } 6068 6069 return resultVar0, resultVar1 6070 } 6071 6072 func (a *OpenTracingAppLayer) GetGroupMemberCount(groupID string) (int64, *model.AppError) { 6073 origCtx := a.ctx 6074 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberCount") 6075 6076 a.ctx = newCtx 6077 a.app.Srv().Store.SetContext(newCtx) 6078 defer func() { 6079 a.app.Srv().Store.SetContext(origCtx) 6080 a.ctx = origCtx 6081 }() 6082 6083 defer span.Finish() 6084 resultVar0, resultVar1 := a.app.GetGroupMemberCount(groupID) 6085 6086 if resultVar1 != nil { 6087 span.LogFields(spanlog.Error(resultVar1)) 6088 ext.Error.Set(span, true) 6089 } 6090 6091 return resultVar0, resultVar1 6092 } 6093 6094 func (a *OpenTracingAppLayer) GetGroupMemberUsers(groupID string) ([]*model.User, *model.AppError) { 6095 origCtx := a.ctx 6096 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsers") 6097 6098 a.ctx = newCtx 6099 a.app.Srv().Store.SetContext(newCtx) 6100 defer func() { 6101 a.app.Srv().Store.SetContext(origCtx) 6102 a.ctx = origCtx 6103 }() 6104 6105 defer span.Finish() 6106 resultVar0, resultVar1 := a.app.GetGroupMemberUsers(groupID) 6107 6108 if resultVar1 != nil { 6109 span.LogFields(spanlog.Error(resultVar1)) 6110 ext.Error.Set(span, true) 6111 } 6112 6113 return resultVar0, resultVar1 6114 } 6115 6116 func (a *OpenTracingAppLayer) GetGroupMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, int, *model.AppError) { 6117 origCtx := a.ctx 6118 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsersPage") 6119 6120 a.ctx = newCtx 6121 a.app.Srv().Store.SetContext(newCtx) 6122 defer func() { 6123 a.app.Srv().Store.SetContext(origCtx) 6124 a.ctx = origCtx 6125 }() 6126 6127 defer span.Finish() 6128 resultVar0, resultVar1, resultVar2 := a.app.GetGroupMemberUsersPage(groupID, page, perPage) 6129 6130 if resultVar2 != nil { 6131 span.LogFields(spanlog.Error(resultVar2)) 6132 ext.Error.Set(span, true) 6133 } 6134 6135 return resultVar0, resultVar1, resultVar2 6136 } 6137 6138 func (a *OpenTracingAppLayer) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 6139 origCtx := a.ctx 6140 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncable") 6141 6142 a.ctx = newCtx 6143 a.app.Srv().Store.SetContext(newCtx) 6144 defer func() { 6145 a.app.Srv().Store.SetContext(origCtx) 6146 a.ctx = origCtx 6147 }() 6148 6149 defer span.Finish() 6150 resultVar0, resultVar1 := a.app.GetGroupSyncable(groupID, syncableID, syncableType) 6151 6152 if resultVar1 != nil { 6153 span.LogFields(spanlog.Error(resultVar1)) 6154 ext.Error.Set(span, true) 6155 } 6156 6157 return resultVar0, resultVar1 6158 } 6159 6160 func (a *OpenTracingAppLayer) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) { 6161 origCtx := a.ctx 6162 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncables") 6163 6164 a.ctx = newCtx 6165 a.app.Srv().Store.SetContext(newCtx) 6166 defer func() { 6167 a.app.Srv().Store.SetContext(origCtx) 6168 a.ctx = origCtx 6169 }() 6170 6171 defer span.Finish() 6172 resultVar0, resultVar1 := a.app.GetGroupSyncables(groupID, syncableType) 6173 6174 if resultVar1 != nil { 6175 span.LogFields(spanlog.Error(resultVar1)) 6176 ext.Error.Set(span, true) 6177 } 6178 6179 return resultVar0, resultVar1 6180 } 6181 6182 func (a *OpenTracingAppLayer) GetGroups(page int, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) { 6183 origCtx := a.ctx 6184 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroups") 6185 6186 a.ctx = newCtx 6187 a.app.Srv().Store.SetContext(newCtx) 6188 defer func() { 6189 a.app.Srv().Store.SetContext(origCtx) 6190 a.ctx = origCtx 6191 }() 6192 6193 defer span.Finish() 6194 resultVar0, resultVar1 := a.app.GetGroups(page, perPage, opts) 6195 6196 if resultVar1 != nil { 6197 span.LogFields(spanlog.Error(resultVar1)) 6198 ext.Error.Set(span, true) 6199 } 6200 6201 return resultVar0, resultVar1 6202 } 6203 6204 func (a *OpenTracingAppLayer) GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { 6205 origCtx := a.ctx 6206 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsAssociatedToChannelsByTeam") 6207 6208 a.ctx = newCtx 6209 a.app.Srv().Store.SetContext(newCtx) 6210 defer func() { 6211 a.app.Srv().Store.SetContext(origCtx) 6212 a.ctx = origCtx 6213 }() 6214 6215 defer span.Finish() 6216 resultVar0, resultVar1 := a.app.GetGroupsAssociatedToChannelsByTeam(teamID, opts) 6217 6218 if resultVar1 != nil { 6219 span.LogFields(spanlog.Error(resultVar1)) 6220 ext.Error.Set(span, true) 6221 } 6222 6223 return resultVar0, resultVar1 6224 } 6225 6226 func (a *OpenTracingAppLayer) GetGroupsByChannel(channelID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 6227 origCtx := a.ctx 6228 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByChannel") 6229 6230 a.ctx = newCtx 6231 a.app.Srv().Store.SetContext(newCtx) 6232 defer func() { 6233 a.app.Srv().Store.SetContext(origCtx) 6234 a.ctx = origCtx 6235 }() 6236 6237 defer span.Finish() 6238 resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByChannel(channelID, opts) 6239 6240 if resultVar2 != nil { 6241 span.LogFields(spanlog.Error(resultVar2)) 6242 ext.Error.Set(span, true) 6243 } 6244 6245 return resultVar0, resultVar1, resultVar2 6246 } 6247 6248 func (a *OpenTracingAppLayer) GetGroupsByIDs(groupIDs []string) ([]*model.Group, *model.AppError) { 6249 origCtx := a.ctx 6250 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByIDs") 6251 6252 a.ctx = newCtx 6253 a.app.Srv().Store.SetContext(newCtx) 6254 defer func() { 6255 a.app.Srv().Store.SetContext(origCtx) 6256 a.ctx = origCtx 6257 }() 6258 6259 defer span.Finish() 6260 resultVar0, resultVar1 := a.app.GetGroupsByIDs(groupIDs) 6261 6262 if resultVar1 != nil { 6263 span.LogFields(spanlog.Error(resultVar1)) 6264 ext.Error.Set(span, true) 6265 } 6266 6267 return resultVar0, resultVar1 6268 } 6269 6270 func (a *OpenTracingAppLayer) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) { 6271 origCtx := a.ctx 6272 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsBySource") 6273 6274 a.ctx = newCtx 6275 a.app.Srv().Store.SetContext(newCtx) 6276 defer func() { 6277 a.app.Srv().Store.SetContext(origCtx) 6278 a.ctx = origCtx 6279 }() 6280 6281 defer span.Finish() 6282 resultVar0, resultVar1 := a.app.GetGroupsBySource(groupSource) 6283 6284 if resultVar1 != nil { 6285 span.LogFields(spanlog.Error(resultVar1)) 6286 ext.Error.Set(span, true) 6287 } 6288 6289 return resultVar0, resultVar1 6290 } 6291 6292 func (a *OpenTracingAppLayer) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 6293 origCtx := a.ctx 6294 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByTeam") 6295 6296 a.ctx = newCtx 6297 a.app.Srv().Store.SetContext(newCtx) 6298 defer func() { 6299 a.app.Srv().Store.SetContext(origCtx) 6300 a.ctx = origCtx 6301 }() 6302 6303 defer span.Finish() 6304 resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByTeam(teamID, opts) 6305 6306 if resultVar2 != nil { 6307 span.LogFields(spanlog.Error(resultVar2)) 6308 ext.Error.Set(span, true) 6309 } 6310 6311 return resultVar0, resultVar1, resultVar2 6312 } 6313 6314 func (a *OpenTracingAppLayer) GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError) { 6315 origCtx := a.ctx 6316 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByUserId") 6317 6318 a.ctx = newCtx 6319 a.app.Srv().Store.SetContext(newCtx) 6320 defer func() { 6321 a.app.Srv().Store.SetContext(origCtx) 6322 a.ctx = origCtx 6323 }() 6324 6325 defer span.Finish() 6326 resultVar0, resultVar1 := a.app.GetGroupsByUserId(userID) 6327 6328 if resultVar1 != nil { 6329 span.LogFields(spanlog.Error(resultVar1)) 6330 ext.Error.Set(span, true) 6331 } 6332 6333 return resultVar0, resultVar1 6334 } 6335 6336 func (a *OpenTracingAppLayer) GetHubForUserId(userID string) *app.Hub { 6337 origCtx := a.ctx 6338 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetHubForUserId") 6339 6340 a.ctx = newCtx 6341 a.app.Srv().Store.SetContext(newCtx) 6342 defer func() { 6343 a.app.Srv().Store.SetContext(origCtx) 6344 a.ctx = origCtx 6345 }() 6346 6347 defer span.Finish() 6348 resultVar0 := a.app.GetHubForUserId(userID) 6349 6350 return resultVar0 6351 } 6352 6353 func (a *OpenTracingAppLayer) GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError) { 6354 origCtx := a.ctx 6355 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhook") 6356 6357 a.ctx = newCtx 6358 a.app.Srv().Store.SetContext(newCtx) 6359 defer func() { 6360 a.app.Srv().Store.SetContext(origCtx) 6361 a.ctx = origCtx 6362 }() 6363 6364 defer span.Finish() 6365 resultVar0, resultVar1 := a.app.GetIncomingWebhook(hookID) 6366 6367 if resultVar1 != nil { 6368 span.LogFields(spanlog.Error(resultVar1)) 6369 ext.Error.Set(span, true) 6370 } 6371 6372 return resultVar0, resultVar1 6373 } 6374 6375 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6376 origCtx := a.ctx 6377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPage") 6378 6379 a.ctx = newCtx 6380 a.app.Srv().Store.SetContext(newCtx) 6381 defer func() { 6382 a.app.Srv().Store.SetContext(origCtx) 6383 a.ctx = origCtx 6384 }() 6385 6386 defer span.Finish() 6387 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPage(teamID, page, perPage) 6388 6389 if resultVar1 != nil { 6390 span.LogFields(spanlog.Error(resultVar1)) 6391 ext.Error.Set(span, true) 6392 } 6393 6394 return resultVar0, resultVar1 6395 } 6396 6397 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6398 origCtx := a.ctx 6399 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPageByUser") 6400 6401 a.ctx = newCtx 6402 a.app.Srv().Store.SetContext(newCtx) 6403 defer func() { 6404 a.app.Srv().Store.SetContext(origCtx) 6405 a.ctx = origCtx 6406 }() 6407 6408 defer span.Finish() 6409 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPageByUser(teamID, userID, page, perPage) 6410 6411 if resultVar1 != nil { 6412 span.LogFields(spanlog.Error(resultVar1)) 6413 ext.Error.Set(span, true) 6414 } 6415 6416 return resultVar0, resultVar1 6417 } 6418 6419 func (a *OpenTracingAppLayer) GetIncomingWebhooksPage(page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6420 origCtx := a.ctx 6421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPage") 6422 6423 a.ctx = newCtx 6424 a.app.Srv().Store.SetContext(newCtx) 6425 defer func() { 6426 a.app.Srv().Store.SetContext(origCtx) 6427 a.ctx = origCtx 6428 }() 6429 6430 defer span.Finish() 6431 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPage(page, perPage) 6432 6433 if resultVar1 != nil { 6434 span.LogFields(spanlog.Error(resultVar1)) 6435 ext.Error.Set(span, true) 6436 } 6437 6438 return resultVar0, resultVar1 6439 } 6440 6441 func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6442 origCtx := a.ctx 6443 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPageByUser") 6444 6445 a.ctx = newCtx 6446 a.app.Srv().Store.SetContext(newCtx) 6447 defer func() { 6448 a.app.Srv().Store.SetContext(origCtx) 6449 a.ctx = origCtx 6450 }() 6451 6452 defer span.Finish() 6453 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPageByUser(userID, page, perPage) 6454 6455 if resultVar1 != nil { 6456 span.LogFields(spanlog.Error(resultVar1)) 6457 ext.Error.Set(span, true) 6458 } 6459 6460 return resultVar0, resultVar1 6461 } 6462 6463 func (a *OpenTracingAppLayer) GetJob(id string) (*model.Job, *model.AppError) { 6464 origCtx := a.ctx 6465 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJob") 6466 6467 a.ctx = newCtx 6468 a.app.Srv().Store.SetContext(newCtx) 6469 defer func() { 6470 a.app.Srv().Store.SetContext(origCtx) 6471 a.ctx = origCtx 6472 }() 6473 6474 defer span.Finish() 6475 resultVar0, resultVar1 := a.app.GetJob(id) 6476 6477 if resultVar1 != nil { 6478 span.LogFields(spanlog.Error(resultVar1)) 6479 ext.Error.Set(span, true) 6480 } 6481 6482 return resultVar0, resultVar1 6483 } 6484 6485 func (a *OpenTracingAppLayer) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) { 6486 origCtx := a.ctx 6487 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobs") 6488 6489 a.ctx = newCtx 6490 a.app.Srv().Store.SetContext(newCtx) 6491 defer func() { 6492 a.app.Srv().Store.SetContext(origCtx) 6493 a.ctx = origCtx 6494 }() 6495 6496 defer span.Finish() 6497 resultVar0, resultVar1 := a.app.GetJobs(offset, limit) 6498 6499 if resultVar1 != nil { 6500 span.LogFields(spanlog.Error(resultVar1)) 6501 ext.Error.Set(span, true) 6502 } 6503 6504 return resultVar0, resultVar1 6505 } 6506 6507 func (a *OpenTracingAppLayer) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 6508 origCtx := a.ctx 6509 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByType") 6510 6511 a.ctx = newCtx 6512 a.app.Srv().Store.SetContext(newCtx) 6513 defer func() { 6514 a.app.Srv().Store.SetContext(origCtx) 6515 a.ctx = origCtx 6516 }() 6517 6518 defer span.Finish() 6519 resultVar0, resultVar1 := a.app.GetJobsByType(jobType, offset, limit) 6520 6521 if resultVar1 != nil { 6522 span.LogFields(spanlog.Error(resultVar1)) 6523 ext.Error.Set(span, true) 6524 } 6525 6526 return resultVar0, resultVar1 6527 } 6528 6529 func (a *OpenTracingAppLayer) GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError) { 6530 origCtx := a.ctx 6531 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypePage") 6532 6533 a.ctx = newCtx 6534 a.app.Srv().Store.SetContext(newCtx) 6535 defer func() { 6536 a.app.Srv().Store.SetContext(origCtx) 6537 a.ctx = origCtx 6538 }() 6539 6540 defer span.Finish() 6541 resultVar0, resultVar1 := a.app.GetJobsByTypePage(jobType, page, perPage) 6542 6543 if resultVar1 != nil { 6544 span.LogFields(spanlog.Error(resultVar1)) 6545 ext.Error.Set(span, true) 6546 } 6547 6548 return resultVar0, resultVar1 6549 } 6550 6551 func (a *OpenTracingAppLayer) GetJobsByTypes(jobTypes []string, offset int, limit int) ([]*model.Job, *model.AppError) { 6552 origCtx := a.ctx 6553 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypes") 6554 6555 a.ctx = newCtx 6556 a.app.Srv().Store.SetContext(newCtx) 6557 defer func() { 6558 a.app.Srv().Store.SetContext(origCtx) 6559 a.ctx = origCtx 6560 }() 6561 6562 defer span.Finish() 6563 resultVar0, resultVar1 := a.app.GetJobsByTypes(jobTypes, offset, limit) 6564 6565 if resultVar1 != nil { 6566 span.LogFields(spanlog.Error(resultVar1)) 6567 ext.Error.Set(span, true) 6568 } 6569 6570 return resultVar0, resultVar1 6571 } 6572 6573 func (a *OpenTracingAppLayer) GetJobsByTypesPage(jobType []string, page int, perPage int) ([]*model.Job, *model.AppError) { 6574 origCtx := a.ctx 6575 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypesPage") 6576 6577 a.ctx = newCtx 6578 a.app.Srv().Store.SetContext(newCtx) 6579 defer func() { 6580 a.app.Srv().Store.SetContext(origCtx) 6581 a.ctx = origCtx 6582 }() 6583 6584 defer span.Finish() 6585 resultVar0, resultVar1 := a.app.GetJobsByTypesPage(jobType, page, perPage) 6586 6587 if resultVar1 != nil { 6588 span.LogFields(spanlog.Error(resultVar1)) 6589 ext.Error.Set(span, true) 6590 } 6591 6592 return resultVar0, resultVar1 6593 } 6594 6595 func (a *OpenTracingAppLayer) GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError) { 6596 origCtx := a.ctx 6597 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsPage") 6598 6599 a.ctx = newCtx 6600 a.app.Srv().Store.SetContext(newCtx) 6601 defer func() { 6602 a.app.Srv().Store.SetContext(origCtx) 6603 a.ctx = origCtx 6604 }() 6605 6606 defer span.Finish() 6607 resultVar0, resultVar1 := a.app.GetJobsPage(page, perPage) 6608 6609 if resultVar1 != nil { 6610 span.LogFields(spanlog.Error(resultVar1)) 6611 ext.Error.Set(span, true) 6612 } 6613 6614 return resultVar0, resultVar1 6615 } 6616 6617 func (a *OpenTracingAppLayer) GetKnownUsers(userID string) ([]string, *model.AppError) { 6618 origCtx := a.ctx 6619 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetKnownUsers") 6620 6621 a.ctx = newCtx 6622 a.app.Srv().Store.SetContext(newCtx) 6623 defer func() { 6624 a.app.Srv().Store.SetContext(origCtx) 6625 a.ctx = origCtx 6626 }() 6627 6628 defer span.Finish() 6629 resultVar0, resultVar1 := a.app.GetKnownUsers(userID) 6630 6631 if resultVar1 != nil { 6632 span.LogFields(spanlog.Error(resultVar1)) 6633 ext.Error.Set(span, true) 6634 } 6635 6636 return resultVar0, resultVar1 6637 } 6638 6639 func (a *OpenTracingAppLayer) GetLatestTermsOfService() (*model.TermsOfService, *model.AppError) { 6640 origCtx := a.ctx 6641 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLatestTermsOfService") 6642 6643 a.ctx = newCtx 6644 a.app.Srv().Store.SetContext(newCtx) 6645 defer func() { 6646 a.app.Srv().Store.SetContext(origCtx) 6647 a.ctx = origCtx 6648 }() 6649 6650 defer span.Finish() 6651 resultVar0, resultVar1 := a.app.GetLatestTermsOfService() 6652 6653 if resultVar1 != nil { 6654 span.LogFields(spanlog.Error(resultVar1)) 6655 ext.Error.Set(span, true) 6656 } 6657 6658 return resultVar0, resultVar1 6659 } 6660 6661 func (a *OpenTracingAppLayer) GetLdapGroup(ldapGroupID string) (*model.Group, *model.AppError) { 6662 origCtx := a.ctx 6663 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLdapGroup") 6664 6665 a.ctx = newCtx 6666 a.app.Srv().Store.SetContext(newCtx) 6667 defer func() { 6668 a.app.Srv().Store.SetContext(origCtx) 6669 a.ctx = origCtx 6670 }() 6671 6672 defer span.Finish() 6673 resultVar0, resultVar1 := a.app.GetLdapGroup(ldapGroupID) 6674 6675 if resultVar1 != nil { 6676 span.LogFields(spanlog.Error(resultVar1)) 6677 ext.Error.Set(span, true) 6678 } 6679 6680 return resultVar0, resultVar1 6681 } 6682 6683 func (a *OpenTracingAppLayer) GetLogs(page int, perPage int) ([]string, *model.AppError) { 6684 origCtx := a.ctx 6685 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogs") 6686 6687 a.ctx = newCtx 6688 a.app.Srv().Store.SetContext(newCtx) 6689 defer func() { 6690 a.app.Srv().Store.SetContext(origCtx) 6691 a.ctx = origCtx 6692 }() 6693 6694 defer span.Finish() 6695 resultVar0, resultVar1 := a.app.GetLogs(page, perPage) 6696 6697 if resultVar1 != nil { 6698 span.LogFields(spanlog.Error(resultVar1)) 6699 ext.Error.Set(span, true) 6700 } 6701 6702 return resultVar0, resultVar1 6703 } 6704 6705 func (a *OpenTracingAppLayer) GetLogsSkipSend(page int, perPage int) ([]string, *model.AppError) { 6706 origCtx := a.ctx 6707 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogsSkipSend") 6708 6709 a.ctx = newCtx 6710 a.app.Srv().Store.SetContext(newCtx) 6711 defer func() { 6712 a.app.Srv().Store.SetContext(origCtx) 6713 a.ctx = origCtx 6714 }() 6715 6716 defer span.Finish() 6717 resultVar0, resultVar1 := a.app.GetLogsSkipSend(page, perPage) 6718 6719 if resultVar1 != nil { 6720 span.LogFields(spanlog.Error(resultVar1)) 6721 ext.Error.Set(span, true) 6722 } 6723 6724 return resultVar0, resultVar1 6725 } 6726 6727 func (a *OpenTracingAppLayer) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) { 6728 origCtx := a.ctx 6729 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMarketplacePlugins") 6730 6731 a.ctx = newCtx 6732 a.app.Srv().Store.SetContext(newCtx) 6733 defer func() { 6734 a.app.Srv().Store.SetContext(origCtx) 6735 a.ctx = origCtx 6736 }() 6737 6738 defer span.Finish() 6739 resultVar0, resultVar1 := a.app.GetMarketplacePlugins(filter) 6740 6741 if resultVar1 != nil { 6742 span.LogFields(spanlog.Error(resultVar1)) 6743 ext.Error.Set(span, true) 6744 } 6745 6746 return resultVar0, resultVar1 6747 } 6748 6749 func (a *OpenTracingAppLayer) GetMemberCountsByGroup(ctx context.Context, channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, *model.AppError) { 6750 origCtx := a.ctx 6751 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMemberCountsByGroup") 6752 6753 a.ctx = newCtx 6754 a.app.Srv().Store.SetContext(newCtx) 6755 defer func() { 6756 a.app.Srv().Store.SetContext(origCtx) 6757 a.ctx = origCtx 6758 }() 6759 6760 defer span.Finish() 6761 resultVar0, resultVar1 := a.app.GetMemberCountsByGroup(ctx, channelID, includeTimezones) 6762 6763 if resultVar1 != nil { 6764 span.LogFields(spanlog.Error(resultVar1)) 6765 ext.Error.Set(span, true) 6766 } 6767 6768 return resultVar0, resultVar1 6769 } 6770 6771 func (a *OpenTracingAppLayer) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string { 6772 origCtx := a.ctx 6773 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMessageForNotification") 6774 6775 a.ctx = newCtx 6776 a.app.Srv().Store.SetContext(newCtx) 6777 defer func() { 6778 a.app.Srv().Store.SetContext(origCtx) 6779 a.ctx = origCtx 6780 }() 6781 6782 defer span.Finish() 6783 resultVar0 := a.app.GetMessageForNotification(post, translateFunc) 6784 6785 return resultVar0 6786 } 6787 6788 func (a *OpenTracingAppLayer) GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) { 6789 origCtx := a.ctx 6790 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMultipleEmojiByName") 6791 6792 a.ctx = newCtx 6793 a.app.Srv().Store.SetContext(newCtx) 6794 defer func() { 6795 a.app.Srv().Store.SetContext(origCtx) 6796 a.ctx = origCtx 6797 }() 6798 6799 defer span.Finish() 6800 resultVar0, resultVar1 := a.app.GetMultipleEmojiByName(names) 6801 6802 if resultVar1 != nil { 6803 span.LogFields(spanlog.Error(resultVar1)) 6804 ext.Error.Set(span, true) 6805 } 6806 6807 return resultVar0, resultVar1 6808 } 6809 6810 func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 6811 origCtx := a.ctx 6812 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNewUsersForTeamPage") 6813 6814 a.ctx = newCtx 6815 a.app.Srv().Store.SetContext(newCtx) 6816 defer func() { 6817 a.app.Srv().Store.SetContext(origCtx) 6818 a.ctx = origCtx 6819 }() 6820 6821 defer span.Finish() 6822 resultVar0, resultVar1 := a.app.GetNewUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) 6823 6824 if resultVar1 != nil { 6825 span.LogFields(spanlog.Error(resultVar1)) 6826 ext.Error.Set(span, true) 6827 } 6828 6829 return resultVar0, resultVar1 6830 } 6831 6832 func (a *OpenTracingAppLayer) GetNextPostIdFromPostList(postList *model.PostList, collapsedThreads bool) string { 6833 origCtx := a.ctx 6834 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNextPostIdFromPostList") 6835 6836 a.ctx = newCtx 6837 a.app.Srv().Store.SetContext(newCtx) 6838 defer func() { 6839 a.app.Srv().Store.SetContext(origCtx) 6840 a.ctx = origCtx 6841 }() 6842 6843 defer span.Finish() 6844 resultVar0 := a.app.GetNextPostIdFromPostList(postList, collapsedThreads) 6845 6846 return resultVar0 6847 } 6848 6849 func (a *OpenTracingAppLayer) GetNotificationNameFormat(user *model.User) string { 6850 origCtx := a.ctx 6851 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNotificationNameFormat") 6852 6853 a.ctx = newCtx 6854 a.app.Srv().Store.SetContext(newCtx) 6855 defer func() { 6856 a.app.Srv().Store.SetContext(origCtx) 6857 a.ctx = origCtx 6858 }() 6859 6860 defer span.Finish() 6861 resultVar0 := a.app.GetNotificationNameFormat(user) 6862 6863 return resultVar0 6864 } 6865 6866 func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError) { 6867 origCtx := a.ctx 6868 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNumberOfChannelsOnTeam") 6869 6870 a.ctx = newCtx 6871 a.app.Srv().Store.SetContext(newCtx) 6872 defer func() { 6873 a.app.Srv().Store.SetContext(origCtx) 6874 a.ctx = origCtx 6875 }() 6876 6877 defer span.Finish() 6878 resultVar0, resultVar1 := a.app.GetNumberOfChannelsOnTeam(teamID) 6879 6880 if resultVar1 != nil { 6881 span.LogFields(spanlog.Error(resultVar1)) 6882 ext.Error.Set(span, true) 6883 } 6884 6885 return resultVar0, resultVar1 6886 } 6887 6888 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(clientId string, grantType string, redirectUri string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) { 6889 origCtx := a.ctx 6890 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForCodeFlow") 6891 6892 a.ctx = newCtx 6893 a.app.Srv().Store.SetContext(newCtx) 6894 defer func() { 6895 a.app.Srv().Store.SetContext(origCtx) 6896 a.ctx = origCtx 6897 }() 6898 6899 defer span.Finish() 6900 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken) 6901 6902 if resultVar1 != nil { 6903 span.LogFields(spanlog.Error(resultVar1)) 6904 ext.Error.Set(span, true) 6905 } 6906 6907 return resultVar0, resultVar1 6908 } 6909 6910 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { 6911 origCtx := a.ctx 6912 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow") 6913 6914 a.ctx = newCtx 6915 a.app.Srv().Store.SetContext(newCtx) 6916 defer func() { 6917 a.app.Srv().Store.SetContext(origCtx) 6918 a.ctx = origCtx 6919 }() 6920 6921 defer span.Finish() 6922 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userID, authRequest) 6923 6924 if resultVar1 != nil { 6925 span.LogFields(spanlog.Error(resultVar1)) 6926 ext.Error.Set(span, true) 6927 } 6928 6929 return resultVar0, resultVar1 6930 } 6931 6932 func (a *OpenTracingAppLayer) GetOAuthApp(appID string) (*model.OAuthApp, *model.AppError) { 6933 origCtx := a.ctx 6934 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApp") 6935 6936 a.ctx = newCtx 6937 a.app.Srv().Store.SetContext(newCtx) 6938 defer func() { 6939 a.app.Srv().Store.SetContext(origCtx) 6940 a.ctx = origCtx 6941 }() 6942 6943 defer span.Finish() 6944 resultVar0, resultVar1 := a.app.GetOAuthApp(appID) 6945 6946 if resultVar1 != nil { 6947 span.LogFields(spanlog.Error(resultVar1)) 6948 ext.Error.Set(span, true) 6949 } 6950 6951 return resultVar0, resultVar1 6952 } 6953 6954 func (a *OpenTracingAppLayer) GetOAuthApps(page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6955 origCtx := a.ctx 6956 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApps") 6957 6958 a.ctx = newCtx 6959 a.app.Srv().Store.SetContext(newCtx) 6960 defer func() { 6961 a.app.Srv().Store.SetContext(origCtx) 6962 a.ctx = origCtx 6963 }() 6964 6965 defer span.Finish() 6966 resultVar0, resultVar1 := a.app.GetOAuthApps(page, perPage) 6967 6968 if resultVar1 != nil { 6969 span.LogFields(spanlog.Error(resultVar1)) 6970 ext.Error.Set(span, true) 6971 } 6972 6973 return resultVar0, resultVar1 6974 } 6975 6976 func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6977 origCtx := a.ctx 6978 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAppsByCreator") 6979 6980 a.ctx = newCtx 6981 a.app.Srv().Store.SetContext(newCtx) 6982 defer func() { 6983 a.app.Srv().Store.SetContext(origCtx) 6984 a.ctx = origCtx 6985 }() 6986 6987 defer span.Finish() 6988 resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userID, page, perPage) 6989 6990 if resultVar1 != nil { 6991 span.LogFields(spanlog.Error(resultVar1)) 6992 ext.Error.Set(span, true) 6993 } 6994 6995 return resultVar0, resultVar1 6996 } 6997 6998 func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 6999 origCtx := a.ctx 7000 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthCodeRedirect") 7001 7002 a.ctx = newCtx 7003 a.app.Srv().Store.SetContext(newCtx) 7004 defer func() { 7005 a.app.Srv().Store.SetContext(origCtx) 7006 a.ctx = origCtx 7007 }() 7008 7009 defer span.Finish() 7010 resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userID, authRequest) 7011 7012 if resultVar1 != nil { 7013 span.LogFields(spanlog.Error(resultVar1)) 7014 ext.Error.Set(span, true) 7015 } 7016 7017 return resultVar0, resultVar1 7018 } 7019 7020 func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 7021 origCtx := a.ctx 7022 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect") 7023 7024 a.ctx = newCtx 7025 a.app.Srv().Store.SetContext(newCtx) 7026 defer func() { 7027 a.app.Srv().Store.SetContext(origCtx) 7028 a.ctx = origCtx 7029 }() 7030 7031 defer span.Finish() 7032 resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userID, authRequest) 7033 7034 if resultVar1 != nil { 7035 span.LogFields(spanlog.Error(resultVar1)) 7036 ext.Error.Set(span, true) 7037 } 7038 7039 return resultVar0, resultVar1 7040 } 7041 7042 func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service string, teamID string, action string, redirectTo string, loginHint string, isMobile bool) (string, *model.AppError) { 7043 origCtx := a.ctx 7044 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint") 7045 7046 a.ctx = newCtx 7047 a.app.Srv().Store.SetContext(newCtx) 7048 defer func() { 7049 a.app.Srv().Store.SetContext(origCtx) 7050 a.ctx = origCtx 7051 }() 7052 7053 defer span.Finish() 7054 resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, teamID, action, redirectTo, loginHint, isMobile) 7055 7056 if resultVar1 != nil { 7057 span.LogFields(spanlog.Error(resultVar1)) 7058 ext.Error.Set(span, true) 7059 } 7060 7061 return resultVar0, resultVar1 7062 } 7063 7064 func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, teamID string) (string, *model.AppError) { 7065 origCtx := a.ctx 7066 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint") 7067 7068 a.ctx = newCtx 7069 a.app.Srv().Store.SetContext(newCtx) 7070 defer func() { 7071 a.app.Srv().Store.SetContext(origCtx) 7072 a.ctx = origCtx 7073 }() 7074 7075 defer span.Finish() 7076 resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, teamID) 7077 7078 if resultVar1 != nil { 7079 span.LogFields(spanlog.Error(resultVar1)) 7080 ext.Error.Set(span, true) 7081 } 7082 7083 return resultVar0, resultVar1 7084 } 7085 7086 func (a *OpenTracingAppLayer) GetOAuthStateToken(token string) (*model.Token, *model.AppError) { 7087 origCtx := a.ctx 7088 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthStateToken") 7089 7090 a.ctx = newCtx 7091 a.app.Srv().Store.SetContext(newCtx) 7092 defer func() { 7093 a.app.Srv().Store.SetContext(origCtx) 7094 a.ctx = origCtx 7095 }() 7096 7097 defer span.Finish() 7098 resultVar0, resultVar1 := a.app.GetOAuthStateToken(token) 7099 7100 if resultVar1 != nil { 7101 span.LogFields(spanlog.Error(resultVar1)) 7102 ext.Error.Set(span, true) 7103 } 7104 7105 return resultVar0, resultVar1 7106 } 7107 7108 func (a *OpenTracingAppLayer) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph { 7109 origCtx := a.ctx 7110 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOpenGraphMetadata") 7111 7112 a.ctx = newCtx 7113 a.app.Srv().Store.SetContext(newCtx) 7114 defer func() { 7115 a.app.Srv().Store.SetContext(origCtx) 7116 a.ctx = origCtx 7117 }() 7118 7119 defer span.Finish() 7120 resultVar0 := a.app.GetOpenGraphMetadata(requestURL) 7121 7122 return resultVar0 7123 } 7124 7125 func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(c *request.Context, userID string, otherUserID string, channelOptions ...model.ChannelOption) (*model.Channel, *model.AppError) { 7126 origCtx := a.ctx 7127 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOrCreateDirectChannel") 7128 7129 a.ctx = newCtx 7130 a.app.Srv().Store.SetContext(newCtx) 7131 defer func() { 7132 a.app.Srv().Store.SetContext(origCtx) 7133 a.ctx = origCtx 7134 }() 7135 7136 defer span.Finish() 7137 resultVar0, resultVar1 := a.app.GetOrCreateDirectChannel(c, userID, otherUserID, channelOptions...) 7138 7139 if resultVar1 != nil { 7140 span.LogFields(spanlog.Error(resultVar1)) 7141 ext.Error.Set(span, true) 7142 } 7143 7144 return resultVar0, resultVar1 7145 } 7146 7147 func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError) { 7148 origCtx := a.ctx 7149 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhook") 7150 7151 a.ctx = newCtx 7152 a.app.Srv().Store.SetContext(newCtx) 7153 defer func() { 7154 a.app.Srv().Store.SetContext(origCtx) 7155 a.ctx = origCtx 7156 }() 7157 7158 defer span.Finish() 7159 resultVar0, resultVar1 := a.app.GetOutgoingWebhook(hookID) 7160 7161 if resultVar1 != nil { 7162 span.LogFields(spanlog.Error(resultVar1)) 7163 ext.Error.Set(span, true) 7164 } 7165 7166 return resultVar0, resultVar1 7167 } 7168 7169 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelID string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 7170 origCtx := a.ctx 7171 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForChannelPageByUser") 7172 7173 a.ctx = newCtx 7174 a.app.Srv().Store.SetContext(newCtx) 7175 defer func() { 7176 a.app.Srv().Store.SetContext(origCtx) 7177 a.ctx = origCtx 7178 }() 7179 7180 defer span.Finish() 7181 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForChannelPageByUser(channelID, userID, page, perPage) 7182 7183 if resultVar1 != nil { 7184 span.LogFields(spanlog.Error(resultVar1)) 7185 ext.Error.Set(span, true) 7186 } 7187 7188 return resultVar0, resultVar1 7189 } 7190 7191 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 7192 origCtx := a.ctx 7193 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPage") 7194 7195 a.ctx = newCtx 7196 a.app.Srv().Store.SetContext(newCtx) 7197 defer func() { 7198 a.app.Srv().Store.SetContext(origCtx) 7199 a.ctx = origCtx 7200 }() 7201 7202 defer span.Finish() 7203 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPage(teamID, page, perPage) 7204 7205 if resultVar1 != nil { 7206 span.LogFields(spanlog.Error(resultVar1)) 7207 ext.Error.Set(span, true) 7208 } 7209 7210 return resultVar0, resultVar1 7211 } 7212 7213 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 7214 origCtx := a.ctx 7215 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPageByUser") 7216 7217 a.ctx = newCtx 7218 a.app.Srv().Store.SetContext(newCtx) 7219 defer func() { 7220 a.app.Srv().Store.SetContext(origCtx) 7221 a.ctx = origCtx 7222 }() 7223 7224 defer span.Finish() 7225 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPageByUser(teamID, userID, page, perPage) 7226 7227 if resultVar1 != nil { 7228 span.LogFields(spanlog.Error(resultVar1)) 7229 ext.Error.Set(span, true) 7230 } 7231 7232 return resultVar0, resultVar1 7233 } 7234 7235 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPage(page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 7236 origCtx := a.ctx 7237 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPage") 7238 7239 a.ctx = newCtx 7240 a.app.Srv().Store.SetContext(newCtx) 7241 defer func() { 7242 a.app.Srv().Store.SetContext(origCtx) 7243 a.ctx = origCtx 7244 }() 7245 7246 defer span.Finish() 7247 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPage(page, perPage) 7248 7249 if resultVar1 != nil { 7250 span.LogFields(spanlog.Error(resultVar1)) 7251 ext.Error.Set(span, true) 7252 } 7253 7254 return resultVar0, resultVar1 7255 } 7256 7257 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 7258 origCtx := a.ctx 7259 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPageByUser") 7260 7261 a.ctx = newCtx 7262 a.app.Srv().Store.SetContext(newCtx) 7263 defer func() { 7264 a.app.Srv().Store.SetContext(origCtx) 7265 a.ctx = origCtx 7266 }() 7267 7268 defer span.Finish() 7269 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPageByUser(userID, page, perPage) 7270 7271 if resultVar1 != nil { 7272 span.LogFields(spanlog.Error(resultVar1)) 7273 ext.Error.Set(span, true) 7274 } 7275 7276 return resultVar0, resultVar1 7277 } 7278 7279 func (a *OpenTracingAppLayer) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) { 7280 origCtx := a.ctx 7281 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPasswordRecoveryToken") 7282 7283 a.ctx = newCtx 7284 a.app.Srv().Store.SetContext(newCtx) 7285 defer func() { 7286 a.app.Srv().Store.SetContext(origCtx) 7287 a.ctx = origCtx 7288 }() 7289 7290 defer span.Finish() 7291 resultVar0, resultVar1 := a.app.GetPasswordRecoveryToken(token) 7292 7293 if resultVar1 != nil { 7294 span.LogFields(spanlog.Error(resultVar1)) 7295 ext.Error.Set(span, true) 7296 } 7297 7298 return resultVar0, resultVar1 7299 } 7300 7301 func (a *OpenTracingAppLayer) GetPermalinkPost(c *request.Context, postID string, userID string) (*model.PostList, *model.AppError) { 7302 origCtx := a.ctx 7303 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPermalinkPost") 7304 7305 a.ctx = newCtx 7306 a.app.Srv().Store.SetContext(newCtx) 7307 defer func() { 7308 a.app.Srv().Store.SetContext(origCtx) 7309 a.ctx = origCtx 7310 }() 7311 7312 defer span.Finish() 7313 resultVar0, resultVar1 := a.app.GetPermalinkPost(c, postID, userID) 7314 7315 if resultVar1 != nil { 7316 span.LogFields(spanlog.Error(resultVar1)) 7317 ext.Error.Set(span, true) 7318 } 7319 7320 return resultVar0, resultVar1 7321 } 7322 7323 func (a *OpenTracingAppLayer) GetPinnedPosts(channelID string) (*model.PostList, *model.AppError) { 7324 origCtx := a.ctx 7325 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPinnedPosts") 7326 7327 a.ctx = newCtx 7328 a.app.Srv().Store.SetContext(newCtx) 7329 defer func() { 7330 a.app.Srv().Store.SetContext(origCtx) 7331 a.ctx = origCtx 7332 }() 7333 7334 defer span.Finish() 7335 resultVar0, resultVar1 := a.app.GetPinnedPosts(channelID) 7336 7337 if resultVar1 != nil { 7338 span.LogFields(spanlog.Error(resultVar1)) 7339 ext.Error.Set(span, true) 7340 } 7341 7342 return resultVar0, resultVar1 7343 } 7344 7345 func (a *OpenTracingAppLayer) GetPluginKey(pluginID string, key string) ([]byte, *model.AppError) { 7346 origCtx := a.ctx 7347 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginKey") 7348 7349 a.ctx = newCtx 7350 a.app.Srv().Store.SetContext(newCtx) 7351 defer func() { 7352 a.app.Srv().Store.SetContext(origCtx) 7353 a.ctx = origCtx 7354 }() 7355 7356 defer span.Finish() 7357 resultVar0, resultVar1 := a.app.GetPluginKey(pluginID, key) 7358 7359 if resultVar1 != nil { 7360 span.LogFields(spanlog.Error(resultVar1)) 7361 ext.Error.Set(span, true) 7362 } 7363 7364 return resultVar0, resultVar1 7365 } 7366 7367 func (a *OpenTracingAppLayer) GetPluginPublicKeyFiles() ([]string, *model.AppError) { 7368 origCtx := a.ctx 7369 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginPublicKeyFiles") 7370 7371 a.ctx = newCtx 7372 a.app.Srv().Store.SetContext(newCtx) 7373 defer func() { 7374 a.app.Srv().Store.SetContext(origCtx) 7375 a.ctx = origCtx 7376 }() 7377 7378 defer span.Finish() 7379 resultVar0, resultVar1 := a.app.GetPluginPublicKeyFiles() 7380 7381 if resultVar1 != nil { 7382 span.LogFields(spanlog.Error(resultVar1)) 7383 ext.Error.Set(span, true) 7384 } 7385 7386 return resultVar0, resultVar1 7387 } 7388 7389 func (a *OpenTracingAppLayer) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) { 7390 origCtx := a.ctx 7391 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatus") 7392 7393 a.ctx = newCtx 7394 a.app.Srv().Store.SetContext(newCtx) 7395 defer func() { 7396 a.app.Srv().Store.SetContext(origCtx) 7397 a.ctx = origCtx 7398 }() 7399 7400 defer span.Finish() 7401 resultVar0, resultVar1 := a.app.GetPluginStatus(id) 7402 7403 if resultVar1 != nil { 7404 span.LogFields(spanlog.Error(resultVar1)) 7405 ext.Error.Set(span, true) 7406 } 7407 7408 return resultVar0, resultVar1 7409 } 7410 7411 func (a *OpenTracingAppLayer) GetPluginStatuses() (model.PluginStatuses, *model.AppError) { 7412 origCtx := a.ctx 7413 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatuses") 7414 7415 a.ctx = newCtx 7416 a.app.Srv().Store.SetContext(newCtx) 7417 defer func() { 7418 a.app.Srv().Store.SetContext(origCtx) 7419 a.ctx = origCtx 7420 }() 7421 7422 defer span.Finish() 7423 resultVar0, resultVar1 := a.app.GetPluginStatuses() 7424 7425 if resultVar1 != nil { 7426 span.LogFields(spanlog.Error(resultVar1)) 7427 ext.Error.Set(span, true) 7428 } 7429 7430 return resultVar0, resultVar1 7431 } 7432 7433 func (a *OpenTracingAppLayer) GetPlugins() (*model.PluginsResponse, *model.AppError) { 7434 origCtx := a.ctx 7435 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPlugins") 7436 7437 a.ctx = newCtx 7438 a.app.Srv().Store.SetContext(newCtx) 7439 defer func() { 7440 a.app.Srv().Store.SetContext(origCtx) 7441 a.ctx = origCtx 7442 }() 7443 7444 defer span.Finish() 7445 resultVar0, resultVar1 := a.app.GetPlugins() 7446 7447 if resultVar1 != nil { 7448 span.LogFields(spanlog.Error(resultVar1)) 7449 ext.Error.Set(span, true) 7450 } 7451 7452 return resultVar0, resultVar1 7453 } 7454 7455 func (a *OpenTracingAppLayer) GetPluginsEnvironment() *plugin.Environment { 7456 origCtx := a.ctx 7457 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginsEnvironment") 7458 7459 a.ctx = newCtx 7460 a.app.Srv().Store.SetContext(newCtx) 7461 defer func() { 7462 a.app.Srv().Store.SetContext(origCtx) 7463 a.ctx = origCtx 7464 }() 7465 7466 defer span.Finish() 7467 resultVar0 := a.app.GetPluginsEnvironment() 7468 7469 return resultVar0 7470 } 7471 7472 func (a *OpenTracingAppLayer) GetPostAfterTime(channelID string, time int64, collapsedThreads bool) (*model.Post, *model.AppError) { 7473 origCtx := a.ctx 7474 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostAfterTime") 7475 7476 a.ctx = newCtx 7477 a.app.Srv().Store.SetContext(newCtx) 7478 defer func() { 7479 a.app.Srv().Store.SetContext(origCtx) 7480 a.ctx = origCtx 7481 }() 7482 7483 defer span.Finish() 7484 resultVar0, resultVar1 := a.app.GetPostAfterTime(channelID, time, collapsedThreads) 7485 7486 if resultVar1 != nil { 7487 span.LogFields(spanlog.Error(resultVar1)) 7488 ext.Error.Set(span, true) 7489 } 7490 7491 return resultVar0, resultVar1 7492 } 7493 7494 func (a *OpenTracingAppLayer) GetPostIdAfterTime(channelID string, time int64, collapsedThreads bool) (string, *model.AppError) { 7495 origCtx := a.ctx 7496 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdAfterTime") 7497 7498 a.ctx = newCtx 7499 a.app.Srv().Store.SetContext(newCtx) 7500 defer func() { 7501 a.app.Srv().Store.SetContext(origCtx) 7502 a.ctx = origCtx 7503 }() 7504 7505 defer span.Finish() 7506 resultVar0, resultVar1 := a.app.GetPostIdAfterTime(channelID, time, collapsedThreads) 7507 7508 if resultVar1 != nil { 7509 span.LogFields(spanlog.Error(resultVar1)) 7510 ext.Error.Set(span, true) 7511 } 7512 7513 return resultVar0, resultVar1 7514 } 7515 7516 func (a *OpenTracingAppLayer) GetPostIdBeforeTime(channelID string, time int64, collapsedThreads bool) (string, *model.AppError) { 7517 origCtx := a.ctx 7518 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdBeforeTime") 7519 7520 a.ctx = newCtx 7521 a.app.Srv().Store.SetContext(newCtx) 7522 defer func() { 7523 a.app.Srv().Store.SetContext(origCtx) 7524 a.ctx = origCtx 7525 }() 7526 7527 defer span.Finish() 7528 resultVar0, resultVar1 := a.app.GetPostIdBeforeTime(channelID, time, collapsedThreads) 7529 7530 if resultVar1 != nil { 7531 span.LogFields(spanlog.Error(resultVar1)) 7532 ext.Error.Set(span, true) 7533 } 7534 7535 return resultVar0, resultVar1 7536 } 7537 7538 func (a *OpenTracingAppLayer) GetPostThread(postID string, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool, userID string) (*model.PostList, *model.AppError) { 7539 origCtx := a.ctx 7540 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostThread") 7541 7542 a.ctx = newCtx 7543 a.app.Srv().Store.SetContext(newCtx) 7544 defer func() { 7545 a.app.Srv().Store.SetContext(origCtx) 7546 a.ctx = origCtx 7547 }() 7548 7549 defer span.Finish() 7550 resultVar0, resultVar1 := a.app.GetPostThread(postID, skipFetchThreads, collapsedThreads, collapsedThreadsExtended, userID) 7551 7552 if resultVar1 != nil { 7553 span.LogFields(spanlog.Error(resultVar1)) 7554 ext.Error.Set(span, true) 7555 } 7556 7557 return resultVar0, resultVar1 7558 } 7559 7560 func (a *OpenTracingAppLayer) GetPosts(channelID string, offset int, limit int) (*model.PostList, *model.AppError) { 7561 origCtx := a.ctx 7562 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPosts") 7563 7564 a.ctx = newCtx 7565 a.app.Srv().Store.SetContext(newCtx) 7566 defer func() { 7567 a.app.Srv().Store.SetContext(origCtx) 7568 a.ctx = origCtx 7569 }() 7570 7571 defer span.Finish() 7572 resultVar0, resultVar1 := a.app.GetPosts(channelID, offset, limit) 7573 7574 if resultVar1 != nil { 7575 span.LogFields(spanlog.Error(resultVar1)) 7576 ext.Error.Set(span, true) 7577 } 7578 7579 return resultVar0, resultVar1 7580 } 7581 7582 func (a *OpenTracingAppLayer) GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7583 origCtx := a.ctx 7584 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAfterPost") 7585 7586 a.ctx = newCtx 7587 a.app.Srv().Store.SetContext(newCtx) 7588 defer func() { 7589 a.app.Srv().Store.SetContext(origCtx) 7590 a.ctx = origCtx 7591 }() 7592 7593 defer span.Finish() 7594 resultVar0, resultVar1 := a.app.GetPostsAfterPost(options) 7595 7596 if resultVar1 != nil { 7597 span.LogFields(spanlog.Error(resultVar1)) 7598 ext.Error.Set(span, true) 7599 } 7600 7601 return resultVar0, resultVar1 7602 } 7603 7604 func (a *OpenTracingAppLayer) GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7605 origCtx := a.ctx 7606 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAroundPost") 7607 7608 a.ctx = newCtx 7609 a.app.Srv().Store.SetContext(newCtx) 7610 defer func() { 7611 a.app.Srv().Store.SetContext(origCtx) 7612 a.ctx = origCtx 7613 }() 7614 7615 defer span.Finish() 7616 resultVar0, resultVar1 := a.app.GetPostsAroundPost(before, options) 7617 7618 if resultVar1 != nil { 7619 span.LogFields(spanlog.Error(resultVar1)) 7620 ext.Error.Set(span, true) 7621 } 7622 7623 return resultVar0, resultVar1 7624 } 7625 7626 func (a *OpenTracingAppLayer) GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7627 origCtx := a.ctx 7628 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsBeforePost") 7629 7630 a.ctx = newCtx 7631 a.app.Srv().Store.SetContext(newCtx) 7632 defer func() { 7633 a.app.Srv().Store.SetContext(origCtx) 7634 a.ctx = origCtx 7635 }() 7636 7637 defer span.Finish() 7638 resultVar0, resultVar1 := a.app.GetPostsBeforePost(options) 7639 7640 if resultVar1 != nil { 7641 span.LogFields(spanlog.Error(resultVar1)) 7642 ext.Error.Set(span, true) 7643 } 7644 7645 return resultVar0, resultVar1 7646 } 7647 7648 func (a *OpenTracingAppLayer) GetPostsEtag(channelID string, collapsedThreads bool) string { 7649 origCtx := a.ctx 7650 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsEtag") 7651 7652 a.ctx = newCtx 7653 a.app.Srv().Store.SetContext(newCtx) 7654 defer func() { 7655 a.app.Srv().Store.SetContext(origCtx) 7656 a.ctx = origCtx 7657 }() 7658 7659 defer span.Finish() 7660 resultVar0 := a.app.GetPostsEtag(channelID, collapsedThreads) 7661 7662 return resultVar0 7663 } 7664 7665 func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelID string, userID string, limitBefore int, limitAfter int, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { 7666 origCtx := a.ctx 7667 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsForChannelAroundLastUnread") 7668 7669 a.ctx = newCtx 7670 a.app.Srv().Store.SetContext(newCtx) 7671 defer func() { 7672 a.app.Srv().Store.SetContext(origCtx) 7673 a.ctx = origCtx 7674 }() 7675 7676 defer span.Finish() 7677 resultVar0, resultVar1 := a.app.GetPostsForChannelAroundLastUnread(channelID, userID, limitBefore, limitAfter, skipFetchThreads, collapsedThreads, collapsedThreadsExtended) 7678 7679 if resultVar1 != nil { 7680 span.LogFields(spanlog.Error(resultVar1)) 7681 ext.Error.Set(span, true) 7682 } 7683 7684 return resultVar0, resultVar1 7685 } 7686 7687 func (a *OpenTracingAppLayer) GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7688 origCtx := a.ctx 7689 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsPage") 7690 7691 a.ctx = newCtx 7692 a.app.Srv().Store.SetContext(newCtx) 7693 defer func() { 7694 a.app.Srv().Store.SetContext(origCtx) 7695 a.ctx = origCtx 7696 }() 7697 7698 defer span.Finish() 7699 resultVar0, resultVar1 := a.app.GetPostsPage(options) 7700 7701 if resultVar1 != nil { 7702 span.LogFields(spanlog.Error(resultVar1)) 7703 ext.Error.Set(span, true) 7704 } 7705 7706 return resultVar0, resultVar1 7707 } 7708 7709 func (a *OpenTracingAppLayer) GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) { 7710 origCtx := a.ctx 7711 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsSince") 7712 7713 a.ctx = newCtx 7714 a.app.Srv().Store.SetContext(newCtx) 7715 defer func() { 7716 a.app.Srv().Store.SetContext(origCtx) 7717 a.ctx = origCtx 7718 }() 7719 7720 defer span.Finish() 7721 resultVar0, resultVar1 := a.app.GetPostsSince(options) 7722 7723 if resultVar1 != nil { 7724 span.LogFields(spanlog.Error(resultVar1)) 7725 ext.Error.Set(span, true) 7726 } 7727 7728 return resultVar0, resultVar1 7729 } 7730 7731 func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError) { 7732 origCtx := a.ctx 7733 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryAndNameForUser") 7734 7735 a.ctx = newCtx 7736 a.app.Srv().Store.SetContext(newCtx) 7737 defer func() { 7738 a.app.Srv().Store.SetContext(origCtx) 7739 a.ctx = origCtx 7740 }() 7741 7742 defer span.Finish() 7743 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userID, category, preferenceName) 7744 7745 if resultVar1 != nil { 7746 span.LogFields(spanlog.Error(resultVar1)) 7747 ext.Error.Set(span, true) 7748 } 7749 7750 return resultVar0, resultVar1 7751 } 7752 7753 func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError) { 7754 origCtx := a.ctx 7755 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryForUser") 7756 7757 a.ctx = newCtx 7758 a.app.Srv().Store.SetContext(newCtx) 7759 defer func() { 7760 a.app.Srv().Store.SetContext(origCtx) 7761 a.ctx = origCtx 7762 }() 7763 7764 defer span.Finish() 7765 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userID, category) 7766 7767 if resultVar1 != nil { 7768 span.LogFields(spanlog.Error(resultVar1)) 7769 ext.Error.Set(span, true) 7770 } 7771 7772 return resultVar0, resultVar1 7773 } 7774 7775 func (a *OpenTracingAppLayer) GetPreferencesForUser(userID string) (model.Preferences, *model.AppError) { 7776 origCtx := a.ctx 7777 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferencesForUser") 7778 7779 a.ctx = newCtx 7780 a.app.Srv().Store.SetContext(newCtx) 7781 defer func() { 7782 a.app.Srv().Store.SetContext(origCtx) 7783 a.ctx = origCtx 7784 }() 7785 7786 defer span.Finish() 7787 resultVar0, resultVar1 := a.app.GetPreferencesForUser(userID) 7788 7789 if resultVar1 != nil { 7790 span.LogFields(spanlog.Error(resultVar1)) 7791 ext.Error.Set(span, true) 7792 } 7793 7794 return resultVar0, resultVar1 7795 } 7796 7797 func (a *OpenTracingAppLayer) GetPrevPostIdFromPostList(postList *model.PostList, collapsedThreads bool) string { 7798 origCtx := a.ctx 7799 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrevPostIdFromPostList") 7800 7801 a.ctx = newCtx 7802 a.app.Srv().Store.SetContext(newCtx) 7803 defer func() { 7804 a.app.Srv().Store.SetContext(origCtx) 7805 a.ctx = origCtx 7806 }() 7807 7808 defer span.Finish() 7809 resultVar0 := a.app.GetPrevPostIdFromPostList(postList, collapsedThreads) 7810 7811 return resultVar0 7812 } 7813 7814 func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7815 origCtx := a.ctx 7816 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrivateChannelsForTeam") 7817 7818 a.ctx = newCtx 7819 a.app.Srv().Store.SetContext(newCtx) 7820 defer func() { 7821 a.app.Srv().Store.SetContext(origCtx) 7822 a.ctx = origCtx 7823 }() 7824 7825 defer span.Finish() 7826 resultVar0, resultVar1 := a.app.GetPrivateChannelsForTeam(teamID, offset, limit) 7827 7828 if resultVar1 != nil { 7829 span.LogFields(spanlog.Error(resultVar1)) 7830 ext.Error.Set(span, true) 7831 } 7832 7833 return resultVar0, resultVar1 7834 } 7835 7836 func (a *OpenTracingAppLayer) GetProductNotices(c *request.Context, userID string, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { 7837 origCtx := a.ctx 7838 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProductNotices") 7839 7840 a.ctx = newCtx 7841 a.app.Srv().Store.SetContext(newCtx) 7842 defer func() { 7843 a.app.Srv().Store.SetContext(origCtx) 7844 a.ctx = origCtx 7845 }() 7846 7847 defer span.Finish() 7848 resultVar0, resultVar1 := a.app.GetProductNotices(c, userID, teamID, client, clientVersion, locale) 7849 7850 if resultVar1 != nil { 7851 span.LogFields(spanlog.Error(resultVar1)) 7852 ext.Error.Set(span, true) 7853 } 7854 7855 return resultVar0, resultVar1 7856 } 7857 7858 func (a *OpenTracingAppLayer) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) { 7859 origCtx := a.ctx 7860 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProfileImage") 7861 7862 a.ctx = newCtx 7863 a.app.Srv().Store.SetContext(newCtx) 7864 defer func() { 7865 a.app.Srv().Store.SetContext(origCtx) 7866 a.ctx = origCtx 7867 }() 7868 7869 defer span.Finish() 7870 resultVar0, resultVar1, resultVar2 := a.app.GetProfileImage(user) 7871 7872 if resultVar2 != nil { 7873 span.LogFields(spanlog.Error(resultVar2)) 7874 ext.Error.Set(span, true) 7875 } 7876 7877 return resultVar0, resultVar1, resultVar2 7878 } 7879 7880 func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamID string, channelIDs []string) (*model.ChannelList, *model.AppError) { 7881 origCtx := a.ctx 7882 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsByIdsForTeam") 7883 7884 a.ctx = newCtx 7885 a.app.Srv().Store.SetContext(newCtx) 7886 defer func() { 7887 a.app.Srv().Store.SetContext(origCtx) 7888 a.ctx = origCtx 7889 }() 7890 7891 defer span.Finish() 7892 resultVar0, resultVar1 := a.app.GetPublicChannelsByIdsForTeam(teamID, channelIDs) 7893 7894 if resultVar1 != nil { 7895 span.LogFields(spanlog.Error(resultVar1)) 7896 ext.Error.Set(span, true) 7897 } 7898 7899 return resultVar0, resultVar1 7900 } 7901 7902 func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7903 origCtx := a.ctx 7904 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsForTeam") 7905 7906 a.ctx = newCtx 7907 a.app.Srv().Store.SetContext(newCtx) 7908 defer func() { 7909 a.app.Srv().Store.SetContext(origCtx) 7910 a.ctx = origCtx 7911 }() 7912 7913 defer span.Finish() 7914 resultVar0, resultVar1 := a.app.GetPublicChannelsForTeam(teamID, offset, limit) 7915 7916 if resultVar1 != nil { 7917 span.LogFields(spanlog.Error(resultVar1)) 7918 ext.Error.Set(span, true) 7919 } 7920 7921 return resultVar0, resultVar1 7922 } 7923 7924 func (a *OpenTracingAppLayer) GetPublicKey(name string) ([]byte, *model.AppError) { 7925 origCtx := a.ctx 7926 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicKey") 7927 7928 a.ctx = newCtx 7929 a.app.Srv().Store.SetContext(newCtx) 7930 defer func() { 7931 a.app.Srv().Store.SetContext(origCtx) 7932 a.ctx = origCtx 7933 }() 7934 7935 defer span.Finish() 7936 resultVar0, resultVar1 := a.app.GetPublicKey(name) 7937 7938 if resultVar1 != nil { 7939 span.LogFields(spanlog.Error(resultVar1)) 7940 ext.Error.Set(span, true) 7941 } 7942 7943 return resultVar0, resultVar1 7944 } 7945 7946 func (a *OpenTracingAppLayer) GetReactionsForPost(postID string) ([]*model.Reaction, *model.AppError) { 7947 origCtx := a.ctx 7948 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetReactionsForPost") 7949 7950 a.ctx = newCtx 7951 a.app.Srv().Store.SetContext(newCtx) 7952 defer func() { 7953 a.app.Srv().Store.SetContext(origCtx) 7954 a.ctx = origCtx 7955 }() 7956 7957 defer span.Finish() 7958 resultVar0, resultVar1 := a.app.GetReactionsForPost(postID) 7959 7960 if resultVar1 != nil { 7961 span.LogFields(spanlog.Error(resultVar1)) 7962 ext.Error.Set(span, true) 7963 } 7964 7965 return resultVar0, resultVar1 7966 } 7967 7968 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError) { 7969 origCtx := a.ctx 7970 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeam") 7971 7972 a.ctx = newCtx 7973 a.app.Srv().Store.SetContext(newCtx) 7974 defer func() { 7975 a.app.Srv().Store.SetContext(origCtx) 7976 a.ctx = origCtx 7977 }() 7978 7979 defer span.Finish() 7980 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeam(teamID) 7981 7982 if resultVar1 != nil { 7983 span.LogFields(spanlog.Error(resultVar1)) 7984 ext.Error.Set(span, true) 7985 } 7986 7987 return resultVar0, resultVar1 7988 } 7989 7990 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 7991 origCtx := a.ctx 7992 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeamPage") 7993 7994 a.ctx = newCtx 7995 a.app.Srv().Store.SetContext(newCtx) 7996 defer func() { 7997 a.app.Srv().Store.SetContext(origCtx) 7998 a.ctx = origCtx 7999 }() 8000 8001 defer span.Finish() 8002 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) 8003 8004 if resultVar1 != nil { 8005 span.LogFields(spanlog.Error(resultVar1)) 8006 ext.Error.Set(span, true) 8007 } 8008 8009 return resultVar0, resultVar1 8010 } 8011 8012 func (a *OpenTracingAppLayer) GetRemoteCluster(remoteClusterId string) (*model.RemoteCluster, *model.AppError) { 8013 origCtx := a.ctx 8014 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRemoteCluster") 8015 8016 a.ctx = newCtx 8017 a.app.Srv().Store.SetContext(newCtx) 8018 defer func() { 8019 a.app.Srv().Store.SetContext(origCtx) 8020 a.ctx = origCtx 8021 }() 8022 8023 defer span.Finish() 8024 resultVar0, resultVar1 := a.app.GetRemoteCluster(remoteClusterId) 8025 8026 if resultVar1 != nil { 8027 span.LogFields(spanlog.Error(resultVar1)) 8028 ext.Error.Set(span, true) 8029 } 8030 8031 return resultVar0, resultVar1 8032 } 8033 8034 func (a *OpenTracingAppLayer) GetRemoteClusterForUser(remoteID string, userID string) (*model.RemoteCluster, *model.AppError) { 8035 origCtx := a.ctx 8036 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRemoteClusterForUser") 8037 8038 a.ctx = newCtx 8039 a.app.Srv().Store.SetContext(newCtx) 8040 defer func() { 8041 a.app.Srv().Store.SetContext(origCtx) 8042 a.ctx = origCtx 8043 }() 8044 8045 defer span.Finish() 8046 resultVar0, resultVar1 := a.app.GetRemoteClusterForUser(remoteID, userID) 8047 8048 if resultVar1 != nil { 8049 span.LogFields(spanlog.Error(resultVar1)) 8050 ext.Error.Set(span, true) 8051 } 8052 8053 return resultVar0, resultVar1 8054 } 8055 8056 func (a *OpenTracingAppLayer) GetRemoteClusterService() (remotecluster.RemoteClusterServiceIFace, *model.AppError) { 8057 origCtx := a.ctx 8058 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRemoteClusterService") 8059 8060 a.ctx = newCtx 8061 a.app.Srv().Store.SetContext(newCtx) 8062 defer func() { 8063 a.app.Srv().Store.SetContext(origCtx) 8064 a.ctx = origCtx 8065 }() 8066 8067 defer span.Finish() 8068 resultVar0, resultVar1 := a.app.GetRemoteClusterService() 8069 8070 if resultVar1 != nil { 8071 span.LogFields(spanlog.Error(resultVar1)) 8072 ext.Error.Set(span, true) 8073 } 8074 8075 return resultVar0, resultVar1 8076 } 8077 8078 func (a *OpenTracingAppLayer) GetRemoteClusterSession(token string, remoteId string) (*model.Session, *model.AppError) { 8079 origCtx := a.ctx 8080 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRemoteClusterSession") 8081 8082 a.ctx = newCtx 8083 a.app.Srv().Store.SetContext(newCtx) 8084 defer func() { 8085 a.app.Srv().Store.SetContext(origCtx) 8086 a.ctx = origCtx 8087 }() 8088 8089 defer span.Finish() 8090 resultVar0, resultVar1 := a.app.GetRemoteClusterSession(token, remoteId) 8091 8092 if resultVar1 != nil { 8093 span.LogFields(spanlog.Error(resultVar1)) 8094 ext.Error.Set(span, true) 8095 } 8096 8097 return resultVar0, resultVar1 8098 } 8099 8100 func (a *OpenTracingAppLayer) GetRetentionPolicies(offset int, limit int) (*model.RetentionPolicyWithTeamAndChannelCountsList, *model.AppError) { 8101 origCtx := a.ctx 8102 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRetentionPolicies") 8103 8104 a.ctx = newCtx 8105 a.app.Srv().Store.SetContext(newCtx) 8106 defer func() { 8107 a.app.Srv().Store.SetContext(origCtx) 8108 a.ctx = origCtx 8109 }() 8110 8111 defer span.Finish() 8112 resultVar0, resultVar1 := a.app.GetRetentionPolicies(offset, limit) 8113 8114 if resultVar1 != nil { 8115 span.LogFields(spanlog.Error(resultVar1)) 8116 ext.Error.Set(span, true) 8117 } 8118 8119 return resultVar0, resultVar1 8120 } 8121 8122 func (a *OpenTracingAppLayer) GetRetentionPoliciesCount() (int64, *model.AppError) { 8123 origCtx := a.ctx 8124 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRetentionPoliciesCount") 8125 8126 a.ctx = newCtx 8127 a.app.Srv().Store.SetContext(newCtx) 8128 defer func() { 8129 a.app.Srv().Store.SetContext(origCtx) 8130 a.ctx = origCtx 8131 }() 8132 8133 defer span.Finish() 8134 resultVar0, resultVar1 := a.app.GetRetentionPoliciesCount() 8135 8136 if resultVar1 != nil { 8137 span.LogFields(spanlog.Error(resultVar1)) 8138 ext.Error.Set(span, true) 8139 } 8140 8141 return resultVar0, resultVar1 8142 } 8143 8144 func (a *OpenTracingAppLayer) GetRetentionPolicy(policyID string) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError) { 8145 origCtx := a.ctx 8146 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRetentionPolicy") 8147 8148 a.ctx = newCtx 8149 a.app.Srv().Store.SetContext(newCtx) 8150 defer func() { 8151 a.app.Srv().Store.SetContext(origCtx) 8152 a.ctx = origCtx 8153 }() 8154 8155 defer span.Finish() 8156 resultVar0, resultVar1 := a.app.GetRetentionPolicy(policyID) 8157 8158 if resultVar1 != nil { 8159 span.LogFields(spanlog.Error(resultVar1)) 8160 ext.Error.Set(span, true) 8161 } 8162 8163 return resultVar0, resultVar1 8164 } 8165 8166 func (a *OpenTracingAppLayer) GetRole(id string) (*model.Role, *model.AppError) { 8167 origCtx := a.ctx 8168 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRole") 8169 8170 a.ctx = newCtx 8171 a.app.Srv().Store.SetContext(newCtx) 8172 defer func() { 8173 a.app.Srv().Store.SetContext(origCtx) 8174 a.ctx = origCtx 8175 }() 8176 8177 defer span.Finish() 8178 resultVar0, resultVar1 := a.app.GetRole(id) 8179 8180 if resultVar1 != nil { 8181 span.LogFields(spanlog.Error(resultVar1)) 8182 ext.Error.Set(span, true) 8183 } 8184 8185 return resultVar0, resultVar1 8186 } 8187 8188 func (a *OpenTracingAppLayer) GetRoleByName(ctx context.Context, name string) (*model.Role, *model.AppError) { 8189 origCtx := a.ctx 8190 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRoleByName") 8191 8192 a.ctx = newCtx 8193 a.app.Srv().Store.SetContext(newCtx) 8194 defer func() { 8195 a.app.Srv().Store.SetContext(origCtx) 8196 a.ctx = origCtx 8197 }() 8198 8199 defer span.Finish() 8200 resultVar0, resultVar1 := a.app.GetRoleByName(ctx, name) 8201 8202 if resultVar1 != nil { 8203 span.LogFields(spanlog.Error(resultVar1)) 8204 ext.Error.Set(span, true) 8205 } 8206 8207 return resultVar0, resultVar1 8208 } 8209 8210 func (a *OpenTracingAppLayer) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) { 8211 origCtx := a.ctx 8212 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRolesByNames") 8213 8214 a.ctx = newCtx 8215 a.app.Srv().Store.SetContext(newCtx) 8216 defer func() { 8217 a.app.Srv().Store.SetContext(origCtx) 8218 a.ctx = origCtx 8219 }() 8220 8221 defer span.Finish() 8222 resultVar0, resultVar1 := a.app.GetRolesByNames(names) 8223 8224 if resultVar1 != nil { 8225 span.LogFields(spanlog.Error(resultVar1)) 8226 ext.Error.Set(span, true) 8227 } 8228 8229 return resultVar0, resultVar1 8230 } 8231 8232 func (a *OpenTracingAppLayer) GetSamlCertificateStatus() *model.SamlCertificateStatus { 8233 origCtx := a.ctx 8234 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlCertificateStatus") 8235 8236 a.ctx = newCtx 8237 a.app.Srv().Store.SetContext(newCtx) 8238 defer func() { 8239 a.app.Srv().Store.SetContext(origCtx) 8240 a.ctx = origCtx 8241 }() 8242 8243 defer span.Finish() 8244 resultVar0 := a.app.GetSamlCertificateStatus() 8245 8246 return resultVar0 8247 } 8248 8249 func (a *OpenTracingAppLayer) GetSamlMetadata() (string, *model.AppError) { 8250 origCtx := a.ctx 8251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadata") 8252 8253 a.ctx = newCtx 8254 a.app.Srv().Store.SetContext(newCtx) 8255 defer func() { 8256 a.app.Srv().Store.SetContext(origCtx) 8257 a.ctx = origCtx 8258 }() 8259 8260 defer span.Finish() 8261 resultVar0, resultVar1 := a.app.GetSamlMetadata() 8262 8263 if resultVar1 != nil { 8264 span.LogFields(spanlog.Error(resultVar1)) 8265 ext.Error.Set(span, true) 8266 } 8267 8268 return resultVar0, resultVar1 8269 } 8270 8271 func (a *OpenTracingAppLayer) GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError) { 8272 origCtx := a.ctx 8273 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadataFromIdp") 8274 8275 a.ctx = newCtx 8276 a.app.Srv().Store.SetContext(newCtx) 8277 defer func() { 8278 a.app.Srv().Store.SetContext(origCtx) 8279 a.ctx = origCtx 8280 }() 8281 8282 defer span.Finish() 8283 resultVar0, resultVar1 := a.app.GetSamlMetadataFromIdp(idpMetadataUrl) 8284 8285 if resultVar1 != nil { 8286 span.LogFields(spanlog.Error(resultVar1)) 8287 ext.Error.Set(span, true) 8288 } 8289 8290 return resultVar0, resultVar1 8291 } 8292 8293 func (a *OpenTracingAppLayer) GetSanitizeOptions(asAdmin bool) map[string]bool { 8294 origCtx := a.ctx 8295 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizeOptions") 8296 8297 a.ctx = newCtx 8298 a.app.Srv().Store.SetContext(newCtx) 8299 defer func() { 8300 a.app.Srv().Store.SetContext(origCtx) 8301 a.ctx = origCtx 8302 }() 8303 8304 defer span.Finish() 8305 resultVar0 := a.app.GetSanitizeOptions(asAdmin) 8306 8307 return resultVar0 8308 } 8309 8310 func (a *OpenTracingAppLayer) GetSanitizedConfig() *model.Config { 8311 origCtx := a.ctx 8312 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizedConfig") 8313 8314 a.ctx = newCtx 8315 a.app.Srv().Store.SetContext(newCtx) 8316 defer func() { 8317 a.app.Srv().Store.SetContext(origCtx) 8318 a.ctx = origCtx 8319 }() 8320 8321 defer span.Finish() 8322 resultVar0 := a.app.GetSanitizedConfig() 8323 8324 return resultVar0 8325 } 8326 8327 func (a *OpenTracingAppLayer) GetScheme(id string) (*model.Scheme, *model.AppError) { 8328 origCtx := a.ctx 8329 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetScheme") 8330 8331 a.ctx = newCtx 8332 a.app.Srv().Store.SetContext(newCtx) 8333 defer func() { 8334 a.app.Srv().Store.SetContext(origCtx) 8335 a.ctx = origCtx 8336 }() 8337 8338 defer span.Finish() 8339 resultVar0, resultVar1 := a.app.GetScheme(id) 8340 8341 if resultVar1 != nil { 8342 span.LogFields(spanlog.Error(resultVar1)) 8343 ext.Error.Set(span, true) 8344 } 8345 8346 return resultVar0, resultVar1 8347 } 8348 8349 func (a *OpenTracingAppLayer) GetSchemeByName(name string) (*model.Scheme, *model.AppError) { 8350 origCtx := a.ctx 8351 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeByName") 8352 8353 a.ctx = newCtx 8354 a.app.Srv().Store.SetContext(newCtx) 8355 defer func() { 8356 a.app.Srv().Store.SetContext(origCtx) 8357 a.ctx = origCtx 8358 }() 8359 8360 defer span.Finish() 8361 resultVar0, resultVar1 := a.app.GetSchemeByName(name) 8362 8363 if resultVar1 != nil { 8364 span.LogFields(spanlog.Error(resultVar1)) 8365 ext.Error.Set(span, true) 8366 } 8367 8368 return resultVar0, resultVar1 8369 } 8370 8371 func (a *OpenTracingAppLayer) GetSchemeRolesForChannel(channelID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 8372 origCtx := a.ctx 8373 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForChannel") 8374 8375 a.ctx = newCtx 8376 a.app.Srv().Store.SetContext(newCtx) 8377 defer func() { 8378 a.app.Srv().Store.SetContext(origCtx) 8379 a.ctx = origCtx 8380 }() 8381 8382 defer span.Finish() 8383 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForChannel(channelID) 8384 8385 if resultVar3 != nil { 8386 span.LogFields(spanlog.Error(resultVar3)) 8387 ext.Error.Set(span, true) 8388 } 8389 8390 return resultVar0, resultVar1, resultVar2, resultVar3 8391 } 8392 8393 func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError) { 8394 origCtx := a.ctx 8395 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForTeam") 8396 8397 a.ctx = newCtx 8398 a.app.Srv().Store.SetContext(newCtx) 8399 defer func() { 8400 a.app.Srv().Store.SetContext(origCtx) 8401 a.ctx = origCtx 8402 }() 8403 8404 defer span.Finish() 8405 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForTeam(teamID) 8406 8407 if resultVar3 != nil { 8408 span.LogFields(spanlog.Error(resultVar3)) 8409 ext.Error.Set(span, true) 8410 } 8411 8412 return resultVar0, resultVar1, resultVar2, resultVar3 8413 } 8414 8415 func (a *OpenTracingAppLayer) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) { 8416 origCtx := a.ctx 8417 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemes") 8418 8419 a.ctx = newCtx 8420 a.app.Srv().Store.SetContext(newCtx) 8421 defer func() { 8422 a.app.Srv().Store.SetContext(origCtx) 8423 a.ctx = origCtx 8424 }() 8425 8426 defer span.Finish() 8427 resultVar0, resultVar1 := a.app.GetSchemes(scope, offset, limit) 8428 8429 if resultVar1 != nil { 8430 span.LogFields(spanlog.Error(resultVar1)) 8431 ext.Error.Set(span, true) 8432 } 8433 8434 return resultVar0, resultVar1 8435 } 8436 8437 func (a *OpenTracingAppLayer) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) { 8438 origCtx := a.ctx 8439 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemesPage") 8440 8441 a.ctx = newCtx 8442 a.app.Srv().Store.SetContext(newCtx) 8443 defer func() { 8444 a.app.Srv().Store.SetContext(origCtx) 8445 a.ctx = origCtx 8446 }() 8447 8448 defer span.Finish() 8449 resultVar0, resultVar1 := a.app.GetSchemesPage(scope, page, perPage) 8450 8451 if resultVar1 != nil { 8452 span.LogFields(spanlog.Error(resultVar1)) 8453 ext.Error.Set(span, true) 8454 } 8455 8456 return resultVar0, resultVar1 8457 } 8458 8459 func (a *OpenTracingAppLayer) GetSession(token string) (*model.Session, *model.AppError) { 8460 origCtx := a.ctx 8461 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSession") 8462 8463 a.ctx = newCtx 8464 a.app.Srv().Store.SetContext(newCtx) 8465 defer func() { 8466 a.app.Srv().Store.SetContext(origCtx) 8467 a.ctx = origCtx 8468 }() 8469 8470 defer span.Finish() 8471 resultVar0, resultVar1 := a.app.GetSession(token) 8472 8473 if resultVar1 != nil { 8474 span.LogFields(spanlog.Error(resultVar1)) 8475 ext.Error.Set(span, true) 8476 } 8477 8478 return resultVar0, resultVar1 8479 } 8480 8481 func (a *OpenTracingAppLayer) GetSessionById(sessionID string) (*model.Session, *model.AppError) { 8482 origCtx := a.ctx 8483 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionById") 8484 8485 a.ctx = newCtx 8486 a.app.Srv().Store.SetContext(newCtx) 8487 defer func() { 8488 a.app.Srv().Store.SetContext(origCtx) 8489 a.ctx = origCtx 8490 }() 8491 8492 defer span.Finish() 8493 resultVar0, resultVar1 := a.app.GetSessionById(sessionID) 8494 8495 if resultVar1 != nil { 8496 span.LogFields(spanlog.Error(resultVar1)) 8497 ext.Error.Set(span, true) 8498 } 8499 8500 return resultVar0, resultVar1 8501 } 8502 8503 func (a *OpenTracingAppLayer) GetSessionLengthInMillis(session *model.Session) int64 { 8504 origCtx := a.ctx 8505 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionLengthInMillis") 8506 8507 a.ctx = newCtx 8508 a.app.Srv().Store.SetContext(newCtx) 8509 defer func() { 8510 a.app.Srv().Store.SetContext(origCtx) 8511 a.ctx = origCtx 8512 }() 8513 8514 defer span.Finish() 8515 resultVar0 := a.app.GetSessionLengthInMillis(session) 8516 8517 return resultVar0 8518 } 8519 8520 func (a *OpenTracingAppLayer) GetSessions(userID string) ([]*model.Session, *model.AppError) { 8521 origCtx := a.ctx 8522 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions") 8523 8524 a.ctx = newCtx 8525 a.app.Srv().Store.SetContext(newCtx) 8526 defer func() { 8527 a.app.Srv().Store.SetContext(origCtx) 8528 a.ctx = origCtx 8529 }() 8530 8531 defer span.Finish() 8532 resultVar0, resultVar1 := a.app.GetSessions(userID) 8533 8534 if resultVar1 != nil { 8535 span.LogFields(spanlog.Error(resultVar1)) 8536 ext.Error.Set(span, true) 8537 } 8538 8539 return resultVar0, resultVar1 8540 } 8541 8542 func (a *OpenTracingAppLayer) GetSharedChannel(channelID string) (*model.SharedChannel, error) { 8543 origCtx := a.ctx 8544 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannel") 8545 8546 a.ctx = newCtx 8547 a.app.Srv().Store.SetContext(newCtx) 8548 defer func() { 8549 a.app.Srv().Store.SetContext(origCtx) 8550 a.ctx = origCtx 8551 }() 8552 8553 defer span.Finish() 8554 resultVar0, resultVar1 := a.app.GetSharedChannel(channelID) 8555 8556 if resultVar1 != nil { 8557 span.LogFields(spanlog.Error(resultVar1)) 8558 ext.Error.Set(span, true) 8559 } 8560 8561 return resultVar0, resultVar1 8562 } 8563 8564 func (a *OpenTracingAppLayer) GetSharedChannelRemote(id string) (*model.SharedChannelRemote, error) { 8565 origCtx := a.ctx 8566 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannelRemote") 8567 8568 a.ctx = newCtx 8569 a.app.Srv().Store.SetContext(newCtx) 8570 defer func() { 8571 a.app.Srv().Store.SetContext(origCtx) 8572 a.ctx = origCtx 8573 }() 8574 8575 defer span.Finish() 8576 resultVar0, resultVar1 := a.app.GetSharedChannelRemote(id) 8577 8578 if resultVar1 != nil { 8579 span.LogFields(spanlog.Error(resultVar1)) 8580 ext.Error.Set(span, true) 8581 } 8582 8583 return resultVar0, resultVar1 8584 } 8585 8586 func (a *OpenTracingAppLayer) GetSharedChannelRemoteByIds(channelID string, remoteID string) (*model.SharedChannelRemote, error) { 8587 origCtx := a.ctx 8588 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannelRemoteByIds") 8589 8590 a.ctx = newCtx 8591 a.app.Srv().Store.SetContext(newCtx) 8592 defer func() { 8593 a.app.Srv().Store.SetContext(origCtx) 8594 a.ctx = origCtx 8595 }() 8596 8597 defer span.Finish() 8598 resultVar0, resultVar1 := a.app.GetSharedChannelRemoteByIds(channelID, remoteID) 8599 8600 if resultVar1 != nil { 8601 span.LogFields(spanlog.Error(resultVar1)) 8602 ext.Error.Set(span, true) 8603 } 8604 8605 return resultVar0, resultVar1 8606 } 8607 8608 func (a *OpenTracingAppLayer) GetSharedChannelRemotes(opts model.SharedChannelRemoteFilterOpts) ([]*model.SharedChannelRemote, error) { 8609 origCtx := a.ctx 8610 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannelRemotes") 8611 8612 a.ctx = newCtx 8613 a.app.Srv().Store.SetContext(newCtx) 8614 defer func() { 8615 a.app.Srv().Store.SetContext(origCtx) 8616 a.ctx = origCtx 8617 }() 8618 8619 defer span.Finish() 8620 resultVar0, resultVar1 := a.app.GetSharedChannelRemotes(opts) 8621 8622 if resultVar1 != nil { 8623 span.LogFields(spanlog.Error(resultVar1)) 8624 ext.Error.Set(span, true) 8625 } 8626 8627 return resultVar0, resultVar1 8628 } 8629 8630 func (a *OpenTracingAppLayer) GetSharedChannelRemotesStatus(channelID string) ([]*model.SharedChannelRemoteStatus, error) { 8631 origCtx := a.ctx 8632 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannelRemotesStatus") 8633 8634 a.ctx = newCtx 8635 a.app.Srv().Store.SetContext(newCtx) 8636 defer func() { 8637 a.app.Srv().Store.SetContext(origCtx) 8638 a.ctx = origCtx 8639 }() 8640 8641 defer span.Finish() 8642 resultVar0, resultVar1 := a.app.GetSharedChannelRemotesStatus(channelID) 8643 8644 if resultVar1 != nil { 8645 span.LogFields(spanlog.Error(resultVar1)) 8646 ext.Error.Set(span, true) 8647 } 8648 8649 return resultVar0, resultVar1 8650 } 8651 8652 func (a *OpenTracingAppLayer) GetSharedChannels(page int, perPage int, opts model.SharedChannelFilterOpts) ([]*model.SharedChannel, *model.AppError) { 8653 origCtx := a.ctx 8654 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannels") 8655 8656 a.ctx = newCtx 8657 a.app.Srv().Store.SetContext(newCtx) 8658 defer func() { 8659 a.app.Srv().Store.SetContext(origCtx) 8660 a.ctx = origCtx 8661 }() 8662 8663 defer span.Finish() 8664 resultVar0, resultVar1 := a.app.GetSharedChannels(page, perPage, opts) 8665 8666 if resultVar1 != nil { 8667 span.LogFields(spanlog.Error(resultVar1)) 8668 ext.Error.Set(span, true) 8669 } 8670 8671 return resultVar0, resultVar1 8672 } 8673 8674 func (a *OpenTracingAppLayer) GetSharedChannelsCount(opts model.SharedChannelFilterOpts) (int64, error) { 8675 origCtx := a.ctx 8676 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSharedChannelsCount") 8677 8678 a.ctx = newCtx 8679 a.app.Srv().Store.SetContext(newCtx) 8680 defer func() { 8681 a.app.Srv().Store.SetContext(origCtx) 8682 a.ctx = origCtx 8683 }() 8684 8685 defer span.Finish() 8686 resultVar0, resultVar1 := a.app.GetSharedChannelsCount(opts) 8687 8688 if resultVar1 != nil { 8689 span.LogFields(spanlog.Error(resultVar1)) 8690 ext.Error.Set(span, true) 8691 } 8692 8693 return resultVar0, resultVar1 8694 } 8695 8696 func (a *OpenTracingAppLayer) GetSidebarCategories(userID string, teamID string) (*model.OrderedSidebarCategories, *model.AppError) { 8697 origCtx := a.ctx 8698 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategories") 8699 8700 a.ctx = newCtx 8701 a.app.Srv().Store.SetContext(newCtx) 8702 defer func() { 8703 a.app.Srv().Store.SetContext(origCtx) 8704 a.ctx = origCtx 8705 }() 8706 8707 defer span.Finish() 8708 resultVar0, resultVar1 := a.app.GetSidebarCategories(userID, teamID) 8709 8710 if resultVar1 != nil { 8711 span.LogFields(spanlog.Error(resultVar1)) 8712 ext.Error.Set(span, true) 8713 } 8714 8715 return resultVar0, resultVar1 8716 } 8717 8718 func (a *OpenTracingAppLayer) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError) { 8719 origCtx := a.ctx 8720 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategory") 8721 8722 a.ctx = newCtx 8723 a.app.Srv().Store.SetContext(newCtx) 8724 defer func() { 8725 a.app.Srv().Store.SetContext(origCtx) 8726 a.ctx = origCtx 8727 }() 8728 8729 defer span.Finish() 8730 resultVar0, resultVar1 := a.app.GetSidebarCategory(categoryId) 8731 8732 if resultVar1 != nil { 8733 span.LogFields(spanlog.Error(resultVar1)) 8734 ext.Error.Set(span, true) 8735 } 8736 8737 return resultVar0, resultVar1 8738 } 8739 8740 func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userID string, teamID string) ([]string, *model.AppError) { 8741 origCtx := a.ctx 8742 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategoryOrder") 8743 8744 a.ctx = newCtx 8745 a.app.Srv().Store.SetContext(newCtx) 8746 defer func() { 8747 a.app.Srv().Store.SetContext(origCtx) 8748 a.ctx = origCtx 8749 }() 8750 8751 defer span.Finish() 8752 resultVar0, resultVar1 := a.app.GetSidebarCategoryOrder(userID, teamID) 8753 8754 if resultVar1 != nil { 8755 span.LogFields(spanlog.Error(resultVar1)) 8756 ext.Error.Set(span, true) 8757 } 8758 8759 return resultVar0, resultVar1 8760 } 8761 8762 func (a *OpenTracingAppLayer) GetSinglePost(postID string) (*model.Post, *model.AppError) { 8763 origCtx := a.ctx 8764 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSinglePost") 8765 8766 a.ctx = newCtx 8767 a.app.Srv().Store.SetContext(newCtx) 8768 defer func() { 8769 a.app.Srv().Store.SetContext(origCtx) 8770 a.ctx = origCtx 8771 }() 8772 8773 defer span.Finish() 8774 resultVar0, resultVar1 := a.app.GetSinglePost(postID) 8775 8776 if resultVar1 != nil { 8777 span.LogFields(spanlog.Error(resultVar1)) 8778 ext.Error.Set(span, true) 8779 } 8780 8781 return resultVar0, resultVar1 8782 } 8783 8784 func (a *OpenTracingAppLayer) GetSiteURL() string { 8785 origCtx := a.ctx 8786 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSiteURL") 8787 8788 a.ctx = newCtx 8789 a.app.Srv().Store.SetContext(newCtx) 8790 defer func() { 8791 a.app.Srv().Store.SetContext(origCtx) 8792 a.ctx = origCtx 8793 }() 8794 8795 defer span.Finish() 8796 resultVar0 := a.app.GetSiteURL() 8797 8798 return resultVar0 8799 } 8800 8801 func (a *OpenTracingAppLayer) GetStatus(userID string) (*model.Status, *model.AppError) { 8802 origCtx := a.ctx 8803 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatus") 8804 8805 a.ctx = newCtx 8806 a.app.Srv().Store.SetContext(newCtx) 8807 defer func() { 8808 a.app.Srv().Store.SetContext(origCtx) 8809 a.ctx = origCtx 8810 }() 8811 8812 defer span.Finish() 8813 resultVar0, resultVar1 := a.app.GetStatus(userID) 8814 8815 if resultVar1 != nil { 8816 span.LogFields(spanlog.Error(resultVar1)) 8817 ext.Error.Set(span, true) 8818 } 8819 8820 return resultVar0, resultVar1 8821 } 8822 8823 func (a *OpenTracingAppLayer) GetStatusFromCache(userID string) *model.Status { 8824 origCtx := a.ctx 8825 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusFromCache") 8826 8827 a.ctx = newCtx 8828 a.app.Srv().Store.SetContext(newCtx) 8829 defer func() { 8830 a.app.Srv().Store.SetContext(origCtx) 8831 a.ctx = origCtx 8832 }() 8833 8834 defer span.Finish() 8835 resultVar0 := a.app.GetStatusFromCache(userID) 8836 8837 return resultVar0 8838 } 8839 8840 func (a *OpenTracingAppLayer) GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError) { 8841 origCtx := a.ctx 8842 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusesByIds") 8843 8844 a.ctx = newCtx 8845 a.app.Srv().Store.SetContext(newCtx) 8846 defer func() { 8847 a.app.Srv().Store.SetContext(origCtx) 8848 a.ctx = origCtx 8849 }() 8850 8851 defer span.Finish() 8852 resultVar0, resultVar1 := a.app.GetStatusesByIds(userIDs) 8853 8854 if resultVar1 != nil { 8855 span.LogFields(spanlog.Error(resultVar1)) 8856 ext.Error.Set(span, true) 8857 } 8858 8859 return resultVar0, resultVar1 8860 } 8861 8862 func (a *OpenTracingAppLayer) GetSubscriptionStats() (*model.SubscriptionStats, *model.AppError) { 8863 origCtx := a.ctx 8864 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSubscriptionStats") 8865 8866 a.ctx = newCtx 8867 a.app.Srv().Store.SetContext(newCtx) 8868 defer func() { 8869 a.app.Srv().Store.SetContext(origCtx) 8870 a.ctx = origCtx 8871 }() 8872 8873 defer span.Finish() 8874 resultVar0, resultVar1 := a.app.GetSubscriptionStats() 8875 8876 if resultVar1 != nil { 8877 span.LogFields(spanlog.Error(resultVar1)) 8878 ext.Error.Set(span, true) 8879 } 8880 8881 return resultVar0, resultVar1 8882 } 8883 8884 func (a *OpenTracingAppLayer) GetSuggestions(c *request.Context, commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion { 8885 origCtx := a.ctx 8886 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSuggestions") 8887 8888 a.ctx = newCtx 8889 a.app.Srv().Store.SetContext(newCtx) 8890 defer func() { 8891 a.app.Srv().Store.SetContext(origCtx) 8892 a.ctx = origCtx 8893 }() 8894 8895 defer span.Finish() 8896 resultVar0 := a.app.GetSuggestions(c, commandArgs, commands, roleID) 8897 8898 return resultVar0 8899 } 8900 8901 func (a *OpenTracingAppLayer) GetSystemBot() (*model.Bot, *model.AppError) { 8902 origCtx := a.ctx 8903 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSystemBot") 8904 8905 a.ctx = newCtx 8906 a.app.Srv().Store.SetContext(newCtx) 8907 defer func() { 8908 a.app.Srv().Store.SetContext(origCtx) 8909 a.ctx = origCtx 8910 }() 8911 8912 defer span.Finish() 8913 resultVar0, resultVar1 := a.app.GetSystemBot() 8914 8915 if resultVar1 != nil { 8916 span.LogFields(spanlog.Error(resultVar1)) 8917 ext.Error.Set(span, true) 8918 } 8919 8920 return resultVar0, resultVar1 8921 } 8922 8923 func (a *OpenTracingAppLayer) GetTeam(teamID string) (*model.Team, *model.AppError) { 8924 origCtx := a.ctx 8925 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeam") 8926 8927 a.ctx = newCtx 8928 a.app.Srv().Store.SetContext(newCtx) 8929 defer func() { 8930 a.app.Srv().Store.SetContext(origCtx) 8931 a.ctx = origCtx 8932 }() 8933 8934 defer span.Finish() 8935 resultVar0, resultVar1 := a.app.GetTeam(teamID) 8936 8937 if resultVar1 != nil { 8938 span.LogFields(spanlog.Error(resultVar1)) 8939 ext.Error.Set(span, true) 8940 } 8941 8942 return resultVar0, resultVar1 8943 } 8944 8945 func (a *OpenTracingAppLayer) GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError) { 8946 origCtx := a.ctx 8947 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByInviteId") 8948 8949 a.ctx = newCtx 8950 a.app.Srv().Store.SetContext(newCtx) 8951 defer func() { 8952 a.app.Srv().Store.SetContext(origCtx) 8953 a.ctx = origCtx 8954 }() 8955 8956 defer span.Finish() 8957 resultVar0, resultVar1 := a.app.GetTeamByInviteId(inviteId) 8958 8959 if resultVar1 != nil { 8960 span.LogFields(spanlog.Error(resultVar1)) 8961 ext.Error.Set(span, true) 8962 } 8963 8964 return resultVar0, resultVar1 8965 } 8966 8967 func (a *OpenTracingAppLayer) GetTeamByName(name string) (*model.Team, *model.AppError) { 8968 origCtx := a.ctx 8969 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByName") 8970 8971 a.ctx = newCtx 8972 a.app.Srv().Store.SetContext(newCtx) 8973 defer func() { 8974 a.app.Srv().Store.SetContext(origCtx) 8975 a.ctx = origCtx 8976 }() 8977 8978 defer span.Finish() 8979 resultVar0, resultVar1 := a.app.GetTeamByName(name) 8980 8981 if resultVar1 != nil { 8982 span.LogFields(spanlog.Error(resultVar1)) 8983 ext.Error.Set(span, true) 8984 } 8985 8986 return resultVar0, resultVar1 8987 } 8988 8989 func (a *OpenTracingAppLayer) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) { 8990 origCtx := a.ctx 8991 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamGroupUsers") 8992 8993 a.ctx = newCtx 8994 a.app.Srv().Store.SetContext(newCtx) 8995 defer func() { 8996 a.app.Srv().Store.SetContext(origCtx) 8997 a.ctx = origCtx 8998 }() 8999 9000 defer span.Finish() 9001 resultVar0, resultVar1 := a.app.GetTeamGroupUsers(teamID) 9002 9003 if resultVar1 != nil { 9004 span.LogFields(spanlog.Error(resultVar1)) 9005 ext.Error.Set(span, true) 9006 } 9007 9008 return resultVar0, resultVar1 9009 } 9010 9011 func (a *OpenTracingAppLayer) GetTeamIcon(team *model.Team) ([]byte, *model.AppError) { 9012 origCtx := a.ctx 9013 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIcon") 9014 9015 a.ctx = newCtx 9016 a.app.Srv().Store.SetContext(newCtx) 9017 defer func() { 9018 a.app.Srv().Store.SetContext(origCtx) 9019 a.ctx = origCtx 9020 }() 9021 9022 defer span.Finish() 9023 resultVar0, resultVar1 := a.app.GetTeamIcon(team) 9024 9025 if resultVar1 != nil { 9026 span.LogFields(spanlog.Error(resultVar1)) 9027 ext.Error.Set(span, true) 9028 } 9029 9030 return resultVar0, resultVar1 9031 } 9032 9033 func (a *OpenTracingAppLayer) GetTeamIdFromQuery(query url.Values) (string, *model.AppError) { 9034 origCtx := a.ctx 9035 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIdFromQuery") 9036 9037 a.ctx = newCtx 9038 a.app.Srv().Store.SetContext(newCtx) 9039 defer func() { 9040 a.app.Srv().Store.SetContext(origCtx) 9041 a.ctx = origCtx 9042 }() 9043 9044 defer span.Finish() 9045 resultVar0, resultVar1 := a.app.GetTeamIdFromQuery(query) 9046 9047 if resultVar1 != nil { 9048 span.LogFields(spanlog.Error(resultVar1)) 9049 ext.Error.Set(span, true) 9050 } 9051 9052 return resultVar0, resultVar1 9053 } 9054 9055 func (a *OpenTracingAppLayer) GetTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) { 9056 origCtx := a.ctx 9057 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMember") 9058 9059 a.ctx = newCtx 9060 a.app.Srv().Store.SetContext(newCtx) 9061 defer func() { 9062 a.app.Srv().Store.SetContext(origCtx) 9063 a.ctx = origCtx 9064 }() 9065 9066 defer span.Finish() 9067 resultVar0, resultVar1 := a.app.GetTeamMember(teamID, userID) 9068 9069 if resultVar1 != nil { 9070 span.LogFields(spanlog.Error(resultVar1)) 9071 ext.Error.Set(span, true) 9072 } 9073 9074 return resultVar0, resultVar1 9075 } 9076 9077 func (a *OpenTracingAppLayer) GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { 9078 origCtx := a.ctx 9079 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembers") 9080 9081 a.ctx = newCtx 9082 a.app.Srv().Store.SetContext(newCtx) 9083 defer func() { 9084 a.app.Srv().Store.SetContext(origCtx) 9085 a.ctx = origCtx 9086 }() 9087 9088 defer span.Finish() 9089 resultVar0, resultVar1 := a.app.GetTeamMembers(teamID, offset, limit, teamMembersGetOptions) 9090 9091 if resultVar1 != nil { 9092 span.LogFields(spanlog.Error(resultVar1)) 9093 ext.Error.Set(span, true) 9094 } 9095 9096 return resultVar0, resultVar1 9097 } 9098 9099 func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { 9100 origCtx := a.ctx 9101 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersByIds") 9102 9103 a.ctx = newCtx 9104 a.app.Srv().Store.SetContext(newCtx) 9105 defer func() { 9106 a.app.Srv().Store.SetContext(origCtx) 9107 a.ctx = origCtx 9108 }() 9109 9110 defer span.Finish() 9111 resultVar0, resultVar1 := a.app.GetTeamMembersByIds(teamID, userIDs, restrictions) 9112 9113 if resultVar1 != nil { 9114 span.LogFields(spanlog.Error(resultVar1)) 9115 ext.Error.Set(span, true) 9116 } 9117 9118 return resultVar0, resultVar1 9119 } 9120 9121 func (a *OpenTracingAppLayer) GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError) { 9122 origCtx := a.ctx 9123 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUser") 9124 9125 a.ctx = newCtx 9126 a.app.Srv().Store.SetContext(newCtx) 9127 defer func() { 9128 a.app.Srv().Store.SetContext(origCtx) 9129 a.ctx = origCtx 9130 }() 9131 9132 defer span.Finish() 9133 resultVar0, resultVar1 := a.app.GetTeamMembersForUser(userID) 9134 9135 if resultVar1 != nil { 9136 span.LogFields(spanlog.Error(resultVar1)) 9137 ext.Error.Set(span, true) 9138 } 9139 9140 return resultVar0, resultVar1 9141 } 9142 9143 func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { 9144 origCtx := a.ctx 9145 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUserWithPagination") 9146 9147 a.ctx = newCtx 9148 a.app.Srv().Store.SetContext(newCtx) 9149 defer func() { 9150 a.app.Srv().Store.SetContext(origCtx) 9151 a.ctx = origCtx 9152 }() 9153 9154 defer span.Finish() 9155 resultVar0, resultVar1 := a.app.GetTeamMembersForUserWithPagination(userID, page, perPage) 9156 9157 if resultVar1 != nil { 9158 span.LogFields(spanlog.Error(resultVar1)) 9159 ext.Error.Set(span, true) 9160 } 9161 9162 return resultVar0, resultVar1 9163 } 9164 9165 func (a *OpenTracingAppLayer) GetTeamPoliciesForUser(userID string, offset int, limit int) (*model.RetentionPolicyForTeamList, *model.AppError) { 9166 origCtx := a.ctx 9167 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamPoliciesForUser") 9168 9169 a.ctx = newCtx 9170 a.app.Srv().Store.SetContext(newCtx) 9171 defer func() { 9172 a.app.Srv().Store.SetContext(origCtx) 9173 a.ctx = origCtx 9174 }() 9175 9176 defer span.Finish() 9177 resultVar0, resultVar1 := a.app.GetTeamPoliciesForUser(userID, offset, limit) 9178 9179 if resultVar1 != nil { 9180 span.LogFields(spanlog.Error(resultVar1)) 9181 ext.Error.Set(span, true) 9182 } 9183 9184 return resultVar0, resultVar1 9185 } 9186 9187 func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 9188 origCtx := a.ctx 9189 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamSchemeChannelRoles") 9190 9191 a.ctx = newCtx 9192 a.app.Srv().Store.SetContext(newCtx) 9193 defer func() { 9194 a.app.Srv().Store.SetContext(origCtx) 9195 a.ctx = origCtx 9196 }() 9197 9198 defer span.Finish() 9199 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetTeamSchemeChannelRoles(teamID) 9200 9201 if resultVar3 != nil { 9202 span.LogFields(spanlog.Error(resultVar3)) 9203 ext.Error.Set(span, true) 9204 } 9205 9206 return resultVar0, resultVar1, resultVar2, resultVar3 9207 } 9208 9209 func (a *OpenTracingAppLayer) GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { 9210 origCtx := a.ctx 9211 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamStats") 9212 9213 a.ctx = newCtx 9214 a.app.Srv().Store.SetContext(newCtx) 9215 defer func() { 9216 a.app.Srv().Store.SetContext(origCtx) 9217 a.ctx = origCtx 9218 }() 9219 9220 defer span.Finish() 9221 resultVar0, resultVar1 := a.app.GetTeamStats(teamID, restrictions) 9222 9223 if resultVar1 != nil { 9224 span.LogFields(spanlog.Error(resultVar1)) 9225 ext.Error.Set(span, true) 9226 } 9227 9228 return resultVar0, resultVar1 9229 } 9230 9231 func (a *OpenTracingAppLayer) GetTeamUnread(teamID string, userID string) (*model.TeamUnread, *model.AppError) { 9232 origCtx := a.ctx 9233 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamUnread") 9234 9235 a.ctx = newCtx 9236 a.app.Srv().Store.SetContext(newCtx) 9237 defer func() { 9238 a.app.Srv().Store.SetContext(origCtx) 9239 a.ctx = origCtx 9240 }() 9241 9242 defer span.Finish() 9243 resultVar0, resultVar1 := a.app.GetTeamUnread(teamID, userID) 9244 9245 if resultVar1 != nil { 9246 span.LogFields(spanlog.Error(resultVar1)) 9247 ext.Error.Set(span, true) 9248 } 9249 9250 return resultVar0, resultVar1 9251 } 9252 9253 func (a *OpenTracingAppLayer) GetTeamsForRetentionPolicy(policyID string, offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 9254 origCtx := a.ctx 9255 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForRetentionPolicy") 9256 9257 a.ctx = newCtx 9258 a.app.Srv().Store.SetContext(newCtx) 9259 defer func() { 9260 a.app.Srv().Store.SetContext(origCtx) 9261 a.ctx = origCtx 9262 }() 9263 9264 defer span.Finish() 9265 resultVar0, resultVar1 := a.app.GetTeamsForRetentionPolicy(policyID, offset, limit) 9266 9267 if resultVar1 != nil { 9268 span.LogFields(spanlog.Error(resultVar1)) 9269 ext.Error.Set(span, true) 9270 } 9271 9272 return resultVar0, resultVar1 9273 } 9274 9275 func (a *OpenTracingAppLayer) GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError) { 9276 origCtx := a.ctx 9277 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForScheme") 9278 9279 a.ctx = newCtx 9280 a.app.Srv().Store.SetContext(newCtx) 9281 defer func() { 9282 a.app.Srv().Store.SetContext(origCtx) 9283 a.ctx = origCtx 9284 }() 9285 9286 defer span.Finish() 9287 resultVar0, resultVar1 := a.app.GetTeamsForScheme(scheme, offset, limit) 9288 9289 if resultVar1 != nil { 9290 span.LogFields(spanlog.Error(resultVar1)) 9291 ext.Error.Set(span, true) 9292 } 9293 9294 return resultVar0, resultVar1 9295 } 9296 9297 func (a *OpenTracingAppLayer) GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError) { 9298 origCtx := a.ctx 9299 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForSchemePage") 9300 9301 a.ctx = newCtx 9302 a.app.Srv().Store.SetContext(newCtx) 9303 defer func() { 9304 a.app.Srv().Store.SetContext(origCtx) 9305 a.ctx = origCtx 9306 }() 9307 9308 defer span.Finish() 9309 resultVar0, resultVar1 := a.app.GetTeamsForSchemePage(scheme, page, perPage) 9310 9311 if resultVar1 != nil { 9312 span.LogFields(spanlog.Error(resultVar1)) 9313 ext.Error.Set(span, true) 9314 } 9315 9316 return resultVar0, resultVar1 9317 } 9318 9319 func (a *OpenTracingAppLayer) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { 9320 origCtx := a.ctx 9321 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForUser") 9322 9323 a.ctx = newCtx 9324 a.app.Srv().Store.SetContext(newCtx) 9325 defer func() { 9326 a.app.Srv().Store.SetContext(origCtx) 9327 a.ctx = origCtx 9328 }() 9329 9330 defer span.Finish() 9331 resultVar0, resultVar1 := a.app.GetTeamsForUser(userID) 9332 9333 if resultVar1 != nil { 9334 span.LogFields(spanlog.Error(resultVar1)) 9335 ext.Error.Set(span, true) 9336 } 9337 9338 return resultVar0, resultVar1 9339 } 9340 9341 func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError) { 9342 origCtx := a.ctx 9343 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsUnreadForUser") 9344 9345 a.ctx = newCtx 9346 a.app.Srv().Store.SetContext(newCtx) 9347 defer func() { 9348 a.app.Srv().Store.SetContext(origCtx) 9349 a.ctx = origCtx 9350 }() 9351 9352 defer span.Finish() 9353 resultVar0, resultVar1 := a.app.GetTeamsUnreadForUser(excludeTeamId, userID) 9354 9355 if resultVar1 != nil { 9356 span.LogFields(spanlog.Error(resultVar1)) 9357 ext.Error.Set(span, true) 9358 } 9359 9360 return resultVar0, resultVar1 9361 } 9362 9363 func (a *OpenTracingAppLayer) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) { 9364 origCtx := a.ctx 9365 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTermsOfService") 9366 9367 a.ctx = newCtx 9368 a.app.Srv().Store.SetContext(newCtx) 9369 defer func() { 9370 a.app.Srv().Store.SetContext(origCtx) 9371 a.ctx = origCtx 9372 }() 9373 9374 defer span.Finish() 9375 resultVar0, resultVar1 := a.app.GetTermsOfService(id) 9376 9377 if resultVar1 != nil { 9378 span.LogFields(spanlog.Error(resultVar1)) 9379 ext.Error.Set(span, true) 9380 } 9381 9382 return resultVar0, resultVar1 9383 } 9384 9385 func (a *OpenTracingAppLayer) GetThreadForUser(teamID string, threadMembership *model.ThreadMembership, extended bool) (*model.ThreadResponse, *model.AppError) { 9386 origCtx := a.ctx 9387 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadForUser") 9388 9389 a.ctx = newCtx 9390 a.app.Srv().Store.SetContext(newCtx) 9391 defer func() { 9392 a.app.Srv().Store.SetContext(origCtx) 9393 a.ctx = origCtx 9394 }() 9395 9396 defer span.Finish() 9397 resultVar0, resultVar1 := a.app.GetThreadForUser(teamID, threadMembership, extended) 9398 9399 if resultVar1 != nil { 9400 span.LogFields(spanlog.Error(resultVar1)) 9401 ext.Error.Set(span, true) 9402 } 9403 9404 return resultVar0, resultVar1 9405 } 9406 9407 func (a *OpenTracingAppLayer) GetThreadMembershipForUser(userId string, threadId string) (*model.ThreadMembership, *model.AppError) { 9408 origCtx := a.ctx 9409 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadMembershipForUser") 9410 9411 a.ctx = newCtx 9412 a.app.Srv().Store.SetContext(newCtx) 9413 defer func() { 9414 a.app.Srv().Store.SetContext(origCtx) 9415 a.ctx = origCtx 9416 }() 9417 9418 defer span.Finish() 9419 resultVar0, resultVar1 := a.app.GetThreadMembershipForUser(userId, threadId) 9420 9421 if resultVar1 != nil { 9422 span.LogFields(spanlog.Error(resultVar1)) 9423 ext.Error.Set(span, true) 9424 } 9425 9426 return resultVar0, resultVar1 9427 } 9428 9429 func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) { 9430 origCtx := a.ctx 9431 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadMembershipsForUser") 9432 9433 a.ctx = newCtx 9434 a.app.Srv().Store.SetContext(newCtx) 9435 defer func() { 9436 a.app.Srv().Store.SetContext(origCtx) 9437 a.ctx = origCtx 9438 }() 9439 9440 defer span.Finish() 9441 resultVar0, resultVar1 := a.app.GetThreadMembershipsForUser(userID, teamID) 9442 9443 if resultVar1 != nil { 9444 span.LogFields(spanlog.Error(resultVar1)) 9445 ext.Error.Set(span, true) 9446 } 9447 9448 return resultVar0, resultVar1 9449 } 9450 9451 func (a *OpenTracingAppLayer) GetThreadsForUser(userID string, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { 9452 origCtx := a.ctx 9453 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadsForUser") 9454 9455 a.ctx = newCtx 9456 a.app.Srv().Store.SetContext(newCtx) 9457 defer func() { 9458 a.app.Srv().Store.SetContext(origCtx) 9459 a.ctx = origCtx 9460 }() 9461 9462 defer span.Finish() 9463 resultVar0, resultVar1 := a.app.GetThreadsForUser(userID, teamID, options) 9464 9465 if resultVar1 != nil { 9466 span.LogFields(spanlog.Error(resultVar1)) 9467 ext.Error.Set(span, true) 9468 } 9469 9470 return resultVar0, resultVar1 9471 } 9472 9473 func (a *OpenTracingAppLayer) GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) { 9474 origCtx := a.ctx 9475 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTotalUsersStats") 9476 9477 a.ctx = newCtx 9478 a.app.Srv().Store.SetContext(newCtx) 9479 defer func() { 9480 a.app.Srv().Store.SetContext(origCtx) 9481 a.ctx = origCtx 9482 }() 9483 9484 defer span.Finish() 9485 resultVar0, resultVar1 := a.app.GetTotalUsersStats(viewRestrictions) 9486 9487 if resultVar1 != nil { 9488 span.LogFields(spanlog.Error(resultVar1)) 9489 ext.Error.Set(span, true) 9490 } 9491 9492 return resultVar0, resultVar1 9493 } 9494 9495 func (a *OpenTracingAppLayer) GetTrackRecord(trackRecordId string) (*model.TrackRecord, *model.AppError) { 9496 origCtx := a.ctx 9497 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTrackRecord") 9498 9499 a.ctx = newCtx 9500 a.app.Srv().Store.SetContext(newCtx) 9501 defer func() { 9502 a.app.Srv().Store.SetContext(origCtx) 9503 a.ctx = origCtx 9504 }() 9505 9506 defer span.Finish() 9507 resultVar0, resultVar1 := a.app.GetTrackRecord(trackRecordId) 9508 9509 if resultVar1 != nil { 9510 span.LogFields(spanlog.Error(resultVar1)) 9511 ext.Error.Set(span, true) 9512 } 9513 9514 return resultVar0, resultVar1 9515 } 9516 9517 func (a *OpenTracingAppLayer) GetUploadSession(uploadId string) (*model.UploadSession, *model.AppError) { 9518 origCtx := a.ctx 9519 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUploadSession") 9520 9521 a.ctx = newCtx 9522 a.app.Srv().Store.SetContext(newCtx) 9523 defer func() { 9524 a.app.Srv().Store.SetContext(origCtx) 9525 a.ctx = origCtx 9526 }() 9527 9528 defer span.Finish() 9529 resultVar0, resultVar1 := a.app.GetUploadSession(uploadId) 9530 9531 if resultVar1 != nil { 9532 span.LogFields(spanlog.Error(resultVar1)) 9533 ext.Error.Set(span, true) 9534 } 9535 9536 return resultVar0, resultVar1 9537 } 9538 9539 func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError) { 9540 origCtx := a.ctx 9541 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUploadSessionsForUser") 9542 9543 a.ctx = newCtx 9544 a.app.Srv().Store.SetContext(newCtx) 9545 defer func() { 9546 a.app.Srv().Store.SetContext(origCtx) 9547 a.ctx = origCtx 9548 }() 9549 9550 defer span.Finish() 9551 resultVar0, resultVar1 := a.app.GetUploadSessionsForUser(userID) 9552 9553 if resultVar1 != nil { 9554 span.LogFields(spanlog.Error(resultVar1)) 9555 ext.Error.Set(span, true) 9556 } 9557 9558 return resultVar0, resultVar1 9559 } 9560 9561 func (a *OpenTracingAppLayer) GetUser(userID string) (*model.User, *model.AppError) { 9562 origCtx := a.ctx 9563 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUser") 9564 9565 a.ctx = newCtx 9566 a.app.Srv().Store.SetContext(newCtx) 9567 defer func() { 9568 a.app.Srv().Store.SetContext(origCtx) 9569 a.ctx = origCtx 9570 }() 9571 9572 defer span.Finish() 9573 resultVar0, resultVar1 := a.app.GetUser(userID) 9574 9575 if resultVar1 != nil { 9576 span.LogFields(spanlog.Error(resultVar1)) 9577 ext.Error.Set(span, true) 9578 } 9579 9580 return resultVar0, resultVar1 9581 } 9582 9583 func (a *OpenTracingAppLayer) GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError) { 9584 origCtx := a.ctx 9585 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessToken") 9586 9587 a.ctx = newCtx 9588 a.app.Srv().Store.SetContext(newCtx) 9589 defer func() { 9590 a.app.Srv().Store.SetContext(origCtx) 9591 a.ctx = origCtx 9592 }() 9593 9594 defer span.Finish() 9595 resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenID, sanitize) 9596 9597 if resultVar1 != nil { 9598 span.LogFields(spanlog.Error(resultVar1)) 9599 ext.Error.Set(span, true) 9600 } 9601 9602 return resultVar0, resultVar1 9603 } 9604 9605 func (a *OpenTracingAppLayer) GetUserAccessTokens(page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 9606 origCtx := a.ctx 9607 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokens") 9608 9609 a.ctx = newCtx 9610 a.app.Srv().Store.SetContext(newCtx) 9611 defer func() { 9612 a.app.Srv().Store.SetContext(origCtx) 9613 a.ctx = origCtx 9614 }() 9615 9616 defer span.Finish() 9617 resultVar0, resultVar1 := a.app.GetUserAccessTokens(page, perPage) 9618 9619 if resultVar1 != nil { 9620 span.LogFields(spanlog.Error(resultVar1)) 9621 ext.Error.Set(span, true) 9622 } 9623 9624 return resultVar0, resultVar1 9625 } 9626 9627 func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userID string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 9628 origCtx := a.ctx 9629 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokensForUser") 9630 9631 a.ctx = newCtx 9632 a.app.Srv().Store.SetContext(newCtx) 9633 defer func() { 9634 a.app.Srv().Store.SetContext(origCtx) 9635 a.ctx = origCtx 9636 }() 9637 9638 defer span.Finish() 9639 resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userID, page, perPage) 9640 9641 if resultVar1 != nil { 9642 span.LogFields(spanlog.Error(resultVar1)) 9643 ext.Error.Set(span, true) 9644 } 9645 9646 return resultVar0, resultVar1 9647 } 9648 9649 func (a *OpenTracingAppLayer) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) { 9650 origCtx := a.ctx 9651 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByAuth") 9652 9653 a.ctx = newCtx 9654 a.app.Srv().Store.SetContext(newCtx) 9655 defer func() { 9656 a.app.Srv().Store.SetContext(origCtx) 9657 a.ctx = origCtx 9658 }() 9659 9660 defer span.Finish() 9661 resultVar0, resultVar1 := a.app.GetUserByAuth(authData, authService) 9662 9663 if resultVar1 != nil { 9664 span.LogFields(spanlog.Error(resultVar1)) 9665 ext.Error.Set(span, true) 9666 } 9667 9668 return resultVar0, resultVar1 9669 } 9670 9671 func (a *OpenTracingAppLayer) GetUserByEmail(email string) (*model.User, *model.AppError) { 9672 origCtx := a.ctx 9673 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByEmail") 9674 9675 a.ctx = newCtx 9676 a.app.Srv().Store.SetContext(newCtx) 9677 defer func() { 9678 a.app.Srv().Store.SetContext(origCtx) 9679 a.ctx = origCtx 9680 }() 9681 9682 defer span.Finish() 9683 resultVar0, resultVar1 := a.app.GetUserByEmail(email) 9684 9685 if resultVar1 != nil { 9686 span.LogFields(spanlog.Error(resultVar1)) 9687 ext.Error.Set(span, true) 9688 } 9689 9690 return resultVar0, resultVar1 9691 } 9692 9693 func (a *OpenTracingAppLayer) GetUserByUsername(username string) (*model.User, *model.AppError) { 9694 origCtx := a.ctx 9695 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByUsername") 9696 9697 a.ctx = newCtx 9698 a.app.Srv().Store.SetContext(newCtx) 9699 defer func() { 9700 a.app.Srv().Store.SetContext(origCtx) 9701 a.ctx = origCtx 9702 }() 9703 9704 defer span.Finish() 9705 resultVar0, resultVar1 := a.app.GetUserByUsername(username) 9706 9707 if resultVar1 != nil { 9708 span.LogFields(spanlog.Error(resultVar1)) 9709 ext.Error.Set(span, true) 9710 } 9711 9712 return resultVar0, resultVar1 9713 } 9714 9715 func (a *OpenTracingAppLayer) GetUserForLogin(id string, loginId string) (*model.User, *model.AppError) { 9716 origCtx := a.ctx 9717 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserForLogin") 9718 9719 a.ctx = newCtx 9720 a.app.Srv().Store.SetContext(newCtx) 9721 defer func() { 9722 a.app.Srv().Store.SetContext(origCtx) 9723 a.ctx = origCtx 9724 }() 9725 9726 defer span.Finish() 9727 resultVar0, resultVar1 := a.app.GetUserForLogin(id, loginId) 9728 9729 if resultVar1 != nil { 9730 span.LogFields(spanlog.Error(resultVar1)) 9731 ext.Error.Set(span, true) 9732 } 9733 9734 return resultVar0, resultVar1 9735 } 9736 9737 func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) { 9738 origCtx := a.ctx 9739 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserStatusesByIds") 9740 9741 a.ctx = newCtx 9742 a.app.Srv().Store.SetContext(newCtx) 9743 defer func() { 9744 a.app.Srv().Store.SetContext(origCtx) 9745 a.ctx = origCtx 9746 }() 9747 9748 defer span.Finish() 9749 resultVar0, resultVar1 := a.app.GetUserStatusesByIds(userIDs) 9750 9751 if resultVar1 != nil { 9752 span.LogFields(spanlog.Error(resultVar1)) 9753 ext.Error.Set(span, true) 9754 } 9755 9756 return resultVar0, resultVar1 9757 } 9758 9759 func (a *OpenTracingAppLayer) GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError) { 9760 origCtx := a.ctx 9761 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserTermsOfService") 9762 9763 a.ctx = newCtx 9764 a.app.Srv().Store.SetContext(newCtx) 9765 defer func() { 9766 a.app.Srv().Store.SetContext(origCtx) 9767 a.ctx = origCtx 9768 }() 9769 9770 defer span.Finish() 9771 resultVar0, resultVar1 := a.app.GetUserTermsOfService(userID) 9772 9773 if resultVar1 != nil { 9774 span.LogFields(spanlog.Error(resultVar1)) 9775 ext.Error.Set(span, true) 9776 } 9777 9778 return resultVar0, resultVar1 9779 } 9780 9781 func (a *OpenTracingAppLayer) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9782 origCtx := a.ctx 9783 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsers") 9784 9785 a.ctx = newCtx 9786 a.app.Srv().Store.SetContext(newCtx) 9787 defer func() { 9788 a.app.Srv().Store.SetContext(origCtx) 9789 a.ctx = origCtx 9790 }() 9791 9792 defer span.Finish() 9793 resultVar0, resultVar1 := a.app.GetUsers(options) 9794 9795 if resultVar1 != nil { 9796 span.LogFields(spanlog.Error(resultVar1)) 9797 ext.Error.Set(span, true) 9798 } 9799 9800 return resultVar0, resultVar1 9801 } 9802 9803 func (a *OpenTracingAppLayer) GetUsersByGroupChannelIds(c *request.Context, channelIDs []string, asAdmin bool) (map[string][]*model.User, *model.AppError) { 9804 origCtx := a.ctx 9805 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByGroupChannelIds") 9806 9807 a.ctx = newCtx 9808 a.app.Srv().Store.SetContext(newCtx) 9809 defer func() { 9810 a.app.Srv().Store.SetContext(origCtx) 9811 a.ctx = origCtx 9812 }() 9813 9814 defer span.Finish() 9815 resultVar0, resultVar1 := a.app.GetUsersByGroupChannelIds(c, channelIDs, asAdmin) 9816 9817 if resultVar1 != nil { 9818 span.LogFields(spanlog.Error(resultVar1)) 9819 ext.Error.Set(span, true) 9820 } 9821 9822 return resultVar0, resultVar1 9823 } 9824 9825 func (a *OpenTracingAppLayer) GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { 9826 origCtx := a.ctx 9827 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByIds") 9828 9829 a.ctx = newCtx 9830 a.app.Srv().Store.SetContext(newCtx) 9831 defer func() { 9832 a.app.Srv().Store.SetContext(origCtx) 9833 a.ctx = origCtx 9834 }() 9835 9836 defer span.Finish() 9837 resultVar0, resultVar1 := a.app.GetUsersByIds(userIDs, options) 9838 9839 if resultVar1 != nil { 9840 span.LogFields(spanlog.Error(resultVar1)) 9841 ext.Error.Set(span, true) 9842 } 9843 9844 return resultVar0, resultVar1 9845 } 9846 9847 func (a *OpenTracingAppLayer) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9848 origCtx := a.ctx 9849 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByUsernames") 9850 9851 a.ctx = newCtx 9852 a.app.Srv().Store.SetContext(newCtx) 9853 defer func() { 9854 a.app.Srv().Store.SetContext(origCtx) 9855 a.ctx = origCtx 9856 }() 9857 9858 defer span.Finish() 9859 resultVar0, resultVar1 := a.app.GetUsersByUsernames(usernames, asAdmin, viewRestrictions) 9860 9861 if resultVar1 != nil { 9862 span.LogFields(spanlog.Error(resultVar1)) 9863 ext.Error.Set(span, true) 9864 } 9865 9866 return resultVar0, resultVar1 9867 } 9868 9869 func (a *OpenTracingAppLayer) GetUsersEtag(restrictionsHash string) string { 9870 origCtx := a.ctx 9871 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersEtag") 9872 9873 a.ctx = newCtx 9874 a.app.Srv().Store.SetContext(newCtx) 9875 defer func() { 9876 a.app.Srv().Store.SetContext(origCtx) 9877 a.ctx = origCtx 9878 }() 9879 9880 defer span.Finish() 9881 resultVar0 := a.app.GetUsersEtag(restrictionsHash) 9882 9883 return resultVar0 9884 } 9885 9886 func (a *OpenTracingAppLayer) GetUsersInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9887 origCtx := a.ctx 9888 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannel") 9889 9890 a.ctx = newCtx 9891 a.app.Srv().Store.SetContext(newCtx) 9892 defer func() { 9893 a.app.Srv().Store.SetContext(origCtx) 9894 a.ctx = origCtx 9895 }() 9896 9897 defer span.Finish() 9898 resultVar0, resultVar1 := a.app.GetUsersInChannel(options) 9899 9900 if resultVar1 != nil { 9901 span.LogFields(spanlog.Error(resultVar1)) 9902 ext.Error.Set(span, true) 9903 } 9904 9905 return resultVar0, resultVar1 9906 } 9907 9908 func (a *OpenTracingAppLayer) GetUsersInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9909 origCtx := a.ctx 9910 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelByStatus") 9911 9912 a.ctx = newCtx 9913 a.app.Srv().Store.SetContext(newCtx) 9914 defer func() { 9915 a.app.Srv().Store.SetContext(origCtx) 9916 a.ctx = origCtx 9917 }() 9918 9919 defer span.Finish() 9920 resultVar0, resultVar1 := a.app.GetUsersInChannelByStatus(options) 9921 9922 if resultVar1 != nil { 9923 span.LogFields(spanlog.Error(resultVar1)) 9924 ext.Error.Set(span, true) 9925 } 9926 9927 return resultVar0, resultVar1 9928 } 9929 9930 func (a *OpenTracingAppLayer) GetUsersInChannelMap(options *model.UserGetOptions, asAdmin bool) (map[string]*model.User, *model.AppError) { 9931 origCtx := a.ctx 9932 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelMap") 9933 9934 a.ctx = newCtx 9935 a.app.Srv().Store.SetContext(newCtx) 9936 defer func() { 9937 a.app.Srv().Store.SetContext(origCtx) 9938 a.ctx = origCtx 9939 }() 9940 9941 defer span.Finish() 9942 resultVar0, resultVar1 := a.app.GetUsersInChannelMap(options, asAdmin) 9943 9944 if resultVar1 != nil { 9945 span.LogFields(spanlog.Error(resultVar1)) 9946 ext.Error.Set(span, true) 9947 } 9948 9949 return resultVar0, resultVar1 9950 } 9951 9952 func (a *OpenTracingAppLayer) GetUsersInChannelPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9953 origCtx := a.ctx 9954 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPage") 9955 9956 a.ctx = newCtx 9957 a.app.Srv().Store.SetContext(newCtx) 9958 defer func() { 9959 a.app.Srv().Store.SetContext(origCtx) 9960 a.ctx = origCtx 9961 }() 9962 9963 defer span.Finish() 9964 resultVar0, resultVar1 := a.app.GetUsersInChannelPage(options, asAdmin) 9965 9966 if resultVar1 != nil { 9967 span.LogFields(spanlog.Error(resultVar1)) 9968 ext.Error.Set(span, true) 9969 } 9970 9971 return resultVar0, resultVar1 9972 } 9973 9974 func (a *OpenTracingAppLayer) GetUsersInChannelPageByStatus(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9975 origCtx := a.ctx 9976 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPageByStatus") 9977 9978 a.ctx = newCtx 9979 a.app.Srv().Store.SetContext(newCtx) 9980 defer func() { 9981 a.app.Srv().Store.SetContext(origCtx) 9982 a.ctx = origCtx 9983 }() 9984 9985 defer span.Finish() 9986 resultVar0, resultVar1 := a.app.GetUsersInChannelPageByStatus(options, asAdmin) 9987 9988 if resultVar1 != nil { 9989 span.LogFields(spanlog.Error(resultVar1)) 9990 ext.Error.Set(span, true) 9991 } 9992 9993 return resultVar0, resultVar1 9994 } 9995 9996 func (a *OpenTracingAppLayer) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9997 origCtx := a.ctx 9998 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeam") 9999 10000 a.ctx = newCtx 10001 a.app.Srv().Store.SetContext(newCtx) 10002 defer func() { 10003 a.app.Srv().Store.SetContext(origCtx) 10004 a.ctx = origCtx 10005 }() 10006 10007 defer span.Finish() 10008 resultVar0, resultVar1 := a.app.GetUsersInTeam(options) 10009 10010 if resultVar1 != nil { 10011 span.LogFields(spanlog.Error(resultVar1)) 10012 ext.Error.Set(span, true) 10013 } 10014 10015 return resultVar0, resultVar1 10016 } 10017 10018 func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamID string, restrictionsHash string) string { 10019 origCtx := a.ctx 10020 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamEtag") 10021 10022 a.ctx = newCtx 10023 a.app.Srv().Store.SetContext(newCtx) 10024 defer func() { 10025 a.app.Srv().Store.SetContext(origCtx) 10026 a.ctx = origCtx 10027 }() 10028 10029 defer span.Finish() 10030 resultVar0 := a.app.GetUsersInTeamEtag(teamID, restrictionsHash) 10031 10032 return resultVar0 10033 } 10034 10035 func (a *OpenTracingAppLayer) GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 10036 origCtx := a.ctx 10037 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamPage") 10038 10039 a.ctx = newCtx 10040 a.app.Srv().Store.SetContext(newCtx) 10041 defer func() { 10042 a.app.Srv().Store.SetContext(origCtx) 10043 a.ctx = origCtx 10044 }() 10045 10046 defer span.Finish() 10047 resultVar0, resultVar1 := a.app.GetUsersInTeamPage(options, asAdmin) 10048 10049 if resultVar1 != nil { 10050 span.LogFields(spanlog.Error(resultVar1)) 10051 ext.Error.Set(span, true) 10052 } 10053 10054 return resultVar0, resultVar1 10055 } 10056 10057 func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamID string, channelID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 10058 origCtx := a.ctx 10059 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannel") 10060 10061 a.ctx = newCtx 10062 a.app.Srv().Store.SetContext(newCtx) 10063 defer func() { 10064 a.app.Srv().Store.SetContext(origCtx) 10065 a.ctx = origCtx 10066 }() 10067 10068 defer span.Finish() 10069 resultVar0, resultVar1 := a.app.GetUsersNotInChannel(teamID, channelID, groupConstrained, offset, limit, viewRestrictions) 10070 10071 if resultVar1 != nil { 10072 span.LogFields(spanlog.Error(resultVar1)) 10073 ext.Error.Set(span, true) 10074 } 10075 10076 return resultVar0, resultVar1 10077 } 10078 10079 func (a *OpenTracingAppLayer) GetUsersNotInChannelMap(teamID string, channelID string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { 10080 origCtx := a.ctx 10081 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelMap") 10082 10083 a.ctx = newCtx 10084 a.app.Srv().Store.SetContext(newCtx) 10085 defer func() { 10086 a.app.Srv().Store.SetContext(origCtx) 10087 a.ctx = origCtx 10088 }() 10089 10090 defer span.Finish() 10091 resultVar0, resultVar1 := a.app.GetUsersNotInChannelMap(teamID, channelID, groupConstrained, offset, limit, asAdmin, viewRestrictions) 10092 10093 if resultVar1 != nil { 10094 span.LogFields(spanlog.Error(resultVar1)) 10095 ext.Error.Set(span, true) 10096 } 10097 10098 return resultVar0, resultVar1 10099 } 10100 10101 func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamID string, channelID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 10102 origCtx := a.ctx 10103 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelPage") 10104 10105 a.ctx = newCtx 10106 a.app.Srv().Store.SetContext(newCtx) 10107 defer func() { 10108 a.app.Srv().Store.SetContext(origCtx) 10109 a.ctx = origCtx 10110 }() 10111 10112 defer span.Finish() 10113 resultVar0, resultVar1 := a.app.GetUsersNotInChannelPage(teamID, channelID, groupConstrained, page, perPage, asAdmin, viewRestrictions) 10114 10115 if resultVar1 != nil { 10116 span.LogFields(spanlog.Error(resultVar1)) 10117 ext.Error.Set(span, true) 10118 } 10119 10120 return resultVar0, resultVar1 10121 } 10122 10123 func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 10124 origCtx := a.ctx 10125 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeam") 10126 10127 a.ctx = newCtx 10128 a.app.Srv().Store.SetContext(newCtx) 10129 defer func() { 10130 a.app.Srv().Store.SetContext(origCtx) 10131 a.ctx = origCtx 10132 }() 10133 10134 defer span.Finish() 10135 resultVar0, resultVar1 := a.app.GetUsersNotInTeam(teamID, groupConstrained, offset, limit, viewRestrictions) 10136 10137 if resultVar1 != nil { 10138 span.LogFields(spanlog.Error(resultVar1)) 10139 ext.Error.Set(span, true) 10140 } 10141 10142 return resultVar0, resultVar1 10143 } 10144 10145 func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string { 10146 origCtx := a.ctx 10147 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamEtag") 10148 10149 a.ctx = newCtx 10150 a.app.Srv().Store.SetContext(newCtx) 10151 defer func() { 10152 a.app.Srv().Store.SetContext(origCtx) 10153 a.ctx = origCtx 10154 }() 10155 10156 defer span.Finish() 10157 resultVar0 := a.app.GetUsersNotInTeamEtag(teamID, restrictionsHash) 10158 10159 return resultVar0 10160 } 10161 10162 func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 10163 origCtx := a.ctx 10164 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamPage") 10165 10166 a.ctx = newCtx 10167 a.app.Srv().Store.SetContext(newCtx) 10168 defer func() { 10169 a.app.Srv().Store.SetContext(origCtx) 10170 a.ctx = origCtx 10171 }() 10172 10173 defer span.Finish() 10174 resultVar0, resultVar1 := a.app.GetUsersNotInTeamPage(teamID, groupConstrained, page, perPage, asAdmin, viewRestrictions) 10175 10176 if resultVar1 != nil { 10177 span.LogFields(spanlog.Error(resultVar1)) 10178 ext.Error.Set(span, true) 10179 } 10180 10181 return resultVar0, resultVar1 10182 } 10183 10184 func (a *OpenTracingAppLayer) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 10185 origCtx := a.ctx 10186 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersPage") 10187 10188 a.ctx = newCtx 10189 a.app.Srv().Store.SetContext(newCtx) 10190 defer func() { 10191 a.app.Srv().Store.SetContext(origCtx) 10192 a.ctx = origCtx 10193 }() 10194 10195 defer span.Finish() 10196 resultVar0, resultVar1 := a.app.GetUsersPage(options, asAdmin) 10197 10198 if resultVar1 != nil { 10199 span.LogFields(spanlog.Error(resultVar1)) 10200 ext.Error.Set(span, true) 10201 } 10202 10203 return resultVar0, resultVar1 10204 } 10205 10206 func (a *OpenTracingAppLayer) GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 10207 origCtx := a.ctx 10208 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeam") 10209 10210 a.ctx = newCtx 10211 a.app.Srv().Store.SetContext(newCtx) 10212 defer func() { 10213 a.app.Srv().Store.SetContext(origCtx) 10214 a.ctx = origCtx 10215 }() 10216 10217 defer span.Finish() 10218 resultVar0, resultVar1 := a.app.GetUsersWithoutTeam(options) 10219 10220 if resultVar1 != nil { 10221 span.LogFields(spanlog.Error(resultVar1)) 10222 ext.Error.Set(span, true) 10223 } 10224 10225 return resultVar0, resultVar1 10226 } 10227 10228 func (a *OpenTracingAppLayer) GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 10229 origCtx := a.ctx 10230 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeamPage") 10231 10232 a.ctx = newCtx 10233 a.app.Srv().Store.SetContext(newCtx) 10234 defer func() { 10235 a.app.Srv().Store.SetContext(origCtx) 10236 a.ctx = origCtx 10237 }() 10238 10239 defer span.Finish() 10240 resultVar0, resultVar1 := a.app.GetUsersWithoutTeamPage(options, asAdmin) 10241 10242 if resultVar1 != nil { 10243 span.LogFields(spanlog.Error(resultVar1)) 10244 ext.Error.Set(span, true) 10245 } 10246 10247 return resultVar0, resultVar1 10248 } 10249 10250 func (a *OpenTracingAppLayer) GetVerifyEmailToken(token string) (*model.Token, *model.AppError) { 10251 origCtx := a.ctx 10252 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetVerifyEmailToken") 10253 10254 a.ctx = newCtx 10255 a.app.Srv().Store.SetContext(newCtx) 10256 defer func() { 10257 a.app.Srv().Store.SetContext(origCtx) 10258 a.ctx = origCtx 10259 }() 10260 10261 defer span.Finish() 10262 resultVar0, resultVar1 := a.app.GetVerifyEmailToken(token) 10263 10264 if resultVar1 != nil { 10265 span.LogFields(spanlog.Error(resultVar1)) 10266 ext.Error.Set(span, true) 10267 } 10268 10269 return resultVar0, resultVar1 10270 } 10271 10272 func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError) { 10273 origCtx := a.ctx 10274 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetViewUsersRestrictions") 10275 10276 a.ctx = newCtx 10277 a.app.Srv().Store.SetContext(newCtx) 10278 defer func() { 10279 a.app.Srv().Store.SetContext(origCtx) 10280 a.ctx = origCtx 10281 }() 10282 10283 defer span.Finish() 10284 resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userID) 10285 10286 if resultVar1 != nil { 10287 span.LogFields(spanlog.Error(resultVar1)) 10288 ext.Error.Set(span, true) 10289 } 10290 10291 return resultVar0, resultVar1 10292 } 10293 10294 func (a *OpenTracingAppLayer) GetWarnMetricsBot() (*model.Bot, *model.AppError) { 10295 origCtx := a.ctx 10296 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetWarnMetricsBot") 10297 10298 a.ctx = newCtx 10299 a.app.Srv().Store.SetContext(newCtx) 10300 defer func() { 10301 a.app.Srv().Store.SetContext(origCtx) 10302 a.ctx = origCtx 10303 }() 10304 10305 defer span.Finish() 10306 resultVar0, resultVar1 := a.app.GetWarnMetricsBot() 10307 10308 if resultVar1 != nil { 10309 span.LogFields(spanlog.Error(resultVar1)) 10310 ext.Error.Set(span, true) 10311 } 10312 10313 return resultVar0, resultVar1 10314 } 10315 10316 func (a *OpenTracingAppLayer) GetWarnMetricsStatus() (map[string]*model.WarnMetricStatus, *model.AppError) { 10317 origCtx := a.ctx 10318 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetWarnMetricsStatus") 10319 10320 a.ctx = newCtx 10321 a.app.Srv().Store.SetContext(newCtx) 10322 defer func() { 10323 a.app.Srv().Store.SetContext(origCtx) 10324 a.ctx = origCtx 10325 }() 10326 10327 defer span.Finish() 10328 resultVar0, resultVar1 := a.app.GetWarnMetricsStatus() 10329 10330 if resultVar1 != nil { 10331 span.LogFields(spanlog.Error(resultVar1)) 10332 ext.Error.Set(span, true) 10333 } 10334 10335 return resultVar0, resultVar1 10336 } 10337 10338 func (a *OpenTracingAppLayer) Handle404(w http.ResponseWriter, r *http.Request) { 10339 origCtx := a.ctx 10340 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Handle404") 10341 10342 a.ctx = newCtx 10343 a.app.Srv().Store.SetContext(newCtx) 10344 defer func() { 10345 a.app.Srv().Store.SetContext(origCtx) 10346 a.ctx = origCtx 10347 }() 10348 10349 defer span.Finish() 10350 a.app.Handle404(w, r) 10351 } 10352 10353 func (a *OpenTracingAppLayer) HandleCommandResponse(c *request.Context, command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) { 10354 origCtx := a.ctx 10355 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponse") 10356 10357 a.ctx = newCtx 10358 a.app.Srv().Store.SetContext(newCtx) 10359 defer func() { 10360 a.app.Srv().Store.SetContext(origCtx) 10361 a.ctx = origCtx 10362 }() 10363 10364 defer span.Finish() 10365 resultVar0, resultVar1 := a.app.HandleCommandResponse(c, command, args, response, builtIn) 10366 10367 if resultVar1 != nil { 10368 span.LogFields(spanlog.Error(resultVar1)) 10369 ext.Error.Set(span, true) 10370 } 10371 10372 return resultVar0, resultVar1 10373 } 10374 10375 func (a *OpenTracingAppLayer) HandleCommandResponsePost(c *request.Context, command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError) { 10376 origCtx := a.ctx 10377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponsePost") 10378 10379 a.ctx = newCtx 10380 a.app.Srv().Store.SetContext(newCtx) 10381 defer func() { 10382 a.app.Srv().Store.SetContext(origCtx) 10383 a.ctx = origCtx 10384 }() 10385 10386 defer span.Finish() 10387 resultVar0, resultVar1 := a.app.HandleCommandResponsePost(c, command, args, response, builtIn) 10388 10389 if resultVar1 != nil { 10390 span.LogFields(spanlog.Error(resultVar1)) 10391 ext.Error.Set(span, true) 10392 } 10393 10394 return resultVar0, resultVar1 10395 } 10396 10397 func (a *OpenTracingAppLayer) HandleCommandWebhook(c *request.Context, hookID string, response *model.CommandResponse) *model.AppError { 10398 origCtx := a.ctx 10399 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandWebhook") 10400 10401 a.ctx = newCtx 10402 a.app.Srv().Store.SetContext(newCtx) 10403 defer func() { 10404 a.app.Srv().Store.SetContext(origCtx) 10405 a.ctx = origCtx 10406 }() 10407 10408 defer span.Finish() 10409 resultVar0 := a.app.HandleCommandWebhook(c, hookID, response) 10410 10411 if resultVar0 != nil { 10412 span.LogFields(spanlog.Error(resultVar0)) 10413 ext.Error.Set(span, true) 10414 } 10415 10416 return resultVar0 10417 } 10418 10419 func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) { 10420 origCtx := a.ctx 10421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleImages") 10422 10423 a.ctx = newCtx 10424 a.app.Srv().Store.SetContext(newCtx) 10425 defer func() { 10426 a.app.Srv().Store.SetContext(origCtx) 10427 a.ctx = origCtx 10428 }() 10429 10430 defer span.Finish() 10431 a.app.HandleImages(previewPathList, thumbnailPathList, fileData) 10432 } 10433 10434 func (a *OpenTracingAppLayer) HandleIncomingWebhook(c *request.Context, hookID string, req *model.IncomingWebhookRequest) *model.AppError { 10435 origCtx := a.ctx 10436 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleIncomingWebhook") 10437 10438 a.ctx = newCtx 10439 a.app.Srv().Store.SetContext(newCtx) 10440 defer func() { 10441 a.app.Srv().Store.SetContext(origCtx) 10442 a.ctx = origCtx 10443 }() 10444 10445 defer span.Finish() 10446 resultVar0 := a.app.HandleIncomingWebhook(c, hookID, req) 10447 10448 if resultVar0 != nil { 10449 span.LogFields(spanlog.Error(resultVar0)) 10450 ext.Error.Set(span, true) 10451 } 10452 10453 return resultVar0 10454 } 10455 10456 func (a *OpenTracingAppLayer) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) { 10457 origCtx := a.ctx 10458 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleMessageExportConfig") 10459 10460 a.ctx = newCtx 10461 a.app.Srv().Store.SetContext(newCtx) 10462 defer func() { 10463 a.app.Srv().Store.SetContext(origCtx) 10464 a.ctx = origCtx 10465 }() 10466 10467 defer span.Finish() 10468 a.app.HandleMessageExportConfig(cfg, appCfg) 10469 } 10470 10471 func (a *OpenTracingAppLayer) HasPermissionTo(askingUserId string, permission *model.Permission) bool { 10472 origCtx := a.ctx 10473 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionTo") 10474 10475 a.ctx = newCtx 10476 a.app.Srv().Store.SetContext(newCtx) 10477 defer func() { 10478 a.app.Srv().Store.SetContext(origCtx) 10479 a.ctx = origCtx 10480 }() 10481 10482 defer span.Finish() 10483 resultVar0 := a.app.HasPermissionTo(askingUserId, permission) 10484 10485 return resultVar0 10486 } 10487 10488 func (a *OpenTracingAppLayer) HasPermissionToChannel(askingUserId string, channelID string, permission *model.Permission) bool { 10489 origCtx := a.ctx 10490 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannel") 10491 10492 a.ctx = newCtx 10493 a.app.Srv().Store.SetContext(newCtx) 10494 defer func() { 10495 a.app.Srv().Store.SetContext(origCtx) 10496 a.ctx = origCtx 10497 }() 10498 10499 defer span.Finish() 10500 resultVar0 := a.app.HasPermissionToChannel(askingUserId, channelID, permission) 10501 10502 return resultVar0 10503 } 10504 10505 func (a *OpenTracingAppLayer) HasPermissionToChannelByPost(askingUserId string, postID string, permission *model.Permission) bool { 10506 origCtx := a.ctx 10507 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannelByPost") 10508 10509 a.ctx = newCtx 10510 a.app.Srv().Store.SetContext(newCtx) 10511 defer func() { 10512 a.app.Srv().Store.SetContext(origCtx) 10513 a.ctx = origCtx 10514 }() 10515 10516 defer span.Finish() 10517 resultVar0 := a.app.HasPermissionToChannelByPost(askingUserId, postID, permission) 10518 10519 return resultVar0 10520 } 10521 10522 func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool { 10523 origCtx := a.ctx 10524 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToTeam") 10525 10526 a.ctx = newCtx 10527 a.app.Srv().Store.SetContext(newCtx) 10528 defer func() { 10529 a.app.Srv().Store.SetContext(origCtx) 10530 a.ctx = origCtx 10531 }() 10532 10533 defer span.Finish() 10534 resultVar0 := a.app.HasPermissionToTeam(askingUserId, teamID, permission) 10535 10536 return resultVar0 10537 } 10538 10539 func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userID string) bool { 10540 origCtx := a.ctx 10541 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToUser") 10542 10543 a.ctx = newCtx 10544 a.app.Srv().Store.SetContext(newCtx) 10545 defer func() { 10546 a.app.Srv().Store.SetContext(origCtx) 10547 a.ctx = origCtx 10548 }() 10549 10550 defer span.Finish() 10551 resultVar0 := a.app.HasPermissionToUser(askingUserId, userID) 10552 10553 return resultVar0 10554 } 10555 10556 func (a *OpenTracingAppLayer) HasRemote(channelID string, remoteID string) (bool, error) { 10557 origCtx := a.ctx 10558 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasRemote") 10559 10560 a.ctx = newCtx 10561 a.app.Srv().Store.SetContext(newCtx) 10562 defer func() { 10563 a.app.Srv().Store.SetContext(origCtx) 10564 a.ctx = origCtx 10565 }() 10566 10567 defer span.Finish() 10568 resultVar0, resultVar1 := a.app.HasRemote(channelID, remoteID) 10569 10570 if resultVar1 != nil { 10571 span.LogFields(spanlog.Error(resultVar1)) 10572 ext.Error.Set(span, true) 10573 } 10574 10575 return resultVar0, resultVar1 10576 } 10577 10578 func (a *OpenTracingAppLayer) HasSharedChannel(channelID string) (bool, error) { 10579 origCtx := a.ctx 10580 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasSharedChannel") 10581 10582 a.ctx = newCtx 10583 a.app.Srv().Store.SetContext(newCtx) 10584 defer func() { 10585 a.app.Srv().Store.SetContext(origCtx) 10586 a.ctx = origCtx 10587 }() 10588 10589 defer span.Finish() 10590 resultVar0, resultVar1 := a.app.HasSharedChannel(channelID) 10591 10592 if resultVar1 != nil { 10593 span.LogFields(spanlog.Error(resultVar1)) 10594 ext.Error.Set(span, true) 10595 } 10596 10597 return resultVar0, resultVar1 10598 } 10599 10600 func (a *OpenTracingAppLayer) HubRegister(webConn *app.WebConn) { 10601 origCtx := a.ctx 10602 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubRegister") 10603 10604 a.ctx = newCtx 10605 a.app.Srv().Store.SetContext(newCtx) 10606 defer func() { 10607 a.app.Srv().Store.SetContext(origCtx) 10608 a.ctx = origCtx 10609 }() 10610 10611 defer span.Finish() 10612 a.app.HubRegister(webConn) 10613 } 10614 10615 func (a *OpenTracingAppLayer) HubStart() { 10616 origCtx := a.ctx 10617 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStart") 10618 10619 a.ctx = newCtx 10620 a.app.Srv().Store.SetContext(newCtx) 10621 defer func() { 10622 a.app.Srv().Store.SetContext(origCtx) 10623 a.ctx = origCtx 10624 }() 10625 10626 defer span.Finish() 10627 a.app.HubStart() 10628 } 10629 10630 func (a *OpenTracingAppLayer) HubStop() { 10631 origCtx := a.ctx 10632 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStop") 10633 10634 a.ctx = newCtx 10635 a.app.Srv().Store.SetContext(newCtx) 10636 defer func() { 10637 a.app.Srv().Store.SetContext(origCtx) 10638 a.ctx = origCtx 10639 }() 10640 10641 defer span.Finish() 10642 a.app.HubStop() 10643 } 10644 10645 func (a *OpenTracingAppLayer) HubUnregister(webConn *app.WebConn) { 10646 origCtx := a.ctx 10647 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubUnregister") 10648 10649 a.ctx = newCtx 10650 a.app.Srv().Store.SetContext(newCtx) 10651 defer func() { 10652 a.app.Srv().Store.SetContext(origCtx) 10653 a.ctx = origCtx 10654 }() 10655 10656 defer span.Finish() 10657 a.app.HubUnregister(webConn) 10658 } 10659 10660 func (a *OpenTracingAppLayer) ImageProxyAdder() func(string) string { 10661 origCtx := a.ctx 10662 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyAdder") 10663 10664 a.ctx = newCtx 10665 a.app.Srv().Store.SetContext(newCtx) 10666 defer func() { 10667 a.app.Srv().Store.SetContext(origCtx) 10668 a.ctx = origCtx 10669 }() 10670 10671 defer span.Finish() 10672 resultVar0 := a.app.ImageProxyAdder() 10673 10674 return resultVar0 10675 } 10676 10677 func (a *OpenTracingAppLayer) ImageProxyRemover() (f func(string) string) { 10678 origCtx := a.ctx 10679 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyRemover") 10680 10681 a.ctx = newCtx 10682 a.app.Srv().Store.SetContext(newCtx) 10683 defer func() { 10684 a.app.Srv().Store.SetContext(origCtx) 10685 a.ctx = origCtx 10686 }() 10687 10688 defer span.Finish() 10689 resultVar0 := a.app.ImageProxyRemover() 10690 10691 return resultVar0 10692 } 10693 10694 func (a *OpenTracingAppLayer) ImportPermissions(jsonl io.Reader) error { 10695 origCtx := a.ctx 10696 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImportPermissions") 10697 10698 a.ctx = newCtx 10699 a.app.Srv().Store.SetContext(newCtx) 10700 defer func() { 10701 a.app.Srv().Store.SetContext(origCtx) 10702 a.ctx = origCtx 10703 }() 10704 10705 defer span.Finish() 10706 resultVar0 := a.app.ImportPermissions(jsonl) 10707 10708 if resultVar0 != nil { 10709 span.LogFields(spanlog.Error(resultVar0)) 10710 ext.Error.Set(span, true) 10711 } 10712 10713 return resultVar0 10714 } 10715 10716 func (a *OpenTracingAppLayer) InitPlugins(c *request.Context, pluginDir string, webappPluginDir string) { 10717 origCtx := a.ctx 10718 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPlugins") 10719 10720 a.ctx = newCtx 10721 a.app.Srv().Store.SetContext(newCtx) 10722 defer func() { 10723 a.app.Srv().Store.SetContext(origCtx) 10724 a.ctx = origCtx 10725 }() 10726 10727 defer span.Finish() 10728 a.app.InitPlugins(c, pluginDir, webappPluginDir) 10729 } 10730 10731 func (a *OpenTracingAppLayer) InstallMarketplacePlugin(request *model.InstallMarketplacePluginRequest) (*model.Manifest, *model.AppError) { 10732 origCtx := a.ctx 10733 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallMarketplacePlugin") 10734 10735 a.ctx = newCtx 10736 a.app.Srv().Store.SetContext(newCtx) 10737 defer func() { 10738 a.app.Srv().Store.SetContext(origCtx) 10739 a.ctx = origCtx 10740 }() 10741 10742 defer span.Finish() 10743 resultVar0, resultVar1 := a.app.InstallMarketplacePlugin(request) 10744 10745 if resultVar1 != nil { 10746 span.LogFields(spanlog.Error(resultVar1)) 10747 ext.Error.Set(span, true) 10748 } 10749 10750 return resultVar0, resultVar1 10751 } 10752 10753 func (a *OpenTracingAppLayer) InstallPlugin(pluginFile io.ReadSeeker, replace bool) (*model.Manifest, *model.AppError) { 10754 origCtx := a.ctx 10755 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPlugin") 10756 10757 a.ctx = newCtx 10758 a.app.Srv().Store.SetContext(newCtx) 10759 defer func() { 10760 a.app.Srv().Store.SetContext(origCtx) 10761 a.ctx = origCtx 10762 }() 10763 10764 defer span.Finish() 10765 resultVar0, resultVar1 := a.app.InstallPlugin(pluginFile, replace) 10766 10767 if resultVar1 != nil { 10768 span.LogFields(spanlog.Error(resultVar1)) 10769 ext.Error.Set(span, true) 10770 } 10771 10772 return resultVar0, resultVar1 10773 } 10774 10775 func (a *OpenTracingAppLayer) InstallPluginFromData(data model.PluginEventData) { 10776 origCtx := a.ctx 10777 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginFromData") 10778 10779 a.ctx = newCtx 10780 a.app.Srv().Store.SetContext(newCtx) 10781 defer func() { 10782 a.app.Srv().Store.SetContext(origCtx) 10783 a.ctx = origCtx 10784 }() 10785 10786 defer span.Finish() 10787 a.app.InstallPluginFromData(data) 10788 } 10789 10790 func (a *OpenTracingAppLayer) InstallPluginWithSignature(pluginFile io.ReadSeeker, signature io.ReadSeeker) (*model.Manifest, *model.AppError) { 10791 origCtx := a.ctx 10792 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginWithSignature") 10793 10794 a.ctx = newCtx 10795 a.app.Srv().Store.SetContext(newCtx) 10796 defer func() { 10797 a.app.Srv().Store.SetContext(origCtx) 10798 a.ctx = origCtx 10799 }() 10800 10801 defer span.Finish() 10802 resultVar0, resultVar1 := a.app.InstallPluginWithSignature(pluginFile, signature) 10803 10804 if resultVar1 != nil { 10805 span.LogFields(spanlog.Error(resultVar1)) 10806 ext.Error.Set(span, true) 10807 } 10808 10809 return resultVar0, resultVar1 10810 } 10811 10812 func (a *OpenTracingAppLayer) InvalidateAllEmailInvites() *model.AppError { 10813 origCtx := a.ctx 10814 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllEmailInvites") 10815 10816 a.ctx = newCtx 10817 a.app.Srv().Store.SetContext(newCtx) 10818 defer func() { 10819 a.app.Srv().Store.SetContext(origCtx) 10820 a.ctx = origCtx 10821 }() 10822 10823 defer span.Finish() 10824 resultVar0 := a.app.InvalidateAllEmailInvites() 10825 10826 if resultVar0 != nil { 10827 span.LogFields(spanlog.Error(resultVar0)) 10828 ext.Error.Set(span, true) 10829 } 10830 10831 return resultVar0 10832 } 10833 10834 func (a *OpenTracingAppLayer) InvalidateCacheForUser(userID string) { 10835 origCtx := a.ctx 10836 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateCacheForUser") 10837 10838 a.ctx = newCtx 10839 a.app.Srv().Store.SetContext(newCtx) 10840 defer func() { 10841 a.app.Srv().Store.SetContext(origCtx) 10842 a.ctx = origCtx 10843 }() 10844 10845 defer span.Finish() 10846 a.app.InvalidateCacheForUser(userID) 10847 } 10848 10849 func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { 10850 origCtx := a.ctx 10851 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannels") 10852 10853 a.ctx = newCtx 10854 a.app.Srv().Store.SetContext(newCtx) 10855 defer func() { 10856 a.app.Srv().Store.SetContext(origCtx) 10857 a.ctx = origCtx 10858 }() 10859 10860 defer span.Finish() 10861 resultVar0 := a.app.InviteGuestsToChannels(teamID, guestsInvite, senderId) 10862 10863 if resultVar0 != nil { 10864 span.LogFields(spanlog.Error(resultVar0)) 10865 ext.Error.Set(span, true) 10866 } 10867 10868 return resultVar0 10869 } 10870 10871 func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 10872 origCtx := a.ctx 10873 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannelsGracefully") 10874 10875 a.ctx = newCtx 10876 a.app.Srv().Store.SetContext(newCtx) 10877 defer func() { 10878 a.app.Srv().Store.SetContext(origCtx) 10879 a.ctx = origCtx 10880 }() 10881 10882 defer span.Finish() 10883 resultVar0, resultVar1 := a.app.InviteGuestsToChannelsGracefully(teamID, guestsInvite, senderId) 10884 10885 if resultVar1 != nil { 10886 span.LogFields(spanlog.Error(resultVar1)) 10887 ext.Error.Set(span, true) 10888 } 10889 10890 return resultVar0, resultVar1 10891 } 10892 10893 func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamID string, senderId string) *model.AppError { 10894 origCtx := a.ctx 10895 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeam") 10896 10897 a.ctx = newCtx 10898 a.app.Srv().Store.SetContext(newCtx) 10899 defer func() { 10900 a.app.Srv().Store.SetContext(origCtx) 10901 a.ctx = origCtx 10902 }() 10903 10904 defer span.Finish() 10905 resultVar0 := a.app.InviteNewUsersToTeam(emailList, teamID, senderId) 10906 10907 if resultVar0 != nil { 10908 span.LogFields(spanlog.Error(resultVar0)) 10909 ext.Error.Set(span, true) 10910 } 10911 10912 return resultVar0 10913 } 10914 10915 func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, teamID string, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 10916 origCtx := a.ctx 10917 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeamGracefully") 10918 10919 a.ctx = newCtx 10920 a.app.Srv().Store.SetContext(newCtx) 10921 defer func() { 10922 a.app.Srv().Store.SetContext(origCtx) 10923 a.ctx = origCtx 10924 }() 10925 10926 defer span.Finish() 10927 resultVar0, resultVar1 := a.app.InviteNewUsersToTeamGracefully(emailList, teamID, senderId) 10928 10929 if resultVar1 != nil { 10930 span.LogFields(spanlog.Error(resultVar1)) 10931 ext.Error.Set(span, true) 10932 } 10933 10934 return resultVar0, resultVar1 10935 } 10936 10937 func (a *OpenTracingAppLayer) IsFirstUserAccount() bool { 10938 origCtx := a.ctx 10939 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsFirstUserAccount") 10940 10941 a.ctx = newCtx 10942 a.app.Srv().Store.SetContext(newCtx) 10943 defer func() { 10944 a.app.Srv().Store.SetContext(origCtx) 10945 a.ctx = origCtx 10946 }() 10947 10948 defer span.Finish() 10949 resultVar0 := a.app.IsFirstUserAccount() 10950 10951 return resultVar0 10952 } 10953 10954 func (a *OpenTracingAppLayer) IsLeader() bool { 10955 origCtx := a.ctx 10956 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsLeader") 10957 10958 a.ctx = newCtx 10959 a.app.Srv().Store.SetContext(newCtx) 10960 defer func() { 10961 a.app.Srv().Store.SetContext(origCtx) 10962 a.ctx = origCtx 10963 }() 10964 10965 defer span.Finish() 10966 resultVar0 := a.app.IsLeader() 10967 10968 return resultVar0 10969 } 10970 10971 func (a *OpenTracingAppLayer) IsPasswordValid(password string) *model.AppError { 10972 origCtx := a.ctx 10973 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPasswordValid") 10974 10975 a.ctx = newCtx 10976 a.app.Srv().Store.SetContext(newCtx) 10977 defer func() { 10978 a.app.Srv().Store.SetContext(origCtx) 10979 a.ctx = origCtx 10980 }() 10981 10982 defer span.Finish() 10983 resultVar0 := a.app.IsPasswordValid(password) 10984 10985 if resultVar0 != nil { 10986 span.LogFields(spanlog.Error(resultVar0)) 10987 ext.Error.Set(span, true) 10988 } 10989 10990 return resultVar0 10991 } 10992 10993 func (a *OpenTracingAppLayer) IsPhase2MigrationCompleted() *model.AppError { 10994 origCtx := a.ctx 10995 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPhase2MigrationCompleted") 10996 10997 a.ctx = newCtx 10998 a.app.Srv().Store.SetContext(newCtx) 10999 defer func() { 11000 a.app.Srv().Store.SetContext(origCtx) 11001 a.ctx = origCtx 11002 }() 11003 11004 defer span.Finish() 11005 resultVar0 := a.app.IsPhase2MigrationCompleted() 11006 11007 if resultVar0 != nil { 11008 span.LogFields(spanlog.Error(resultVar0)) 11009 ext.Error.Set(span, true) 11010 } 11011 11012 return resultVar0 11013 } 11014 11015 func (a *OpenTracingAppLayer) IsUserAway(lastActivityAt int64) bool { 11016 origCtx := a.ctx 11017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserAway") 11018 11019 a.ctx = newCtx 11020 a.app.Srv().Store.SetContext(newCtx) 11021 defer func() { 11022 a.app.Srv().Store.SetContext(origCtx) 11023 a.ctx = origCtx 11024 }() 11025 11026 defer span.Finish() 11027 resultVar0 := a.app.IsUserAway(lastActivityAt) 11028 11029 return resultVar0 11030 } 11031 11032 func (a *OpenTracingAppLayer) IsUserSignUpAllowed() *model.AppError { 11033 origCtx := a.ctx 11034 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserSignUpAllowed") 11035 11036 a.ctx = newCtx 11037 a.app.Srv().Store.SetContext(newCtx) 11038 defer func() { 11039 a.app.Srv().Store.SetContext(origCtx) 11040 a.ctx = origCtx 11041 }() 11042 11043 defer span.Finish() 11044 resultVar0 := a.app.IsUserSignUpAllowed() 11045 11046 if resultVar0 != nil { 11047 span.LogFields(spanlog.Error(resultVar0)) 11048 ext.Error.Set(span, true) 11049 } 11050 11051 return resultVar0 11052 } 11053 11054 func (a *OpenTracingAppLayer) JoinChannel(c *request.Context, channel *model.Channel, userID string) *model.AppError { 11055 origCtx := a.ctx 11056 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinChannel") 11057 11058 a.ctx = newCtx 11059 a.app.Srv().Store.SetContext(newCtx) 11060 defer func() { 11061 a.app.Srv().Store.SetContext(origCtx) 11062 a.ctx = origCtx 11063 }() 11064 11065 defer span.Finish() 11066 resultVar0 := a.app.JoinChannel(c, channel, userID) 11067 11068 if resultVar0 != nil { 11069 span.LogFields(spanlog.Error(resultVar0)) 11070 ext.Error.Set(span, true) 11071 } 11072 11073 return resultVar0 11074 } 11075 11076 func (a *OpenTracingAppLayer) JoinDefaultChannels(c *request.Context, teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { 11077 origCtx := a.ctx 11078 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinDefaultChannels") 11079 11080 a.ctx = newCtx 11081 a.app.Srv().Store.SetContext(newCtx) 11082 defer func() { 11083 a.app.Srv().Store.SetContext(origCtx) 11084 a.ctx = origCtx 11085 }() 11086 11087 defer span.Finish() 11088 resultVar0 := a.app.JoinDefaultChannels(c, teamID, user, shouldBeAdmin, userRequestorId) 11089 11090 if resultVar0 != nil { 11091 span.LogFields(spanlog.Error(resultVar0)) 11092 ext.Error.Set(span, true) 11093 } 11094 11095 return resultVar0 11096 } 11097 11098 func (a *OpenTracingAppLayer) JoinUserToTeam(c *request.Context, team *model.Team, user *model.User, userRequestorId string) (*model.TeamMember, *model.AppError) { 11099 origCtx := a.ctx 11100 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinUserToTeam") 11101 11102 a.ctx = newCtx 11103 a.app.Srv().Store.SetContext(newCtx) 11104 defer func() { 11105 a.app.Srv().Store.SetContext(origCtx) 11106 a.ctx = origCtx 11107 }() 11108 11109 defer span.Finish() 11110 resultVar0, resultVar1 := a.app.JoinUserToTeam(c, team, user, userRequestorId) 11111 11112 if resultVar1 != nil { 11113 span.LogFields(spanlog.Error(resultVar1)) 11114 ext.Error.Set(span, true) 11115 } 11116 11117 return resultVar0, resultVar1 11118 } 11119 11120 func (a *OpenTracingAppLayer) LeaveChannel(c *request.Context, channelID string, userID string) *model.AppError { 11121 origCtx := a.ctx 11122 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveChannel") 11123 11124 a.ctx = newCtx 11125 a.app.Srv().Store.SetContext(newCtx) 11126 defer func() { 11127 a.app.Srv().Store.SetContext(origCtx) 11128 a.ctx = origCtx 11129 }() 11130 11131 defer span.Finish() 11132 resultVar0 := a.app.LeaveChannel(c, channelID, userID) 11133 11134 if resultVar0 != nil { 11135 span.LogFields(spanlog.Error(resultVar0)) 11136 ext.Error.Set(span, true) 11137 } 11138 11139 return resultVar0 11140 } 11141 11142 func (a *OpenTracingAppLayer) LeaveTeam(c *request.Context, team *model.Team, user *model.User, requestorId string) *model.AppError { 11143 origCtx := a.ctx 11144 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveTeam") 11145 11146 a.ctx = newCtx 11147 a.app.Srv().Store.SetContext(newCtx) 11148 defer func() { 11149 a.app.Srv().Store.SetContext(origCtx) 11150 a.ctx = origCtx 11151 }() 11152 11153 defer span.Finish() 11154 resultVar0 := a.app.LeaveTeam(c, team, user, requestorId) 11155 11156 if resultVar0 != nil { 11157 span.LogFields(spanlog.Error(resultVar0)) 11158 ext.Error.Set(span, true) 11159 } 11160 11161 return resultVar0 11162 } 11163 11164 func (a *OpenTracingAppLayer) LimitedClientConfig() map[string]string { 11165 origCtx := a.ctx 11166 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfig") 11167 11168 a.ctx = newCtx 11169 a.app.Srv().Store.SetContext(newCtx) 11170 defer func() { 11171 a.app.Srv().Store.SetContext(origCtx) 11172 a.ctx = origCtx 11173 }() 11174 11175 defer span.Finish() 11176 resultVar0 := a.app.LimitedClientConfig() 11177 11178 return resultVar0 11179 } 11180 11181 func (a *OpenTracingAppLayer) LimitedClientConfigWithComputed() map[string]string { 11182 origCtx := a.ctx 11183 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfigWithComputed") 11184 11185 a.ctx = newCtx 11186 a.app.Srv().Store.SetContext(newCtx) 11187 defer func() { 11188 a.app.Srv().Store.SetContext(origCtx) 11189 a.ctx = origCtx 11190 }() 11191 11192 defer span.Finish() 11193 resultVar0 := a.app.LimitedClientConfigWithComputed() 11194 11195 return resultVar0 11196 } 11197 11198 func (a *OpenTracingAppLayer) ListAllCommands(teamID string, T i18n.TranslateFunc) ([]*model.Command, *model.AppError) { 11199 origCtx := a.ctx 11200 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAllCommands") 11201 11202 a.ctx = newCtx 11203 a.app.Srv().Store.SetContext(newCtx) 11204 defer func() { 11205 a.app.Srv().Store.SetContext(origCtx) 11206 a.ctx = origCtx 11207 }() 11208 11209 defer span.Finish() 11210 resultVar0, resultVar1 := a.app.ListAllCommands(teamID, T) 11211 11212 if resultVar1 != nil { 11213 span.LogFields(spanlog.Error(resultVar1)) 11214 ext.Error.Set(span, true) 11215 } 11216 11217 return resultVar0, resultVar1 11218 } 11219 11220 func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamID string, T i18n.TranslateFunc) ([]*model.Command, *model.AppError) { 11221 origCtx := a.ctx 11222 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAutocompleteCommands") 11223 11224 a.ctx = newCtx 11225 a.app.Srv().Store.SetContext(newCtx) 11226 defer func() { 11227 a.app.Srv().Store.SetContext(origCtx) 11228 a.ctx = origCtx 11229 }() 11230 11231 span.SetTag("teamID", teamID) 11232 11233 defer span.Finish() 11234 resultVar0, resultVar1 := a.app.ListAutocompleteCommands(teamID, T) 11235 11236 if resultVar1 != nil { 11237 span.LogFields(spanlog.Error(resultVar1)) 11238 ext.Error.Set(span, true) 11239 } 11240 11241 return resultVar0, resultVar1 11242 } 11243 11244 func (a *OpenTracingAppLayer) ListDirectory(path string) ([]string, *model.AppError) { 11245 origCtx := a.ctx 11246 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListDirectory") 11247 11248 a.ctx = newCtx 11249 a.app.Srv().Store.SetContext(newCtx) 11250 defer func() { 11251 a.app.Srv().Store.SetContext(origCtx) 11252 a.ctx = origCtx 11253 }() 11254 11255 defer span.Finish() 11256 resultVar0, resultVar1 := a.app.ListDirectory(path) 11257 11258 if resultVar1 != nil { 11259 span.LogFields(spanlog.Error(resultVar1)) 11260 ext.Error.Set(span, true) 11261 } 11262 11263 return resultVar0, resultVar1 11264 } 11265 11266 func (a *OpenTracingAppLayer) ListExports() ([]string, *model.AppError) { 11267 origCtx := a.ctx 11268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListExports") 11269 11270 a.ctx = newCtx 11271 a.app.Srv().Store.SetContext(newCtx) 11272 defer func() { 11273 a.app.Srv().Store.SetContext(origCtx) 11274 a.ctx = origCtx 11275 }() 11276 11277 defer span.Finish() 11278 resultVar0, resultVar1 := a.app.ListExports() 11279 11280 if resultVar1 != nil { 11281 span.LogFields(spanlog.Error(resultVar1)) 11282 ext.Error.Set(span, true) 11283 } 11284 11285 return resultVar0, resultVar1 11286 } 11287 11288 func (a *OpenTracingAppLayer) ListImports() ([]string, *model.AppError) { 11289 origCtx := a.ctx 11290 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListImports") 11291 11292 a.ctx = newCtx 11293 a.app.Srv().Store.SetContext(newCtx) 11294 defer func() { 11295 a.app.Srv().Store.SetContext(origCtx) 11296 a.ctx = origCtx 11297 }() 11298 11299 defer span.Finish() 11300 resultVar0, resultVar1 := a.app.ListImports() 11301 11302 if resultVar1 != nil { 11303 span.LogFields(spanlog.Error(resultVar1)) 11304 ext.Error.Set(span, true) 11305 } 11306 11307 return resultVar0, resultVar1 11308 } 11309 11310 func (a *OpenTracingAppLayer) ListPluginKeys(pluginID string, page int, perPage int) ([]string, *model.AppError) { 11311 origCtx := a.ctx 11312 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListPluginKeys") 11313 11314 a.ctx = newCtx 11315 a.app.Srv().Store.SetContext(newCtx) 11316 defer func() { 11317 a.app.Srv().Store.SetContext(origCtx) 11318 a.ctx = origCtx 11319 }() 11320 11321 defer span.Finish() 11322 resultVar0, resultVar1 := a.app.ListPluginKeys(pluginID, page, perPage) 11323 11324 if resultVar1 != nil { 11325 span.LogFields(spanlog.Error(resultVar1)) 11326 ext.Error.Set(span, true) 11327 } 11328 11329 return resultVar0, resultVar1 11330 } 11331 11332 func (a *OpenTracingAppLayer) ListTeamCommands(teamID string) ([]*model.Command, *model.AppError) { 11333 origCtx := a.ctx 11334 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListTeamCommands") 11335 11336 a.ctx = newCtx 11337 a.app.Srv().Store.SetContext(newCtx) 11338 defer func() { 11339 a.app.Srv().Store.SetContext(origCtx) 11340 a.ctx = origCtx 11341 }() 11342 11343 defer span.Finish() 11344 resultVar0, resultVar1 := a.app.ListTeamCommands(teamID) 11345 11346 if resultVar1 != nil { 11347 span.LogFields(spanlog.Error(resultVar1)) 11348 ext.Error.Set(span, true) 11349 } 11350 11351 return resultVar0, resultVar1 11352 } 11353 11354 func (a *OpenTracingAppLayer) LogAuditRec(rec *audit.Record, err error) { 11355 origCtx := a.ctx 11356 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRec") 11357 11358 a.ctx = newCtx 11359 a.app.Srv().Store.SetContext(newCtx) 11360 defer func() { 11361 a.app.Srv().Store.SetContext(origCtx) 11362 a.ctx = origCtx 11363 }() 11364 11365 defer span.Finish() 11366 a.app.LogAuditRec(rec, err) 11367 } 11368 11369 func (a *OpenTracingAppLayer) LogAuditRecWithLevel(rec *audit.Record, level mlog.LogLevel, err error) { 11370 origCtx := a.ctx 11371 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRecWithLevel") 11372 11373 a.ctx = newCtx 11374 a.app.Srv().Store.SetContext(newCtx) 11375 defer func() { 11376 a.app.Srv().Store.SetContext(origCtx) 11377 a.ctx = origCtx 11378 }() 11379 11380 defer span.Finish() 11381 a.app.LogAuditRecWithLevel(rec, level, err) 11382 } 11383 11384 func (a *OpenTracingAppLayer) LoginByOAuth(c *request.Context, service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { 11385 origCtx := a.ctx 11386 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth") 11387 11388 a.ctx = newCtx 11389 a.app.Srv().Store.SetContext(newCtx) 11390 defer func() { 11391 a.app.Srv().Store.SetContext(origCtx) 11392 a.ctx = origCtx 11393 }() 11394 11395 defer span.Finish() 11396 resultVar0, resultVar1 := a.app.LoginByOAuth(c, service, userData, teamID, tokenUser) 11397 11398 if resultVar1 != nil { 11399 span.LogFields(spanlog.Error(resultVar1)) 11400 ext.Error.Set(span, true) 11401 } 11402 11403 return resultVar0, resultVar1 11404 } 11405 11406 func (a *OpenTracingAppLayer) MakeAuditRecord(event string, initialStatus string) *audit.Record { 11407 origCtx := a.ctx 11408 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakeAuditRecord") 11409 11410 a.ctx = newCtx 11411 a.app.Srv().Store.SetContext(newCtx) 11412 defer func() { 11413 a.app.Srv().Store.SetContext(origCtx) 11414 a.ctx = origCtx 11415 }() 11416 11417 defer span.Finish() 11418 resultVar0 := a.app.MakeAuditRecord(event, initialStatus) 11419 11420 return resultVar0 11421 } 11422 11423 func (a *OpenTracingAppLayer) MakePermissionError(s *model.Session, permissions []*model.Permission) *model.AppError { 11424 origCtx := a.ctx 11425 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakePermissionError") 11426 11427 a.ctx = newCtx 11428 a.app.Srv().Store.SetContext(newCtx) 11429 defer func() { 11430 a.app.Srv().Store.SetContext(origCtx) 11431 a.ctx = origCtx 11432 }() 11433 11434 defer span.Finish() 11435 resultVar0 := a.app.MakePermissionError(s, permissions) 11436 11437 if resultVar0 != nil { 11438 span.LogFields(spanlog.Error(resultVar0)) 11439 ext.Error.Set(span, true) 11440 } 11441 11442 return resultVar0 11443 } 11444 11445 func (a *OpenTracingAppLayer) MarkChannelAsUnreadFromPost(postID string, userID string, collapsedThreadsSupported bool, followThread bool) (*model.ChannelUnreadAt, *model.AppError) { 11446 origCtx := a.ctx 11447 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelAsUnreadFromPost") 11448 11449 a.ctx = newCtx 11450 a.app.Srv().Store.SetContext(newCtx) 11451 defer func() { 11452 a.app.Srv().Store.SetContext(origCtx) 11453 a.ctx = origCtx 11454 }() 11455 11456 defer span.Finish() 11457 resultVar0, resultVar1 := a.app.MarkChannelAsUnreadFromPost(postID, userID, collapsedThreadsSupported, followThread) 11458 11459 if resultVar1 != nil { 11460 span.LogFields(spanlog.Error(resultVar1)) 11461 ext.Error.Set(span, true) 11462 } 11463 11464 return resultVar0, resultVar1 11465 } 11466 11467 func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIDs []string, userID string, currentSessionId string, collapsedThreadsSupported bool) (map[string]int64, *model.AppError) { 11468 origCtx := a.ctx 11469 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelsAsViewed") 11470 11471 a.ctx = newCtx 11472 a.app.Srv().Store.SetContext(newCtx) 11473 defer func() { 11474 a.app.Srv().Store.SetContext(origCtx) 11475 a.ctx = origCtx 11476 }() 11477 11478 defer span.Finish() 11479 resultVar0, resultVar1 := a.app.MarkChannelsAsViewed(channelIDs, userID, currentSessionId, collapsedThreadsSupported) 11480 11481 if resultVar1 != nil { 11482 span.LogFields(spanlog.Error(resultVar1)) 11483 ext.Error.Set(span, true) 11484 } 11485 11486 return resultVar0, resultVar1 11487 } 11488 11489 func (a *OpenTracingAppLayer) MaxPostSize() int { 11490 origCtx := a.ctx 11491 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MaxPostSize") 11492 11493 a.ctx = newCtx 11494 a.app.Srv().Store.SetContext(newCtx) 11495 defer func() { 11496 a.app.Srv().Store.SetContext(origCtx) 11497 a.ctx = origCtx 11498 }() 11499 11500 defer span.Finish() 11501 resultVar0 := a.app.MaxPostSize() 11502 11503 return resultVar0 11504 } 11505 11506 func (a *OpenTracingAppLayer) MentionsToPublicChannels(message string, teamID string) model.ChannelMentionMap { 11507 origCtx := a.ctx 11508 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToPublicChannels") 11509 11510 a.ctx = newCtx 11511 a.app.Srv().Store.SetContext(newCtx) 11512 defer func() { 11513 a.app.Srv().Store.SetContext(origCtx) 11514 a.ctx = origCtx 11515 }() 11516 11517 defer span.Finish() 11518 resultVar0 := a.app.MentionsToPublicChannels(message, teamID) 11519 11520 return resultVar0 11521 } 11522 11523 func (a *OpenTracingAppLayer) MentionsToTeamMembers(message string, teamID string) model.UserMentionMap { 11524 origCtx := a.ctx 11525 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToTeamMembers") 11526 11527 a.ctx = newCtx 11528 a.app.Srv().Store.SetContext(newCtx) 11529 defer func() { 11530 a.app.Srv().Store.SetContext(origCtx) 11531 a.ctx = origCtx 11532 }() 11533 11534 defer span.Finish() 11535 resultVar0 := a.app.MentionsToTeamMembers(message, teamID) 11536 11537 return resultVar0 11538 } 11539 11540 func (a *OpenTracingAppLayer) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { 11541 origCtx := a.ctx 11542 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateFilenamesToFileInfos") 11543 11544 a.ctx = newCtx 11545 a.app.Srv().Store.SetContext(newCtx) 11546 defer func() { 11547 a.app.Srv().Store.SetContext(origCtx) 11548 a.ctx = origCtx 11549 }() 11550 11551 defer span.Finish() 11552 resultVar0 := a.app.MigrateFilenamesToFileInfos(post) 11553 11554 return resultVar0 11555 } 11556 11557 func (a *OpenTracingAppLayer) MigrateIdLDAP(toAttribute string) *model.AppError { 11558 origCtx := a.ctx 11559 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateIdLDAP") 11560 11561 a.ctx = newCtx 11562 a.app.Srv().Store.SetContext(newCtx) 11563 defer func() { 11564 a.app.Srv().Store.SetContext(origCtx) 11565 a.ctx = origCtx 11566 }() 11567 11568 defer span.Finish() 11569 resultVar0 := a.app.MigrateIdLDAP(toAttribute) 11570 11571 if resultVar0 != nil { 11572 span.LogFields(spanlog.Error(resultVar0)) 11573 ext.Error.Set(span, true) 11574 } 11575 11576 return resultVar0 11577 } 11578 11579 func (a *OpenTracingAppLayer) MoveChannel(c *request.Context, team *model.Team, channel *model.Channel, user *model.User) *model.AppError { 11580 origCtx := a.ctx 11581 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveChannel") 11582 11583 a.ctx = newCtx 11584 a.app.Srv().Store.SetContext(newCtx) 11585 defer func() { 11586 a.app.Srv().Store.SetContext(origCtx) 11587 a.ctx = origCtx 11588 }() 11589 11590 defer span.Finish() 11591 resultVar0 := a.app.MoveChannel(c, team, channel, user) 11592 11593 if resultVar0 != nil { 11594 span.LogFields(spanlog.Error(resultVar0)) 11595 ext.Error.Set(span, true) 11596 } 11597 11598 return resultVar0 11599 } 11600 11601 func (a *OpenTracingAppLayer) MoveCommand(team *model.Team, command *model.Command) *model.AppError { 11602 origCtx := a.ctx 11603 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveCommand") 11604 11605 a.ctx = newCtx 11606 a.app.Srv().Store.SetContext(newCtx) 11607 defer func() { 11608 a.app.Srv().Store.SetContext(origCtx) 11609 a.ctx = origCtx 11610 }() 11611 11612 defer span.Finish() 11613 resultVar0 := a.app.MoveCommand(team, command) 11614 11615 if resultVar0 != nil { 11616 span.LogFields(spanlog.Error(resultVar0)) 11617 ext.Error.Set(span, true) 11618 } 11619 11620 return resultVar0 11621 } 11622 11623 func (a *OpenTracingAppLayer) MoveFile(oldPath string, newPath string) *model.AppError { 11624 origCtx := a.ctx 11625 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveFile") 11626 11627 a.ctx = newCtx 11628 a.app.Srv().Store.SetContext(newCtx) 11629 defer func() { 11630 a.app.Srv().Store.SetContext(origCtx) 11631 a.ctx = origCtx 11632 }() 11633 11634 defer span.Finish() 11635 resultVar0 := a.app.MoveFile(oldPath, newPath) 11636 11637 if resultVar0 != nil { 11638 span.LogFields(spanlog.Error(resultVar0)) 11639 ext.Error.Set(span, true) 11640 } 11641 11642 return resultVar0 11643 } 11644 11645 func (a *OpenTracingAppLayer) NewClusterDiscoveryService() *app.ClusterDiscoveryService { 11646 origCtx := a.ctx 11647 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewClusterDiscoveryService") 11648 11649 a.ctx = newCtx 11650 a.app.Srv().Store.SetContext(newCtx) 11651 defer func() { 11652 a.app.Srv().Store.SetContext(origCtx) 11653 a.ctx = origCtx 11654 }() 11655 11656 defer span.Finish() 11657 resultVar0 := a.app.NewClusterDiscoveryService() 11658 11659 return resultVar0 11660 } 11661 11662 func (a *OpenTracingAppLayer) NewPluginAPI(c *request.Context, manifest *model.Manifest) plugin.API { 11663 origCtx := a.ctx 11664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewPluginAPI") 11665 11666 a.ctx = newCtx 11667 a.app.Srv().Store.SetContext(newCtx) 11668 defer func() { 11669 a.app.Srv().Store.SetContext(origCtx) 11670 a.ctx = origCtx 11671 }() 11672 11673 defer span.Finish() 11674 resultVar0 := a.app.NewPluginAPI(c, manifest) 11675 11676 return resultVar0 11677 } 11678 11679 func (a *OpenTracingAppLayer) NewWebConn(cfg *app.WebConnConfig) *app.WebConn { 11680 origCtx := a.ctx 11681 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebConn") 11682 11683 a.ctx = newCtx 11684 a.app.Srv().Store.SetContext(newCtx) 11685 defer func() { 11686 a.app.Srv().Store.SetContext(origCtx) 11687 a.ctx = origCtx 11688 }() 11689 11690 defer span.Finish() 11691 resultVar0 := a.app.NewWebConn(cfg) 11692 11693 return resultVar0 11694 } 11695 11696 func (a *OpenTracingAppLayer) NewWebHub() *app.Hub { 11697 origCtx := a.ctx 11698 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebHub") 11699 11700 a.ctx = newCtx 11701 a.app.Srv().Store.SetContext(newCtx) 11702 defer func() { 11703 a.app.Srv().Store.SetContext(origCtx) 11704 a.ctx = origCtx 11705 }() 11706 11707 defer span.Finish() 11708 resultVar0 := a.app.NewWebHub() 11709 11710 return resultVar0 11711 } 11712 11713 func (a *OpenTracingAppLayer) NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError { 11714 origCtx := a.ctx 11715 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifyAndSetWarnMetricAck") 11716 11717 a.ctx = newCtx 11718 a.app.Srv().Store.SetContext(newCtx) 11719 defer func() { 11720 a.app.Srv().Store.SetContext(origCtx) 11721 a.ctx = origCtx 11722 }() 11723 11724 defer span.Finish() 11725 resultVar0 := a.app.NotifyAndSetWarnMetricAck(warnMetricId, sender, forceAck, isBot) 11726 11727 if resultVar0 != nil { 11728 span.LogFields(spanlog.Error(resultVar0)) 11729 ext.Error.Set(span, true) 11730 } 11731 11732 return resultVar0 11733 } 11734 11735 func (a *OpenTracingAppLayer) NotifySessionsExpired() *model.AppError { 11736 origCtx := a.ctx 11737 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifySessionsExpired") 11738 11739 a.ctx = newCtx 11740 a.app.Srv().Store.SetContext(newCtx) 11741 defer func() { 11742 a.app.Srv().Store.SetContext(origCtx) 11743 a.ctx = origCtx 11744 }() 11745 11746 defer span.Finish() 11747 resultVar0 := a.app.NotifySessionsExpired() 11748 11749 if resultVar0 != nil { 11750 span.LogFields(spanlog.Error(resultVar0)) 11751 ext.Error.Set(span, true) 11752 } 11753 11754 return resultVar0 11755 } 11756 11757 func (a *OpenTracingAppLayer) NotifySharedChannelUserUpdate(user *model.User) { 11758 origCtx := a.ctx 11759 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifySharedChannelUserUpdate") 11760 11761 a.ctx = newCtx 11762 a.app.Srv().Store.SetContext(newCtx) 11763 defer func() { 11764 a.app.Srv().Store.SetContext(origCtx) 11765 a.ctx = origCtx 11766 }() 11767 11768 defer span.Finish() 11769 a.app.NotifySharedChannelUserUpdate(user) 11770 } 11771 11772 func (a *OpenTracingAppLayer) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError { 11773 origCtx := a.ctx 11774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OpenInteractiveDialog") 11775 11776 a.ctx = newCtx 11777 a.app.Srv().Store.SetContext(newCtx) 11778 defer func() { 11779 a.app.Srv().Store.SetContext(origCtx) 11780 a.ctx = origCtx 11781 }() 11782 11783 defer span.Finish() 11784 resultVar0 := a.app.OpenInteractiveDialog(request) 11785 11786 if resultVar0 != nil { 11787 span.LogFields(spanlog.Error(resultVar0)) 11788 ext.Error.Set(span, true) 11789 } 11790 11791 return resultVar0 11792 } 11793 11794 func (a *OpenTracingAppLayer) OriginChecker() func(*http.Request) bool { 11795 origCtx := a.ctx 11796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OriginChecker") 11797 11798 a.ctx = newCtx 11799 a.app.Srv().Store.SetContext(newCtx) 11800 defer func() { 11801 a.app.Srv().Store.SetContext(origCtx) 11802 a.ctx = origCtx 11803 }() 11804 11805 defer span.Finish() 11806 resultVar0 := a.app.OriginChecker() 11807 11808 return resultVar0 11809 } 11810 11811 func (a *OpenTracingAppLayer) OverrideIconURLIfEmoji(post *model.Post) { 11812 origCtx := a.ctx 11813 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OverrideIconURLIfEmoji") 11814 11815 a.ctx = newCtx 11816 a.app.Srv().Store.SetContext(newCtx) 11817 defer func() { 11818 a.app.Srv().Store.SetContext(origCtx) 11819 a.ctx = origCtx 11820 }() 11821 11822 defer span.Finish() 11823 a.app.OverrideIconURLIfEmoji(post) 11824 } 11825 11826 func (a *OpenTracingAppLayer) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) { 11827 origCtx := a.ctx 11828 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchBot") 11829 11830 a.ctx = newCtx 11831 a.app.Srv().Store.SetContext(newCtx) 11832 defer func() { 11833 a.app.Srv().Store.SetContext(origCtx) 11834 a.ctx = origCtx 11835 }() 11836 11837 defer span.Finish() 11838 resultVar0, resultVar1 := a.app.PatchBot(botUserId, botPatch) 11839 11840 if resultVar1 != nil { 11841 span.LogFields(spanlog.Error(resultVar1)) 11842 ext.Error.Set(span, true) 11843 } 11844 11845 return resultVar0, resultVar1 11846 } 11847 11848 func (a *OpenTracingAppLayer) PatchChannel(c *request.Context, channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError) { 11849 origCtx := a.ctx 11850 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannel") 11851 11852 a.ctx = newCtx 11853 a.app.Srv().Store.SetContext(newCtx) 11854 defer func() { 11855 a.app.Srv().Store.SetContext(origCtx) 11856 a.ctx = origCtx 11857 }() 11858 11859 defer span.Finish() 11860 resultVar0, resultVar1 := a.app.PatchChannel(c, channel, patch, userID) 11861 11862 if resultVar1 != nil { 11863 span.LogFields(spanlog.Error(resultVar1)) 11864 ext.Error.Set(span, true) 11865 } 11866 11867 return resultVar0, resultVar1 11868 } 11869 11870 func (a *OpenTracingAppLayer) PatchChannelModerationsForChannel(channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) { 11871 origCtx := a.ctx 11872 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannelModerationsForChannel") 11873 11874 a.ctx = newCtx 11875 a.app.Srv().Store.SetContext(newCtx) 11876 defer func() { 11877 a.app.Srv().Store.SetContext(origCtx) 11878 a.ctx = origCtx 11879 }() 11880 11881 defer span.Finish() 11882 resultVar0, resultVar1 := a.app.PatchChannelModerationsForChannel(channel, channelModerationsPatch) 11883 11884 if resultVar1 != nil { 11885 span.LogFields(spanlog.Error(resultVar1)) 11886 ext.Error.Set(span, true) 11887 } 11888 11889 return resultVar0, resultVar1 11890 } 11891 11892 func (a *OpenTracingAppLayer) PatchPost(c *request.Context, postID string, patch *model.PostPatch) (*model.Post, *model.AppError) { 11893 origCtx := a.ctx 11894 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchPost") 11895 11896 a.ctx = newCtx 11897 a.app.Srv().Store.SetContext(newCtx) 11898 defer func() { 11899 a.app.Srv().Store.SetContext(origCtx) 11900 a.ctx = origCtx 11901 }() 11902 11903 defer span.Finish() 11904 resultVar0, resultVar1 := a.app.PatchPost(c, postID, patch) 11905 11906 if resultVar1 != nil { 11907 span.LogFields(spanlog.Error(resultVar1)) 11908 ext.Error.Set(span, true) 11909 } 11910 11911 return resultVar0, resultVar1 11912 } 11913 11914 func (a *OpenTracingAppLayer) PatchRetentionPolicy(patch *model.RetentionPolicyWithTeamAndChannelIDs) (*model.RetentionPolicyWithTeamAndChannelCounts, *model.AppError) { 11915 origCtx := a.ctx 11916 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchRetentionPolicy") 11917 11918 a.ctx = newCtx 11919 a.app.Srv().Store.SetContext(newCtx) 11920 defer func() { 11921 a.app.Srv().Store.SetContext(origCtx) 11922 a.ctx = origCtx 11923 }() 11924 11925 defer span.Finish() 11926 resultVar0, resultVar1 := a.app.PatchRetentionPolicy(patch) 11927 11928 if resultVar1 != nil { 11929 span.LogFields(spanlog.Error(resultVar1)) 11930 ext.Error.Set(span, true) 11931 } 11932 11933 return resultVar0, resultVar1 11934 } 11935 11936 func (a *OpenTracingAppLayer) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) { 11937 origCtx := a.ctx 11938 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchRole") 11939 11940 a.ctx = newCtx 11941 a.app.Srv().Store.SetContext(newCtx) 11942 defer func() { 11943 a.app.Srv().Store.SetContext(origCtx) 11944 a.ctx = origCtx 11945 }() 11946 11947 defer span.Finish() 11948 resultVar0, resultVar1 := a.app.PatchRole(role, patch) 11949 11950 if resultVar1 != nil { 11951 span.LogFields(spanlog.Error(resultVar1)) 11952 ext.Error.Set(span, true) 11953 } 11954 11955 return resultVar0, resultVar1 11956 } 11957 11958 func (a *OpenTracingAppLayer) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) { 11959 origCtx := a.ctx 11960 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchScheme") 11961 11962 a.ctx = newCtx 11963 a.app.Srv().Store.SetContext(newCtx) 11964 defer func() { 11965 a.app.Srv().Store.SetContext(origCtx) 11966 a.ctx = origCtx 11967 }() 11968 11969 defer span.Finish() 11970 resultVar0, resultVar1 := a.app.PatchScheme(scheme, patch) 11971 11972 if resultVar1 != nil { 11973 span.LogFields(spanlog.Error(resultVar1)) 11974 ext.Error.Set(span, true) 11975 } 11976 11977 return resultVar0, resultVar1 11978 } 11979 11980 func (a *OpenTracingAppLayer) PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError) { 11981 origCtx := a.ctx 11982 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchTeam") 11983 11984 a.ctx = newCtx 11985 a.app.Srv().Store.SetContext(newCtx) 11986 defer func() { 11987 a.app.Srv().Store.SetContext(origCtx) 11988 a.ctx = origCtx 11989 }() 11990 11991 defer span.Finish() 11992 resultVar0, resultVar1 := a.app.PatchTeam(teamID, patch) 11993 11994 if resultVar1 != nil { 11995 span.LogFields(spanlog.Error(resultVar1)) 11996 ext.Error.Set(span, true) 11997 } 11998 11999 return resultVar0, resultVar1 12000 } 12001 12002 func (a *OpenTracingAppLayer) PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { 12003 origCtx := a.ctx 12004 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchUser") 12005 12006 a.ctx = newCtx 12007 a.app.Srv().Store.SetContext(newCtx) 12008 defer func() { 12009 a.app.Srv().Store.SetContext(origCtx) 12010 a.ctx = origCtx 12011 }() 12012 12013 defer span.Finish() 12014 resultVar0, resultVar1 := a.app.PatchUser(userID, patch, asAdmin) 12015 12016 if resultVar1 != nil { 12017 span.LogFields(spanlog.Error(resultVar1)) 12018 ext.Error.Set(span, true) 12019 } 12020 12021 return resultVar0, resultVar1 12022 } 12023 12024 func (a *OpenTracingAppLayer) PermanentDeleteAllUsers(c *request.Context) *model.AppError { 12025 origCtx := a.ctx 12026 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteAllUsers") 12027 12028 a.ctx = newCtx 12029 a.app.Srv().Store.SetContext(newCtx) 12030 defer func() { 12031 a.app.Srv().Store.SetContext(origCtx) 12032 a.ctx = origCtx 12033 }() 12034 12035 defer span.Finish() 12036 resultVar0 := a.app.PermanentDeleteAllUsers(c) 12037 12038 if resultVar0 != nil { 12039 span.LogFields(spanlog.Error(resultVar0)) 12040 ext.Error.Set(span, true) 12041 } 12042 12043 return resultVar0 12044 } 12045 12046 func (a *OpenTracingAppLayer) PermanentDeleteBot(botUserId string) *model.AppError { 12047 origCtx := a.ctx 12048 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteBot") 12049 12050 a.ctx = newCtx 12051 a.app.Srv().Store.SetContext(newCtx) 12052 defer func() { 12053 a.app.Srv().Store.SetContext(origCtx) 12054 a.ctx = origCtx 12055 }() 12056 12057 defer span.Finish() 12058 resultVar0 := a.app.PermanentDeleteBot(botUserId) 12059 12060 if resultVar0 != nil { 12061 span.LogFields(spanlog.Error(resultVar0)) 12062 ext.Error.Set(span, true) 12063 } 12064 12065 return resultVar0 12066 } 12067 12068 func (a *OpenTracingAppLayer) PermanentDeleteChannel(channel *model.Channel) *model.AppError { 12069 origCtx := a.ctx 12070 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteChannel") 12071 12072 a.ctx = newCtx 12073 a.app.Srv().Store.SetContext(newCtx) 12074 defer func() { 12075 a.app.Srv().Store.SetContext(origCtx) 12076 a.ctx = origCtx 12077 }() 12078 12079 defer span.Finish() 12080 resultVar0 := a.app.PermanentDeleteChannel(channel) 12081 12082 if resultVar0 != nil { 12083 span.LogFields(spanlog.Error(resultVar0)) 12084 ext.Error.Set(span, true) 12085 } 12086 12087 return resultVar0 12088 } 12089 12090 func (a *OpenTracingAppLayer) PermanentDeleteTeam(team *model.Team) *model.AppError { 12091 origCtx := a.ctx 12092 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeam") 12093 12094 a.ctx = newCtx 12095 a.app.Srv().Store.SetContext(newCtx) 12096 defer func() { 12097 a.app.Srv().Store.SetContext(origCtx) 12098 a.ctx = origCtx 12099 }() 12100 12101 defer span.Finish() 12102 resultVar0 := a.app.PermanentDeleteTeam(team) 12103 12104 if resultVar0 != nil { 12105 span.LogFields(spanlog.Error(resultVar0)) 12106 ext.Error.Set(span, true) 12107 } 12108 12109 return resultVar0 12110 } 12111 12112 func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamID string) *model.AppError { 12113 origCtx := a.ctx 12114 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeamId") 12115 12116 a.ctx = newCtx 12117 a.app.Srv().Store.SetContext(newCtx) 12118 defer func() { 12119 a.app.Srv().Store.SetContext(origCtx) 12120 a.ctx = origCtx 12121 }() 12122 12123 defer span.Finish() 12124 resultVar0 := a.app.PermanentDeleteTeamId(teamID) 12125 12126 if resultVar0 != nil { 12127 span.LogFields(spanlog.Error(resultVar0)) 12128 ext.Error.Set(span, true) 12129 } 12130 12131 return resultVar0 12132 } 12133 12134 func (a *OpenTracingAppLayer) PermanentDeleteUser(c *request.Context, user *model.User) *model.AppError { 12135 origCtx := a.ctx 12136 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteUser") 12137 12138 a.ctx = newCtx 12139 a.app.Srv().Store.SetContext(newCtx) 12140 defer func() { 12141 a.app.Srv().Store.SetContext(origCtx) 12142 a.ctx = origCtx 12143 }() 12144 12145 defer span.Finish() 12146 resultVar0 := a.app.PermanentDeleteUser(c, user) 12147 12148 if resultVar0 != nil { 12149 span.LogFields(spanlog.Error(resultVar0)) 12150 ext.Error.Set(span, true) 12151 } 12152 12153 return resultVar0 12154 } 12155 12156 func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamID string) []*model.Command { 12157 origCtx := a.ctx 12158 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginCommandsForTeam") 12159 12160 a.ctx = newCtx 12161 a.app.Srv().Store.SetContext(newCtx) 12162 defer func() { 12163 a.app.Srv().Store.SetContext(origCtx) 12164 a.ctx = origCtx 12165 }() 12166 12167 defer span.Finish() 12168 resultVar0 := a.app.PluginCommandsForTeam(teamID) 12169 12170 return resultVar0 12171 } 12172 12173 func (a *OpenTracingAppLayer) PopulateWebConnConfig(s *model.Session, cfg *app.WebConnConfig, seqVal string) (*app.WebConnConfig, error) { 12174 origCtx := a.ctx 12175 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PopulateWebConnConfig") 12176 12177 a.ctx = newCtx 12178 a.app.Srv().Store.SetContext(newCtx) 12179 defer func() { 12180 a.app.Srv().Store.SetContext(origCtx) 12181 a.ctx = origCtx 12182 }() 12183 12184 defer span.Finish() 12185 resultVar0, resultVar1 := a.app.PopulateWebConnConfig(s, cfg, seqVal) 12186 12187 if resultVar1 != nil { 12188 span.LogFields(spanlog.Error(resultVar1)) 12189 ext.Error.Set(span, true) 12190 } 12191 12192 return resultVar0, resultVar1 12193 } 12194 12195 func (a *OpenTracingAppLayer) PostActionCookieSecret() []byte { 12196 origCtx := a.ctx 12197 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostActionCookieSecret") 12198 12199 a.ctx = newCtx 12200 a.app.Srv().Store.SetContext(newCtx) 12201 defer func() { 12202 a.app.Srv().Store.SetContext(origCtx) 12203 a.ctx = origCtx 12204 }() 12205 12206 defer span.Finish() 12207 resultVar0 := a.app.PostActionCookieSecret() 12208 12209 return resultVar0 12210 } 12211 12212 func (a *OpenTracingAppLayer) PostAddToChannelMessage(c *request.Context, user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError { 12213 origCtx := a.ctx 12214 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostAddToChannelMessage") 12215 12216 a.ctx = newCtx 12217 a.app.Srv().Store.SetContext(newCtx) 12218 defer func() { 12219 a.app.Srv().Store.SetContext(origCtx) 12220 a.ctx = origCtx 12221 }() 12222 12223 defer span.Finish() 12224 resultVar0 := a.app.PostAddToChannelMessage(c, user, addedUser, channel, postRootId) 12225 12226 if resultVar0 != nil { 12227 span.LogFields(spanlog.Error(resultVar0)) 12228 ext.Error.Set(span, true) 12229 } 12230 12231 return resultVar0 12232 } 12233 12234 func (a *OpenTracingAppLayer) PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch { 12235 origCtx := a.ctx 12236 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostPatchWithProxyRemovedFromImageURLs") 12237 12238 a.ctx = newCtx 12239 a.app.Srv().Store.SetContext(newCtx) 12240 defer func() { 12241 a.app.Srv().Store.SetContext(origCtx) 12242 a.ctx = origCtx 12243 }() 12244 12245 defer span.Finish() 12246 resultVar0 := a.app.PostPatchWithProxyRemovedFromImageURLs(patch) 12247 12248 return resultVar0 12249 } 12250 12251 func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(c *request.Context, userID string, channel *model.Channel, oldChannelDisplayName string, newChannelDisplayName string) *model.AppError { 12252 origCtx := a.ctx 12253 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelDisplayNameMessage") 12254 12255 a.ctx = newCtx 12256 a.app.Srv().Store.SetContext(newCtx) 12257 defer func() { 12258 a.app.Srv().Store.SetContext(origCtx) 12259 a.ctx = origCtx 12260 }() 12261 12262 defer span.Finish() 12263 resultVar0 := a.app.PostUpdateChannelDisplayNameMessage(c, userID, channel, oldChannelDisplayName, newChannelDisplayName) 12264 12265 if resultVar0 != nil { 12266 span.LogFields(spanlog.Error(resultVar0)) 12267 ext.Error.Set(span, true) 12268 } 12269 12270 return resultVar0 12271 } 12272 12273 func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(c *request.Context, userID string, channel *model.Channel, oldChannelHeader string, newChannelHeader string) *model.AppError { 12274 origCtx := a.ctx 12275 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelHeaderMessage") 12276 12277 a.ctx = newCtx 12278 a.app.Srv().Store.SetContext(newCtx) 12279 defer func() { 12280 a.app.Srv().Store.SetContext(origCtx) 12281 a.ctx = origCtx 12282 }() 12283 12284 defer span.Finish() 12285 resultVar0 := a.app.PostUpdateChannelHeaderMessage(c, userID, channel, oldChannelHeader, newChannelHeader) 12286 12287 if resultVar0 != nil { 12288 span.LogFields(spanlog.Error(resultVar0)) 12289 ext.Error.Set(span, true) 12290 } 12291 12292 return resultVar0 12293 } 12294 12295 func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(c *request.Context, userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { 12296 origCtx := a.ctx 12297 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelPurposeMessage") 12298 12299 a.ctx = newCtx 12300 a.app.Srv().Store.SetContext(newCtx) 12301 defer func() { 12302 a.app.Srv().Store.SetContext(origCtx) 12303 a.ctx = origCtx 12304 }() 12305 12306 defer span.Finish() 12307 resultVar0 := a.app.PostUpdateChannelPurposeMessage(c, userID, channel, oldChannelPurpose, newChannelPurpose) 12308 12309 if resultVar0 != nil { 12310 span.LogFields(spanlog.Error(resultVar0)) 12311 ext.Error.Set(span, true) 12312 } 12313 12314 return resultVar0 12315 } 12316 12317 func (a *OpenTracingAppLayer) PostWithProxyAddedToImageURLs(post *model.Post) *model.Post { 12318 origCtx := a.ctx 12319 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyAddedToImageURLs") 12320 12321 a.ctx = newCtx 12322 a.app.Srv().Store.SetContext(newCtx) 12323 defer func() { 12324 a.app.Srv().Store.SetContext(origCtx) 12325 a.ctx = origCtx 12326 }() 12327 12328 defer span.Finish() 12329 resultVar0 := a.app.PostWithProxyAddedToImageURLs(post) 12330 12331 return resultVar0 12332 } 12333 12334 func (a *OpenTracingAppLayer) PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post { 12335 origCtx := a.ctx 12336 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyRemovedFromImageURLs") 12337 12338 a.ctx = newCtx 12339 a.app.Srv().Store.SetContext(newCtx) 12340 defer func() { 12341 a.app.Srv().Store.SetContext(origCtx) 12342 a.ctx = origCtx 12343 }() 12344 12345 defer span.Finish() 12346 resultVar0 := a.app.PostWithProxyRemovedFromImageURLs(post) 12347 12348 return resultVar0 12349 } 12350 12351 func (a *OpenTracingAppLayer) PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post { 12352 origCtx := a.ctx 12353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostForClient") 12354 12355 a.ctx = newCtx 12356 a.app.Srv().Store.SetContext(newCtx) 12357 defer func() { 12358 a.app.Srv().Store.SetContext(origCtx) 12359 a.ctx = origCtx 12360 }() 12361 12362 defer span.Finish() 12363 resultVar0 := a.app.PreparePostForClient(originalPost, isNewPost, isEditPost) 12364 12365 return resultVar0 12366 } 12367 12368 func (a *OpenTracingAppLayer) PreparePostListForClient(originalList *model.PostList) *model.PostList { 12369 origCtx := a.ctx 12370 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostListForClient") 12371 12372 a.ctx = newCtx 12373 a.app.Srv().Store.SetContext(newCtx) 12374 defer func() { 12375 a.app.Srv().Store.SetContext(origCtx) 12376 a.ctx = origCtx 12377 }() 12378 12379 defer span.Finish() 12380 resultVar0 := a.app.PreparePostListForClient(originalList) 12381 12382 return resultVar0 12383 } 12384 12385 func (a *OpenTracingAppLayer) ProcessSlackAttachments(attachments []*model.SlackAttachment) []*model.SlackAttachment { 12386 origCtx := a.ctx 12387 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackAttachments") 12388 12389 a.ctx = newCtx 12390 a.app.Srv().Store.SetContext(newCtx) 12391 defer func() { 12392 a.app.Srv().Store.SetContext(origCtx) 12393 a.ctx = origCtx 12394 }() 12395 12396 defer span.Finish() 12397 resultVar0 := a.app.ProcessSlackAttachments(attachments) 12398 12399 return resultVar0 12400 } 12401 12402 func (a *OpenTracingAppLayer) ProcessSlackText(text string) string { 12403 origCtx := a.ctx 12404 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackText") 12405 12406 a.ctx = newCtx 12407 a.app.Srv().Store.SetContext(newCtx) 12408 defer func() { 12409 a.app.Srv().Store.SetContext(origCtx) 12410 a.ctx = origCtx 12411 }() 12412 12413 defer span.Finish() 12414 resultVar0 := a.app.ProcessSlackText(text) 12415 12416 return resultVar0 12417 } 12418 12419 func (a *OpenTracingAppLayer) PromoteGuestToUser(c *request.Context, user *model.User, requestorId string) *model.AppError { 12420 origCtx := a.ctx 12421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PromoteGuestToUser") 12422 12423 a.ctx = newCtx 12424 a.app.Srv().Store.SetContext(newCtx) 12425 defer func() { 12426 a.app.Srv().Store.SetContext(origCtx) 12427 a.ctx = origCtx 12428 }() 12429 12430 defer span.Finish() 12431 resultVar0 := a.app.PromoteGuestToUser(c, user, requestorId) 12432 12433 if resultVar0 != nil { 12434 span.LogFields(spanlog.Error(resultVar0)) 12435 ext.Error.Set(span, true) 12436 } 12437 12438 return resultVar0 12439 } 12440 12441 func (a *OpenTracingAppLayer) Publish(message *model.WebSocketEvent) { 12442 origCtx := a.ctx 12443 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Publish") 12444 12445 a.ctx = newCtx 12446 a.app.Srv().Store.SetContext(newCtx) 12447 defer func() { 12448 a.app.Srv().Store.SetContext(origCtx) 12449 a.ctx = origCtx 12450 }() 12451 12452 defer span.Finish() 12453 a.app.Publish(message) 12454 } 12455 12456 func (a *OpenTracingAppLayer) PublishUserTyping(userID string, channelID string, parentId string) *model.AppError { 12457 origCtx := a.ctx 12458 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishUserTyping") 12459 12460 a.ctx = newCtx 12461 a.app.Srv().Store.SetContext(newCtx) 12462 defer func() { 12463 a.app.Srv().Store.SetContext(origCtx) 12464 a.ctx = origCtx 12465 }() 12466 12467 defer span.Finish() 12468 resultVar0 := a.app.PublishUserTyping(userID, channelID, parentId) 12469 12470 if resultVar0 != nil { 12471 span.LogFields(spanlog.Error(resultVar0)) 12472 ext.Error.Set(span, true) 12473 } 12474 12475 return resultVar0 12476 } 12477 12478 func (a *OpenTracingAppLayer) PurgeBleveIndexes() *model.AppError { 12479 origCtx := a.ctx 12480 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeBleveIndexes") 12481 12482 a.ctx = newCtx 12483 a.app.Srv().Store.SetContext(newCtx) 12484 defer func() { 12485 a.app.Srv().Store.SetContext(origCtx) 12486 a.ctx = origCtx 12487 }() 12488 12489 defer span.Finish() 12490 resultVar0 := a.app.PurgeBleveIndexes() 12491 12492 if resultVar0 != nil { 12493 span.LogFields(spanlog.Error(resultVar0)) 12494 ext.Error.Set(span, true) 12495 } 12496 12497 return resultVar0 12498 } 12499 12500 func (a *OpenTracingAppLayer) PurgeElasticsearchIndexes() *model.AppError { 12501 origCtx := a.ctx 12502 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeElasticsearchIndexes") 12503 12504 a.ctx = newCtx 12505 a.app.Srv().Store.SetContext(newCtx) 12506 defer func() { 12507 a.app.Srv().Store.SetContext(origCtx) 12508 a.ctx = origCtx 12509 }() 12510 12511 defer span.Finish() 12512 resultVar0 := a.app.PurgeElasticsearchIndexes() 12513 12514 if resultVar0 != nil { 12515 span.LogFields(spanlog.Error(resultVar0)) 12516 ext.Error.Set(span, true) 12517 } 12518 12519 return resultVar0 12520 } 12521 12522 func (a *OpenTracingAppLayer) ReadFile(path string) ([]byte, *model.AppError) { 12523 origCtx := a.ctx 12524 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReadFile") 12525 12526 a.ctx = newCtx 12527 a.app.Srv().Store.SetContext(newCtx) 12528 defer func() { 12529 a.app.Srv().Store.SetContext(origCtx) 12530 a.ctx = origCtx 12531 }() 12532 12533 defer span.Finish() 12534 resultVar0, resultVar1 := a.app.ReadFile(path) 12535 12536 if resultVar1 != nil { 12537 span.LogFields(spanlog.Error(resultVar1)) 12538 ext.Error.Set(span, true) 12539 } 12540 12541 return resultVar0, resultVar1 12542 } 12543 12544 func (a *OpenTracingAppLayer) RecycleDatabaseConnection() { 12545 origCtx := a.ctx 12546 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RecycleDatabaseConnection") 12547 12548 a.ctx = newCtx 12549 a.app.Srv().Store.SetContext(newCtx) 12550 defer func() { 12551 a.app.Srv().Store.SetContext(origCtx) 12552 a.ctx = origCtx 12553 }() 12554 12555 defer span.Finish() 12556 a.app.RecycleDatabaseConnection() 12557 } 12558 12559 func (a *OpenTracingAppLayer) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) { 12560 origCtx := a.ctx 12561 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenCommandToken") 12562 12563 a.ctx = newCtx 12564 a.app.Srv().Store.SetContext(newCtx) 12565 defer func() { 12566 a.app.Srv().Store.SetContext(origCtx) 12567 a.ctx = origCtx 12568 }() 12569 12570 defer span.Finish() 12571 resultVar0, resultVar1 := a.app.RegenCommandToken(cmd) 12572 12573 if resultVar1 != nil { 12574 span.LogFields(spanlog.Error(resultVar1)) 12575 ext.Error.Set(span, true) 12576 } 12577 12578 return resultVar0, resultVar1 12579 } 12580 12581 func (a *OpenTracingAppLayer) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 12582 origCtx := a.ctx 12583 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenOutgoingWebhookToken") 12584 12585 a.ctx = newCtx 12586 a.app.Srv().Store.SetContext(newCtx) 12587 defer func() { 12588 a.app.Srv().Store.SetContext(origCtx) 12589 a.ctx = origCtx 12590 }() 12591 12592 defer span.Finish() 12593 resultVar0, resultVar1 := a.app.RegenOutgoingWebhookToken(hook) 12594 12595 if resultVar1 != nil { 12596 span.LogFields(spanlog.Error(resultVar1)) 12597 ext.Error.Set(span, true) 12598 } 12599 12600 return resultVar0, resultVar1 12601 } 12602 12603 func (a *OpenTracingAppLayer) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 12604 origCtx := a.ctx 12605 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateOAuthAppSecret") 12606 12607 a.ctx = newCtx 12608 a.app.Srv().Store.SetContext(newCtx) 12609 defer func() { 12610 a.app.Srv().Store.SetContext(origCtx) 12611 a.ctx = origCtx 12612 }() 12613 12614 defer span.Finish() 12615 resultVar0, resultVar1 := a.app.RegenerateOAuthAppSecret(app) 12616 12617 if resultVar1 != nil { 12618 span.LogFields(spanlog.Error(resultVar1)) 12619 ext.Error.Set(span, true) 12620 } 12621 12622 return resultVar0, resultVar1 12623 } 12624 12625 func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError) { 12626 origCtx := a.ctx 12627 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateTeamInviteId") 12628 12629 a.ctx = newCtx 12630 a.app.Srv().Store.SetContext(newCtx) 12631 defer func() { 12632 a.app.Srv().Store.SetContext(origCtx) 12633 a.ctx = origCtx 12634 }() 12635 12636 defer span.Finish() 12637 resultVar0, resultVar1 := a.app.RegenerateTeamInviteId(teamID) 12638 12639 if resultVar1 != nil { 12640 span.LogFields(spanlog.Error(resultVar1)) 12641 ext.Error.Set(span, true) 12642 } 12643 12644 return resultVar0, resultVar1 12645 } 12646 12647 func (a *OpenTracingAppLayer) RegisterPluginCommand(pluginID string, command *model.Command) error { 12648 origCtx := a.ctx 12649 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegisterPluginCommand") 12650 12651 a.ctx = newCtx 12652 a.app.Srv().Store.SetContext(newCtx) 12653 defer func() { 12654 a.app.Srv().Store.SetContext(origCtx) 12655 a.ctx = origCtx 12656 }() 12657 12658 defer span.Finish() 12659 resultVar0 := a.app.RegisterPluginCommand(pluginID, command) 12660 12661 if resultVar0 != nil { 12662 span.LogFields(spanlog.Error(resultVar0)) 12663 ext.Error.Set(span, true) 12664 } 12665 12666 return resultVar0 12667 } 12668 12669 func (a *OpenTracingAppLayer) ReloadConfig() error { 12670 origCtx := a.ctx 12671 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReloadConfig") 12672 12673 a.ctx = newCtx 12674 a.app.Srv().Store.SetContext(newCtx) 12675 defer func() { 12676 a.app.Srv().Store.SetContext(origCtx) 12677 a.ctx = origCtx 12678 }() 12679 12680 defer span.Finish() 12681 resultVar0 := a.app.ReloadConfig() 12682 12683 if resultVar0 != nil { 12684 span.LogFields(spanlog.Error(resultVar0)) 12685 ext.Error.Set(span, true) 12686 } 12687 12688 return resultVar0 12689 } 12690 12691 func (a *OpenTracingAppLayer) RemoveAllDeactivatedMembersFromChannel(channel *model.Channel) *model.AppError { 12692 origCtx := a.ctx 12693 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveAllDeactivatedMembersFromChannel") 12694 12695 a.ctx = newCtx 12696 a.app.Srv().Store.SetContext(newCtx) 12697 defer func() { 12698 a.app.Srv().Store.SetContext(origCtx) 12699 a.ctx = origCtx 12700 }() 12701 12702 defer span.Finish() 12703 resultVar0 := a.app.RemoveAllDeactivatedMembersFromChannel(channel) 12704 12705 if resultVar0 != nil { 12706 span.LogFields(spanlog.Error(resultVar0)) 12707 ext.Error.Set(span, true) 12708 } 12709 12710 return resultVar0 12711 } 12712 12713 func (a *OpenTracingAppLayer) RemoveChannelsFromRetentionPolicy(policyID string, channelIDs []string) *model.AppError { 12714 origCtx := a.ctx 12715 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveChannelsFromRetentionPolicy") 12716 12717 a.ctx = newCtx 12718 a.app.Srv().Store.SetContext(newCtx) 12719 defer func() { 12720 a.app.Srv().Store.SetContext(origCtx) 12721 a.ctx = origCtx 12722 }() 12723 12724 defer span.Finish() 12725 resultVar0 := a.app.RemoveChannelsFromRetentionPolicy(policyID, channelIDs) 12726 12727 if resultVar0 != nil { 12728 span.LogFields(spanlog.Error(resultVar0)) 12729 ext.Error.Set(span, true) 12730 } 12731 12732 return resultVar0 12733 } 12734 12735 func (a *OpenTracingAppLayer) RemoveConfigListener(id string) { 12736 origCtx := a.ctx 12737 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveConfigListener") 12738 12739 a.ctx = newCtx 12740 a.app.Srv().Store.SetContext(newCtx) 12741 defer func() { 12742 a.app.Srv().Store.SetContext(origCtx) 12743 a.ctx = origCtx 12744 }() 12745 12746 defer span.Finish() 12747 a.app.RemoveConfigListener(id) 12748 } 12749 12750 func (a *OpenTracingAppLayer) RemoveCustomStatus(userID string) *model.AppError { 12751 origCtx := a.ctx 12752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveCustomStatus") 12753 12754 a.ctx = newCtx 12755 a.app.Srv().Store.SetContext(newCtx) 12756 defer func() { 12757 a.app.Srv().Store.SetContext(origCtx) 12758 a.ctx = origCtx 12759 }() 12760 12761 defer span.Finish() 12762 resultVar0 := a.app.RemoveCustomStatus(userID) 12763 12764 if resultVar0 != nil { 12765 span.LogFields(spanlog.Error(resultVar0)) 12766 ext.Error.Set(span, true) 12767 } 12768 12769 return resultVar0 12770 } 12771 12772 func (a *OpenTracingAppLayer) RemoveDirectory(path string) *model.AppError { 12773 origCtx := a.ctx 12774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveDirectory") 12775 12776 a.ctx = newCtx 12777 a.app.Srv().Store.SetContext(newCtx) 12778 defer func() { 12779 a.app.Srv().Store.SetContext(origCtx) 12780 a.ctx = origCtx 12781 }() 12782 12783 defer span.Finish() 12784 resultVar0 := a.app.RemoveDirectory(path) 12785 12786 if resultVar0 != nil { 12787 span.LogFields(spanlog.Error(resultVar0)) 12788 ext.Error.Set(span, true) 12789 } 12790 12791 return resultVar0 12792 } 12793 12794 func (a *OpenTracingAppLayer) RemoveFile(path string) *model.AppError { 12795 origCtx := a.ctx 12796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveFile") 12797 12798 a.ctx = newCtx 12799 a.app.Srv().Store.SetContext(newCtx) 12800 defer func() { 12801 a.app.Srv().Store.SetContext(origCtx) 12802 a.ctx = origCtx 12803 }() 12804 12805 defer span.Finish() 12806 resultVar0 := a.app.RemoveFile(path) 12807 12808 if resultVar0 != nil { 12809 span.LogFields(spanlog.Error(resultVar0)) 12810 ext.Error.Set(span, true) 12811 } 12812 12813 return resultVar0 12814 } 12815 12816 func (a *OpenTracingAppLayer) RemoveLdapPrivateCertificate() *model.AppError { 12817 origCtx := a.ctx 12818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLdapPrivateCertificate") 12819 12820 a.ctx = newCtx 12821 a.app.Srv().Store.SetContext(newCtx) 12822 defer func() { 12823 a.app.Srv().Store.SetContext(origCtx) 12824 a.ctx = origCtx 12825 }() 12826 12827 defer span.Finish() 12828 resultVar0 := a.app.RemoveLdapPrivateCertificate() 12829 12830 if resultVar0 != nil { 12831 span.LogFields(spanlog.Error(resultVar0)) 12832 ext.Error.Set(span, true) 12833 } 12834 12835 return resultVar0 12836 } 12837 12838 func (a *OpenTracingAppLayer) RemoveLdapPublicCertificate() *model.AppError { 12839 origCtx := a.ctx 12840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLdapPublicCertificate") 12841 12842 a.ctx = newCtx 12843 a.app.Srv().Store.SetContext(newCtx) 12844 defer func() { 12845 a.app.Srv().Store.SetContext(origCtx) 12846 a.ctx = origCtx 12847 }() 12848 12849 defer span.Finish() 12850 resultVar0 := a.app.RemoveLdapPublicCertificate() 12851 12852 if resultVar0 != nil { 12853 span.LogFields(spanlog.Error(resultVar0)) 12854 ext.Error.Set(span, true) 12855 } 12856 12857 return resultVar0 12858 } 12859 12860 func (a *OpenTracingAppLayer) RemovePlugin(id string) *model.AppError { 12861 origCtx := a.ctx 12862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePlugin") 12863 12864 a.ctx = newCtx 12865 a.app.Srv().Store.SetContext(newCtx) 12866 defer func() { 12867 a.app.Srv().Store.SetContext(origCtx) 12868 a.ctx = origCtx 12869 }() 12870 12871 defer span.Finish() 12872 resultVar0 := a.app.RemovePlugin(id) 12873 12874 if resultVar0 != nil { 12875 span.LogFields(spanlog.Error(resultVar0)) 12876 ext.Error.Set(span, true) 12877 } 12878 12879 return resultVar0 12880 } 12881 12882 func (a *OpenTracingAppLayer) RemovePluginFromData(data model.PluginEventData) { 12883 origCtx := a.ctx 12884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePluginFromData") 12885 12886 a.ctx = newCtx 12887 a.app.Srv().Store.SetContext(newCtx) 12888 defer func() { 12889 a.app.Srv().Store.SetContext(origCtx) 12890 a.ctx = origCtx 12891 }() 12892 12893 defer span.Finish() 12894 a.app.RemovePluginFromData(data) 12895 } 12896 12897 func (a *OpenTracingAppLayer) RemoveRecentCustomStatus(userID string, status *model.CustomStatus) *model.AppError { 12898 origCtx := a.ctx 12899 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveRecentCustomStatus") 12900 12901 a.ctx = newCtx 12902 a.app.Srv().Store.SetContext(newCtx) 12903 defer func() { 12904 a.app.Srv().Store.SetContext(origCtx) 12905 a.ctx = origCtx 12906 }() 12907 12908 defer span.Finish() 12909 resultVar0 := a.app.RemoveRecentCustomStatus(userID, status) 12910 12911 if resultVar0 != nil { 12912 span.LogFields(spanlog.Error(resultVar0)) 12913 ext.Error.Set(span, true) 12914 } 12915 12916 return resultVar0 12917 } 12918 12919 func (a *OpenTracingAppLayer) RemoveSamlIdpCertificate() *model.AppError { 12920 origCtx := a.ctx 12921 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlIdpCertificate") 12922 12923 a.ctx = newCtx 12924 a.app.Srv().Store.SetContext(newCtx) 12925 defer func() { 12926 a.app.Srv().Store.SetContext(origCtx) 12927 a.ctx = origCtx 12928 }() 12929 12930 defer span.Finish() 12931 resultVar0 := a.app.RemoveSamlIdpCertificate() 12932 12933 if resultVar0 != nil { 12934 span.LogFields(spanlog.Error(resultVar0)) 12935 ext.Error.Set(span, true) 12936 } 12937 12938 return resultVar0 12939 } 12940 12941 func (a *OpenTracingAppLayer) RemoveSamlPrivateCertificate() *model.AppError { 12942 origCtx := a.ctx 12943 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPrivateCertificate") 12944 12945 a.ctx = newCtx 12946 a.app.Srv().Store.SetContext(newCtx) 12947 defer func() { 12948 a.app.Srv().Store.SetContext(origCtx) 12949 a.ctx = origCtx 12950 }() 12951 12952 defer span.Finish() 12953 resultVar0 := a.app.RemoveSamlPrivateCertificate() 12954 12955 if resultVar0 != nil { 12956 span.LogFields(spanlog.Error(resultVar0)) 12957 ext.Error.Set(span, true) 12958 } 12959 12960 return resultVar0 12961 } 12962 12963 func (a *OpenTracingAppLayer) RemoveSamlPublicCertificate() *model.AppError { 12964 origCtx := a.ctx 12965 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPublicCertificate") 12966 12967 a.ctx = newCtx 12968 a.app.Srv().Store.SetContext(newCtx) 12969 defer func() { 12970 a.app.Srv().Store.SetContext(origCtx) 12971 a.ctx = origCtx 12972 }() 12973 12974 defer span.Finish() 12975 resultVar0 := a.app.RemoveSamlPublicCertificate() 12976 12977 if resultVar0 != nil { 12978 span.LogFields(spanlog.Error(resultVar0)) 12979 ext.Error.Set(span, true) 12980 } 12981 12982 return resultVar0 12983 } 12984 12985 func (a *OpenTracingAppLayer) RemoveTeamIcon(teamID string) *model.AppError { 12986 origCtx := a.ctx 12987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamIcon") 12988 12989 a.ctx = newCtx 12990 a.app.Srv().Store.SetContext(newCtx) 12991 defer func() { 12992 a.app.Srv().Store.SetContext(origCtx) 12993 a.ctx = origCtx 12994 }() 12995 12996 defer span.Finish() 12997 resultVar0 := a.app.RemoveTeamIcon(teamID) 12998 12999 if resultVar0 != nil { 13000 span.LogFields(spanlog.Error(resultVar0)) 13001 ext.Error.Set(span, true) 13002 } 13003 13004 return resultVar0 13005 } 13006 13007 func (a *OpenTracingAppLayer) RemoveTeamMemberFromTeam(c *request.Context, teamMember *model.TeamMember, requestorId string) *model.AppError { 13008 origCtx := a.ctx 13009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamMemberFromTeam") 13010 13011 a.ctx = newCtx 13012 a.app.Srv().Store.SetContext(newCtx) 13013 defer func() { 13014 a.app.Srv().Store.SetContext(origCtx) 13015 a.ctx = origCtx 13016 }() 13017 13018 defer span.Finish() 13019 resultVar0 := a.app.RemoveTeamMemberFromTeam(c, teamMember, requestorId) 13020 13021 if resultVar0 != nil { 13022 span.LogFields(spanlog.Error(resultVar0)) 13023 ext.Error.Set(span, true) 13024 } 13025 13026 return resultVar0 13027 } 13028 13029 func (a *OpenTracingAppLayer) RemoveTeamsFromRetentionPolicy(policyID string, teamIDs []string) *model.AppError { 13030 origCtx := a.ctx 13031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamsFromRetentionPolicy") 13032 13033 a.ctx = newCtx 13034 a.app.Srv().Store.SetContext(newCtx) 13035 defer func() { 13036 a.app.Srv().Store.SetContext(origCtx) 13037 a.ctx = origCtx 13038 }() 13039 13040 defer span.Finish() 13041 resultVar0 := a.app.RemoveTeamsFromRetentionPolicy(policyID, teamIDs) 13042 13043 if resultVar0 != nil { 13044 span.LogFields(spanlog.Error(resultVar0)) 13045 ext.Error.Set(span, true) 13046 } 13047 13048 return resultVar0 13049 } 13050 13051 func (a *OpenTracingAppLayer) RemoveUserFromChannel(c *request.Context, userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError { 13052 origCtx := a.ctx 13053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromChannel") 13054 13055 a.ctx = newCtx 13056 a.app.Srv().Store.SetContext(newCtx) 13057 defer func() { 13058 a.app.Srv().Store.SetContext(origCtx) 13059 a.ctx = origCtx 13060 }() 13061 13062 defer span.Finish() 13063 resultVar0 := a.app.RemoveUserFromChannel(c, userIDToRemove, removerUserId, channel) 13064 13065 if resultVar0 != nil { 13066 span.LogFields(spanlog.Error(resultVar0)) 13067 ext.Error.Set(span, true) 13068 } 13069 13070 return resultVar0 13071 } 13072 13073 func (a *OpenTracingAppLayer) RemoveUserFromTeam(c *request.Context, teamID string, userID string, requestorId string) *model.AppError { 13074 origCtx := a.ctx 13075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromTeam") 13076 13077 a.ctx = newCtx 13078 a.app.Srv().Store.SetContext(newCtx) 13079 defer func() { 13080 a.app.Srv().Store.SetContext(origCtx) 13081 a.ctx = origCtx 13082 }() 13083 13084 defer span.Finish() 13085 resultVar0 := a.app.RemoveUserFromTeam(c, teamID, userID, requestorId) 13086 13087 if resultVar0 != nil { 13088 span.LogFields(spanlog.Error(resultVar0)) 13089 ext.Error.Set(span, true) 13090 } 13091 13092 return resultVar0 13093 } 13094 13095 func (a *OpenTracingAppLayer) RemoveUsersFromChannelNotMemberOfTeam(c *request.Context, remover *model.User, channel *model.Channel, team *model.Team) *model.AppError { 13096 origCtx := a.ctx 13097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUsersFromChannelNotMemberOfTeam") 13098 13099 a.ctx = newCtx 13100 a.app.Srv().Store.SetContext(newCtx) 13101 defer func() { 13102 a.app.Srv().Store.SetContext(origCtx) 13103 a.ctx = origCtx 13104 }() 13105 13106 defer span.Finish() 13107 resultVar0 := a.app.RemoveUsersFromChannelNotMemberOfTeam(c, remover, channel, team) 13108 13109 if resultVar0 != nil { 13110 span.LogFields(spanlog.Error(resultVar0)) 13111 ext.Error.Set(span, true) 13112 } 13113 13114 return resultVar0 13115 } 13116 13117 func (a *OpenTracingAppLayer) RenameChannel(channel *model.Channel, newChannelName string, newDisplayName string) (*model.Channel, *model.AppError) { 13118 origCtx := a.ctx 13119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameChannel") 13120 13121 a.ctx = newCtx 13122 a.app.Srv().Store.SetContext(newCtx) 13123 defer func() { 13124 a.app.Srv().Store.SetContext(origCtx) 13125 a.ctx = origCtx 13126 }() 13127 13128 defer span.Finish() 13129 resultVar0, resultVar1 := a.app.RenameChannel(channel, newChannelName, newDisplayName) 13130 13131 if resultVar1 != nil { 13132 span.LogFields(spanlog.Error(resultVar1)) 13133 ext.Error.Set(span, true) 13134 } 13135 13136 return resultVar0, resultVar1 13137 } 13138 13139 func (a *OpenTracingAppLayer) RenameTeam(team *model.Team, newTeamName string, newDisplayName string) (*model.Team, *model.AppError) { 13140 origCtx := a.ctx 13141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameTeam") 13142 13143 a.ctx = newCtx 13144 a.app.Srv().Store.SetContext(newCtx) 13145 defer func() { 13146 a.app.Srv().Store.SetContext(origCtx) 13147 a.ctx = origCtx 13148 }() 13149 13150 defer span.Finish() 13151 resultVar0, resultVar1 := a.app.RenameTeam(team, newTeamName, newDisplayName) 13152 13153 if resultVar1 != nil { 13154 span.LogFields(spanlog.Error(resultVar1)) 13155 ext.Error.Set(span, true) 13156 } 13157 13158 return resultVar0, resultVar1 13159 } 13160 13161 func (a *OpenTracingAppLayer) RequestLicenseAndAckWarnMetric(c *request.Context, warnMetricId string, isBot bool) *model.AppError { 13162 origCtx := a.ctx 13163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RequestLicenseAndAckWarnMetric") 13164 13165 a.ctx = newCtx 13166 a.app.Srv().Store.SetContext(newCtx) 13167 defer func() { 13168 a.app.Srv().Store.SetContext(origCtx) 13169 a.ctx = origCtx 13170 }() 13171 13172 defer span.Finish() 13173 resultVar0 := a.app.RequestLicenseAndAckWarnMetric(c, warnMetricId, isBot) 13174 13175 if resultVar0 != nil { 13176 span.LogFields(spanlog.Error(resultVar0)) 13177 ext.Error.Set(span, true) 13178 } 13179 13180 return resultVar0 13181 } 13182 13183 func (a *OpenTracingAppLayer) ResetPasswordFromToken(userSuppliedTokenString string, newPassword string) *model.AppError { 13184 origCtx := a.ctx 13185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPasswordFromToken") 13186 13187 a.ctx = newCtx 13188 a.app.Srv().Store.SetContext(newCtx) 13189 defer func() { 13190 a.app.Srv().Store.SetContext(origCtx) 13191 a.ctx = origCtx 13192 }() 13193 13194 defer span.Finish() 13195 resultVar0 := a.app.ResetPasswordFromToken(userSuppliedTokenString, newPassword) 13196 13197 if resultVar0 != nil { 13198 span.LogFields(spanlog.Error(resultVar0)) 13199 ext.Error.Set(span, true) 13200 } 13201 13202 return resultVar0 13203 } 13204 13205 func (a *OpenTracingAppLayer) ResetPermissionsSystem() *model.AppError { 13206 origCtx := a.ctx 13207 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPermissionsSystem") 13208 13209 a.ctx = newCtx 13210 a.app.Srv().Store.SetContext(newCtx) 13211 defer func() { 13212 a.app.Srv().Store.SetContext(origCtx) 13213 a.ctx = origCtx 13214 }() 13215 13216 defer span.Finish() 13217 resultVar0 := a.app.ResetPermissionsSystem() 13218 13219 if resultVar0 != nil { 13220 span.LogFields(spanlog.Error(resultVar0)) 13221 ext.Error.Set(span, true) 13222 } 13223 13224 return resultVar0 13225 } 13226 13227 func (a *OpenTracingAppLayer) ResetSamlAuthDataToEmail(includeDeleted bool, dryRun bool, userIDs []string) (numAffected int, appErr *model.AppError) { 13228 origCtx := a.ctx 13229 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetSamlAuthDataToEmail") 13230 13231 a.ctx = newCtx 13232 a.app.Srv().Store.SetContext(newCtx) 13233 defer func() { 13234 a.app.Srv().Store.SetContext(origCtx) 13235 a.ctx = origCtx 13236 }() 13237 13238 defer span.Finish() 13239 resultVar0, resultVar1 := a.app.ResetSamlAuthDataToEmail(includeDeleted, dryRun, userIDs) 13240 13241 if resultVar1 != nil { 13242 span.LogFields(spanlog.Error(resultVar1)) 13243 ext.Error.Set(span, true) 13244 } 13245 13246 return resultVar0, resultVar1 13247 } 13248 13249 func (a *OpenTracingAppLayer) RestoreChannel(c *request.Context, channel *model.Channel, userID string) (*model.Channel, *model.AppError) { 13250 origCtx := a.ctx 13251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreChannel") 13252 13253 a.ctx = newCtx 13254 a.app.Srv().Store.SetContext(newCtx) 13255 defer func() { 13256 a.app.Srv().Store.SetContext(origCtx) 13257 a.ctx = origCtx 13258 }() 13259 13260 defer span.Finish() 13261 resultVar0, resultVar1 := a.app.RestoreChannel(c, channel, userID) 13262 13263 if resultVar1 != nil { 13264 span.LogFields(spanlog.Error(resultVar1)) 13265 ext.Error.Set(span, true) 13266 } 13267 13268 return resultVar0, resultVar1 13269 } 13270 13271 func (a *OpenTracingAppLayer) RestoreTeam(teamID string) *model.AppError { 13272 origCtx := a.ctx 13273 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreTeam") 13274 13275 a.ctx = newCtx 13276 a.app.Srv().Store.SetContext(newCtx) 13277 defer func() { 13278 a.app.Srv().Store.SetContext(origCtx) 13279 a.ctx = origCtx 13280 }() 13281 13282 defer span.Finish() 13283 resultVar0 := a.app.RestoreTeam(teamID) 13284 13285 if resultVar0 != nil { 13286 span.LogFields(spanlog.Error(resultVar0)) 13287 ext.Error.Set(span, true) 13288 } 13289 13290 return resultVar0 13291 } 13292 13293 func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { 13294 origCtx := a.ctx 13295 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersGetByPermissions") 13296 13297 a.ctx = newCtx 13298 a.app.Srv().Store.SetContext(newCtx) 13299 defer func() { 13300 a.app.Srv().Store.SetContext(origCtx) 13301 a.ctx = origCtx 13302 }() 13303 13304 defer span.Finish() 13305 resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userID, options) 13306 13307 if resultVar1 != nil { 13308 span.LogFields(spanlog.Error(resultVar1)) 13309 ext.Error.Set(span, true) 13310 } 13311 13312 return resultVar0, resultVar1 13313 } 13314 13315 func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { 13316 origCtx := a.ctx 13317 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersSearchByPermissions") 13318 13319 a.ctx = newCtx 13320 a.app.Srv().Store.SetContext(newCtx) 13321 defer func() { 13322 a.app.Srv().Store.SetContext(origCtx) 13323 a.ctx = origCtx 13324 }() 13325 13326 defer span.Finish() 13327 resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userID, options) 13328 13329 if resultVar1 != nil { 13330 span.LogFields(spanlog.Error(resultVar1)) 13331 ext.Error.Set(span, true) 13332 } 13333 13334 return resultVar0, resultVar1 13335 } 13336 13337 func (a *OpenTracingAppLayer) ReturnSessionToPool(session *model.Session) { 13338 origCtx := a.ctx 13339 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReturnSessionToPool") 13340 13341 a.ctx = newCtx 13342 a.app.Srv().Store.SetContext(newCtx) 13343 defer func() { 13344 a.app.Srv().Store.SetContext(origCtx) 13345 a.ctx = origCtx 13346 }() 13347 13348 defer span.Finish() 13349 a.app.ReturnSessionToPool(session) 13350 } 13351 13352 func (a *OpenTracingAppLayer) RevokeAccessToken(token string) *model.AppError { 13353 origCtx := a.ctx 13354 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAccessToken") 13355 13356 a.ctx = newCtx 13357 a.app.Srv().Store.SetContext(newCtx) 13358 defer func() { 13359 a.app.Srv().Store.SetContext(origCtx) 13360 a.ctx = origCtx 13361 }() 13362 13363 defer span.Finish() 13364 resultVar0 := a.app.RevokeAccessToken(token) 13365 13366 if resultVar0 != nil { 13367 span.LogFields(spanlog.Error(resultVar0)) 13368 ext.Error.Set(span, true) 13369 } 13370 13371 return resultVar0 13372 } 13373 13374 func (a *OpenTracingAppLayer) RevokeAllSessions(userID string) *model.AppError { 13375 origCtx := a.ctx 13376 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions") 13377 13378 a.ctx = newCtx 13379 a.app.Srv().Store.SetContext(newCtx) 13380 defer func() { 13381 a.app.Srv().Store.SetContext(origCtx) 13382 a.ctx = origCtx 13383 }() 13384 13385 defer span.Finish() 13386 resultVar0 := a.app.RevokeAllSessions(userID) 13387 13388 if resultVar0 != nil { 13389 span.LogFields(spanlog.Error(resultVar0)) 13390 ext.Error.Set(span, true) 13391 } 13392 13393 return resultVar0 13394 } 13395 13396 func (a *OpenTracingAppLayer) RevokeSession(session *model.Session) *model.AppError { 13397 origCtx := a.ctx 13398 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSession") 13399 13400 a.ctx = newCtx 13401 a.app.Srv().Store.SetContext(newCtx) 13402 defer func() { 13403 a.app.Srv().Store.SetContext(origCtx) 13404 a.ctx = origCtx 13405 }() 13406 13407 defer span.Finish() 13408 resultVar0 := a.app.RevokeSession(session) 13409 13410 if resultVar0 != nil { 13411 span.LogFields(spanlog.Error(resultVar0)) 13412 ext.Error.Set(span, true) 13413 } 13414 13415 return resultVar0 13416 } 13417 13418 func (a *OpenTracingAppLayer) RevokeSessionById(sessionID string) *model.AppError { 13419 origCtx := a.ctx 13420 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionById") 13421 13422 a.ctx = newCtx 13423 a.app.Srv().Store.SetContext(newCtx) 13424 defer func() { 13425 a.app.Srv().Store.SetContext(origCtx) 13426 a.ctx = origCtx 13427 }() 13428 13429 defer span.Finish() 13430 resultVar0 := a.app.RevokeSessionById(sessionID) 13431 13432 if resultVar0 != nil { 13433 span.LogFields(spanlog.Error(resultVar0)) 13434 ext.Error.Set(span, true) 13435 } 13436 13437 return resultVar0 13438 } 13439 13440 func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userID string, deviceID string, currentSessionId string) *model.AppError { 13441 origCtx := a.ctx 13442 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId") 13443 13444 a.ctx = newCtx 13445 a.app.Srv().Store.SetContext(newCtx) 13446 defer func() { 13447 a.app.Srv().Store.SetContext(origCtx) 13448 a.ctx = origCtx 13449 }() 13450 13451 defer span.Finish() 13452 resultVar0 := a.app.RevokeSessionsForDeviceId(userID, deviceID, currentSessionId) 13453 13454 if resultVar0 != nil { 13455 span.LogFields(spanlog.Error(resultVar0)) 13456 ext.Error.Set(span, true) 13457 } 13458 13459 return resultVar0 13460 } 13461 13462 func (a *OpenTracingAppLayer) RevokeSessionsFromAllUsers() *model.AppError { 13463 origCtx := a.ctx 13464 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsFromAllUsers") 13465 13466 a.ctx = newCtx 13467 a.app.Srv().Store.SetContext(newCtx) 13468 defer func() { 13469 a.app.Srv().Store.SetContext(origCtx) 13470 a.ctx = origCtx 13471 }() 13472 13473 defer span.Finish() 13474 resultVar0 := a.app.RevokeSessionsFromAllUsers() 13475 13476 if resultVar0 != nil { 13477 span.LogFields(spanlog.Error(resultVar0)) 13478 ext.Error.Set(span, true) 13479 } 13480 13481 return resultVar0 13482 } 13483 13484 func (a *OpenTracingAppLayer) RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError { 13485 origCtx := a.ctx 13486 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeUserAccessToken") 13487 13488 a.ctx = newCtx 13489 a.app.Srv().Store.SetContext(newCtx) 13490 defer func() { 13491 a.app.Srv().Store.SetContext(origCtx) 13492 a.ctx = origCtx 13493 }() 13494 13495 defer span.Finish() 13496 resultVar0 := a.app.RevokeUserAccessToken(token) 13497 13498 if resultVar0 != nil { 13499 span.LogFields(spanlog.Error(resultVar0)) 13500 ext.Error.Set(span, true) 13501 } 13502 13503 return resultVar0 13504 } 13505 13506 func (a *OpenTracingAppLayer) RolesGrantPermission(roleNames []string, permissionId string) bool { 13507 origCtx := a.ctx 13508 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RolesGrantPermission") 13509 13510 a.ctx = newCtx 13511 a.app.Srv().Store.SetContext(newCtx) 13512 defer func() { 13513 a.app.Srv().Store.SetContext(origCtx) 13514 a.ctx = origCtx 13515 }() 13516 13517 defer span.Finish() 13518 resultVar0 := a.app.RolesGrantPermission(roleNames, permissionId) 13519 13520 return resultVar0 13521 } 13522 13523 func (a *OpenTracingAppLayer) SanitizeProfile(user *model.User, asAdmin bool) { 13524 origCtx := a.ctx 13525 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeProfile") 13526 13527 a.ctx = newCtx 13528 a.app.Srv().Store.SetContext(newCtx) 13529 defer func() { 13530 a.app.Srv().Store.SetContext(origCtx) 13531 a.ctx = origCtx 13532 }() 13533 13534 defer span.Finish() 13535 a.app.SanitizeProfile(user, asAdmin) 13536 } 13537 13538 func (a *OpenTracingAppLayer) SanitizeTeam(session model.Session, team *model.Team) *model.Team { 13539 origCtx := a.ctx 13540 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeam") 13541 13542 a.ctx = newCtx 13543 a.app.Srv().Store.SetContext(newCtx) 13544 defer func() { 13545 a.app.Srv().Store.SetContext(origCtx) 13546 a.ctx = origCtx 13547 }() 13548 13549 defer span.Finish() 13550 resultVar0 := a.app.SanitizeTeam(session, team) 13551 13552 return resultVar0 13553 } 13554 13555 func (a *OpenTracingAppLayer) SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team { 13556 origCtx := a.ctx 13557 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeams") 13558 13559 a.ctx = newCtx 13560 a.app.Srv().Store.SetContext(newCtx) 13561 defer func() { 13562 a.app.Srv().Store.SetContext(origCtx) 13563 a.ctx = origCtx 13564 }() 13565 13566 defer span.Finish() 13567 resultVar0 := a.app.SanitizeTeams(session, teams) 13568 13569 return resultVar0 13570 } 13571 13572 func (a *OpenTracingAppLayer) SaveAndBroadcastStatus(status *model.Status) { 13573 origCtx := a.ctx 13574 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveAndBroadcastStatus") 13575 13576 a.ctx = newCtx 13577 a.app.Srv().Store.SetContext(newCtx) 13578 defer func() { 13579 a.app.Srv().Store.SetContext(origCtx) 13580 a.ctx = origCtx 13581 }() 13582 13583 defer span.Finish() 13584 a.app.SaveAndBroadcastStatus(status) 13585 } 13586 13587 func (a *OpenTracingAppLayer) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError { 13588 origCtx := a.ctx 13589 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveBrandImage") 13590 13591 a.ctx = newCtx 13592 a.app.Srv().Store.SetContext(newCtx) 13593 defer func() { 13594 a.app.Srv().Store.SetContext(origCtx) 13595 a.ctx = origCtx 13596 }() 13597 13598 defer span.Finish() 13599 resultVar0 := a.app.SaveBrandImage(imageData) 13600 13601 if resultVar0 != nil { 13602 span.LogFields(spanlog.Error(resultVar0)) 13603 ext.Error.Set(span, true) 13604 } 13605 13606 return resultVar0 13607 } 13608 13609 func (a *OpenTracingAppLayer) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) { 13610 origCtx := a.ctx 13611 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveComplianceReport") 13612 13613 a.ctx = newCtx 13614 a.app.Srv().Store.SetContext(newCtx) 13615 defer func() { 13616 a.app.Srv().Store.SetContext(origCtx) 13617 a.ctx = origCtx 13618 }() 13619 13620 defer span.Finish() 13621 resultVar0, resultVar1 := a.app.SaveComplianceReport(job) 13622 13623 if resultVar1 != nil { 13624 span.LogFields(spanlog.Error(resultVar1)) 13625 ext.Error.Set(span, true) 13626 } 13627 13628 return resultVar0, resultVar1 13629 } 13630 13631 func (a *OpenTracingAppLayer) SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) (*model.Config, *model.Config, *model.AppError) { 13632 origCtx := a.ctx 13633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveConfig") 13634 13635 a.ctx = newCtx 13636 a.app.Srv().Store.SetContext(newCtx) 13637 defer func() { 13638 a.app.Srv().Store.SetContext(origCtx) 13639 a.ctx = origCtx 13640 }() 13641 13642 defer span.Finish() 13643 resultVar0, resultVar1, resultVar2 := a.app.SaveConfig(newCfg, sendConfigChangeClusterMessage) 13644 13645 if resultVar2 != nil { 13646 span.LogFields(spanlog.Error(resultVar2)) 13647 ext.Error.Set(span, true) 13648 } 13649 13650 return resultVar0, resultVar1, resultVar2 13651 } 13652 13653 func (a *OpenTracingAppLayer) SaveReactionForPost(c *request.Context, reaction *model.Reaction) (*model.Reaction, *model.AppError) { 13654 origCtx := a.ctx 13655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveReactionForPost") 13656 13657 a.ctx = newCtx 13658 a.app.Srv().Store.SetContext(newCtx) 13659 defer func() { 13660 a.app.Srv().Store.SetContext(origCtx) 13661 a.ctx = origCtx 13662 }() 13663 13664 defer span.Finish() 13665 resultVar0, resultVar1 := a.app.SaveReactionForPost(c, reaction) 13666 13667 if resultVar1 != nil { 13668 span.LogFields(spanlog.Error(resultVar1)) 13669 ext.Error.Set(span, true) 13670 } 13671 13672 return resultVar0, resultVar1 13673 } 13674 13675 func (a *OpenTracingAppLayer) SaveSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error) { 13676 origCtx := a.ctx 13677 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveSharedChannel") 13678 13679 a.ctx = newCtx 13680 a.app.Srv().Store.SetContext(newCtx) 13681 defer func() { 13682 a.app.Srv().Store.SetContext(origCtx) 13683 a.ctx = origCtx 13684 }() 13685 13686 defer span.Finish() 13687 resultVar0, resultVar1 := a.app.SaveSharedChannel(sc) 13688 13689 if resultVar1 != nil { 13690 span.LogFields(spanlog.Error(resultVar1)) 13691 ext.Error.Set(span, true) 13692 } 13693 13694 return resultVar0, resultVar1 13695 } 13696 13697 func (a *OpenTracingAppLayer) SaveSharedChannelRemote(remote *model.SharedChannelRemote) (*model.SharedChannelRemote, error) { 13698 origCtx := a.ctx 13699 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveSharedChannelRemote") 13700 13701 a.ctx = newCtx 13702 a.app.Srv().Store.SetContext(newCtx) 13703 defer func() { 13704 a.app.Srv().Store.SetContext(origCtx) 13705 a.ctx = origCtx 13706 }() 13707 13708 defer span.Finish() 13709 resultVar0, resultVar1 := a.app.SaveSharedChannelRemote(remote) 13710 13711 if resultVar1 != nil { 13712 span.LogFields(spanlog.Error(resultVar1)) 13713 ext.Error.Set(span, true) 13714 } 13715 13716 return resultVar0, resultVar1 13717 } 13718 13719 func (a *OpenTracingAppLayer) SaveUserTermsOfService(userID string, termsOfServiceId string, accepted bool) *model.AppError { 13720 origCtx := a.ctx 13721 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveUserTermsOfService") 13722 13723 a.ctx = newCtx 13724 a.app.Srv().Store.SetContext(newCtx) 13725 defer func() { 13726 a.app.Srv().Store.SetContext(origCtx) 13727 a.ctx = origCtx 13728 }() 13729 13730 defer span.Finish() 13731 resultVar0 := a.app.SaveUserTermsOfService(userID, termsOfServiceId, accepted) 13732 13733 if resultVar0 != nil { 13734 span.LogFields(spanlog.Error(resultVar0)) 13735 ext.Error.Set(span, true) 13736 } 13737 13738 return resultVar0 13739 } 13740 13741 func (a *OpenTracingAppLayer) SchemesIterator(scope string, batchSize int) func() []*model.Scheme { 13742 origCtx := a.ctx 13743 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SchemesIterator") 13744 13745 a.ctx = newCtx 13746 a.app.Srv().Store.SetContext(newCtx) 13747 defer func() { 13748 a.app.Srv().Store.SetContext(origCtx) 13749 a.ctx = origCtx 13750 }() 13751 13752 defer span.Finish() 13753 resultVar0 := a.app.SchemesIterator(scope, batchSize) 13754 13755 return resultVar0 13756 } 13757 13758 func (a *OpenTracingAppLayer) SearchAllChannels(term string, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) { 13759 origCtx := a.ctx 13760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllChannels") 13761 13762 a.ctx = newCtx 13763 a.app.Srv().Store.SetContext(newCtx) 13764 defer func() { 13765 a.app.Srv().Store.SetContext(origCtx) 13766 a.ctx = origCtx 13767 }() 13768 13769 defer span.Finish() 13770 resultVar0, resultVar1, resultVar2 := a.app.SearchAllChannels(term, opts) 13771 13772 if resultVar2 != nil { 13773 span.LogFields(spanlog.Error(resultVar2)) 13774 ext.Error.Set(span, true) 13775 } 13776 13777 return resultVar0, resultVar1, resultVar2 13778 } 13779 13780 func (a *OpenTracingAppLayer) SearchAllTeams(searchOpts *model.TeamSearch) ([]*model.Team, int64, *model.AppError) { 13781 origCtx := a.ctx 13782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllTeams") 13783 13784 a.ctx = newCtx 13785 a.app.Srv().Store.SetContext(newCtx) 13786 defer func() { 13787 a.app.Srv().Store.SetContext(origCtx) 13788 a.ctx = origCtx 13789 }() 13790 13791 defer span.Finish() 13792 resultVar0, resultVar1, resultVar2 := a.app.SearchAllTeams(searchOpts) 13793 13794 if resultVar2 != nil { 13795 span.LogFields(spanlog.Error(resultVar2)) 13796 ext.Error.Set(span, true) 13797 } 13798 13799 return resultVar0, resultVar1, resultVar2 13800 } 13801 13802 func (a *OpenTracingAppLayer) SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError) { 13803 origCtx := a.ctx 13804 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchArchivedChannels") 13805 13806 a.ctx = newCtx 13807 a.app.Srv().Store.SetContext(newCtx) 13808 defer func() { 13809 a.app.Srv().Store.SetContext(origCtx) 13810 a.ctx = origCtx 13811 }() 13812 13813 defer span.Finish() 13814 resultVar0, resultVar1 := a.app.SearchArchivedChannels(teamID, term, userID) 13815 13816 if resultVar1 != nil { 13817 span.LogFields(spanlog.Error(resultVar1)) 13818 ext.Error.Set(span, true) 13819 } 13820 13821 return resultVar0, resultVar1 13822 } 13823 13824 func (a *OpenTracingAppLayer) SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { 13825 origCtx := a.ctx 13826 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannels") 13827 13828 a.ctx = newCtx 13829 a.app.Srv().Store.SetContext(newCtx) 13830 defer func() { 13831 a.app.Srv().Store.SetContext(origCtx) 13832 a.ctx = origCtx 13833 }() 13834 13835 defer span.Finish() 13836 resultVar0, resultVar1 := a.app.SearchChannels(teamID, term) 13837 13838 if resultVar1 != nil { 13839 span.LogFields(spanlog.Error(resultVar1)) 13840 ext.Error.Set(span, true) 13841 } 13842 13843 return resultVar0, resultVar1 13844 } 13845 13846 func (a *OpenTracingAppLayer) SearchChannelsForUser(userID string, teamID string, term string) (*model.ChannelList, *model.AppError) { 13847 origCtx := a.ctx 13848 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsForUser") 13849 13850 a.ctx = newCtx 13851 a.app.Srv().Store.SetContext(newCtx) 13852 defer func() { 13853 a.app.Srv().Store.SetContext(origCtx) 13854 a.ctx = origCtx 13855 }() 13856 13857 defer span.Finish() 13858 resultVar0, resultVar1 := a.app.SearchChannelsForUser(userID, teamID, term) 13859 13860 if resultVar1 != nil { 13861 span.LogFields(spanlog.Error(resultVar1)) 13862 ext.Error.Set(span, true) 13863 } 13864 13865 return resultVar0, resultVar1 13866 } 13867 13868 func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { 13869 origCtx := a.ctx 13870 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsUserNotIn") 13871 13872 a.ctx = newCtx 13873 a.app.Srv().Store.SetContext(newCtx) 13874 defer func() { 13875 a.app.Srv().Store.SetContext(origCtx) 13876 a.ctx = origCtx 13877 }() 13878 13879 defer span.Finish() 13880 resultVar0, resultVar1 := a.app.SearchChannelsUserNotIn(teamID, userID, term) 13881 13882 if resultVar1 != nil { 13883 span.LogFields(spanlog.Error(resultVar1)) 13884 ext.Error.Set(span, true) 13885 } 13886 13887 return resultVar0, resultVar1 13888 } 13889 13890 func (a *OpenTracingAppLayer) SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) { 13891 origCtx := a.ctx 13892 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEmoji") 13893 13894 a.ctx = newCtx 13895 a.app.Srv().Store.SetContext(newCtx) 13896 defer func() { 13897 a.app.Srv().Store.SetContext(origCtx) 13898 a.ctx = origCtx 13899 }() 13900 13901 defer span.Finish() 13902 resultVar0, resultVar1 := a.app.SearchEmoji(name, prefixOnly, limit) 13903 13904 if resultVar1 != nil { 13905 span.LogFields(spanlog.Error(resultVar1)) 13906 ext.Error.Set(span, true) 13907 } 13908 13909 return resultVar0, resultVar1 13910 } 13911 13912 func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker { 13913 origCtx := a.ctx 13914 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEngine") 13915 13916 a.ctx = newCtx 13917 a.app.Srv().Store.SetContext(newCtx) 13918 defer func() { 13919 a.app.Srv().Store.SetContext(origCtx) 13920 a.ctx = origCtx 13921 }() 13922 13923 defer span.Finish() 13924 resultVar0 := a.app.SearchEngine() 13925 13926 return resultVar0 13927 } 13928 13929 func (a *OpenTracingAppLayer) SearchFilesInTeamForUser(c *request.Context, terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.FileInfoList, *model.AppError) { 13930 origCtx := a.ctx 13931 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchFilesInTeamForUser") 13932 13933 a.ctx = newCtx 13934 a.app.Srv().Store.SetContext(newCtx) 13935 defer func() { 13936 a.app.Srv().Store.SetContext(origCtx) 13937 a.ctx = origCtx 13938 }() 13939 13940 defer span.Finish() 13941 resultVar0, resultVar1 := a.app.SearchFilesInTeamForUser(c, terms, userId, teamId, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) 13942 13943 if resultVar1 != nil { 13944 span.LogFields(spanlog.Error(resultVar1)) 13945 ext.Error.Set(span, true) 13946 } 13947 13948 return resultVar0, resultVar1 13949 } 13950 13951 func (a *OpenTracingAppLayer) SearchGroupChannels(userID string, term string) (*model.ChannelList, *model.AppError) { 13952 origCtx := a.ctx 13953 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchGroupChannels") 13954 13955 a.ctx = newCtx 13956 a.app.Srv().Store.SetContext(newCtx) 13957 defer func() { 13958 a.app.Srv().Store.SetContext(origCtx) 13959 a.ctx = origCtx 13960 }() 13961 13962 defer span.Finish() 13963 resultVar0, resultVar1 := a.app.SearchGroupChannels(userID, term) 13964 13965 if resultVar1 != nil { 13966 span.LogFields(spanlog.Error(resultVar1)) 13967 ext.Error.Set(span, true) 13968 } 13969 13970 return resultVar0, resultVar1 13971 } 13972 13973 func (a *OpenTracingAppLayer) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { 13974 origCtx := a.ctx 13975 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeam") 13976 13977 a.ctx = newCtx 13978 a.app.Srv().Store.SetContext(newCtx) 13979 defer func() { 13980 a.app.Srv().Store.SetContext(origCtx) 13981 a.ctx = origCtx 13982 }() 13983 13984 defer span.Finish() 13985 resultVar0, resultVar1 := a.app.SearchPostsInTeam(teamID, paramsList) 13986 13987 if resultVar1 != nil { 13988 span.LogFields(spanlog.Error(resultVar1)) 13989 ext.Error.Set(span, true) 13990 } 13991 13992 return resultVar0, resultVar1 13993 } 13994 13995 func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(c *request.Context, terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) { 13996 origCtx := a.ctx 13997 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeamForUser") 13998 13999 a.ctx = newCtx 14000 a.app.Srv().Store.SetContext(newCtx) 14001 defer func() { 14002 a.app.Srv().Store.SetContext(origCtx) 14003 a.ctx = origCtx 14004 }() 14005 14006 defer span.Finish() 14007 resultVar0, resultVar1 := a.app.SearchPostsInTeamForUser(c, terms, userID, teamID, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) 14008 14009 if resultVar1 != nil { 14010 span.LogFields(spanlog.Error(resultVar1)) 14011 ext.Error.Set(span, true) 14012 } 14013 14014 return resultVar0, resultVar1 14015 } 14016 14017 func (a *OpenTracingAppLayer) SearchPrivateTeams(searchOpts *model.TeamSearch) ([]*model.Team, *model.AppError) { 14018 origCtx := a.ctx 14019 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPrivateTeams") 14020 14021 a.ctx = newCtx 14022 a.app.Srv().Store.SetContext(newCtx) 14023 defer func() { 14024 a.app.Srv().Store.SetContext(origCtx) 14025 a.ctx = origCtx 14026 }() 14027 14028 defer span.Finish() 14029 resultVar0, resultVar1 := a.app.SearchPrivateTeams(searchOpts) 14030 14031 if resultVar1 != nil { 14032 span.LogFields(spanlog.Error(resultVar1)) 14033 ext.Error.Set(span, true) 14034 } 14035 14036 return resultVar0, resultVar1 14037 } 14038 14039 func (a *OpenTracingAppLayer) SearchPublicTeams(searchOpts *model.TeamSearch) ([]*model.Team, *model.AppError) { 14040 origCtx := a.ctx 14041 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPublicTeams") 14042 14043 a.ctx = newCtx 14044 a.app.Srv().Store.SetContext(newCtx) 14045 defer func() { 14046 a.app.Srv().Store.SetContext(origCtx) 14047 a.ctx = origCtx 14048 }() 14049 14050 defer span.Finish() 14051 resultVar0, resultVar1 := a.app.SearchPublicTeams(searchOpts) 14052 14053 if resultVar1 != nil { 14054 span.LogFields(spanlog.Error(resultVar1)) 14055 ext.Error.Set(span, true) 14056 } 14057 14058 return resultVar0, resultVar1 14059 } 14060 14061 func (a *OpenTracingAppLayer) SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) { 14062 origCtx := a.ctx 14063 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUserAccessTokens") 14064 14065 a.ctx = newCtx 14066 a.app.Srv().Store.SetContext(newCtx) 14067 defer func() { 14068 a.app.Srv().Store.SetContext(origCtx) 14069 a.ctx = origCtx 14070 }() 14071 14072 defer span.Finish() 14073 resultVar0, resultVar1 := a.app.SearchUserAccessTokens(term) 14074 14075 if resultVar1 != nil { 14076 span.LogFields(spanlog.Error(resultVar1)) 14077 ext.Error.Set(span, true) 14078 } 14079 14080 return resultVar0, resultVar1 14081 } 14082 14083 func (a *OpenTracingAppLayer) SearchUsers(props *model.UserSearch, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14084 origCtx := a.ctx 14085 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsers") 14086 14087 a.ctx = newCtx 14088 a.app.Srv().Store.SetContext(newCtx) 14089 defer func() { 14090 a.app.Srv().Store.SetContext(origCtx) 14091 a.ctx = origCtx 14092 }() 14093 14094 defer span.Finish() 14095 resultVar0, resultVar1 := a.app.SearchUsers(props, options) 14096 14097 if resultVar1 != nil { 14098 span.LogFields(spanlog.Error(resultVar1)) 14099 ext.Error.Set(span, true) 14100 } 14101 14102 return resultVar0, resultVar1 14103 } 14104 14105 func (a *OpenTracingAppLayer) SearchUsersInChannel(channelID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14106 origCtx := a.ctx 14107 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInChannel") 14108 14109 a.ctx = newCtx 14110 a.app.Srv().Store.SetContext(newCtx) 14111 defer func() { 14112 a.app.Srv().Store.SetContext(origCtx) 14113 a.ctx = origCtx 14114 }() 14115 14116 defer span.Finish() 14117 resultVar0, resultVar1 := a.app.SearchUsersInChannel(channelID, term, options) 14118 14119 if resultVar1 != nil { 14120 span.LogFields(spanlog.Error(resultVar1)) 14121 ext.Error.Set(span, true) 14122 } 14123 14124 return resultVar0, resultVar1 14125 } 14126 14127 func (a *OpenTracingAppLayer) SearchUsersInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14128 origCtx := a.ctx 14129 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInGroup") 14130 14131 a.ctx = newCtx 14132 a.app.Srv().Store.SetContext(newCtx) 14133 defer func() { 14134 a.app.Srv().Store.SetContext(origCtx) 14135 a.ctx = origCtx 14136 }() 14137 14138 defer span.Finish() 14139 resultVar0, resultVar1 := a.app.SearchUsersInGroup(groupID, term, options) 14140 14141 if resultVar1 != nil { 14142 span.LogFields(spanlog.Error(resultVar1)) 14143 ext.Error.Set(span, true) 14144 } 14145 14146 return resultVar0, resultVar1 14147 } 14148 14149 func (a *OpenTracingAppLayer) SearchUsersInTeam(teamID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14150 origCtx := a.ctx 14151 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInTeam") 14152 14153 a.ctx = newCtx 14154 a.app.Srv().Store.SetContext(newCtx) 14155 defer func() { 14156 a.app.Srv().Store.SetContext(origCtx) 14157 a.ctx = origCtx 14158 }() 14159 14160 defer span.Finish() 14161 resultVar0, resultVar1 := a.app.SearchUsersInTeam(teamID, term, options) 14162 14163 if resultVar1 != nil { 14164 span.LogFields(spanlog.Error(resultVar1)) 14165 ext.Error.Set(span, true) 14166 } 14167 14168 return resultVar0, resultVar1 14169 } 14170 14171 func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamID string, channelID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14172 origCtx := a.ctx 14173 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInChannel") 14174 14175 a.ctx = newCtx 14176 a.app.Srv().Store.SetContext(newCtx) 14177 defer func() { 14178 a.app.Srv().Store.SetContext(origCtx) 14179 a.ctx = origCtx 14180 }() 14181 14182 defer span.Finish() 14183 resultVar0, resultVar1 := a.app.SearchUsersNotInChannel(teamID, channelID, term, options) 14184 14185 if resultVar1 != nil { 14186 span.LogFields(spanlog.Error(resultVar1)) 14187 ext.Error.Set(span, true) 14188 } 14189 14190 return resultVar0, resultVar1 14191 } 14192 14193 func (a *OpenTracingAppLayer) SearchUsersNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14194 origCtx := a.ctx 14195 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInTeam") 14196 14197 a.ctx = newCtx 14198 a.app.Srv().Store.SetContext(newCtx) 14199 defer func() { 14200 a.app.Srv().Store.SetContext(origCtx) 14201 a.ctx = origCtx 14202 }() 14203 14204 defer span.Finish() 14205 resultVar0, resultVar1 := a.app.SearchUsersNotInTeam(notInTeamId, term, options) 14206 14207 if resultVar1 != nil { 14208 span.LogFields(spanlog.Error(resultVar1)) 14209 ext.Error.Set(span, true) 14210 } 14211 14212 return resultVar0, resultVar1 14213 } 14214 14215 func (a *OpenTracingAppLayer) SearchUsersWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 14216 origCtx := a.ctx 14217 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersWithoutTeam") 14218 14219 a.ctx = newCtx 14220 a.app.Srv().Store.SetContext(newCtx) 14221 defer func() { 14222 a.app.Srv().Store.SetContext(origCtx) 14223 a.ctx = origCtx 14224 }() 14225 14226 defer span.Finish() 14227 resultVar0, resultVar1 := a.app.SearchUsersWithoutTeam(term, options) 14228 14229 if resultVar1 != nil { 14230 span.LogFields(spanlog.Error(resultVar1)) 14231 ext.Error.Set(span, true) 14232 } 14233 14234 return resultVar0, resultVar1 14235 } 14236 14237 func (a *OpenTracingAppLayer) SendAckToPushProxy(ack *model.PushNotificationAck) error { 14238 origCtx := a.ctx 14239 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAckToPushProxy") 14240 14241 a.ctx = newCtx 14242 a.app.Srv().Store.SetContext(newCtx) 14243 defer func() { 14244 a.app.Srv().Store.SetContext(origCtx) 14245 a.ctx = origCtx 14246 }() 14247 14248 defer span.Finish() 14249 resultVar0 := a.app.SendAckToPushProxy(ack) 14250 14251 if resultVar0 != nil { 14252 span.LogFields(spanlog.Error(resultVar0)) 14253 ext.Error.Set(span, true) 14254 } 14255 14256 return resultVar0 14257 } 14258 14259 func (a *OpenTracingAppLayer) SendAdminUpgradeRequestEmail(username string, subscription *model.Subscription, action string) *model.AppError { 14260 origCtx := a.ctx 14261 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAdminUpgradeRequestEmail") 14262 14263 a.ctx = newCtx 14264 a.app.Srv().Store.SetContext(newCtx) 14265 defer func() { 14266 a.app.Srv().Store.SetContext(origCtx) 14267 a.ctx = origCtx 14268 }() 14269 14270 defer span.Finish() 14271 resultVar0 := a.app.SendAdminUpgradeRequestEmail(username, subscription, action) 14272 14273 if resultVar0 != nil { 14274 span.LogFields(spanlog.Error(resultVar0)) 14275 ext.Error.Set(span, true) 14276 } 14277 14278 return resultVar0 14279 } 14280 14281 func (a *OpenTracingAppLayer) SendAutoResponse(c *request.Context, channel *model.Channel, receiver *model.User, post *model.Post) (bool, *model.AppError) { 14282 origCtx := a.ctx 14283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponse") 14284 14285 a.ctx = newCtx 14286 a.app.Srv().Store.SetContext(newCtx) 14287 defer func() { 14288 a.app.Srv().Store.SetContext(origCtx) 14289 a.ctx = origCtx 14290 }() 14291 14292 defer span.Finish() 14293 resultVar0, resultVar1 := a.app.SendAutoResponse(c, channel, receiver, post) 14294 14295 if resultVar1 != nil { 14296 span.LogFields(spanlog.Error(resultVar1)) 14297 ext.Error.Set(span, true) 14298 } 14299 14300 return resultVar0, resultVar1 14301 } 14302 14303 func (a *OpenTracingAppLayer) SendAutoResponseIfNecessary(c *request.Context, channel *model.Channel, sender *model.User, post *model.Post) (bool, *model.AppError) { 14304 origCtx := a.ctx 14305 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponseIfNecessary") 14306 14307 a.ctx = newCtx 14308 a.app.Srv().Store.SetContext(newCtx) 14309 defer func() { 14310 a.app.Srv().Store.SetContext(origCtx) 14311 a.ctx = origCtx 14312 }() 14313 14314 defer span.Finish() 14315 resultVar0, resultVar1 := a.app.SendAutoResponseIfNecessary(c, channel, sender, post) 14316 14317 if resultVar1 != nil { 14318 span.LogFields(spanlog.Error(resultVar1)) 14319 ext.Error.Set(span, true) 14320 } 14321 14322 return resultVar0, resultVar1 14323 } 14324 14325 func (a *OpenTracingAppLayer) SendCloudTrialEndWarningEmail(trialEndDate string, siteURL string) *model.AppError { 14326 origCtx := a.ctx 14327 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendCloudTrialEndWarningEmail") 14328 14329 a.ctx = newCtx 14330 a.app.Srv().Store.SetContext(newCtx) 14331 defer func() { 14332 a.app.Srv().Store.SetContext(origCtx) 14333 a.ctx = origCtx 14334 }() 14335 14336 defer span.Finish() 14337 resultVar0 := a.app.SendCloudTrialEndWarningEmail(trialEndDate, siteURL) 14338 14339 if resultVar0 != nil { 14340 span.LogFields(spanlog.Error(resultVar0)) 14341 ext.Error.Set(span, true) 14342 } 14343 14344 return resultVar0 14345 } 14346 14347 func (a *OpenTracingAppLayer) SendCloudTrialEndedEmail() *model.AppError { 14348 origCtx := a.ctx 14349 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendCloudTrialEndedEmail") 14350 14351 a.ctx = newCtx 14352 a.app.Srv().Store.SetContext(newCtx) 14353 defer func() { 14354 a.app.Srv().Store.SetContext(origCtx) 14355 a.ctx = origCtx 14356 }() 14357 14358 defer span.Finish() 14359 resultVar0 := a.app.SendCloudTrialEndedEmail() 14360 14361 if resultVar0 != nil { 14362 span.LogFields(spanlog.Error(resultVar0)) 14363 ext.Error.Set(span, true) 14364 } 14365 14366 return resultVar0 14367 } 14368 14369 func (a *OpenTracingAppLayer) SendEmailVerification(user *model.User, newEmail string, redirect string) *model.AppError { 14370 origCtx := a.ctx 14371 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEmailVerification") 14372 14373 a.ctx = newCtx 14374 a.app.Srv().Store.SetContext(newCtx) 14375 defer func() { 14376 a.app.Srv().Store.SetContext(origCtx) 14377 a.ctx = origCtx 14378 }() 14379 14380 defer span.Finish() 14381 resultVar0 := a.app.SendEmailVerification(user, newEmail, redirect) 14382 14383 if resultVar0 != nil { 14384 span.LogFields(spanlog.Error(resultVar0)) 14385 ext.Error.Set(span, true) 14386 } 14387 14388 return resultVar0 14389 } 14390 14391 func (a *OpenTracingAppLayer) SendEphemeralPost(userID string, post *model.Post) *model.Post { 14392 origCtx := a.ctx 14393 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEphemeralPost") 14394 14395 a.ctx = newCtx 14396 a.app.Srv().Store.SetContext(newCtx) 14397 defer func() { 14398 a.app.Srv().Store.SetContext(origCtx) 14399 a.ctx = origCtx 14400 }() 14401 14402 defer span.Finish() 14403 resultVar0 := a.app.SendEphemeralPost(userID, post) 14404 14405 return resultVar0 14406 } 14407 14408 func (a *OpenTracingAppLayer) SendNoCardPaymentFailedEmail() *model.AppError { 14409 origCtx := a.ctx 14410 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNoCardPaymentFailedEmail") 14411 14412 a.ctx = newCtx 14413 a.app.Srv().Store.SetContext(newCtx) 14414 defer func() { 14415 a.app.Srv().Store.SetContext(origCtx) 14416 a.ctx = origCtx 14417 }() 14418 14419 defer span.Finish() 14420 resultVar0 := a.app.SendNoCardPaymentFailedEmail() 14421 14422 if resultVar0 != nil { 14423 span.LogFields(spanlog.Error(resultVar0)) 14424 ext.Error.Set(span, true) 14425 } 14426 14427 return resultVar0 14428 } 14429 14430 func (a *OpenTracingAppLayer) SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error) { 14431 origCtx := a.ctx 14432 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNotifications") 14433 14434 a.ctx = newCtx 14435 a.app.Srv().Store.SetContext(newCtx) 14436 defer func() { 14437 a.app.Srv().Store.SetContext(origCtx) 14438 a.ctx = origCtx 14439 }() 14440 14441 defer span.Finish() 14442 resultVar0, resultVar1 := a.app.SendNotifications(post, team, channel, sender, parentPostList, setOnline) 14443 14444 if resultVar1 != nil { 14445 span.LogFields(spanlog.Error(resultVar1)) 14446 ext.Error.Set(span, true) 14447 } 14448 14449 return resultVar0, resultVar1 14450 } 14451 14452 func (a *OpenTracingAppLayer) SendPasswordReset(email string, siteURL string) (bool, *model.AppError) { 14453 origCtx := a.ctx 14454 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPasswordReset") 14455 14456 a.ctx = newCtx 14457 a.app.Srv().Store.SetContext(newCtx) 14458 defer func() { 14459 a.app.Srv().Store.SetContext(origCtx) 14460 a.ctx = origCtx 14461 }() 14462 14463 defer span.Finish() 14464 resultVar0, resultVar1 := a.app.SendPasswordReset(email, siteURL) 14465 14466 if resultVar1 != nil { 14467 span.LogFields(spanlog.Error(resultVar1)) 14468 ext.Error.Set(span, true) 14469 } 14470 14471 return resultVar0, resultVar1 14472 } 14473 14474 func (a *OpenTracingAppLayer) SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError { 14475 origCtx := a.ctx 14476 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPaymentFailedEmail") 14477 14478 a.ctx = newCtx 14479 a.app.Srv().Store.SetContext(newCtx) 14480 defer func() { 14481 a.app.Srv().Store.SetContext(origCtx) 14482 a.ctx = origCtx 14483 }() 14484 14485 defer span.Finish() 14486 resultVar0 := a.app.SendPaymentFailedEmail(failedPayment) 14487 14488 if resultVar0 != nil { 14489 span.LogFields(spanlog.Error(resultVar0)) 14490 ext.Error.Set(span, true) 14491 } 14492 14493 return resultVar0 14494 } 14495 14496 func (a *OpenTracingAppLayer) ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, sourcePluginId string, destinationPluginId string) { 14497 origCtx := a.ctx 14498 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServeInterPluginRequest") 14499 14500 a.ctx = newCtx 14501 a.app.Srv().Store.SetContext(newCtx) 14502 defer func() { 14503 a.app.Srv().Store.SetContext(origCtx) 14504 a.ctx = origCtx 14505 }() 14506 14507 defer span.Finish() 14508 a.app.ServeInterPluginRequest(w, r, sourcePluginId, destinationPluginId) 14509 } 14510 14511 func (a *OpenTracingAppLayer) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool { 14512 origCtx := a.ctx 14513 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionTo") 14514 14515 a.ctx = newCtx 14516 a.app.Srv().Store.SetContext(newCtx) 14517 defer func() { 14518 a.app.Srv().Store.SetContext(origCtx) 14519 a.ctx = origCtx 14520 }() 14521 14522 defer span.Finish() 14523 resultVar0 := a.app.SessionHasPermissionTo(session, permission) 14524 14525 return resultVar0 14526 } 14527 14528 func (a *OpenTracingAppLayer) SessionHasPermissionToAny(session model.Session, permissions []*model.Permission) bool { 14529 origCtx := a.ctx 14530 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToAny") 14531 14532 a.ctx = newCtx 14533 a.app.Srv().Store.SetContext(newCtx) 14534 defer func() { 14535 a.app.Srv().Store.SetContext(origCtx) 14536 a.ctx = origCtx 14537 }() 14538 14539 defer span.Finish() 14540 resultVar0 := a.app.SessionHasPermissionToAny(session, permissions) 14541 14542 return resultVar0 14543 } 14544 14545 func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Session, userID string, teamID string, categoryId string) bool { 14546 origCtx := a.ctx 14547 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToCategory") 14548 14549 a.ctx = newCtx 14550 a.app.Srv().Store.SetContext(newCtx) 14551 defer func() { 14552 a.app.Srv().Store.SetContext(origCtx) 14553 a.ctx = origCtx 14554 }() 14555 14556 defer span.Finish() 14557 resultVar0 := a.app.SessionHasPermissionToCategory(session, userID, teamID, categoryId) 14558 14559 return resultVar0 14560 } 14561 14562 func (a *OpenTracingAppLayer) SessionHasPermissionToChannel(session model.Session, channelID string, permission *model.Permission) bool { 14563 origCtx := a.ctx 14564 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannel") 14565 14566 a.ctx = newCtx 14567 a.app.Srv().Store.SetContext(newCtx) 14568 defer func() { 14569 a.app.Srv().Store.SetContext(origCtx) 14570 a.ctx = origCtx 14571 }() 14572 14573 defer span.Finish() 14574 resultVar0 := a.app.SessionHasPermissionToChannel(session, channelID, permission) 14575 14576 return resultVar0 14577 } 14578 14579 func (a *OpenTracingAppLayer) SessionHasPermissionToChannelByPost(session model.Session, postID string, permission *model.Permission) bool { 14580 origCtx := a.ctx 14581 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannelByPost") 14582 14583 a.ctx = newCtx 14584 a.app.Srv().Store.SetContext(newCtx) 14585 defer func() { 14586 a.app.Srv().Store.SetContext(origCtx) 14587 a.ctx = origCtx 14588 }() 14589 14590 defer span.Finish() 14591 resultVar0 := a.app.SessionHasPermissionToChannelByPost(session, postID, permission) 14592 14593 return resultVar0 14594 } 14595 14596 func (a *OpenTracingAppLayer) SessionHasPermissionToCreateJob(session model.Session, job *model.Job) (bool, *model.Permission) { 14597 origCtx := a.ctx 14598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToCreateJob") 14599 14600 a.ctx = newCtx 14601 a.app.Srv().Store.SetContext(newCtx) 14602 defer func() { 14603 a.app.Srv().Store.SetContext(origCtx) 14604 a.ctx = origCtx 14605 }() 14606 14607 defer span.Finish() 14608 resultVar0, resultVar1 := a.app.SessionHasPermissionToCreateJob(session, job) 14609 14610 return resultVar0, resultVar1 14611 } 14612 14613 func (a *OpenTracingAppLayer) SessionHasPermissionToManageBot(session model.Session, botUserId string) *model.AppError { 14614 origCtx := a.ctx 14615 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToManageBot") 14616 14617 a.ctx = newCtx 14618 a.app.Srv().Store.SetContext(newCtx) 14619 defer func() { 14620 a.app.Srv().Store.SetContext(origCtx) 14621 a.ctx = origCtx 14622 }() 14623 14624 defer span.Finish() 14625 resultVar0 := a.app.SessionHasPermissionToManageBot(session, botUserId) 14626 14627 if resultVar0 != nil { 14628 span.LogFields(spanlog.Error(resultVar0)) 14629 ext.Error.Set(span, true) 14630 } 14631 14632 return resultVar0 14633 } 14634 14635 func (a *OpenTracingAppLayer) SessionHasPermissionToReadJob(session model.Session, jobType string) (bool, *model.Permission) { 14636 origCtx := a.ctx 14637 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToReadJob") 14638 14639 a.ctx = newCtx 14640 a.app.Srv().Store.SetContext(newCtx) 14641 defer func() { 14642 a.app.Srv().Store.SetContext(origCtx) 14643 a.ctx = origCtx 14644 }() 14645 14646 defer span.Finish() 14647 resultVar0, resultVar1 := a.app.SessionHasPermissionToReadJob(session, jobType) 14648 14649 return resultVar0, resultVar1 14650 } 14651 14652 func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool { 14653 origCtx := a.ctx 14654 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToTeam") 14655 14656 a.ctx = newCtx 14657 a.app.Srv().Store.SetContext(newCtx) 14658 defer func() { 14659 a.app.Srv().Store.SetContext(origCtx) 14660 a.ctx = origCtx 14661 }() 14662 14663 defer span.Finish() 14664 resultVar0 := a.app.SessionHasPermissionToTeam(session, teamID, permission) 14665 14666 return resultVar0 14667 } 14668 14669 func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userID string) bool { 14670 origCtx := a.ctx 14671 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUser") 14672 14673 a.ctx = newCtx 14674 a.app.Srv().Store.SetContext(newCtx) 14675 defer func() { 14676 a.app.Srv().Store.SetContext(origCtx) 14677 a.ctx = origCtx 14678 }() 14679 14680 defer span.Finish() 14681 resultVar0 := a.app.SessionHasPermissionToUser(session, userID) 14682 14683 return resultVar0 14684 } 14685 14686 func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Session, userID string) bool { 14687 origCtx := a.ctx 14688 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUserOrBot") 14689 14690 a.ctx = newCtx 14691 a.app.Srv().Store.SetContext(newCtx) 14692 defer func() { 14693 a.app.Srv().Store.SetContext(origCtx) 14694 a.ctx = origCtx 14695 }() 14696 14697 defer span.Finish() 14698 resultVar0 := a.app.SessionHasPermissionToUserOrBot(session, userID) 14699 14700 return resultVar0 14701 } 14702 14703 func (a *OpenTracingAppLayer) SessionIsRegistered(session model.Session) bool { 14704 origCtx := a.ctx 14705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionIsRegistered") 14706 14707 a.ctx = newCtx 14708 a.app.Srv().Store.SetContext(newCtx) 14709 defer func() { 14710 a.app.Srv().Store.SetContext(origCtx) 14711 a.ctx = origCtx 14712 }() 14713 14714 defer span.Finish() 14715 resultVar0 := a.app.SessionIsRegistered(session) 14716 14717 return resultVar0 14718 } 14719 14720 func (a *OpenTracingAppLayer) SetActiveChannel(userID string, channelID string) *model.AppError { 14721 origCtx := a.ctx 14722 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetActiveChannel") 14723 14724 a.ctx = newCtx 14725 a.app.Srv().Store.SetContext(newCtx) 14726 defer func() { 14727 a.app.Srv().Store.SetContext(origCtx) 14728 a.ctx = origCtx 14729 }() 14730 14731 defer span.Finish() 14732 resultVar0 := a.app.SetActiveChannel(userID, channelID) 14733 14734 if resultVar0 != nil { 14735 span.LogFields(spanlog.Error(resultVar0)) 14736 ext.Error.Set(span, true) 14737 } 14738 14739 return resultVar0 14740 } 14741 14742 func (a *OpenTracingAppLayer) SetAutoResponderStatus(user *model.User, oldNotifyProps model.StringMap) { 14743 origCtx := a.ctx 14744 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetAutoResponderStatus") 14745 14746 a.ctx = newCtx 14747 a.app.Srv().Store.SetContext(newCtx) 14748 defer func() { 14749 a.app.Srv().Store.SetContext(origCtx) 14750 a.ctx = origCtx 14751 }() 14752 14753 defer span.Finish() 14754 a.app.SetAutoResponderStatus(user, oldNotifyProps) 14755 } 14756 14757 func (a *OpenTracingAppLayer) SetBotIconImage(botUserId string, file io.ReadSeeker) *model.AppError { 14758 origCtx := a.ctx 14759 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImage") 14760 14761 a.ctx = newCtx 14762 a.app.Srv().Store.SetContext(newCtx) 14763 defer func() { 14764 a.app.Srv().Store.SetContext(origCtx) 14765 a.ctx = origCtx 14766 }() 14767 14768 defer span.Finish() 14769 resultVar0 := a.app.SetBotIconImage(botUserId, file) 14770 14771 if resultVar0 != nil { 14772 span.LogFields(spanlog.Error(resultVar0)) 14773 ext.Error.Set(span, true) 14774 } 14775 14776 return resultVar0 14777 } 14778 14779 func (a *OpenTracingAppLayer) SetBotIconImageFromMultiPartFile(botUserId string, imageData *multipart.FileHeader) *model.AppError { 14780 origCtx := a.ctx 14781 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImageFromMultiPartFile") 14782 14783 a.ctx = newCtx 14784 a.app.Srv().Store.SetContext(newCtx) 14785 defer func() { 14786 a.app.Srv().Store.SetContext(origCtx) 14787 a.ctx = origCtx 14788 }() 14789 14790 defer span.Finish() 14791 resultVar0 := a.app.SetBotIconImageFromMultiPartFile(botUserId, imageData) 14792 14793 if resultVar0 != nil { 14794 span.LogFields(spanlog.Error(resultVar0)) 14795 ext.Error.Set(span, true) 14796 } 14797 14798 return resultVar0 14799 } 14800 14801 func (a *OpenTracingAppLayer) SetCustomStatus(userID string, cs *model.CustomStatus) *model.AppError { 14802 origCtx := a.ctx 14803 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetCustomStatus") 14804 14805 a.ctx = newCtx 14806 a.app.Srv().Store.SetContext(newCtx) 14807 defer func() { 14808 a.app.Srv().Store.SetContext(origCtx) 14809 a.ctx = origCtx 14810 }() 14811 14812 defer span.Finish() 14813 resultVar0 := a.app.SetCustomStatus(userID, cs) 14814 14815 if resultVar0 != nil { 14816 span.LogFields(spanlog.Error(resultVar0)) 14817 ext.Error.Set(span, true) 14818 } 14819 14820 return resultVar0 14821 } 14822 14823 func (a *OpenTracingAppLayer) SetDefaultProfileImage(user *model.User) *model.AppError { 14824 origCtx := a.ctx 14825 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDefaultProfileImage") 14826 14827 a.ctx = newCtx 14828 a.app.Srv().Store.SetContext(newCtx) 14829 defer func() { 14830 a.app.Srv().Store.SetContext(origCtx) 14831 a.ctx = origCtx 14832 }() 14833 14834 defer span.Finish() 14835 resultVar0 := a.app.SetDefaultProfileImage(user) 14836 14837 if resultVar0 != nil { 14838 span.LogFields(spanlog.Error(resultVar0)) 14839 ext.Error.Set(span, true) 14840 } 14841 14842 return resultVar0 14843 } 14844 14845 func (a *OpenTracingAppLayer) SetPhase2PermissionsMigrationStatus(isComplete bool) error { 14846 origCtx := a.ctx 14847 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPhase2PermissionsMigrationStatus") 14848 14849 a.ctx = newCtx 14850 a.app.Srv().Store.SetContext(newCtx) 14851 defer func() { 14852 a.app.Srv().Store.SetContext(origCtx) 14853 a.ctx = origCtx 14854 }() 14855 14856 defer span.Finish() 14857 resultVar0 := a.app.SetPhase2PermissionsMigrationStatus(isComplete) 14858 14859 if resultVar0 != nil { 14860 span.LogFields(spanlog.Error(resultVar0)) 14861 ext.Error.Set(span, true) 14862 } 14863 14864 return resultVar0 14865 } 14866 14867 func (a *OpenTracingAppLayer) SetPluginKey(pluginID string, key string, value []byte) *model.AppError { 14868 origCtx := a.ctx 14869 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKey") 14870 14871 a.ctx = newCtx 14872 a.app.Srv().Store.SetContext(newCtx) 14873 defer func() { 14874 a.app.Srv().Store.SetContext(origCtx) 14875 a.ctx = origCtx 14876 }() 14877 14878 defer span.Finish() 14879 resultVar0 := a.app.SetPluginKey(pluginID, key, value) 14880 14881 if resultVar0 != nil { 14882 span.LogFields(spanlog.Error(resultVar0)) 14883 ext.Error.Set(span, true) 14884 } 14885 14886 return resultVar0 14887 } 14888 14889 func (a *OpenTracingAppLayer) SetPluginKeyWithExpiry(pluginID string, key string, value []byte, expireInSeconds int64) *model.AppError { 14890 origCtx := a.ctx 14891 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithExpiry") 14892 14893 a.ctx = newCtx 14894 a.app.Srv().Store.SetContext(newCtx) 14895 defer func() { 14896 a.app.Srv().Store.SetContext(origCtx) 14897 a.ctx = origCtx 14898 }() 14899 14900 defer span.Finish() 14901 resultVar0 := a.app.SetPluginKeyWithExpiry(pluginID, key, value, expireInSeconds) 14902 14903 if resultVar0 != nil { 14904 span.LogFields(spanlog.Error(resultVar0)) 14905 ext.Error.Set(span, true) 14906 } 14907 14908 return resultVar0 14909 } 14910 14911 func (a *OpenTracingAppLayer) SetPluginKeyWithOptions(pluginID string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) { 14912 origCtx := a.ctx 14913 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithOptions") 14914 14915 a.ctx = newCtx 14916 a.app.Srv().Store.SetContext(newCtx) 14917 defer func() { 14918 a.app.Srv().Store.SetContext(origCtx) 14919 a.ctx = origCtx 14920 }() 14921 14922 defer span.Finish() 14923 resultVar0, resultVar1 := a.app.SetPluginKeyWithOptions(pluginID, key, value, options) 14924 14925 if resultVar1 != nil { 14926 span.LogFields(spanlog.Error(resultVar1)) 14927 ext.Error.Set(span, true) 14928 } 14929 14930 return resultVar0, resultVar1 14931 } 14932 14933 func (a *OpenTracingAppLayer) SetPluginsEnvironment(pluginsEnvironment *plugin.Environment) { 14934 origCtx := a.ctx 14935 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginsEnvironment") 14936 14937 a.ctx = newCtx 14938 a.app.Srv().Store.SetContext(newCtx) 14939 defer func() { 14940 a.app.Srv().Store.SetContext(origCtx) 14941 a.ctx = origCtx 14942 }() 14943 14944 defer span.Finish() 14945 a.app.SetPluginsEnvironment(pluginsEnvironment) 14946 } 14947 14948 func (a *OpenTracingAppLayer) SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError { 14949 origCtx := a.ctx 14950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImage") 14951 14952 a.ctx = newCtx 14953 a.app.Srv().Store.SetContext(newCtx) 14954 defer func() { 14955 a.app.Srv().Store.SetContext(origCtx) 14956 a.ctx = origCtx 14957 }() 14958 14959 defer span.Finish() 14960 resultVar0 := a.app.SetProfileImage(userID, imageData) 14961 14962 if resultVar0 != nil { 14963 span.LogFields(spanlog.Error(resultVar0)) 14964 ext.Error.Set(span, true) 14965 } 14966 14967 return resultVar0 14968 } 14969 14970 func (a *OpenTracingAppLayer) SetProfileImageFromFile(userID string, file io.Reader) *model.AppError { 14971 origCtx := a.ctx 14972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromFile") 14973 14974 a.ctx = newCtx 14975 a.app.Srv().Store.SetContext(newCtx) 14976 defer func() { 14977 a.app.Srv().Store.SetContext(origCtx) 14978 a.ctx = origCtx 14979 }() 14980 14981 defer span.Finish() 14982 resultVar0 := a.app.SetProfileImageFromFile(userID, file) 14983 14984 if resultVar0 != nil { 14985 span.LogFields(spanlog.Error(resultVar0)) 14986 ext.Error.Set(span, true) 14987 } 14988 14989 return resultVar0 14990 } 14991 14992 func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError { 14993 origCtx := a.ctx 14994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromMultiPartFile") 14995 14996 a.ctx = newCtx 14997 a.app.Srv().Store.SetContext(newCtx) 14998 defer func() { 14999 a.app.Srv().Store.SetContext(origCtx) 15000 a.ctx = origCtx 15001 }() 15002 15003 defer span.Finish() 15004 resultVar0 := a.app.SetProfileImageFromMultiPartFile(userID, file) 15005 15006 if resultVar0 != nil { 15007 span.LogFields(spanlog.Error(resultVar0)) 15008 ext.Error.Set(span, true) 15009 } 15010 15011 return resultVar0 15012 } 15013 15014 func (a *OpenTracingAppLayer) SetRemoteClusterLastPingAt(remoteClusterId string) *model.AppError { 15015 origCtx := a.ctx 15016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetRemoteClusterLastPingAt") 15017 15018 a.ctx = newCtx 15019 a.app.Srv().Store.SetContext(newCtx) 15020 defer func() { 15021 a.app.Srv().Store.SetContext(origCtx) 15022 a.ctx = origCtx 15023 }() 15024 15025 defer span.Finish() 15026 resultVar0 := a.app.SetRemoteClusterLastPingAt(remoteClusterId) 15027 15028 if resultVar0 != nil { 15029 span.LogFields(spanlog.Error(resultVar0)) 15030 ext.Error.Set(span, true) 15031 } 15032 15033 return resultVar0 15034 } 15035 15036 func (a *OpenTracingAppLayer) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError { 15037 origCtx := a.ctx 15038 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSamlIdpCertificateFromMetadata") 15039 15040 a.ctx = newCtx 15041 a.app.Srv().Store.SetContext(newCtx) 15042 defer func() { 15043 a.app.Srv().Store.SetContext(origCtx) 15044 a.ctx = origCtx 15045 }() 15046 15047 defer span.Finish() 15048 resultVar0 := a.app.SetSamlIdpCertificateFromMetadata(data) 15049 15050 if resultVar0 != nil { 15051 span.LogFields(spanlog.Error(resultVar0)) 15052 ext.Error.Set(span, true) 15053 } 15054 15055 return resultVar0 15056 } 15057 15058 func (a *OpenTracingAppLayer) SetSearchEngine(se *searchengine.Broker) { 15059 origCtx := a.ctx 15060 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSearchEngine") 15061 15062 a.ctx = newCtx 15063 a.app.Srv().Store.SetContext(newCtx) 15064 defer func() { 15065 a.app.Srv().Store.SetContext(origCtx) 15066 a.ctx = origCtx 15067 }() 15068 15069 defer span.Finish() 15070 a.app.SetSearchEngine(se) 15071 } 15072 15073 func (a *OpenTracingAppLayer) SetSessionExpireInDays(session *model.Session, days int) { 15074 origCtx := a.ctx 15075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSessionExpireInDays") 15076 15077 a.ctx = newCtx 15078 a.app.Srv().Store.SetContext(newCtx) 15079 defer func() { 15080 a.app.Srv().Store.SetContext(origCtx) 15081 a.ctx = origCtx 15082 }() 15083 15084 defer span.Finish() 15085 a.app.SetSessionExpireInDays(session, days) 15086 } 15087 15088 func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userID string, manual bool) { 15089 origCtx := a.ctx 15090 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusAwayIfNeeded") 15091 15092 a.ctx = newCtx 15093 a.app.Srv().Store.SetContext(newCtx) 15094 defer func() { 15095 a.app.Srv().Store.SetContext(origCtx) 15096 a.ctx = origCtx 15097 }() 15098 15099 defer span.Finish() 15100 a.app.SetStatusAwayIfNeeded(userID, manual) 15101 } 15102 15103 func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userID string) { 15104 origCtx := a.ctx 15105 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturb") 15106 15107 a.ctx = newCtx 15108 a.app.Srv().Store.SetContext(newCtx) 15109 defer func() { 15110 a.app.Srv().Store.SetContext(origCtx) 15111 a.ctx = origCtx 15112 }() 15113 15114 defer span.Finish() 15115 a.app.SetStatusDoNotDisturb(userID) 15116 } 15117 15118 func (a *OpenTracingAppLayer) SetStatusDoNotDisturbTimed(userId string, endtime int64) { 15119 origCtx := a.ctx 15120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturbTimed") 15121 15122 a.ctx = newCtx 15123 a.app.Srv().Store.SetContext(newCtx) 15124 defer func() { 15125 a.app.Srv().Store.SetContext(origCtx) 15126 a.ctx = origCtx 15127 }() 15128 15129 defer span.Finish() 15130 a.app.SetStatusDoNotDisturbTimed(userId, endtime) 15131 } 15132 15133 func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userID string, activityAt int64) { 15134 origCtx := a.ctx 15135 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusLastActivityAt") 15136 15137 a.ctx = newCtx 15138 a.app.Srv().Store.SetContext(newCtx) 15139 defer func() { 15140 a.app.Srv().Store.SetContext(origCtx) 15141 a.ctx = origCtx 15142 }() 15143 15144 defer span.Finish() 15145 a.app.SetStatusLastActivityAt(userID, activityAt) 15146 } 15147 15148 func (a *OpenTracingAppLayer) SetStatusOffline(userID string, manual bool) { 15149 origCtx := a.ctx 15150 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOffline") 15151 15152 a.ctx = newCtx 15153 a.app.Srv().Store.SetContext(newCtx) 15154 defer func() { 15155 a.app.Srv().Store.SetContext(origCtx) 15156 a.ctx = origCtx 15157 }() 15158 15159 defer span.Finish() 15160 a.app.SetStatusOffline(userID, manual) 15161 } 15162 15163 func (a *OpenTracingAppLayer) SetStatusOnline(userID string, manual bool) { 15164 origCtx := a.ctx 15165 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOnline") 15166 15167 a.ctx = newCtx 15168 a.app.Srv().Store.SetContext(newCtx) 15169 defer func() { 15170 a.app.Srv().Store.SetContext(origCtx) 15171 a.ctx = origCtx 15172 }() 15173 15174 defer span.Finish() 15175 a.app.SetStatusOnline(userID, manual) 15176 } 15177 15178 func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userID string) { 15179 origCtx := a.ctx 15180 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOutOfOffice") 15181 15182 a.ctx = newCtx 15183 a.app.Srv().Store.SetContext(newCtx) 15184 defer func() { 15185 a.app.Srv().Store.SetContext(origCtx) 15186 a.ctx = origCtx 15187 }() 15188 15189 defer span.Finish() 15190 a.app.SetStatusOutOfOffice(userID) 15191 } 15192 15193 func (a *OpenTracingAppLayer) SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError { 15194 origCtx := a.ctx 15195 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIcon") 15196 15197 a.ctx = newCtx 15198 a.app.Srv().Store.SetContext(newCtx) 15199 defer func() { 15200 a.app.Srv().Store.SetContext(origCtx) 15201 a.ctx = origCtx 15202 }() 15203 15204 defer span.Finish() 15205 resultVar0 := a.app.SetTeamIcon(teamID, imageData) 15206 15207 if resultVar0 != nil { 15208 span.LogFields(spanlog.Error(resultVar0)) 15209 ext.Error.Set(span, true) 15210 } 15211 15212 return resultVar0 15213 } 15214 15215 func (a *OpenTracingAppLayer) SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError { 15216 origCtx := a.ctx 15217 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromFile") 15218 15219 a.ctx = newCtx 15220 a.app.Srv().Store.SetContext(newCtx) 15221 defer func() { 15222 a.app.Srv().Store.SetContext(origCtx) 15223 a.ctx = origCtx 15224 }() 15225 15226 defer span.Finish() 15227 resultVar0 := a.app.SetTeamIconFromFile(team, file) 15228 15229 if resultVar0 != nil { 15230 span.LogFields(spanlog.Error(resultVar0)) 15231 ext.Error.Set(span, true) 15232 } 15233 15234 return resultVar0 15235 } 15236 15237 func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError { 15238 origCtx := a.ctx 15239 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromMultiPartFile") 15240 15241 a.ctx = newCtx 15242 a.app.Srv().Store.SetContext(newCtx) 15243 defer func() { 15244 a.app.Srv().Store.SetContext(origCtx) 15245 a.ctx = origCtx 15246 }() 15247 15248 defer span.Finish() 15249 resultVar0 := a.app.SetTeamIconFromMultiPartFile(teamID, file) 15250 15251 if resultVar0 != nil { 15252 span.LogFields(spanlog.Error(resultVar0)) 15253 ext.Error.Set(span, true) 15254 } 15255 15256 return resultVar0 15257 } 15258 15259 func (a *OpenTracingAppLayer) SlackImport(c *request.Context, fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) { 15260 origCtx := a.ctx 15261 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackImport") 15262 15263 a.ctx = newCtx 15264 a.app.Srv().Store.SetContext(newCtx) 15265 defer func() { 15266 a.app.Srv().Store.SetContext(origCtx) 15267 a.ctx = origCtx 15268 }() 15269 15270 defer span.Finish() 15271 resultVar0, resultVar1 := a.app.SlackImport(c, fileData, fileSize, teamID) 15272 15273 if resultVar0 != nil { 15274 span.LogFields(spanlog.Error(resultVar0)) 15275 ext.Error.Set(span, true) 15276 } 15277 15278 return resultVar0, resultVar1 15279 } 15280 15281 func (a *OpenTracingAppLayer) SoftDeleteTeam(teamID string) *model.AppError { 15282 origCtx := a.ctx 15283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SoftDeleteTeam") 15284 15285 a.ctx = newCtx 15286 a.app.Srv().Store.SetContext(newCtx) 15287 defer func() { 15288 a.app.Srv().Store.SetContext(origCtx) 15289 a.ctx = origCtx 15290 }() 15291 15292 defer span.Finish() 15293 resultVar0 := a.app.SoftDeleteTeam(teamID) 15294 15295 if resultVar0 != nil { 15296 span.LogFields(spanlog.Error(resultVar0)) 15297 ext.Error.Set(span, true) 15298 } 15299 15300 return resultVar0 15301 } 15302 15303 func (a *OpenTracingAppLayer) StartTrackRecord(trackRecordId string) (*model.TrackRecord, *model.AppError) { 15304 origCtx := a.ctx 15305 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.StartTrackRecord") 15306 15307 a.ctx = newCtx 15308 a.app.Srv().Store.SetContext(newCtx) 15309 defer func() { 15310 a.app.Srv().Store.SetContext(origCtx) 15311 a.ctx = origCtx 15312 }() 15313 15314 defer span.Finish() 15315 resultVar0, resultVar1 := a.app.StartTrackRecord(trackRecordId) 15316 15317 if resultVar1 != nil { 15318 span.LogFields(spanlog.Error(resultVar1)) 15319 ext.Error.Set(span, true) 15320 } 15321 15322 return resultVar0, resultVar1 15323 } 15324 15325 func (a *OpenTracingAppLayer) SubmitInteractiveDialog(c *request.Context, request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) { 15326 origCtx := a.ctx 15327 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SubmitInteractiveDialog") 15328 15329 a.ctx = newCtx 15330 a.app.Srv().Store.SetContext(newCtx) 15331 defer func() { 15332 a.app.Srv().Store.SetContext(origCtx) 15333 a.ctx = origCtx 15334 }() 15335 15336 defer span.Finish() 15337 resultVar0, resultVar1 := a.app.SubmitInteractiveDialog(c, request) 15338 15339 if resultVar1 != nil { 15340 span.LogFields(spanlog.Error(resultVar1)) 15341 ext.Error.Set(span, true) 15342 } 15343 15344 return resultVar0, resultVar1 15345 } 15346 15347 func (a *OpenTracingAppLayer) SwitchEmailToLdap(email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) { 15348 origCtx := a.ctx 15349 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToLdap") 15350 15351 a.ctx = newCtx 15352 a.app.Srv().Store.SetContext(newCtx) 15353 defer func() { 15354 a.app.Srv().Store.SetContext(origCtx) 15355 a.ctx = origCtx 15356 }() 15357 15358 defer span.Finish() 15359 resultVar0, resultVar1 := a.app.SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword) 15360 15361 if resultVar1 != nil { 15362 span.LogFields(spanlog.Error(resultVar1)) 15363 ext.Error.Set(span, true) 15364 } 15365 15366 return resultVar0, resultVar1 15367 } 15368 15369 func (a *OpenTracingAppLayer) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) { 15370 origCtx := a.ctx 15371 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToOAuth") 15372 15373 a.ctx = newCtx 15374 a.app.Srv().Store.SetContext(newCtx) 15375 defer func() { 15376 a.app.Srv().Store.SetContext(origCtx) 15377 a.ctx = origCtx 15378 }() 15379 15380 defer span.Finish() 15381 resultVar0, resultVar1 := a.app.SwitchEmailToOAuth(w, r, email, password, code, service) 15382 15383 if resultVar1 != nil { 15384 span.LogFields(spanlog.Error(resultVar1)) 15385 ext.Error.Set(span, true) 15386 } 15387 15388 return resultVar0, resultVar1 15389 } 15390 15391 func (a *OpenTracingAppLayer) SwitchLdapToEmail(ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) { 15392 origCtx := a.ctx 15393 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchLdapToEmail") 15394 15395 a.ctx = newCtx 15396 a.app.Srv().Store.SetContext(newCtx) 15397 defer func() { 15398 a.app.Srv().Store.SetContext(origCtx) 15399 a.ctx = origCtx 15400 }() 15401 15402 defer span.Finish() 15403 resultVar0, resultVar1 := a.app.SwitchLdapToEmail(ldapPassword, code, email, newPassword) 15404 15405 if resultVar1 != nil { 15406 span.LogFields(spanlog.Error(resultVar1)) 15407 ext.Error.Set(span, true) 15408 } 15409 15410 return resultVar0, resultVar1 15411 } 15412 15413 func (a *OpenTracingAppLayer) SwitchOAuthToEmail(email string, password string, requesterId string) (string, *model.AppError) { 15414 origCtx := a.ctx 15415 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchOAuthToEmail") 15416 15417 a.ctx = newCtx 15418 a.app.Srv().Store.SetContext(newCtx) 15419 defer func() { 15420 a.app.Srv().Store.SetContext(origCtx) 15421 a.ctx = origCtx 15422 }() 15423 15424 defer span.Finish() 15425 resultVar0, resultVar1 := a.app.SwitchOAuthToEmail(email, password, requesterId) 15426 15427 if resultVar1 != nil { 15428 span.LogFields(spanlog.Error(resultVar1)) 15429 ext.Error.Set(span, true) 15430 } 15431 15432 return resultVar0, resultVar1 15433 } 15434 15435 func (a *OpenTracingAppLayer) SyncLdap(includeRemovedMembers bool) { 15436 origCtx := a.ctx 15437 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncLdap") 15438 15439 a.ctx = newCtx 15440 a.app.Srv().Store.SetContext(newCtx) 15441 defer func() { 15442 a.app.Srv().Store.SetContext(origCtx) 15443 a.ctx = origCtx 15444 }() 15445 15446 defer span.Finish() 15447 a.app.SyncLdap(includeRemovedMembers) 15448 } 15449 15450 func (a *OpenTracingAppLayer) SyncPlugins() *model.AppError { 15451 origCtx := a.ctx 15452 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPlugins") 15453 15454 a.ctx = newCtx 15455 a.app.Srv().Store.SetContext(newCtx) 15456 defer func() { 15457 a.app.Srv().Store.SetContext(origCtx) 15458 a.ctx = origCtx 15459 }() 15460 15461 defer span.Finish() 15462 resultVar0 := a.app.SyncPlugins() 15463 15464 if resultVar0 != nil { 15465 span.LogFields(spanlog.Error(resultVar0)) 15466 ext.Error.Set(span, true) 15467 } 15468 15469 return resultVar0 15470 } 15471 15472 func (a *OpenTracingAppLayer) SyncPluginsActiveState() { 15473 origCtx := a.ctx 15474 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPluginsActiveState") 15475 15476 a.ctx = newCtx 15477 a.app.Srv().Store.SetContext(newCtx) 15478 defer func() { 15479 a.app.Srv().Store.SetContext(origCtx) 15480 a.ctx = origCtx 15481 }() 15482 15483 defer span.Finish() 15484 a.app.SyncPluginsActiveState() 15485 } 15486 15487 func (a *OpenTracingAppLayer) SyncRolesAndMembership(c *request.Context, syncableID string, syncableType model.GroupSyncableType, includeRemovedMembers bool) { 15488 origCtx := a.ctx 15489 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncRolesAndMembership") 15490 15491 a.ctx = newCtx 15492 a.app.Srv().Store.SetContext(newCtx) 15493 defer func() { 15494 a.app.Srv().Store.SetContext(origCtx) 15495 a.ctx = origCtx 15496 }() 15497 15498 defer span.Finish() 15499 a.app.SyncRolesAndMembership(c, syncableID, syncableType, includeRemovedMembers) 15500 } 15501 15502 func (a *OpenTracingAppLayer) SyncSyncableRoles(syncableID string, syncableType model.GroupSyncableType) *model.AppError { 15503 origCtx := a.ctx 15504 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncSyncableRoles") 15505 15506 a.ctx = newCtx 15507 a.app.Srv().Store.SetContext(newCtx) 15508 defer func() { 15509 a.app.Srv().Store.SetContext(origCtx) 15510 a.ctx = origCtx 15511 }() 15512 15513 defer span.Finish() 15514 resultVar0 := a.app.SyncSyncableRoles(syncableID, syncableType) 15515 15516 if resultVar0 != nil { 15517 span.LogFields(spanlog.Error(resultVar0)) 15518 ext.Error.Set(span, true) 15519 } 15520 15521 return resultVar0 15522 } 15523 15524 func (a *OpenTracingAppLayer) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 15525 origCtx := a.ctx 15526 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersMinusGroupMembers") 15527 15528 a.ctx = newCtx 15529 a.app.Srv().Store.SetContext(newCtx) 15530 defer func() { 15531 a.app.Srv().Store.SetContext(origCtx) 15532 a.ctx = origCtx 15533 }() 15534 15535 defer span.Finish() 15536 resultVar0, resultVar1, resultVar2 := a.app.TeamMembersMinusGroupMembers(teamID, groupIDs, page, perPage) 15537 15538 if resultVar2 != nil { 15539 span.LogFields(spanlog.Error(resultVar2)) 15540 ext.Error.Set(span, true) 15541 } 15542 15543 return resultVar0, resultVar1, resultVar2 15544 } 15545 15546 func (a *OpenTracingAppLayer) TeamMembersToAdd(since int64, teamID *string, includeRemovedMembers bool) ([]*model.UserTeamIDPair, *model.AppError) { 15547 origCtx := a.ctx 15548 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToAdd") 15549 15550 a.ctx = newCtx 15551 a.app.Srv().Store.SetContext(newCtx) 15552 defer func() { 15553 a.app.Srv().Store.SetContext(origCtx) 15554 a.ctx = origCtx 15555 }() 15556 15557 defer span.Finish() 15558 resultVar0, resultVar1 := a.app.TeamMembersToAdd(since, teamID, includeRemovedMembers) 15559 15560 if resultVar1 != nil { 15561 span.LogFields(spanlog.Error(resultVar1)) 15562 ext.Error.Set(span, true) 15563 } 15564 15565 return resultVar0, resultVar1 15566 } 15567 15568 func (a *OpenTracingAppLayer) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError) { 15569 origCtx := a.ctx 15570 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToRemove") 15571 15572 a.ctx = newCtx 15573 a.app.Srv().Store.SetContext(newCtx) 15574 defer func() { 15575 a.app.Srv().Store.SetContext(origCtx) 15576 a.ctx = origCtx 15577 }() 15578 15579 defer span.Finish() 15580 resultVar0, resultVar1 := a.app.TeamMembersToRemove(teamID) 15581 15582 if resultVar1 != nil { 15583 span.LogFields(spanlog.Error(resultVar1)) 15584 ext.Error.Set(span, true) 15585 } 15586 15587 return resultVar0, resultVar1 15588 } 15589 15590 func (a *OpenTracingAppLayer) TelemetryId() string { 15591 origCtx := a.ctx 15592 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TelemetryId") 15593 15594 a.ctx = newCtx 15595 a.app.Srv().Store.SetContext(newCtx) 15596 defer func() { 15597 a.app.Srv().Store.SetContext(origCtx) 15598 a.ctx = origCtx 15599 }() 15600 15601 defer span.Finish() 15602 resultVar0 := a.app.TelemetryId() 15603 15604 return resultVar0 15605 } 15606 15607 func (a *OpenTracingAppLayer) TestElasticsearch(cfg *model.Config) *model.AppError { 15608 origCtx := a.ctx 15609 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestElasticsearch") 15610 15611 a.ctx = newCtx 15612 a.app.Srv().Store.SetContext(newCtx) 15613 defer func() { 15614 a.app.Srv().Store.SetContext(origCtx) 15615 a.ctx = origCtx 15616 }() 15617 15618 defer span.Finish() 15619 resultVar0 := a.app.TestElasticsearch(cfg) 15620 15621 if resultVar0 != nil { 15622 span.LogFields(spanlog.Error(resultVar0)) 15623 ext.Error.Set(span, true) 15624 } 15625 15626 return resultVar0 15627 } 15628 15629 func (a *OpenTracingAppLayer) TestEmail(userID string, cfg *model.Config) *model.AppError { 15630 origCtx := a.ctx 15631 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestEmail") 15632 15633 a.ctx = newCtx 15634 a.app.Srv().Store.SetContext(newCtx) 15635 defer func() { 15636 a.app.Srv().Store.SetContext(origCtx) 15637 a.ctx = origCtx 15638 }() 15639 15640 defer span.Finish() 15641 resultVar0 := a.app.TestEmail(userID, cfg) 15642 15643 if resultVar0 != nil { 15644 span.LogFields(spanlog.Error(resultVar0)) 15645 ext.Error.Set(span, true) 15646 } 15647 15648 return resultVar0 15649 } 15650 15651 func (a *OpenTracingAppLayer) TestFileStoreConnection() *model.AppError { 15652 origCtx := a.ctx 15653 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFileStoreConnection") 15654 15655 a.ctx = newCtx 15656 a.app.Srv().Store.SetContext(newCtx) 15657 defer func() { 15658 a.app.Srv().Store.SetContext(origCtx) 15659 a.ctx = origCtx 15660 }() 15661 15662 defer span.Finish() 15663 resultVar0 := a.app.TestFileStoreConnection() 15664 15665 if resultVar0 != nil { 15666 span.LogFields(spanlog.Error(resultVar0)) 15667 ext.Error.Set(span, true) 15668 } 15669 15670 return resultVar0 15671 } 15672 15673 func (a *OpenTracingAppLayer) TestFileStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { 15674 origCtx := a.ctx 15675 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFileStoreConnectionWithConfig") 15676 15677 a.ctx = newCtx 15678 a.app.Srv().Store.SetContext(newCtx) 15679 defer func() { 15680 a.app.Srv().Store.SetContext(origCtx) 15681 a.ctx = origCtx 15682 }() 15683 15684 defer span.Finish() 15685 resultVar0 := a.app.TestFileStoreConnectionWithConfig(cfg) 15686 15687 if resultVar0 != nil { 15688 span.LogFields(spanlog.Error(resultVar0)) 15689 ext.Error.Set(span, true) 15690 } 15691 15692 return resultVar0 15693 } 15694 15695 func (a *OpenTracingAppLayer) TestLdap() *model.AppError { 15696 origCtx := a.ctx 15697 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestLdap") 15698 15699 a.ctx = newCtx 15700 a.app.Srv().Store.SetContext(newCtx) 15701 defer func() { 15702 a.app.Srv().Store.SetContext(origCtx) 15703 a.ctx = origCtx 15704 }() 15705 15706 defer span.Finish() 15707 resultVar0 := a.app.TestLdap() 15708 15709 if resultVar0 != nil { 15710 span.LogFields(spanlog.Error(resultVar0)) 15711 ext.Error.Set(span, true) 15712 } 15713 15714 return resultVar0 15715 } 15716 15717 func (a *OpenTracingAppLayer) TestSiteURL(siteURL string) *model.AppError { 15718 origCtx := a.ctx 15719 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestSiteURL") 15720 15721 a.ctx = newCtx 15722 a.app.Srv().Store.SetContext(newCtx) 15723 defer func() { 15724 a.app.Srv().Store.SetContext(origCtx) 15725 a.ctx = origCtx 15726 }() 15727 15728 defer span.Finish() 15729 resultVar0 := a.app.TestSiteURL(siteURL) 15730 15731 if resultVar0 != nil { 15732 span.LogFields(spanlog.Error(resultVar0)) 15733 ext.Error.Set(span, true) 15734 } 15735 15736 return resultVar0 15737 } 15738 15739 func (a *OpenTracingAppLayer) ToggleMuteChannel(channelID string, userID string) (*model.ChannelMember, *model.AppError) { 15740 origCtx := a.ctx 15741 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ToggleMuteChannel") 15742 15743 a.ctx = newCtx 15744 a.app.Srv().Store.SetContext(newCtx) 15745 defer func() { 15746 a.app.Srv().Store.SetContext(origCtx) 15747 a.ctx = origCtx 15748 }() 15749 15750 defer span.Finish() 15751 resultVar0, resultVar1 := a.app.ToggleMuteChannel(channelID, userID) 15752 15753 if resultVar1 != nil { 15754 span.LogFields(spanlog.Error(resultVar1)) 15755 ext.Error.Set(span, true) 15756 } 15757 15758 return resultVar0, resultVar1 15759 } 15760 15761 func (a *OpenTracingAppLayer) TotalWebsocketConnections() int { 15762 origCtx := a.ctx 15763 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TotalWebsocketConnections") 15764 15765 a.ctx = newCtx 15766 a.app.Srv().Store.SetContext(newCtx) 15767 defer func() { 15768 a.app.Srv().Store.SetContext(origCtx) 15769 a.ctx = origCtx 15770 }() 15771 15772 defer span.Finish() 15773 resultVar0 := a.app.TotalWebsocketConnections() 15774 15775 return resultVar0 15776 } 15777 15778 func (a *OpenTracingAppLayer) TriggerWebhook(c *request.Context, payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel) { 15779 origCtx := a.ctx 15780 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TriggerWebhook") 15781 15782 a.ctx = newCtx 15783 a.app.Srv().Store.SetContext(newCtx) 15784 defer func() { 15785 a.app.Srv().Store.SetContext(origCtx) 15786 a.ctx = origCtx 15787 }() 15788 15789 defer span.Finish() 15790 a.app.TriggerWebhook(c, payload, hook, post, channel) 15791 } 15792 15793 func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginID string, teamID string, trigger string) { 15794 origCtx := a.ctx 15795 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommand") 15796 15797 a.ctx = newCtx 15798 a.app.Srv().Store.SetContext(newCtx) 15799 defer func() { 15800 a.app.Srv().Store.SetContext(origCtx) 15801 a.ctx = origCtx 15802 }() 15803 15804 defer span.Finish() 15805 a.app.UnregisterPluginCommand(pluginID, teamID, trigger) 15806 } 15807 15808 func (a *OpenTracingAppLayer) UnregisterPluginCommands(pluginID string) { 15809 origCtx := a.ctx 15810 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommands") 15811 15812 a.ctx = newCtx 15813 a.app.Srv().Store.SetContext(newCtx) 15814 defer func() { 15815 a.app.Srv().Store.SetContext(origCtx) 15816 a.ctx = origCtx 15817 }() 15818 15819 defer span.Finish() 15820 a.app.UnregisterPluginCommands(pluginID) 15821 } 15822 15823 func (a *OpenTracingAppLayer) UpdateActive(c *request.Context, user *model.User, active bool) (*model.User, *model.AppError) { 15824 origCtx := a.ctx 15825 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateActive") 15826 15827 a.ctx = newCtx 15828 a.app.Srv().Store.SetContext(newCtx) 15829 defer func() { 15830 a.app.Srv().Store.SetContext(origCtx) 15831 a.ctx = origCtx 15832 }() 15833 15834 defer span.Finish() 15835 resultVar0, resultVar1 := a.app.UpdateActive(c, user, active) 15836 15837 if resultVar1 != nil { 15838 span.LogFields(spanlog.Error(resultVar1)) 15839 ext.Error.Set(span, true) 15840 } 15841 15842 return resultVar0, resultVar1 15843 } 15844 15845 func (a *OpenTracingAppLayer) UpdateBotActive(c *request.Context, botUserId string, active bool) (*model.Bot, *model.AppError) { 15846 origCtx := a.ctx 15847 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotActive") 15848 15849 a.ctx = newCtx 15850 a.app.Srv().Store.SetContext(newCtx) 15851 defer func() { 15852 a.app.Srv().Store.SetContext(origCtx) 15853 a.ctx = origCtx 15854 }() 15855 15856 defer span.Finish() 15857 resultVar0, resultVar1 := a.app.UpdateBotActive(c, botUserId, active) 15858 15859 if resultVar1 != nil { 15860 span.LogFields(spanlog.Error(resultVar1)) 15861 ext.Error.Set(span, true) 15862 } 15863 15864 return resultVar0, resultVar1 15865 } 15866 15867 func (a *OpenTracingAppLayer) UpdateBotOwner(botUserId string, newOwnerId string) (*model.Bot, *model.AppError) { 15868 origCtx := a.ctx 15869 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotOwner") 15870 15871 a.ctx = newCtx 15872 a.app.Srv().Store.SetContext(newCtx) 15873 defer func() { 15874 a.app.Srv().Store.SetContext(origCtx) 15875 a.ctx = origCtx 15876 }() 15877 15878 defer span.Finish() 15879 resultVar0, resultVar1 := a.app.UpdateBotOwner(botUserId, newOwnerId) 15880 15881 if resultVar1 != nil { 15882 span.LogFields(spanlog.Error(resultVar1)) 15883 ext.Error.Set(span, true) 15884 } 15885 15886 return resultVar0, resultVar1 15887 } 15888 15889 func (a *OpenTracingAppLayer) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { 15890 origCtx := a.ctx 15891 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannel") 15892 15893 a.ctx = newCtx 15894 a.app.Srv().Store.SetContext(newCtx) 15895 defer func() { 15896 a.app.Srv().Store.SetContext(origCtx) 15897 a.ctx = origCtx 15898 }() 15899 15900 defer span.Finish() 15901 resultVar0, resultVar1 := a.app.UpdateChannel(channel) 15902 15903 if resultVar1 != nil { 15904 span.LogFields(spanlog.Error(resultVar1)) 15905 ext.Error.Set(span, true) 15906 } 15907 15908 return resultVar0, resultVar1 15909 } 15910 15911 func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIDs []string, userID string) *model.AppError { 15912 origCtx := a.ctx 15913 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelLastViewedAt") 15914 15915 a.ctx = newCtx 15916 a.app.Srv().Store.SetContext(newCtx) 15917 defer func() { 15918 a.app.Srv().Store.SetContext(origCtx) 15919 a.ctx = origCtx 15920 }() 15921 15922 defer span.Finish() 15923 resultVar0 := a.app.UpdateChannelLastViewedAt(channelIDs, userID) 15924 15925 if resultVar0 != nil { 15926 span.LogFields(spanlog.Error(resultVar0)) 15927 ext.Error.Set(span, true) 15928 } 15929 15930 return resultVar0 15931 } 15932 15933 func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]string, channelID string, userID string) (*model.ChannelMember, *model.AppError) { 15934 origCtx := a.ctx 15935 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberNotifyProps") 15936 15937 a.ctx = newCtx 15938 a.app.Srv().Store.SetContext(newCtx) 15939 defer func() { 15940 a.app.Srv().Store.SetContext(origCtx) 15941 a.ctx = origCtx 15942 }() 15943 15944 defer span.Finish() 15945 resultVar0, resultVar1 := a.app.UpdateChannelMemberNotifyProps(data, channelID, userID) 15946 15947 if resultVar1 != nil { 15948 span.LogFields(spanlog.Error(resultVar1)) 15949 ext.Error.Set(span, true) 15950 } 15951 15952 return resultVar0, resultVar1 15953 } 15954 15955 func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelID string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) { 15956 origCtx := a.ctx 15957 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberRoles") 15958 15959 a.ctx = newCtx 15960 a.app.Srv().Store.SetContext(newCtx) 15961 defer func() { 15962 a.app.Srv().Store.SetContext(origCtx) 15963 a.ctx = origCtx 15964 }() 15965 15966 defer span.Finish() 15967 resultVar0, resultVar1 := a.app.UpdateChannelMemberRoles(channelID, userID, newRoles) 15968 15969 if resultVar1 != nil { 15970 span.LogFields(spanlog.Error(resultVar1)) 15971 ext.Error.Set(span, true) 15972 } 15973 15974 return resultVar0, resultVar1 15975 } 15976 15977 func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { 15978 origCtx := a.ctx 15979 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberSchemeRoles") 15980 15981 a.ctx = newCtx 15982 a.app.Srv().Store.SetContext(newCtx) 15983 defer func() { 15984 a.app.Srv().Store.SetContext(origCtx) 15985 a.ctx = origCtx 15986 }() 15987 15988 defer span.Finish() 15989 resultVar0, resultVar1 := a.app.UpdateChannelMemberSchemeRoles(channelID, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) 15990 15991 if resultVar1 != nil { 15992 span.LogFields(spanlog.Error(resultVar1)) 15993 ext.Error.Set(span, true) 15994 } 15995 15996 return resultVar0, resultVar1 15997 } 15998 15999 func (a *OpenTracingAppLayer) UpdateChannelPrivacy(c *request.Context, oldChannel *model.Channel, user *model.User) (*model.Channel, *model.AppError) { 16000 origCtx := a.ctx 16001 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelPrivacy") 16002 16003 a.ctx = newCtx 16004 a.app.Srv().Store.SetContext(newCtx) 16005 defer func() { 16006 a.app.Srv().Store.SetContext(origCtx) 16007 a.ctx = origCtx 16008 }() 16009 16010 defer span.Finish() 16011 resultVar0, resultVar1 := a.app.UpdateChannelPrivacy(c, oldChannel, user) 16012 16013 if resultVar1 != nil { 16014 span.LogFields(spanlog.Error(resultVar1)) 16015 ext.Error.Set(span, true) 16016 } 16017 16018 return resultVar0, resultVar1 16019 } 16020 16021 func (a *OpenTracingAppLayer) UpdateChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 16022 origCtx := a.ctx 16023 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelScheme") 16024 16025 a.ctx = newCtx 16026 a.app.Srv().Store.SetContext(newCtx) 16027 defer func() { 16028 a.app.Srv().Store.SetContext(origCtx) 16029 a.ctx = origCtx 16030 }() 16031 16032 defer span.Finish() 16033 resultVar0, resultVar1 := a.app.UpdateChannelScheme(channel) 16034 16035 if resultVar1 != nil { 16036 span.LogFields(spanlog.Error(resultVar1)) 16037 ext.Error.Set(span, true) 16038 } 16039 16040 return resultVar0, resultVar1 16041 } 16042 16043 func (a *OpenTracingAppLayer) UpdateCommand(oldCmd *model.Command, updatedCmd *model.Command) (*model.Command, *model.AppError) { 16044 origCtx := a.ctx 16045 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateCommand") 16046 16047 a.ctx = newCtx 16048 a.app.Srv().Store.SetContext(newCtx) 16049 defer func() { 16050 a.app.Srv().Store.SetContext(origCtx) 16051 a.ctx = origCtx 16052 }() 16053 16054 defer span.Finish() 16055 resultVar0, resultVar1 := a.app.UpdateCommand(oldCmd, updatedCmd) 16056 16057 if resultVar1 != nil { 16058 span.LogFields(spanlog.Error(resultVar1)) 16059 ext.Error.Set(span, true) 16060 } 16061 16062 return resultVar0, resultVar1 16063 } 16064 16065 func (a *OpenTracingAppLayer) UpdateConfig(f func(*model.Config)) { 16066 origCtx := a.ctx 16067 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateConfig") 16068 16069 a.ctx = newCtx 16070 a.app.Srv().Store.SetContext(newCtx) 16071 defer func() { 16072 a.app.Srv().Store.SetContext(origCtx) 16073 a.ctx = origCtx 16074 }() 16075 16076 defer span.Finish() 16077 a.app.UpdateConfig(f) 16078 } 16079 16080 func (a *OpenTracingAppLayer) UpdateDNDStatusOfUsers() { 16081 origCtx := a.ctx 16082 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateDNDStatusOfUsers") 16083 16084 a.ctx = newCtx 16085 a.app.Srv().Store.SetContext(newCtx) 16086 defer func() { 16087 a.app.Srv().Store.SetContext(origCtx) 16088 a.ctx = origCtx 16089 }() 16090 16091 defer span.Finish() 16092 a.app.UpdateDNDStatusOfUsers() 16093 } 16094 16095 func (a *OpenTracingAppLayer) UpdateEphemeralPost(userID string, post *model.Post) *model.Post { 16096 origCtx := a.ctx 16097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateEphemeralPost") 16098 16099 a.ctx = newCtx 16100 a.app.Srv().Store.SetContext(newCtx) 16101 defer func() { 16102 a.app.Srv().Store.SetContext(origCtx) 16103 a.ctx = origCtx 16104 }() 16105 16106 defer span.Finish() 16107 resultVar0 := a.app.UpdateEphemeralPost(userID, post) 16108 16109 return resultVar0 16110 } 16111 16112 func (a *OpenTracingAppLayer) UpdateExpiredDNDStatuses() ([]*model.Status, error) { 16113 origCtx := a.ctx 16114 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateExpiredDNDStatuses") 16115 16116 a.ctx = newCtx 16117 a.app.Srv().Store.SetContext(newCtx) 16118 defer func() { 16119 a.app.Srv().Store.SetContext(origCtx) 16120 a.ctx = origCtx 16121 }() 16122 16123 defer span.Finish() 16124 resultVar0, resultVar1 := a.app.UpdateExpiredDNDStatuses() 16125 16126 if resultVar1 != nil { 16127 span.LogFields(spanlog.Error(resultVar1)) 16128 ext.Error.Set(span, true) 16129 } 16130 16131 return resultVar0, resultVar1 16132 } 16133 16134 func (a *OpenTracingAppLayer) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) { 16135 origCtx := a.ctx 16136 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroup") 16137 16138 a.ctx = newCtx 16139 a.app.Srv().Store.SetContext(newCtx) 16140 defer func() { 16141 a.app.Srv().Store.SetContext(origCtx) 16142 a.ctx = origCtx 16143 }() 16144 16145 defer span.Finish() 16146 resultVar0, resultVar1 := a.app.UpdateGroup(group) 16147 16148 if resultVar1 != nil { 16149 span.LogFields(spanlog.Error(resultVar1)) 16150 ext.Error.Set(span, true) 16151 } 16152 16153 return resultVar0, resultVar1 16154 } 16155 16156 func (a *OpenTracingAppLayer) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 16157 origCtx := a.ctx 16158 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroupSyncable") 16159 16160 a.ctx = newCtx 16161 a.app.Srv().Store.SetContext(newCtx) 16162 defer func() { 16163 a.app.Srv().Store.SetContext(origCtx) 16164 a.ctx = origCtx 16165 }() 16166 16167 defer span.Finish() 16168 resultVar0, resultVar1 := a.app.UpdateGroupSyncable(groupSyncable) 16169 16170 if resultVar1 != nil { 16171 span.LogFields(spanlog.Error(resultVar1)) 16172 ext.Error.Set(span, true) 16173 } 16174 16175 return resultVar0, resultVar1 16176 } 16177 16178 func (a *OpenTracingAppLayer) UpdateHashedPassword(user *model.User, newHashedPassword string) *model.AppError { 16179 origCtx := a.ctx 16180 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateHashedPassword") 16181 16182 a.ctx = newCtx 16183 a.app.Srv().Store.SetContext(newCtx) 16184 defer func() { 16185 a.app.Srv().Store.SetContext(origCtx) 16186 a.ctx = origCtx 16187 }() 16188 16189 defer span.Finish() 16190 resultVar0 := a.app.UpdateHashedPassword(user, newHashedPassword) 16191 16192 if resultVar0 != nil { 16193 span.LogFields(spanlog.Error(resultVar0)) 16194 ext.Error.Set(span, true) 16195 } 16196 16197 return resultVar0 16198 } 16199 16200 func (a *OpenTracingAppLayer) UpdateHashedPasswordByUserId(userID string, newHashedPassword string) *model.AppError { 16201 origCtx := a.ctx 16202 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateHashedPasswordByUserId") 16203 16204 a.ctx = newCtx 16205 a.app.Srv().Store.SetContext(newCtx) 16206 defer func() { 16207 a.app.Srv().Store.SetContext(origCtx) 16208 a.ctx = origCtx 16209 }() 16210 16211 defer span.Finish() 16212 resultVar0 := a.app.UpdateHashedPasswordByUserId(userID, newHashedPassword) 16213 16214 if resultVar0 != nil { 16215 span.LogFields(spanlog.Error(resultVar0)) 16216 ext.Error.Set(span, true) 16217 } 16218 16219 return resultVar0 16220 } 16221 16222 func (a *OpenTracingAppLayer) UpdateIncomingWebhook(oldHook *model.IncomingWebhook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 16223 origCtx := a.ctx 16224 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateIncomingWebhook") 16225 16226 a.ctx = newCtx 16227 a.app.Srv().Store.SetContext(newCtx) 16228 defer func() { 16229 a.app.Srv().Store.SetContext(origCtx) 16230 a.ctx = origCtx 16231 }() 16232 16233 defer span.Finish() 16234 resultVar0, resultVar1 := a.app.UpdateIncomingWebhook(oldHook, updatedHook) 16235 16236 if resultVar1 != nil { 16237 span.LogFields(spanlog.Error(resultVar1)) 16238 ext.Error.Set(span, true) 16239 } 16240 16241 return resultVar0, resultVar1 16242 } 16243 16244 func (a *OpenTracingAppLayer) UpdateLastActivityAtIfNeeded(session model.Session) { 16245 origCtx := a.ctx 16246 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateLastActivityAtIfNeeded") 16247 16248 a.ctx = newCtx 16249 a.app.Srv().Store.SetContext(newCtx) 16250 defer func() { 16251 a.app.Srv().Store.SetContext(origCtx) 16252 a.ctx = origCtx 16253 }() 16254 16255 defer span.Finish() 16256 a.app.UpdateLastActivityAtIfNeeded(session) 16257 } 16258 16259 func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userID string, token string) *model.AppError { 16260 origCtx := a.ctx 16261 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMfa") 16262 16263 a.ctx = newCtx 16264 a.app.Srv().Store.SetContext(newCtx) 16265 defer func() { 16266 a.app.Srv().Store.SetContext(origCtx) 16267 a.ctx = origCtx 16268 }() 16269 16270 defer span.Finish() 16271 resultVar0 := a.app.UpdateMfa(activate, userID, token) 16272 16273 if resultVar0 != nil { 16274 span.LogFields(spanlog.Error(resultVar0)) 16275 ext.Error.Set(span, true) 16276 } 16277 16278 return resultVar0 16279 } 16280 16281 func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userID string) { 16282 origCtx := a.ctx 16283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMobileAppBadge") 16284 16285 a.ctx = newCtx 16286 a.app.Srv().Store.SetContext(newCtx) 16287 defer func() { 16288 a.app.Srv().Store.SetContext(origCtx) 16289 a.ctx = origCtx 16290 }() 16291 16292 defer span.Finish() 16293 a.app.UpdateMobileAppBadge(userID) 16294 } 16295 16296 func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, tokenUser *model.User) *model.AppError { 16297 origCtx := a.ctx 16298 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOAuthUserAttrs") 16299 16300 a.ctx = newCtx 16301 a.app.Srv().Store.SetContext(newCtx) 16302 defer func() { 16303 a.app.Srv().Store.SetContext(origCtx) 16304 a.ctx = origCtx 16305 }() 16306 16307 defer span.Finish() 16308 resultVar0 := a.app.UpdateOAuthUserAttrs(userData, user, provider, service, tokenUser) 16309 16310 if resultVar0 != nil { 16311 span.LogFields(spanlog.Error(resultVar0)) 16312 ext.Error.Set(span, true) 16313 } 16314 16315 return resultVar0 16316 } 16317 16318 func (a *OpenTracingAppLayer) UpdateOauthApp(oldApp *model.OAuthApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 16319 origCtx := a.ctx 16320 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOauthApp") 16321 16322 a.ctx = newCtx 16323 a.app.Srv().Store.SetContext(newCtx) 16324 defer func() { 16325 a.app.Srv().Store.SetContext(origCtx) 16326 a.ctx = origCtx 16327 }() 16328 16329 defer span.Finish() 16330 resultVar0, resultVar1 := a.app.UpdateOauthApp(oldApp, updatedApp) 16331 16332 if resultVar1 != nil { 16333 span.LogFields(spanlog.Error(resultVar1)) 16334 ext.Error.Set(span, true) 16335 } 16336 16337 return resultVar0, resultVar1 16338 } 16339 16340 func (a *OpenTracingAppLayer) UpdateOutgoingWebhook(oldHook *model.OutgoingWebhook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 16341 origCtx := a.ctx 16342 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOutgoingWebhook") 16343 16344 a.ctx = newCtx 16345 a.app.Srv().Store.SetContext(newCtx) 16346 defer func() { 16347 a.app.Srv().Store.SetContext(origCtx) 16348 a.ctx = origCtx 16349 }() 16350 16351 defer span.Finish() 16352 resultVar0, resultVar1 := a.app.UpdateOutgoingWebhook(oldHook, updatedHook) 16353 16354 if resultVar1 != nil { 16355 span.LogFields(spanlog.Error(resultVar1)) 16356 ext.Error.Set(span, true) 16357 } 16358 16359 return resultVar0, resultVar1 16360 } 16361 16362 func (a *OpenTracingAppLayer) UpdatePassword(user *model.User, newPassword string) *model.AppError { 16363 origCtx := a.ctx 16364 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePassword") 16365 16366 a.ctx = newCtx 16367 a.app.Srv().Store.SetContext(newCtx) 16368 defer func() { 16369 a.app.Srv().Store.SetContext(origCtx) 16370 a.ctx = origCtx 16371 }() 16372 16373 defer span.Finish() 16374 resultVar0 := a.app.UpdatePassword(user, newPassword) 16375 16376 if resultVar0 != nil { 16377 span.LogFields(spanlog.Error(resultVar0)) 16378 ext.Error.Set(span, true) 16379 } 16380 16381 return resultVar0 16382 } 16383 16384 func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userID string, currentPassword string, newPassword string) *model.AppError { 16385 origCtx := a.ctx 16386 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordAsUser") 16387 16388 a.ctx = newCtx 16389 a.app.Srv().Store.SetContext(newCtx) 16390 defer func() { 16391 a.app.Srv().Store.SetContext(origCtx) 16392 a.ctx = origCtx 16393 }() 16394 16395 defer span.Finish() 16396 resultVar0 := a.app.UpdatePasswordAsUser(userID, currentPassword, newPassword) 16397 16398 if resultVar0 != nil { 16399 span.LogFields(spanlog.Error(resultVar0)) 16400 ext.Error.Set(span, true) 16401 } 16402 16403 return resultVar0 16404 } 16405 16406 func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userID string, newPassword string, method string) *model.AppError { 16407 origCtx := a.ctx 16408 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordByUserIdSendEmail") 16409 16410 a.ctx = newCtx 16411 a.app.Srv().Store.SetContext(newCtx) 16412 defer func() { 16413 a.app.Srv().Store.SetContext(origCtx) 16414 a.ctx = origCtx 16415 }() 16416 16417 defer span.Finish() 16418 resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userID, newPassword, method) 16419 16420 if resultVar0 != nil { 16421 span.LogFields(spanlog.Error(resultVar0)) 16422 ext.Error.Set(span, true) 16423 } 16424 16425 return resultVar0 16426 } 16427 16428 func (a *OpenTracingAppLayer) UpdatePasswordSendEmail(user *model.User, newPassword string, method string) *model.AppError { 16429 origCtx := a.ctx 16430 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordSendEmail") 16431 16432 a.ctx = newCtx 16433 a.app.Srv().Store.SetContext(newCtx) 16434 defer func() { 16435 a.app.Srv().Store.SetContext(origCtx) 16436 a.ctx = origCtx 16437 }() 16438 16439 defer span.Finish() 16440 resultVar0 := a.app.UpdatePasswordSendEmail(user, newPassword, method) 16441 16442 if resultVar0 != nil { 16443 span.LogFields(spanlog.Error(resultVar0)) 16444 ext.Error.Set(span, true) 16445 } 16446 16447 return resultVar0 16448 } 16449 16450 func (a *OpenTracingAppLayer) UpdatePost(c *request.Context, post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) { 16451 origCtx := a.ctx 16452 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePost") 16453 16454 a.ctx = newCtx 16455 a.app.Srv().Store.SetContext(newCtx) 16456 defer func() { 16457 a.app.Srv().Store.SetContext(origCtx) 16458 a.ctx = origCtx 16459 }() 16460 16461 defer span.Finish() 16462 resultVar0, resultVar1 := a.app.UpdatePost(c, post, safeUpdate) 16463 16464 if resultVar1 != nil { 16465 span.LogFields(spanlog.Error(resultVar1)) 16466 ext.Error.Set(span, true) 16467 } 16468 16469 return resultVar0, resultVar1 16470 } 16471 16472 func (a *OpenTracingAppLayer) UpdatePreferences(userID string, preferences model.Preferences) *model.AppError { 16473 origCtx := a.ctx 16474 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePreferences") 16475 16476 a.ctx = newCtx 16477 a.app.Srv().Store.SetContext(newCtx) 16478 defer func() { 16479 a.app.Srv().Store.SetContext(origCtx) 16480 a.ctx = origCtx 16481 }() 16482 16483 defer span.Finish() 16484 resultVar0 := a.app.UpdatePreferences(userID, preferences) 16485 16486 if resultVar0 != nil { 16487 span.LogFields(spanlog.Error(resultVar0)) 16488 ext.Error.Set(span, true) 16489 } 16490 16491 return resultVar0 16492 } 16493 16494 func (a *OpenTracingAppLayer) UpdateProductNotices() *model.AppError { 16495 origCtx := a.ctx 16496 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateProductNotices") 16497 16498 a.ctx = newCtx 16499 a.app.Srv().Store.SetContext(newCtx) 16500 defer func() { 16501 a.app.Srv().Store.SetContext(origCtx) 16502 a.ctx = origCtx 16503 }() 16504 16505 defer span.Finish() 16506 resultVar0 := a.app.UpdateProductNotices() 16507 16508 if resultVar0 != nil { 16509 span.LogFields(spanlog.Error(resultVar0)) 16510 ext.Error.Set(span, true) 16511 } 16512 16513 return resultVar0 16514 } 16515 16516 func (a *OpenTracingAppLayer) UpdateRemoteCluster(rc *model.RemoteCluster) (*model.RemoteCluster, *model.AppError) { 16517 origCtx := a.ctx 16518 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRemoteCluster") 16519 16520 a.ctx = newCtx 16521 a.app.Srv().Store.SetContext(newCtx) 16522 defer func() { 16523 a.app.Srv().Store.SetContext(origCtx) 16524 a.ctx = origCtx 16525 }() 16526 16527 defer span.Finish() 16528 resultVar0, resultVar1 := a.app.UpdateRemoteCluster(rc) 16529 16530 if resultVar1 != nil { 16531 span.LogFields(spanlog.Error(resultVar1)) 16532 ext.Error.Set(span, true) 16533 } 16534 16535 return resultVar0, resultVar1 16536 } 16537 16538 func (a *OpenTracingAppLayer) UpdateRemoteClusterTopics(remoteClusterId string, topics string) (*model.RemoteCluster, *model.AppError) { 16539 origCtx := a.ctx 16540 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRemoteClusterTopics") 16541 16542 a.ctx = newCtx 16543 a.app.Srv().Store.SetContext(newCtx) 16544 defer func() { 16545 a.app.Srv().Store.SetContext(origCtx) 16546 a.ctx = origCtx 16547 }() 16548 16549 defer span.Finish() 16550 resultVar0, resultVar1 := a.app.UpdateRemoteClusterTopics(remoteClusterId, topics) 16551 16552 if resultVar1 != nil { 16553 span.LogFields(spanlog.Error(resultVar1)) 16554 ext.Error.Set(span, true) 16555 } 16556 16557 return resultVar0, resultVar1 16558 } 16559 16560 func (a *OpenTracingAppLayer) UpdateRole(role *model.Role) (*model.Role, *model.AppError) { 16561 origCtx := a.ctx 16562 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRole") 16563 16564 a.ctx = newCtx 16565 a.app.Srv().Store.SetContext(newCtx) 16566 defer func() { 16567 a.app.Srv().Store.SetContext(origCtx) 16568 a.ctx = origCtx 16569 }() 16570 16571 defer span.Finish() 16572 resultVar0, resultVar1 := a.app.UpdateRole(role) 16573 16574 if resultVar1 != nil { 16575 span.LogFields(spanlog.Error(resultVar1)) 16576 ext.Error.Set(span, true) 16577 } 16578 16579 return resultVar0, resultVar1 16580 } 16581 16582 func (a *OpenTracingAppLayer) UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 16583 origCtx := a.ctx 16584 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateScheme") 16585 16586 a.ctx = newCtx 16587 a.app.Srv().Store.SetContext(newCtx) 16588 defer func() { 16589 a.app.Srv().Store.SetContext(origCtx) 16590 a.ctx = origCtx 16591 }() 16592 16593 defer span.Finish() 16594 resultVar0, resultVar1 := a.app.UpdateScheme(scheme) 16595 16596 if resultVar1 != nil { 16597 span.LogFields(spanlog.Error(resultVar1)) 16598 ext.Error.Set(span, true) 16599 } 16600 16601 return resultVar0, resultVar1 16602 } 16603 16604 func (a *OpenTracingAppLayer) UpdateSharedChannel(sc *model.SharedChannel) (*model.SharedChannel, error) { 16605 origCtx := a.ctx 16606 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSharedChannel") 16607 16608 a.ctx = newCtx 16609 a.app.Srv().Store.SetContext(newCtx) 16610 defer func() { 16611 a.app.Srv().Store.SetContext(origCtx) 16612 a.ctx = origCtx 16613 }() 16614 16615 defer span.Finish() 16616 resultVar0, resultVar1 := a.app.UpdateSharedChannel(sc) 16617 16618 if resultVar1 != nil { 16619 span.LogFields(spanlog.Error(resultVar1)) 16620 ext.Error.Set(span, true) 16621 } 16622 16623 return resultVar0, resultVar1 16624 } 16625 16626 func (a *OpenTracingAppLayer) UpdateSharedChannelRemoteCursor(id string, cursor model.GetPostsSinceForSyncCursor) error { 16627 origCtx := a.ctx 16628 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSharedChannelRemoteCursor") 16629 16630 a.ctx = newCtx 16631 a.app.Srv().Store.SetContext(newCtx) 16632 defer func() { 16633 a.app.Srv().Store.SetContext(origCtx) 16634 a.ctx = origCtx 16635 }() 16636 16637 defer span.Finish() 16638 resultVar0 := a.app.UpdateSharedChannelRemoteCursor(id, cursor) 16639 16640 if resultVar0 != nil { 16641 span.LogFields(spanlog.Error(resultVar0)) 16642 ext.Error.Set(span, true) 16643 } 16644 16645 return resultVar0 16646 } 16647 16648 func (a *OpenTracingAppLayer) UpdateSidebarCategories(userID string, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { 16649 origCtx := a.ctx 16650 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategories") 16651 16652 a.ctx = newCtx 16653 a.app.Srv().Store.SetContext(newCtx) 16654 defer func() { 16655 a.app.Srv().Store.SetContext(origCtx) 16656 a.ctx = origCtx 16657 }() 16658 16659 defer span.Finish() 16660 resultVar0, resultVar1 := a.app.UpdateSidebarCategories(userID, teamID, categories) 16661 16662 if resultVar1 != nil { 16663 span.LogFields(spanlog.Error(resultVar1)) 16664 ext.Error.Set(span, true) 16665 } 16666 16667 return resultVar0, resultVar1 16668 } 16669 16670 func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userID string, teamID string, categoryOrder []string) *model.AppError { 16671 origCtx := a.ctx 16672 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategoryOrder") 16673 16674 a.ctx = newCtx 16675 a.app.Srv().Store.SetContext(newCtx) 16676 defer func() { 16677 a.app.Srv().Store.SetContext(origCtx) 16678 a.ctx = origCtx 16679 }() 16680 16681 defer span.Finish() 16682 resultVar0 := a.app.UpdateSidebarCategoryOrder(userID, teamID, categoryOrder) 16683 16684 if resultVar0 != nil { 16685 span.LogFields(spanlog.Error(resultVar0)) 16686 ext.Error.Set(span, true) 16687 } 16688 16689 return resultVar0 16690 } 16691 16692 func (a *OpenTracingAppLayer) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { 16693 origCtx := a.ctx 16694 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeam") 16695 16696 a.ctx = newCtx 16697 a.app.Srv().Store.SetContext(newCtx) 16698 defer func() { 16699 a.app.Srv().Store.SetContext(origCtx) 16700 a.ctx = origCtx 16701 }() 16702 16703 defer span.Finish() 16704 resultVar0, resultVar1 := a.app.UpdateTeam(team) 16705 16706 if resultVar1 != nil { 16707 span.LogFields(spanlog.Error(resultVar1)) 16708 ext.Error.Set(span, true) 16709 } 16710 16711 return resultVar0, resultVar1 16712 } 16713 16714 func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) { 16715 origCtx := a.ctx 16716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberRoles") 16717 16718 a.ctx = newCtx 16719 a.app.Srv().Store.SetContext(newCtx) 16720 defer func() { 16721 a.app.Srv().Store.SetContext(origCtx) 16722 a.ctx = origCtx 16723 }() 16724 16725 defer span.Finish() 16726 resultVar0, resultVar1 := a.app.UpdateTeamMemberRoles(teamID, userID, newRoles) 16727 16728 if resultVar1 != nil { 16729 span.LogFields(spanlog.Error(resultVar1)) 16730 ext.Error.Set(span, true) 16731 } 16732 16733 return resultVar0, resultVar1 16734 } 16735 16736 func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { 16737 origCtx := a.ctx 16738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberSchemeRoles") 16739 16740 a.ctx = newCtx 16741 a.app.Srv().Store.SetContext(newCtx) 16742 defer func() { 16743 a.app.Srv().Store.SetContext(origCtx) 16744 a.ctx = origCtx 16745 }() 16746 16747 defer span.Finish() 16748 resultVar0, resultVar1 := a.app.UpdateTeamMemberSchemeRoles(teamID, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) 16749 16750 if resultVar1 != nil { 16751 span.LogFields(spanlog.Error(resultVar1)) 16752 ext.Error.Set(span, true) 16753 } 16754 16755 return resultVar0, resultVar1 16756 } 16757 16758 func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError { 16759 origCtx := a.ctx 16760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamPrivacy") 16761 16762 a.ctx = newCtx 16763 a.app.Srv().Store.SetContext(newCtx) 16764 defer func() { 16765 a.app.Srv().Store.SetContext(origCtx) 16766 a.ctx = origCtx 16767 }() 16768 16769 defer span.Finish() 16770 resultVar0 := a.app.UpdateTeamPrivacy(teamID, teamType, allowOpenInvite) 16771 16772 if resultVar0 != nil { 16773 span.LogFields(spanlog.Error(resultVar0)) 16774 ext.Error.Set(span, true) 16775 } 16776 16777 return resultVar0 16778 } 16779 16780 func (a *OpenTracingAppLayer) UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError) { 16781 origCtx := a.ctx 16782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamScheme") 16783 16784 a.ctx = newCtx 16785 a.app.Srv().Store.SetContext(newCtx) 16786 defer func() { 16787 a.app.Srv().Store.SetContext(origCtx) 16788 a.ctx = origCtx 16789 }() 16790 16791 defer span.Finish() 16792 resultVar0, resultVar1 := a.app.UpdateTeamScheme(team) 16793 16794 if resultVar1 != nil { 16795 span.LogFields(spanlog.Error(resultVar1)) 16796 ext.Error.Set(span, true) 16797 } 16798 16799 return resultVar0, resultVar1 16800 } 16801 16802 func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userID string, teamID string, threadID string, state bool) *model.AppError { 16803 origCtx := a.ctx 16804 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadFollowForUser") 16805 16806 a.ctx = newCtx 16807 a.app.Srv().Store.SetContext(newCtx) 16808 defer func() { 16809 a.app.Srv().Store.SetContext(origCtx) 16810 a.ctx = origCtx 16811 }() 16812 16813 defer span.Finish() 16814 resultVar0 := a.app.UpdateThreadFollowForUser(userID, teamID, threadID, state) 16815 16816 if resultVar0 != nil { 16817 span.LogFields(spanlog.Error(resultVar0)) 16818 ext.Error.Set(span, true) 16819 } 16820 16821 return resultVar0 16822 } 16823 16824 func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userID string, teamID string, threadID string, timestamp int64) (*model.ThreadResponse, *model.AppError) { 16825 origCtx := a.ctx 16826 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadReadForUser") 16827 16828 a.ctx = newCtx 16829 a.app.Srv().Store.SetContext(newCtx) 16830 defer func() { 16831 a.app.Srv().Store.SetContext(origCtx) 16832 a.ctx = origCtx 16833 }() 16834 16835 defer span.Finish() 16836 resultVar0, resultVar1 := a.app.UpdateThreadReadForUser(userID, teamID, threadID, timestamp) 16837 16838 if resultVar1 != nil { 16839 span.LogFields(spanlog.Error(resultVar1)) 16840 ext.Error.Set(span, true) 16841 } 16842 16843 return resultVar0, resultVar1 16844 } 16845 16846 func (a *OpenTracingAppLayer) UpdateThreadsReadForUser(userID string, teamID string) *model.AppError { 16847 origCtx := a.ctx 16848 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadsReadForUser") 16849 16850 a.ctx = newCtx 16851 a.app.Srv().Store.SetContext(newCtx) 16852 defer func() { 16853 a.app.Srv().Store.SetContext(origCtx) 16854 a.ctx = origCtx 16855 }() 16856 16857 defer span.Finish() 16858 resultVar0 := a.app.UpdateThreadsReadForUser(userID, teamID) 16859 16860 if resultVar0 != nil { 16861 span.LogFields(spanlog.Error(resultVar0)) 16862 ext.Error.Set(span, true) 16863 } 16864 16865 return resultVar0 16866 } 16867 16868 func (a *OpenTracingAppLayer) UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) { 16869 origCtx := a.ctx 16870 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUser") 16871 16872 a.ctx = newCtx 16873 a.app.Srv().Store.SetContext(newCtx) 16874 defer func() { 16875 a.app.Srv().Store.SetContext(origCtx) 16876 a.ctx = origCtx 16877 }() 16878 16879 defer span.Finish() 16880 resultVar0, resultVar1 := a.app.UpdateUser(user, sendNotifications) 16881 16882 if resultVar1 != nil { 16883 span.LogFields(spanlog.Error(resultVar1)) 16884 ext.Error.Set(span, true) 16885 } 16886 16887 return resultVar0, resultVar1 16888 } 16889 16890 func (a *OpenTracingAppLayer) UpdateUserActive(c *request.Context, userID string, active bool) *model.AppError { 16891 origCtx := a.ctx 16892 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive") 16893 16894 a.ctx = newCtx 16895 a.app.Srv().Store.SetContext(newCtx) 16896 defer func() { 16897 a.app.Srv().Store.SetContext(origCtx) 16898 a.ctx = origCtx 16899 }() 16900 16901 defer span.Finish() 16902 resultVar0 := a.app.UpdateUserActive(c, userID, active) 16903 16904 if resultVar0 != nil { 16905 span.LogFields(spanlog.Error(resultVar0)) 16906 ext.Error.Set(span, true) 16907 } 16908 16909 return resultVar0 16910 } 16911 16912 func (a *OpenTracingAppLayer) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) { 16913 origCtx := a.ctx 16914 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAsUser") 16915 16916 a.ctx = newCtx 16917 a.app.Srv().Store.SetContext(newCtx) 16918 defer func() { 16919 a.app.Srv().Store.SetContext(origCtx) 16920 a.ctx = origCtx 16921 }() 16922 16923 defer span.Finish() 16924 resultVar0, resultVar1 := a.app.UpdateUserAsUser(user, asAdmin) 16925 16926 if resultVar1 != nil { 16927 span.LogFields(spanlog.Error(resultVar1)) 16928 ext.Error.Set(span, true) 16929 } 16930 16931 return resultVar0, resultVar1 16932 } 16933 16934 func (a *OpenTracingAppLayer) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { 16935 origCtx := a.ctx 16936 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAuth") 16937 16938 a.ctx = newCtx 16939 a.app.Srv().Store.SetContext(newCtx) 16940 defer func() { 16941 a.app.Srv().Store.SetContext(origCtx) 16942 a.ctx = origCtx 16943 }() 16944 16945 defer span.Finish() 16946 resultVar0, resultVar1 := a.app.UpdateUserAuth(userID, userAuth) 16947 16948 if resultVar1 != nil { 16949 span.LogFields(spanlog.Error(resultVar1)) 16950 ext.Error.Set(span, true) 16951 } 16952 16953 return resultVar0, resultVar1 16954 } 16955 16956 func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { 16957 origCtx := a.ctx 16958 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserNotifyProps") 16959 16960 a.ctx = newCtx 16961 a.app.Srv().Store.SetContext(newCtx) 16962 defer func() { 16963 a.app.Srv().Store.SetContext(origCtx) 16964 a.ctx = origCtx 16965 }() 16966 16967 defer span.Finish() 16968 resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userID, props, sendNotifications) 16969 16970 if resultVar1 != nil { 16971 span.LogFields(spanlog.Error(resultVar1)) 16972 ext.Error.Set(span, true) 16973 } 16974 16975 return resultVar0, resultVar1 16976 } 16977 16978 func (a *OpenTracingAppLayer) UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 16979 origCtx := a.ctx 16980 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRoles") 16981 16982 a.ctx = newCtx 16983 a.app.Srv().Store.SetContext(newCtx) 16984 defer func() { 16985 a.app.Srv().Store.SetContext(origCtx) 16986 a.ctx = origCtx 16987 }() 16988 16989 defer span.Finish() 16990 resultVar0, resultVar1 := a.app.UpdateUserRoles(userID, newRoles, sendWebSocketEvent) 16991 16992 if resultVar1 != nil { 16993 span.LogFields(spanlog.Error(resultVar1)) 16994 ext.Error.Set(span, true) 16995 } 16996 16997 return resultVar0, resultVar1 16998 } 16999 17000 func (a *OpenTracingAppLayer) UpdateUserRolesWithUser(user *model.User, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 17001 origCtx := a.ctx 17002 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRolesWithUser") 17003 17004 a.ctx = newCtx 17005 a.app.Srv().Store.SetContext(newCtx) 17006 defer func() { 17007 a.app.Srv().Store.SetContext(origCtx) 17008 a.ctx = origCtx 17009 }() 17010 17011 defer span.Finish() 17012 resultVar0, resultVar1 := a.app.UpdateUserRolesWithUser(user, newRoles, sendWebSocketEvent) 17013 17014 if resultVar1 != nil { 17015 span.LogFields(spanlog.Error(resultVar1)) 17016 ext.Error.Set(span, true) 17017 } 17018 17019 return resultVar0, resultVar1 17020 } 17021 17022 func (a *OpenTracingAppLayer) UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError { 17023 origCtx := a.ctx 17024 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNotices") 17025 17026 a.ctx = newCtx 17027 a.app.Srv().Store.SetContext(newCtx) 17028 defer func() { 17029 a.app.Srv().Store.SetContext(origCtx) 17030 a.ctx = origCtx 17031 }() 17032 17033 defer span.Finish() 17034 resultVar0 := a.app.UpdateViewedProductNotices(userID, noticeIds) 17035 17036 if resultVar0 != nil { 17037 span.LogFields(spanlog.Error(resultVar0)) 17038 ext.Error.Set(span, true) 17039 } 17040 17041 return resultVar0 17042 } 17043 17044 func (a *OpenTracingAppLayer) UpdateViewedProductNoticesForNewUser(userID string) { 17045 origCtx := a.ctx 17046 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNoticesForNewUser") 17047 17048 a.ctx = newCtx 17049 a.app.Srv().Store.SetContext(newCtx) 17050 defer func() { 17051 a.app.Srv().Store.SetContext(origCtx) 17052 a.ctx = origCtx 17053 }() 17054 17055 defer span.Finish() 17056 a.app.UpdateViewedProductNoticesForNewUser(userID) 17057 } 17058 17059 func (a *OpenTracingAppLayer) UpdateWebConnUserActivity(session model.Session, activityAt int64) { 17060 origCtx := a.ctx 17061 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateWebConnUserActivity") 17062 17063 a.ctx = newCtx 17064 a.app.Srv().Store.SetContext(newCtx) 17065 defer func() { 17066 a.app.Srv().Store.SetContext(origCtx) 17067 a.ctx = origCtx 17068 }() 17069 17070 defer span.Finish() 17071 a.app.UpdateWebConnUserActivity(session, activityAt) 17072 } 17073 17074 func (a *OpenTracingAppLayer) UploadData(c *request.Context, us *model.UploadSession, rd io.Reader) (*model.FileInfo, *model.AppError) { 17075 origCtx := a.ctx 17076 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadData") 17077 17078 a.ctx = newCtx 17079 a.app.Srv().Store.SetContext(newCtx) 17080 defer func() { 17081 a.app.Srv().Store.SetContext(origCtx) 17082 a.ctx = origCtx 17083 }() 17084 17085 defer span.Finish() 17086 resultVar0, resultVar1 := a.app.UploadData(c, us, rd) 17087 17088 if resultVar1 != nil { 17089 span.LogFields(spanlog.Error(resultVar1)) 17090 ext.Error.Set(span, true) 17091 } 17092 17093 return resultVar0, resultVar1 17094 } 17095 17096 func (a *OpenTracingAppLayer) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError { 17097 origCtx := a.ctx 17098 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadEmojiImage") 17099 17100 a.ctx = newCtx 17101 a.app.Srv().Store.SetContext(newCtx) 17102 defer func() { 17103 a.app.Srv().Store.SetContext(origCtx) 17104 a.ctx = origCtx 17105 }() 17106 17107 defer span.Finish() 17108 resultVar0 := a.app.UploadEmojiImage(id, imageData) 17109 17110 if resultVar0 != nil { 17111 span.LogFields(spanlog.Error(resultVar0)) 17112 ext.Error.Set(span, true) 17113 } 17114 17115 return resultVar0 17116 } 17117 17118 func (a *OpenTracingAppLayer) UploadFile(c *request.Context, data []byte, channelID string, filename string) (*model.FileInfo, *model.AppError) { 17119 origCtx := a.ctx 17120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFile") 17121 17122 a.ctx = newCtx 17123 a.app.Srv().Store.SetContext(newCtx) 17124 defer func() { 17125 a.app.Srv().Store.SetContext(origCtx) 17126 a.ctx = origCtx 17127 }() 17128 17129 defer span.Finish() 17130 resultVar0, resultVar1 := a.app.UploadFile(c, data, channelID, filename) 17131 17132 if resultVar1 != nil { 17133 span.LogFields(spanlog.Error(resultVar1)) 17134 ext.Error.Set(span, true) 17135 } 17136 17137 return resultVar0, resultVar1 17138 } 17139 17140 func (a *OpenTracingAppLayer) UploadFileX(c *request.Context, channelID string, name string, input io.Reader, opts ...func(*app.UploadFileTask)) (*model.FileInfo, *model.AppError) { 17141 origCtx := a.ctx 17142 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFileX") 17143 17144 a.ctx = newCtx 17145 a.app.Srv().Store.SetContext(newCtx) 17146 defer func() { 17147 a.app.Srv().Store.SetContext(origCtx) 17148 a.ctx = origCtx 17149 }() 17150 17151 defer span.Finish() 17152 resultVar0, resultVar1 := a.app.UploadFileX(c, channelID, name, input, opts...) 17153 17154 if resultVar1 != nil { 17155 span.LogFields(spanlog.Error(resultVar1)) 17156 ext.Error.Set(span, true) 17157 } 17158 17159 return resultVar0, resultVar1 17160 } 17161 17162 func (a *OpenTracingAppLayer) UploadFiles(c *request.Context, teamID string, channelID string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 17163 origCtx := a.ctx 17164 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFiles") 17165 17166 a.ctx = newCtx 17167 a.app.Srv().Store.SetContext(newCtx) 17168 defer func() { 17169 a.app.Srv().Store.SetContext(origCtx) 17170 a.ctx = origCtx 17171 }() 17172 17173 defer span.Finish() 17174 resultVar0, resultVar1 := a.app.UploadFiles(c, teamID, channelID, userID, files, filenames, clientIds, now) 17175 17176 if resultVar1 != nil { 17177 span.LogFields(spanlog.Error(resultVar1)) 17178 ext.Error.Set(span, true) 17179 } 17180 17181 return resultVar0, resultVar1 17182 } 17183 17184 func (a *OpenTracingAppLayer) UploadMultipartFiles(c *request.Context, teamID string, channelID string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 17185 origCtx := a.ctx 17186 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadMultipartFiles") 17187 17188 a.ctx = newCtx 17189 a.app.Srv().Store.SetContext(newCtx) 17190 defer func() { 17191 a.app.Srv().Store.SetContext(origCtx) 17192 a.ctx = origCtx 17193 }() 17194 17195 defer span.Finish() 17196 resultVar0, resultVar1 := a.app.UploadMultipartFiles(c, teamID, channelID, userID, fileHeaders, clientIds, now) 17197 17198 if resultVar1 != nil { 17199 span.LogFields(spanlog.Error(resultVar1)) 17200 ext.Error.Set(span, true) 17201 } 17202 17203 return resultVar0, resultVar1 17204 } 17205 17206 func (a *OpenTracingAppLayer) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 17207 origCtx := a.ctx 17208 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupMember") 17209 17210 a.ctx = newCtx 17211 a.app.Srv().Store.SetContext(newCtx) 17212 defer func() { 17213 a.app.Srv().Store.SetContext(origCtx) 17214 a.ctx = origCtx 17215 }() 17216 17217 defer span.Finish() 17218 resultVar0, resultVar1 := a.app.UpsertGroupMember(groupID, userID) 17219 17220 if resultVar1 != nil { 17221 span.LogFields(spanlog.Error(resultVar1)) 17222 ext.Error.Set(span, true) 17223 } 17224 17225 return resultVar0, resultVar1 17226 } 17227 17228 func (a *OpenTracingAppLayer) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 17229 origCtx := a.ctx 17230 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupSyncable") 17231 17232 a.ctx = newCtx 17233 a.app.Srv().Store.SetContext(newCtx) 17234 defer func() { 17235 a.app.Srv().Store.SetContext(origCtx) 17236 a.ctx = origCtx 17237 }() 17238 17239 defer span.Finish() 17240 resultVar0, resultVar1 := a.app.UpsertGroupSyncable(groupSyncable) 17241 17242 if resultVar1 != nil { 17243 span.LogFields(spanlog.Error(resultVar1)) 17244 ext.Error.Set(span, true) 17245 } 17246 17247 return resultVar0, resultVar1 17248 } 17249 17250 func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) { 17251 origCtx := a.ctx 17252 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserCanSeeOtherUser") 17253 17254 a.ctx = newCtx 17255 a.app.Srv().Store.SetContext(newCtx) 17256 defer func() { 17257 a.app.Srv().Store.SetContext(origCtx) 17258 a.ctx = origCtx 17259 }() 17260 17261 defer span.Finish() 17262 resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userID, otherUserId) 17263 17264 if resultVar1 != nil { 17265 span.LogFields(spanlog.Error(resultVar1)) 17266 ext.Error.Set(span, true) 17267 } 17268 17269 return resultVar0, resultVar1 17270 } 17271 17272 func (a *OpenTracingAppLayer) UserIsInAdminRoleGroup(userID string, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError) { 17273 origCtx := a.ctx 17274 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserIsInAdminRoleGroup") 17275 17276 a.ctx = newCtx 17277 a.app.Srv().Store.SetContext(newCtx) 17278 defer func() { 17279 a.app.Srv().Store.SetContext(origCtx) 17280 a.ctx = origCtx 17281 }() 17282 17283 defer span.Finish() 17284 resultVar0, resultVar1 := a.app.UserIsInAdminRoleGroup(userID, syncableID, syncableType) 17285 17286 if resultVar1 != nil { 17287 span.LogFields(spanlog.Error(resultVar1)) 17288 ext.Error.Set(span, true) 17289 } 17290 17291 return resultVar0, resultVar1 17292 } 17293 17294 func (a *OpenTracingAppLayer) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError { 17295 origCtx := a.ctx 17296 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyEmailFromToken") 17297 17298 a.ctx = newCtx 17299 a.app.Srv().Store.SetContext(newCtx) 17300 defer func() { 17301 a.app.Srv().Store.SetContext(origCtx) 17302 a.ctx = origCtx 17303 }() 17304 17305 defer span.Finish() 17306 resultVar0 := a.app.VerifyEmailFromToken(userSuppliedTokenString) 17307 17308 if resultVar0 != nil { 17309 span.LogFields(spanlog.Error(resultVar0)) 17310 ext.Error.Set(span, true) 17311 } 17312 17313 return resultVar0 17314 } 17315 17316 func (a *OpenTracingAppLayer) VerifyPlugin(plugin io.ReadSeeker, signature io.ReadSeeker) *model.AppError { 17317 origCtx := a.ctx 17318 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyPlugin") 17319 17320 a.ctx = newCtx 17321 a.app.Srv().Store.SetContext(newCtx) 17322 defer func() { 17323 a.app.Srv().Store.SetContext(origCtx) 17324 a.ctx = origCtx 17325 }() 17326 17327 defer span.Finish() 17328 resultVar0 := a.app.VerifyPlugin(plugin, signature) 17329 17330 if resultVar0 != nil { 17331 span.LogFields(spanlog.Error(resultVar0)) 17332 ext.Error.Set(span, true) 17333 } 17334 17335 return resultVar0 17336 } 17337 17338 func (a *OpenTracingAppLayer) VerifyUserEmail(userID string, email string) *model.AppError { 17339 origCtx := a.ctx 17340 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyUserEmail") 17341 17342 a.ctx = newCtx 17343 a.app.Srv().Store.SetContext(newCtx) 17344 defer func() { 17345 a.app.Srv().Store.SetContext(origCtx) 17346 a.ctx = origCtx 17347 }() 17348 17349 defer span.Finish() 17350 resultVar0 := a.app.VerifyUserEmail(userID, email) 17351 17352 if resultVar0 != nil { 17353 span.LogFields(spanlog.Error(resultVar0)) 17354 ext.Error.Set(span, true) 17355 } 17356 17357 return resultVar0 17358 } 17359 17360 func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userID string, currentSessionId string, collapsedThreadsSupported bool) (map[string]int64, *model.AppError) { 17361 origCtx := a.ctx 17362 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ViewChannel") 17363 17364 a.ctx = newCtx 17365 a.app.Srv().Store.SetContext(newCtx) 17366 defer func() { 17367 a.app.Srv().Store.SetContext(origCtx) 17368 a.ctx = origCtx 17369 }() 17370 17371 defer span.Finish() 17372 resultVar0, resultVar1 := a.app.ViewChannel(view, userID, currentSessionId, collapsedThreadsSupported) 17373 17374 if resultVar1 != nil { 17375 span.LogFields(spanlog.Error(resultVar1)) 17376 ext.Error.Set(span, true) 17377 } 17378 17379 return resultVar0, resultVar1 17380 } 17381 17382 func (a *OpenTracingAppLayer) WriteFile(fr io.Reader, path string) (int64, *model.AppError) { 17383 origCtx := a.ctx 17384 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WriteFile") 17385 17386 a.ctx = newCtx 17387 a.app.Srv().Store.SetContext(newCtx) 17388 defer func() { 17389 a.app.Srv().Store.SetContext(origCtx) 17390 a.ctx = origCtx 17391 }() 17392 17393 defer span.Finish() 17394 resultVar0, resultVar1 := a.app.WriteFile(fr, path) 17395 17396 if resultVar1 != nil { 17397 span.LogFields(spanlog.Error(resultVar1)) 17398 ext.Error.Set(span, true) 17399 } 17400 17401 return resultVar0, resultVar1 17402 } 17403 17404 func NewOpenTracingAppLayer(childApp app.AppIface, ctx context.Context) *OpenTracingAppLayer { 17405 newApp := OpenTracingAppLayer{ 17406 app: childApp, 17407 ctx: ctx, 17408 } 17409 17410 newApp.srv = childApp.Srv() 17411 newApp.log = childApp.Log() 17412 newApp.notificationsLog = childApp.NotificationsLog() 17413 17414 newApp.accountMigration = childApp.AccountMigration() 17415 newApp.cluster = childApp.Cluster() 17416 newApp.compliance = childApp.Compliance() 17417 newApp.dataRetention = childApp.DataRetention() 17418 newApp.searchEngine = childApp.SearchEngine() 17419 newApp.ldap = childApp.Ldap() 17420 newApp.messageExport = childApp.MessageExport() 17421 newApp.metrics = childApp.Metrics() 17422 newApp.notification = childApp.Notification() 17423 newApp.saml = childApp.Saml() 17424 newApp.httpService = childApp.HTTPService() 17425 newApp.imageProxy = childApp.ImageProxy() 17426 newApp.timezones = childApp.Timezones() 17427 17428 return &newApp 17429 } 17430 17431 func (a *OpenTracingAppLayer) Srv() *app.Server { 17432 return a.srv 17433 } 17434 func (a *OpenTracingAppLayer) Log() *mlog.Logger { 17435 return a.log 17436 } 17437 func (a *OpenTracingAppLayer) NotificationsLog() *mlog.Logger { 17438 return a.notificationsLog 17439 } 17440 17441 func (a *OpenTracingAppLayer) AccountMigration() einterfaces.AccountMigrationInterface { 17442 return a.accountMigration 17443 } 17444 func (a *OpenTracingAppLayer) Cluster() einterfaces.ClusterInterface { 17445 return a.cluster 17446 } 17447 func (a *OpenTracingAppLayer) Compliance() einterfaces.ComplianceInterface { 17448 return a.compliance 17449 } 17450 func (a *OpenTracingAppLayer) DataRetention() einterfaces.DataRetentionInterface { 17451 return a.dataRetention 17452 } 17453 func (a *OpenTracingAppLayer) Ldap() einterfaces.LdapInterface { 17454 return a.ldap 17455 } 17456 func (a *OpenTracingAppLayer) MessageExport() einterfaces.MessageExportInterface { 17457 return a.messageExport 17458 } 17459 func (a *OpenTracingAppLayer) Metrics() einterfaces.MetricsInterface { 17460 return a.metrics 17461 } 17462 func (a *OpenTracingAppLayer) Notification() einterfaces.NotificationInterface { 17463 return a.notification 17464 } 17465 func (a *OpenTracingAppLayer) Saml() einterfaces.SamlInterface { 17466 return a.saml 17467 } 17468 func (a *OpenTracingAppLayer) HTTPService() httpservice.HTTPService { 17469 return a.httpService 17470 } 17471 func (a *OpenTracingAppLayer) ImageProxy() *imageproxy.ImageProxy { 17472 return a.imageProxy 17473 } 17474 func (a *OpenTracingAppLayer) Timezones() *timezones.Timezones { 17475 return a.timezones 17476 } 17477 17478 func (a *OpenTracingAppLayer) SetServer(srv *app.Server) { 17479 a.srv = srv 17480 }