github.com/haalcala/mattermost-server-change-repo@v0.0.0-20210713015153-16753fbeee5f/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 "bytes" 11 "context" 12 "crypto/ecdsa" 13 "io" 14 "mime/multipart" 15 "net/http" 16 "net/url" 17 "time" 18 19 "github.com/dyatlov/go-opengraph/opengraph" 20 "github.com/gorilla/websocket" 21 "github.com/mattermost/go-i18n/i18n" 22 goi18n "github.com/mattermost/go-i18n/i18n" 23 "github.com/mattermost/mattermost-server/v5/app" 24 "github.com/mattermost/mattermost-server/v5/audit" 25 "github.com/mattermost/mattermost-server/v5/einterfaces" 26 "github.com/mattermost/mattermost-server/v5/mlog" 27 "github.com/mattermost/mattermost-server/v5/model" 28 "github.com/mattermost/mattermost-server/v5/plugin" 29 "github.com/mattermost/mattermost-server/v5/services/filesstore" 30 "github.com/mattermost/mattermost-server/v5/services/httpservice" 31 "github.com/mattermost/mattermost-server/v5/services/imageproxy" 32 "github.com/mattermost/mattermost-server/v5/services/searchengine" 33 "github.com/mattermost/mattermost-server/v5/services/timezones" 34 "github.com/mattermost/mattermost-server/v5/services/tracing" 35 "github.com/mattermost/mattermost-server/v5/store" 36 "github.com/opentracing/opentracing-go/ext" 37 spanlog "github.com/opentracing/opentracing-go/log" 38 ) 39 40 type OpenTracingAppLayer struct { 41 app app.AppIface 42 43 srv *app.Server 44 45 log *mlog.Logger 46 notificationsLog *mlog.Logger 47 48 t i18n.TranslateFunc 49 session model.Session 50 requestId string 51 ipAddress string 52 path string 53 userAgent string 54 acceptLanguage string 55 56 accountMigration einterfaces.AccountMigrationInterface 57 cluster einterfaces.ClusterInterface 58 compliance einterfaces.ComplianceInterface 59 dataRetention einterfaces.DataRetentionInterface 60 searchEngine *searchengine.Broker 61 ldap einterfaces.LdapInterface 62 messageExport einterfaces.MessageExportInterface 63 metrics einterfaces.MetricsInterface 64 notification einterfaces.NotificationInterface 65 saml einterfaces.SamlInterface 66 67 httpService httpservice.HTTPService 68 imageProxy *imageproxy.ImageProxy 69 timezones *timezones.Timezones 70 71 context context.Context 72 ctx context.Context 73 } 74 75 func (a *OpenTracingAppLayer) ActivateMfa(userID string, token string) *model.AppError { 76 origCtx := a.ctx 77 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ActivateMfa") 78 79 a.ctx = newCtx 80 a.app.Srv().Store.SetContext(newCtx) 81 defer func() { 82 a.app.Srv().Store.SetContext(origCtx) 83 a.ctx = origCtx 84 }() 85 86 defer span.Finish() 87 resultVar0 := a.app.ActivateMfa(userID, token) 88 89 if resultVar0 != nil { 90 span.LogFields(spanlog.Error(resultVar0)) 91 ext.Error.Set(span, true) 92 } 93 94 return resultVar0 95 } 96 97 func (a *OpenTracingAppLayer) AddChannelMember(userID string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { 98 origCtx := a.ctx 99 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddChannelMember") 100 101 a.ctx = newCtx 102 a.app.Srv().Store.SetContext(newCtx) 103 defer func() { 104 a.app.Srv().Store.SetContext(origCtx) 105 a.ctx = origCtx 106 }() 107 108 defer span.Finish() 109 resultVar0, resultVar1 := a.app.AddChannelMember(userID, channel, userRequestorId, postRootId) 110 111 if resultVar1 != nil { 112 span.LogFields(spanlog.Error(resultVar1)) 113 ext.Error.Set(span, true) 114 } 115 116 return resultVar0, resultVar1 117 } 118 119 func (a *OpenTracingAppLayer) AddConfigListener(listener func(*model.Config, *model.Config)) string { 120 origCtx := a.ctx 121 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddConfigListener") 122 123 a.ctx = newCtx 124 a.app.Srv().Store.SetContext(newCtx) 125 defer func() { 126 a.app.Srv().Store.SetContext(origCtx) 127 a.ctx = origCtx 128 }() 129 130 defer span.Finish() 131 resultVar0 := a.app.AddConfigListener(listener) 132 133 return resultVar0 134 } 135 136 func (a *OpenTracingAppLayer) AddCursorIdsForPostList(originalList *model.PostList, afterPost string, beforePost string, since int64, page int, perPage int) { 137 origCtx := a.ctx 138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddCursorIdsForPostList") 139 140 a.ctx = newCtx 141 a.app.Srv().Store.SetContext(newCtx) 142 defer func() { 143 a.app.Srv().Store.SetContext(origCtx) 144 a.ctx = origCtx 145 }() 146 147 defer span.Finish() 148 a.app.AddCursorIdsForPostList(originalList, afterPost, beforePost, since, page, perPage) 149 } 150 151 func (a *OpenTracingAppLayer) AddDirectChannels(teamID string, user *model.User) *model.AppError { 152 origCtx := a.ctx 153 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddDirectChannels") 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 resultVar0 := a.app.AddDirectChannels(teamID, user) 164 165 if resultVar0 != nil { 166 span.LogFields(spanlog.Error(resultVar0)) 167 ext.Error.Set(span, true) 168 } 169 170 return resultVar0 171 } 172 173 func (a *OpenTracingAppLayer) AddLdapPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 174 origCtx := a.ctx 175 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddLdapPrivateCertificate") 176 177 a.ctx = newCtx 178 a.app.Srv().Store.SetContext(newCtx) 179 defer func() { 180 a.app.Srv().Store.SetContext(origCtx) 181 a.ctx = origCtx 182 }() 183 184 defer span.Finish() 185 resultVar0 := a.app.AddLdapPrivateCertificate(fileData) 186 187 if resultVar0 != nil { 188 span.LogFields(spanlog.Error(resultVar0)) 189 ext.Error.Set(span, true) 190 } 191 192 return resultVar0 193 } 194 195 func (a *OpenTracingAppLayer) AddLdapPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 196 origCtx := a.ctx 197 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddLdapPublicCertificate") 198 199 a.ctx = newCtx 200 a.app.Srv().Store.SetContext(newCtx) 201 defer func() { 202 a.app.Srv().Store.SetContext(origCtx) 203 a.ctx = origCtx 204 }() 205 206 defer span.Finish() 207 resultVar0 := a.app.AddLdapPublicCertificate(fileData) 208 209 if resultVar0 != nil { 210 span.LogFields(spanlog.Error(resultVar0)) 211 ext.Error.Set(span, true) 212 } 213 214 return resultVar0 215 } 216 217 func (a *OpenTracingAppLayer) AddPublicKey(name string, key io.Reader) *model.AppError { 218 origCtx := a.ctx 219 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddPublicKey") 220 221 a.ctx = newCtx 222 a.app.Srv().Store.SetContext(newCtx) 223 defer func() { 224 a.app.Srv().Store.SetContext(origCtx) 225 a.ctx = origCtx 226 }() 227 228 defer span.Finish() 229 resultVar0 := a.app.AddPublicKey(name, key) 230 231 if resultVar0 != nil { 232 span.LogFields(spanlog.Error(resultVar0)) 233 ext.Error.Set(span, true) 234 } 235 236 return resultVar0 237 } 238 239 func (a *OpenTracingAppLayer) AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError { 240 origCtx := a.ctx 241 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlIdpCertificate") 242 243 a.ctx = newCtx 244 a.app.Srv().Store.SetContext(newCtx) 245 defer func() { 246 a.app.Srv().Store.SetContext(origCtx) 247 a.ctx = origCtx 248 }() 249 250 defer span.Finish() 251 resultVar0 := a.app.AddSamlIdpCertificate(fileData) 252 253 if resultVar0 != nil { 254 span.LogFields(spanlog.Error(resultVar0)) 255 ext.Error.Set(span, true) 256 } 257 258 return resultVar0 259 } 260 261 func (a *OpenTracingAppLayer) AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 262 origCtx := a.ctx 263 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPrivateCertificate") 264 265 a.ctx = newCtx 266 a.app.Srv().Store.SetContext(newCtx) 267 defer func() { 268 a.app.Srv().Store.SetContext(origCtx) 269 a.ctx = origCtx 270 }() 271 272 defer span.Finish() 273 resultVar0 := a.app.AddSamlPrivateCertificate(fileData) 274 275 if resultVar0 != nil { 276 span.LogFields(spanlog.Error(resultVar0)) 277 ext.Error.Set(span, true) 278 } 279 280 return resultVar0 281 } 282 283 func (a *OpenTracingAppLayer) AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 284 origCtx := a.ctx 285 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPublicCertificate") 286 287 a.ctx = newCtx 288 a.app.Srv().Store.SetContext(newCtx) 289 defer func() { 290 a.app.Srv().Store.SetContext(origCtx) 291 a.ctx = origCtx 292 }() 293 294 defer span.Finish() 295 resultVar0 := a.app.AddSamlPublicCertificate(fileData) 296 297 if resultVar0 != nil { 298 span.LogFields(spanlog.Error(resultVar0)) 299 ext.Error.Set(span, true) 300 } 301 302 return resultVar0 303 } 304 305 func (a *OpenTracingAppLayer) AddSessionToCache(session *model.Session) { 306 origCtx := a.ctx 307 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSessionToCache") 308 309 a.ctx = newCtx 310 a.app.Srv().Store.SetContext(newCtx) 311 defer func() { 312 a.app.Srv().Store.SetContext(origCtx) 313 a.ctx = origCtx 314 }() 315 316 defer span.Finish() 317 a.app.AddSessionToCache(session) 318 } 319 320 func (a *OpenTracingAppLayer) AddStatusCache(status *model.Status) { 321 origCtx := a.ctx 322 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCache") 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 a.app.AddStatusCache(status) 333 } 334 335 func (a *OpenTracingAppLayer) AddStatusCacheSkipClusterSend(status *model.Status) { 336 origCtx := a.ctx 337 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCacheSkipClusterSend") 338 339 a.ctx = newCtx 340 a.app.Srv().Store.SetContext(newCtx) 341 defer func() { 342 a.app.Srv().Store.SetContext(origCtx) 343 a.ctx = origCtx 344 }() 345 346 defer span.Finish() 347 a.app.AddStatusCacheSkipClusterSend(status) 348 } 349 350 func (a *OpenTracingAppLayer) AddTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) { 351 origCtx := a.ctx 352 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMember") 353 354 a.ctx = newCtx 355 a.app.Srv().Store.SetContext(newCtx) 356 defer func() { 357 a.app.Srv().Store.SetContext(origCtx) 358 a.ctx = origCtx 359 }() 360 361 defer span.Finish() 362 resultVar0, resultVar1 := a.app.AddTeamMember(teamID, userID) 363 364 if resultVar1 != nil { 365 span.LogFields(spanlog.Error(resultVar1)) 366 ext.Error.Set(span, true) 367 } 368 369 return resultVar0, resultVar1 370 } 371 372 func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userID string) (*model.TeamMember, *model.AppError) { 373 origCtx := a.ctx 374 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByInviteId") 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 resultVar0, resultVar1 := a.app.AddTeamMemberByInviteId(inviteId, userID) 385 386 if resultVar1 != nil { 387 span.LogFields(spanlog.Error(resultVar1)) 388 ext.Error.Set(span, true) 389 } 390 391 return resultVar0, resultVar1 392 } 393 394 func (a *OpenTracingAppLayer) AddTeamMemberByToken(userID string, tokenID string) (*model.TeamMember, *model.AppError) { 395 origCtx := a.ctx 396 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByToken") 397 398 a.ctx = newCtx 399 a.app.Srv().Store.SetContext(newCtx) 400 defer func() { 401 a.app.Srv().Store.SetContext(origCtx) 402 a.ctx = origCtx 403 }() 404 405 defer span.Finish() 406 resultVar0, resultVar1 := a.app.AddTeamMemberByToken(userID, tokenID) 407 408 if resultVar1 != nil { 409 span.LogFields(spanlog.Error(resultVar1)) 410 ext.Error.Set(span, true) 411 } 412 413 return resultVar0, resultVar1 414 } 415 416 func (a *OpenTracingAppLayer) AddTeamMembers(teamID string, userIDs []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { 417 origCtx := a.ctx 418 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMembers") 419 420 a.ctx = newCtx 421 a.app.Srv().Store.SetContext(newCtx) 422 defer func() { 423 a.app.Srv().Store.SetContext(origCtx) 424 a.ctx = origCtx 425 }() 426 427 defer span.Finish() 428 resultVar0, resultVar1 := a.app.AddTeamMembers(teamID, userIDs, userRequestorId, graceful) 429 430 if resultVar1 != nil { 431 span.LogFields(spanlog.Error(resultVar1)) 432 ext.Error.Set(span, true) 433 } 434 435 return resultVar0, resultVar1 436 } 437 438 func (a *OpenTracingAppLayer) AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError) { 439 origCtx := a.ctx 440 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToChannel") 441 442 a.ctx = newCtx 443 a.app.Srv().Store.SetContext(newCtx) 444 defer func() { 445 a.app.Srv().Store.SetContext(origCtx) 446 a.ctx = origCtx 447 }() 448 449 defer span.Finish() 450 resultVar0, resultVar1 := a.app.AddUserToChannel(user, channel) 451 452 if resultVar1 != nil { 453 span.LogFields(spanlog.Error(resultVar1)) 454 ext.Error.Set(span, true) 455 } 456 457 return resultVar0, resultVar1 458 } 459 460 func (a *OpenTracingAppLayer) AddUserToTeam(teamID string, userID string, userRequestorId string) (*model.Team, *model.AppError) { 461 origCtx := a.ctx 462 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeam") 463 464 a.ctx = newCtx 465 a.app.Srv().Store.SetContext(newCtx) 466 defer func() { 467 a.app.Srv().Store.SetContext(origCtx) 468 a.ctx = origCtx 469 }() 470 471 defer span.Finish() 472 resultVar0, resultVar1 := a.app.AddUserToTeam(teamID, userID, userRequestorId) 473 474 if resultVar1 != nil { 475 span.LogFields(spanlog.Error(resultVar1)) 476 ext.Error.Set(span, true) 477 } 478 479 return resultVar0, resultVar1 480 } 481 482 func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userID string) (*model.Team, *model.AppError) { 483 origCtx := a.ctx 484 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByInviteId") 485 486 a.ctx = newCtx 487 a.app.Srv().Store.SetContext(newCtx) 488 defer func() { 489 a.app.Srv().Store.SetContext(origCtx) 490 a.ctx = origCtx 491 }() 492 493 defer span.Finish() 494 resultVar0, resultVar1 := a.app.AddUserToTeamByInviteId(inviteId, userID) 495 496 if resultVar1 != nil { 497 span.LogFields(spanlog.Error(resultVar1)) 498 ext.Error.Set(span, true) 499 } 500 501 return resultVar0, resultVar1 502 } 503 504 func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamID string, user *model.User) *model.AppError { 505 origCtx := a.ctx 506 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByTeamId") 507 508 a.ctx = newCtx 509 a.app.Srv().Store.SetContext(newCtx) 510 defer func() { 511 a.app.Srv().Store.SetContext(origCtx) 512 a.ctx = origCtx 513 }() 514 515 defer span.Finish() 516 resultVar0 := a.app.AddUserToTeamByTeamId(teamID, user) 517 518 if resultVar0 != nil { 519 span.LogFields(spanlog.Error(resultVar0)) 520 ext.Error.Set(span, true) 521 } 522 523 return resultVar0 524 } 525 526 func (a *OpenTracingAppLayer) AddUserToTeamByToken(userID string, tokenID string) (*model.Team, *model.AppError) { 527 origCtx := a.ctx 528 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByToken") 529 530 a.ctx = newCtx 531 a.app.Srv().Store.SetContext(newCtx) 532 defer func() { 533 a.app.Srv().Store.SetContext(origCtx) 534 a.ctx = origCtx 535 }() 536 537 defer span.Finish() 538 resultVar0, resultVar1 := a.app.AddUserToTeamByToken(userID, tokenID) 539 540 if resultVar1 != nil { 541 span.LogFields(spanlog.Error(resultVar1)) 542 ext.Error.Set(span, true) 543 } 544 545 return resultVar0, resultVar1 546 } 547 548 func (a *OpenTracingAppLayer) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) { 549 origCtx := a.ctx 550 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AdjustImage") 551 552 a.ctx = newCtx 553 a.app.Srv().Store.SetContext(newCtx) 554 defer func() { 555 a.app.Srv().Store.SetContext(origCtx) 556 a.ctx = origCtx 557 }() 558 559 defer span.Finish() 560 resultVar0, resultVar1 := a.app.AdjustImage(file) 561 562 if resultVar1 != nil { 563 span.LogFields(spanlog.Error(resultVar1)) 564 ext.Error.Set(span, true) 565 } 566 567 return resultVar0, resultVar1 568 } 569 570 func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 571 origCtx := a.ctx 572 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser") 573 574 a.ctx = newCtx 575 a.app.Srv().Store.SetContext(newCtx) 576 defer func() { 577 a.app.Srv().Store.SetContext(origCtx) 578 a.ctx = origCtx 579 }() 580 581 defer span.Finish() 582 resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userID, authRequest) 583 584 if resultVar1 != nil { 585 span.LogFields(spanlog.Error(resultVar1)) 586 ext.Error.Set(span, true) 587 } 588 589 return resultVar0, resultVar1 590 } 591 592 func (a *OpenTracingAppLayer) AppendFile(fr io.Reader, path string) (int64, *model.AppError) { 593 origCtx := a.ctx 594 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AppendFile") 595 596 a.ctx = newCtx 597 a.app.Srv().Store.SetContext(newCtx) 598 defer func() { 599 a.app.Srv().Store.SetContext(origCtx) 600 a.ctx = origCtx 601 }() 602 603 defer span.Finish() 604 resultVar0, resultVar1 := a.app.AppendFile(fr, path) 605 606 if resultVar1 != nil { 607 span.LogFields(spanlog.Error(resultVar1)) 608 ext.Error.Set(span, true) 609 } 610 611 return resultVar0, resultVar1 612 } 613 614 func (a *OpenTracingAppLayer) AsymmetricSigningKey() *ecdsa.PrivateKey { 615 origCtx := a.ctx 616 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AsymmetricSigningKey") 617 618 a.ctx = newCtx 619 a.app.Srv().Store.SetContext(newCtx) 620 defer func() { 621 a.app.Srv().Store.SetContext(origCtx) 622 a.ctx = origCtx 623 }() 624 625 defer span.Finish() 626 resultVar0 := a.app.AsymmetricSigningKey() 627 628 return resultVar0 629 } 630 631 func (a *OpenTracingAppLayer) AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError { 632 origCtx := a.ctx 633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachDeviceId") 634 635 a.ctx = newCtx 636 a.app.Srv().Store.SetContext(newCtx) 637 defer func() { 638 a.app.Srv().Store.SetContext(origCtx) 639 a.ctx = origCtx 640 }() 641 642 defer span.Finish() 643 resultVar0 := a.app.AttachDeviceId(sessionId, deviceId, expiresAt) 644 645 if resultVar0 != nil { 646 span.LogFields(spanlog.Error(resultVar0)) 647 ext.Error.Set(span, true) 648 } 649 650 return resultVar0 651 } 652 653 func (a *OpenTracingAppLayer) AttachSessionCookies(w http.ResponseWriter, r *http.Request) { 654 origCtx := a.ctx 655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachSessionCookies") 656 657 a.ctx = newCtx 658 a.app.Srv().Store.SetContext(newCtx) 659 defer func() { 660 a.app.Srv().Store.SetContext(origCtx) 661 a.ctx = origCtx 662 }() 663 664 defer span.Finish() 665 a.app.AttachSessionCookies(w, r) 666 } 667 668 func (a *OpenTracingAppLayer) AuthenticateUserForLogin(id string, loginId string, password string, mfaToken string, cwsToken string, ldapOnly bool) (user *model.User, err *model.AppError) { 669 origCtx := a.ctx 670 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthenticateUserForLogin") 671 672 a.ctx = newCtx 673 a.app.Srv().Store.SetContext(newCtx) 674 defer func() { 675 a.app.Srv().Store.SetContext(origCtx) 676 a.ctx = origCtx 677 }() 678 679 defer span.Finish() 680 resultVar0, resultVar1 := a.app.AuthenticateUserForLogin(id, loginId, password, mfaToken, cwsToken, ldapOnly) 681 682 if resultVar1 != nil { 683 span.LogFields(spanlog.Error(resultVar1)) 684 ext.Error.Set(span, true) 685 } 686 687 return resultVar0, resultVar1 688 } 689 690 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) { 691 origCtx := a.ctx 692 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthorizeOAuthUser") 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, resultVar1, resultVar2, resultVar3, resultVar4 := a.app.AuthorizeOAuthUser(w, r, service, code, state, redirectUri) 703 704 if resultVar4 != nil { 705 span.LogFields(spanlog.Error(resultVar4)) 706 ext.Error.Set(span, true) 707 } 708 709 return resultVar0, resultVar1, resultVar2, resultVar3, resultVar4 710 } 711 712 func (a *OpenTracingAppLayer) AutocompleteChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { 713 origCtx := a.ctx 714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannels") 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 resultVar0, resultVar1 := a.app.AutocompleteChannels(teamID, term) 725 726 if resultVar1 != nil { 727 span.LogFields(spanlog.Error(resultVar1)) 728 ext.Error.Set(span, true) 729 } 730 731 return resultVar0, resultVar1 732 } 733 734 func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { 735 origCtx := a.ctx 736 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannelsForSearch") 737 738 a.ctx = newCtx 739 a.app.Srv().Store.SetContext(newCtx) 740 defer func() { 741 a.app.Srv().Store.SetContext(origCtx) 742 a.ctx = origCtx 743 }() 744 745 defer span.Finish() 746 resultVar0, resultVar1 := a.app.AutocompleteChannelsForSearch(teamID, userID, term) 747 748 if resultVar1 != nil { 749 span.LogFields(spanlog.Error(resultVar1)) 750 ext.Error.Set(span, true) 751 } 752 753 return resultVar0, resultVar1 754 } 755 756 func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { 757 origCtx := a.ctx 758 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInChannel") 759 760 a.ctx = newCtx 761 a.app.Srv().Store.SetContext(newCtx) 762 defer func() { 763 a.app.Srv().Store.SetContext(origCtx) 764 a.ctx = origCtx 765 }() 766 767 defer span.Finish() 768 resultVar0, resultVar1 := a.app.AutocompleteUsersInChannel(teamID, channelId, term, options) 769 770 if resultVar1 != nil { 771 span.LogFields(spanlog.Error(resultVar1)) 772 ext.Error.Set(span, true) 773 } 774 775 return resultVar0, resultVar1 776 } 777 778 func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamID string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { 779 origCtx := a.ctx 780 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInTeam") 781 782 a.ctx = newCtx 783 a.app.Srv().Store.SetContext(newCtx) 784 defer func() { 785 a.app.Srv().Store.SetContext(origCtx) 786 a.ctx = origCtx 787 }() 788 789 defer span.Finish() 790 resultVar0, resultVar1 := a.app.AutocompleteUsersInTeam(teamID, term, options) 791 792 if resultVar1 != nil { 793 span.LogFields(spanlog.Error(resultVar1)) 794 ext.Error.Set(span, true) 795 } 796 797 return resultVar0, resultVar1 798 } 799 800 func (a *OpenTracingAppLayer) BroadcastStatus(status *model.Status) { 801 origCtx := a.ctx 802 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BroadcastStatus") 803 804 a.ctx = newCtx 805 a.app.Srv().Store.SetContext(newCtx) 806 defer func() { 807 a.app.Srv().Store.SetContext(origCtx) 808 a.ctx = origCtx 809 }() 810 811 defer span.Finish() 812 a.app.BroadcastStatus(status) 813 } 814 815 func (a *OpenTracingAppLayer) BuildPostReactions(postId string) (*[]app.ReactionImportData, *model.AppError) { 816 origCtx := a.ctx 817 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPostReactions") 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.BuildPostReactions(postId) 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) 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) { 838 origCtx := a.ctx 839 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPushNotificationMessage") 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.BuildPushNotificationMessage(contentsConfig, post, user, channel, channelName, senderName, explicitMention, channelWideMention, replyToThreadType) 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) BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError) { 860 origCtx := a.ctx 861 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildSamlMetadataObject") 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 resultVar0, resultVar1 := a.app.BuildSamlMetadataObject(idpMetadata) 872 873 if resultVar1 != nil { 874 span.LogFields(spanlog.Error(resultVar1)) 875 ext.Error.Set(span, true) 876 } 877 878 return resultVar0, resultVar1 879 } 880 881 func (a *OpenTracingAppLayer) BulkExport(writer io.Writer, outPath string, opts app.BulkExportOpts) *model.AppError { 882 origCtx := a.ctx 883 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkExport") 884 885 a.ctx = newCtx 886 a.app.Srv().Store.SetContext(newCtx) 887 defer func() { 888 a.app.Srv().Store.SetContext(origCtx) 889 a.ctx = origCtx 890 }() 891 892 defer span.Finish() 893 resultVar0 := a.app.BulkExport(writer, outPath, opts) 894 895 if resultVar0 != nil { 896 span.LogFields(spanlog.Error(resultVar0)) 897 ext.Error.Set(span, true) 898 } 899 900 return resultVar0 901 } 902 903 func (a *OpenTracingAppLayer) BulkImport(fileReader io.Reader, dryRun bool, workers int) (*model.AppError, int) { 904 origCtx := a.ctx 905 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImport") 906 907 a.ctx = newCtx 908 a.app.Srv().Store.SetContext(newCtx) 909 defer func() { 910 a.app.Srv().Store.SetContext(origCtx) 911 a.ctx = origCtx 912 }() 913 914 defer span.Finish() 915 resultVar0, resultVar1 := a.app.BulkImport(fileReader, dryRun, workers) 916 917 if resultVar0 != nil { 918 span.LogFields(spanlog.Error(resultVar0)) 919 ext.Error.Set(span, true) 920 } 921 922 return resultVar0, resultVar1 923 } 924 925 func (a *OpenTracingAppLayer) BulkImportWithPath(fileReader io.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) { 926 origCtx := a.ctx 927 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImportWithPath") 928 929 a.ctx = newCtx 930 a.app.Srv().Store.SetContext(newCtx) 931 defer func() { 932 a.app.Srv().Store.SetContext(origCtx) 933 a.ctx = origCtx 934 }() 935 936 defer span.Finish() 937 resultVar0, resultVar1 := a.app.BulkImportWithPath(fileReader, dryRun, workers, importPath) 938 939 if resultVar0 != nil { 940 span.LogFields(spanlog.Error(resultVar0)) 941 ext.Error.Set(span, true) 942 } 943 944 return resultVar0, resultVar1 945 } 946 947 func (a *OpenTracingAppLayer) CancelJob(jobId string) *model.AppError { 948 origCtx := a.ctx 949 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CancelJob") 950 951 a.ctx = newCtx 952 a.app.Srv().Store.SetContext(newCtx) 953 defer func() { 954 a.app.Srv().Store.SetContext(origCtx) 955 a.ctx = origCtx 956 }() 957 958 defer span.Finish() 959 resultVar0 := a.app.CancelJob(jobId) 960 961 if resultVar0 != nil { 962 span.LogFields(spanlog.Error(resultVar0)) 963 ext.Error.Set(span, true) 964 } 965 966 return resultVar0 967 } 968 969 func (a *OpenTracingAppLayer) ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 970 origCtx := a.ctx 971 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersMinusGroupMembers") 972 973 a.ctx = newCtx 974 a.app.Srv().Store.SetContext(newCtx) 975 defer func() { 976 a.app.Srv().Store.SetContext(origCtx) 977 a.ctx = origCtx 978 }() 979 980 defer span.Finish() 981 resultVar0, resultVar1, resultVar2 := a.app.ChannelMembersMinusGroupMembers(channelID, groupIDs, page, perPage) 982 983 if resultVar2 != nil { 984 span.LogFields(spanlog.Error(resultVar2)) 985 ext.Error.Set(span, true) 986 } 987 988 return resultVar0, resultVar1, resultVar2 989 } 990 991 func (a *OpenTracingAppLayer) ChannelMembersToAdd(since int64, channelID *string) ([]*model.UserChannelIDPair, *model.AppError) { 992 origCtx := a.ctx 993 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToAdd") 994 995 a.ctx = newCtx 996 a.app.Srv().Store.SetContext(newCtx) 997 defer func() { 998 a.app.Srv().Store.SetContext(origCtx) 999 a.ctx = origCtx 1000 }() 1001 1002 defer span.Finish() 1003 resultVar0, resultVar1 := a.app.ChannelMembersToAdd(since, channelID) 1004 1005 if resultVar1 != nil { 1006 span.LogFields(spanlog.Error(resultVar1)) 1007 ext.Error.Set(span, true) 1008 } 1009 1010 return resultVar0, resultVar1 1011 } 1012 1013 func (a *OpenTracingAppLayer) ChannelMembersToRemove(teamID *string) ([]*model.ChannelMember, *model.AppError) { 1014 origCtx := a.ctx 1015 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToRemove") 1016 1017 a.ctx = newCtx 1018 a.app.Srv().Store.SetContext(newCtx) 1019 defer func() { 1020 a.app.Srv().Store.SetContext(origCtx) 1021 a.ctx = origCtx 1022 }() 1023 1024 defer span.Finish() 1025 resultVar0, resultVar1 := a.app.ChannelMembersToRemove(teamID) 1026 1027 if resultVar1 != nil { 1028 span.LogFields(spanlog.Error(resultVar1)) 1029 ext.Error.Set(span, true) 1030 } 1031 1032 return resultVar0, resultVar1 1033 } 1034 1035 func (a *OpenTracingAppLayer) CheckAndSendUserLimitWarningEmails() *model.AppError { 1036 origCtx := a.ctx 1037 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckAndSendUserLimitWarningEmails") 1038 1039 a.ctx = newCtx 1040 a.app.Srv().Store.SetContext(newCtx) 1041 defer func() { 1042 a.app.Srv().Store.SetContext(origCtx) 1043 a.ctx = origCtx 1044 }() 1045 1046 defer span.Finish() 1047 resultVar0 := a.app.CheckAndSendUserLimitWarningEmails() 1048 1049 if resultVar0 != nil { 1050 span.LogFields(spanlog.Error(resultVar0)) 1051 ext.Error.Set(span, true) 1052 } 1053 1054 return resultVar0 1055 } 1056 1057 func (a *OpenTracingAppLayer) CheckForClientSideCert(r *http.Request) (string, string, string) { 1058 origCtx := a.ctx 1059 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckForClientSideCert") 1060 1061 a.ctx = newCtx 1062 a.app.Srv().Store.SetContext(newCtx) 1063 defer func() { 1064 a.app.Srv().Store.SetContext(origCtx) 1065 a.ctx = origCtx 1066 }() 1067 1068 defer span.Finish() 1069 resultVar0, resultVar1, resultVar2 := a.app.CheckForClientSideCert(r) 1070 1071 return resultVar0, resultVar1, resultVar2 1072 } 1073 1074 func (a *OpenTracingAppLayer) CheckMandatoryS3Fields(settings *model.FileSettings) *model.AppError { 1075 origCtx := a.ctx 1076 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckMandatoryS3Fields") 1077 1078 a.ctx = newCtx 1079 a.app.Srv().Store.SetContext(newCtx) 1080 defer func() { 1081 a.app.Srv().Store.SetContext(origCtx) 1082 a.ctx = origCtx 1083 }() 1084 1085 defer span.Finish() 1086 resultVar0 := a.app.CheckMandatoryS3Fields(settings) 1087 1088 if resultVar0 != nil { 1089 span.LogFields(spanlog.Error(resultVar0)) 1090 ext.Error.Set(span, true) 1091 } 1092 1093 return resultVar0 1094 } 1095 1096 func (a *OpenTracingAppLayer) CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError { 1097 origCtx := a.ctx 1098 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckPasswordAndAllCriteria") 1099 1100 a.ctx = newCtx 1101 a.app.Srv().Store.SetContext(newCtx) 1102 defer func() { 1103 a.app.Srv().Store.SetContext(origCtx) 1104 a.ctx = origCtx 1105 }() 1106 1107 defer span.Finish() 1108 resultVar0 := a.app.CheckPasswordAndAllCriteria(user, password, mfaToken) 1109 1110 if resultVar0 != nil { 1111 span.LogFields(spanlog.Error(resultVar0)) 1112 ext.Error.Set(span, true) 1113 } 1114 1115 return resultVar0 1116 } 1117 1118 func (a *OpenTracingAppLayer) CheckRolesExist(roleNames []string) *model.AppError { 1119 origCtx := a.ctx 1120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckRolesExist") 1121 1122 a.ctx = newCtx 1123 a.app.Srv().Store.SetContext(newCtx) 1124 defer func() { 1125 a.app.Srv().Store.SetContext(origCtx) 1126 a.ctx = origCtx 1127 }() 1128 1129 defer span.Finish() 1130 resultVar0 := a.app.CheckRolesExist(roleNames) 1131 1132 if resultVar0 != nil { 1133 span.LogFields(spanlog.Error(resultVar0)) 1134 ext.Error.Set(span, true) 1135 } 1136 1137 return resultVar0 1138 } 1139 1140 func (a *OpenTracingAppLayer) CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1141 origCtx := a.ctx 1142 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserAllAuthenticationCriteria") 1143 1144 a.ctx = newCtx 1145 a.app.Srv().Store.SetContext(newCtx) 1146 defer func() { 1147 a.app.Srv().Store.SetContext(origCtx) 1148 a.ctx = origCtx 1149 }() 1150 1151 defer span.Finish() 1152 resultVar0 := a.app.CheckUserAllAuthenticationCriteria(user, mfaToken) 1153 1154 if resultVar0 != nil { 1155 span.LogFields(spanlog.Error(resultVar0)) 1156 ext.Error.Set(span, true) 1157 } 1158 1159 return resultVar0 1160 } 1161 1162 func (a *OpenTracingAppLayer) CheckUserMfa(user *model.User, token string) *model.AppError { 1163 origCtx := a.ctx 1164 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserMfa") 1165 1166 a.ctx = newCtx 1167 a.app.Srv().Store.SetContext(newCtx) 1168 defer func() { 1169 a.app.Srv().Store.SetContext(origCtx) 1170 a.ctx = origCtx 1171 }() 1172 1173 defer span.Finish() 1174 resultVar0 := a.app.CheckUserMfa(user, token) 1175 1176 if resultVar0 != nil { 1177 span.LogFields(spanlog.Error(resultVar0)) 1178 ext.Error.Set(span, true) 1179 } 1180 1181 return resultVar0 1182 } 1183 1184 func (a *OpenTracingAppLayer) CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError { 1185 origCtx := a.ctx 1186 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPostflightAuthenticationCriteria") 1187 1188 a.ctx = newCtx 1189 a.app.Srv().Store.SetContext(newCtx) 1190 defer func() { 1191 a.app.Srv().Store.SetContext(origCtx) 1192 a.ctx = origCtx 1193 }() 1194 1195 defer span.Finish() 1196 resultVar0 := a.app.CheckUserPostflightAuthenticationCriteria(user) 1197 1198 if resultVar0 != nil { 1199 span.LogFields(spanlog.Error(resultVar0)) 1200 ext.Error.Set(span, true) 1201 } 1202 1203 return resultVar0 1204 } 1205 1206 func (a *OpenTracingAppLayer) CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1207 origCtx := a.ctx 1208 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPreflightAuthenticationCriteria") 1209 1210 a.ctx = newCtx 1211 a.app.Srv().Store.SetContext(newCtx) 1212 defer func() { 1213 a.app.Srv().Store.SetContext(origCtx) 1214 a.ctx = origCtx 1215 }() 1216 1217 defer span.Finish() 1218 resultVar0 := a.app.CheckUserPreflightAuthenticationCriteria(user, mfaToken) 1219 1220 if resultVar0 != nil { 1221 span.LogFields(spanlog.Error(resultVar0)) 1222 ext.Error.Set(span, true) 1223 } 1224 1225 return resultVar0 1226 } 1227 1228 func (a *OpenTracingAppLayer) CheckValidDomains(team *model.Team) *model.AppError { 1229 origCtx := a.ctx 1230 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckValidDomains") 1231 1232 a.ctx = newCtx 1233 a.app.Srv().Store.SetContext(newCtx) 1234 defer func() { 1235 a.app.Srv().Store.SetContext(origCtx) 1236 a.ctx = origCtx 1237 }() 1238 1239 defer span.Finish() 1240 resultVar0 := a.app.CheckValidDomains(team) 1241 1242 if resultVar0 != nil { 1243 span.LogFields(spanlog.Error(resultVar0)) 1244 ext.Error.Set(span, true) 1245 } 1246 1247 return resultVar0 1248 } 1249 1250 func (a *OpenTracingAppLayer) ClearChannelMembersCache(channelID string) { 1251 origCtx := a.ctx 1252 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearChannelMembersCache") 1253 1254 a.ctx = newCtx 1255 a.app.Srv().Store.SetContext(newCtx) 1256 defer func() { 1257 a.app.Srv().Store.SetContext(origCtx) 1258 a.ctx = origCtx 1259 }() 1260 1261 defer span.Finish() 1262 a.app.ClearChannelMembersCache(channelID) 1263 } 1264 1265 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsers() { 1266 origCtx := a.ctx 1267 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsers") 1268 1269 a.ctx = newCtx 1270 a.app.Srv().Store.SetContext(newCtx) 1271 defer func() { 1272 a.app.Srv().Store.SetContext(origCtx) 1273 a.ctx = origCtx 1274 }() 1275 1276 defer span.Finish() 1277 a.app.ClearSessionCacheForAllUsers() 1278 } 1279 1280 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsersSkipClusterSend() { 1281 origCtx := a.ctx 1282 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsersSkipClusterSend") 1283 1284 a.ctx = newCtx 1285 a.app.Srv().Store.SetContext(newCtx) 1286 defer func() { 1287 a.app.Srv().Store.SetContext(origCtx) 1288 a.ctx = origCtx 1289 }() 1290 1291 defer span.Finish() 1292 a.app.ClearSessionCacheForAllUsersSkipClusterSend() 1293 } 1294 1295 func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userID string) { 1296 origCtx := a.ctx 1297 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUser") 1298 1299 a.ctx = newCtx 1300 a.app.Srv().Store.SetContext(newCtx) 1301 defer func() { 1302 a.app.Srv().Store.SetContext(origCtx) 1303 a.ctx = origCtx 1304 }() 1305 1306 defer span.Finish() 1307 a.app.ClearSessionCacheForUser(userID) 1308 } 1309 1310 func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userID string) { 1311 origCtx := a.ctx 1312 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUserSkipClusterSend") 1313 1314 a.ctx = newCtx 1315 a.app.Srv().Store.SetContext(newCtx) 1316 defer func() { 1317 a.app.Srv().Store.SetContext(origCtx) 1318 a.ctx = origCtx 1319 }() 1320 1321 defer span.Finish() 1322 a.app.ClearSessionCacheForUserSkipClusterSend(userID) 1323 } 1324 1325 func (a *OpenTracingAppLayer) ClearTeamMembersCache(teamID string) { 1326 origCtx := a.ctx 1327 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearTeamMembersCache") 1328 1329 a.ctx = newCtx 1330 a.app.Srv().Store.SetContext(newCtx) 1331 defer func() { 1332 a.app.Srv().Store.SetContext(origCtx) 1333 a.ctx = origCtx 1334 }() 1335 1336 defer span.Finish() 1337 a.app.ClearTeamMembersCache(teamID) 1338 } 1339 1340 func (a *OpenTracingAppLayer) ClientConfig() map[string]string { 1341 origCtx := a.ctx 1342 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfig") 1343 1344 a.ctx = newCtx 1345 a.app.Srv().Store.SetContext(newCtx) 1346 defer func() { 1347 a.app.Srv().Store.SetContext(origCtx) 1348 a.ctx = origCtx 1349 }() 1350 1351 defer span.Finish() 1352 resultVar0 := a.app.ClientConfig() 1353 1354 return resultVar0 1355 } 1356 1357 func (a *OpenTracingAppLayer) ClientConfigHash() string { 1358 origCtx := a.ctx 1359 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigHash") 1360 1361 a.ctx = newCtx 1362 a.app.Srv().Store.SetContext(newCtx) 1363 defer func() { 1364 a.app.Srv().Store.SetContext(origCtx) 1365 a.ctx = origCtx 1366 }() 1367 1368 defer span.Finish() 1369 resultVar0 := a.app.ClientConfigHash() 1370 1371 return resultVar0 1372 } 1373 1374 func (a *OpenTracingAppLayer) ClientConfigWithComputed() map[string]string { 1375 origCtx := a.ctx 1376 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigWithComputed") 1377 1378 a.ctx = newCtx 1379 a.app.Srv().Store.SetContext(newCtx) 1380 defer func() { 1381 a.app.Srv().Store.SetContext(origCtx) 1382 a.ctx = origCtx 1383 }() 1384 1385 defer span.Finish() 1386 resultVar0 := a.app.ClientConfigWithComputed() 1387 1388 return resultVar0 1389 } 1390 1391 func (a *OpenTracingAppLayer) Cloud() einterfaces.CloudInterface { 1392 origCtx := a.ctx 1393 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Cloud") 1394 1395 a.ctx = newCtx 1396 a.app.Srv().Store.SetContext(newCtx) 1397 defer func() { 1398 a.app.Srv().Store.SetContext(origCtx) 1399 a.ctx = origCtx 1400 }() 1401 1402 defer span.Finish() 1403 resultVar0 := a.app.Cloud() 1404 1405 return resultVar0 1406 } 1407 1408 func (a *OpenTracingAppLayer) CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError) { 1409 origCtx := a.ctx 1410 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndDeletePluginKey") 1411 1412 a.ctx = newCtx 1413 a.app.Srv().Store.SetContext(newCtx) 1414 defer func() { 1415 a.app.Srv().Store.SetContext(origCtx) 1416 a.ctx = origCtx 1417 }() 1418 1419 defer span.Finish() 1420 resultVar0, resultVar1 := a.app.CompareAndDeletePluginKey(pluginId, key, oldValue) 1421 1422 if resultVar1 != nil { 1423 span.LogFields(spanlog.Error(resultVar1)) 1424 ext.Error.Set(span, true) 1425 } 1426 1427 return resultVar0, resultVar1 1428 } 1429 1430 func (a *OpenTracingAppLayer) CompareAndSetPluginKey(pluginId string, key string, oldValue []byte, newValue []byte) (bool, *model.AppError) { 1431 origCtx := a.ctx 1432 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndSetPluginKey") 1433 1434 a.ctx = newCtx 1435 a.app.Srv().Store.SetContext(newCtx) 1436 defer func() { 1437 a.app.Srv().Store.SetContext(origCtx) 1438 a.ctx = origCtx 1439 }() 1440 1441 defer span.Finish() 1442 resultVar0, resultVar1 := a.app.CompareAndSetPluginKey(pluginId, key, oldValue, newValue) 1443 1444 if resultVar1 != nil { 1445 span.LogFields(spanlog.Error(resultVar1)) 1446 ext.Error.Set(span, true) 1447 } 1448 1449 return resultVar0, resultVar1 1450 } 1451 1452 func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, teamID string, props map[string]string, tokenUser *model.User) (*model.User, *model.AppError) { 1453 origCtx := a.ctx 1454 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth") 1455 1456 a.ctx = newCtx 1457 a.app.Srv().Store.SetContext(newCtx) 1458 defer func() { 1459 a.app.Srv().Store.SetContext(origCtx) 1460 a.ctx = origCtx 1461 }() 1462 1463 defer span.Finish() 1464 resultVar0, resultVar1 := a.app.CompleteOAuth(service, body, teamID, props, tokenUser) 1465 1466 if resultVar1 != nil { 1467 span.LogFields(spanlog.Error(resultVar1)) 1468 ext.Error.Set(span, true) 1469 } 1470 1471 return resultVar0, resultVar1 1472 } 1473 1474 func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(service string, userData io.Reader, email string, tokenUser *model.User) (*model.User, *model.AppError) { 1475 origCtx := a.ctx 1476 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteSwitchWithOAuth") 1477 1478 a.ctx = newCtx 1479 a.app.Srv().Store.SetContext(newCtx) 1480 defer func() { 1481 a.app.Srv().Store.SetContext(origCtx) 1482 a.ctx = origCtx 1483 }() 1484 1485 defer span.Finish() 1486 resultVar0, resultVar1 := a.app.CompleteSwitchWithOAuth(service, userData, email, tokenUser) 1487 1488 if resultVar1 != nil { 1489 span.LogFields(spanlog.Error(resultVar1)) 1490 ext.Error.Set(span, true) 1491 } 1492 1493 return resultVar0, resultVar1 1494 } 1495 1496 func (a *OpenTracingAppLayer) Config() *model.Config { 1497 origCtx := a.ctx 1498 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Config") 1499 1500 a.ctx = newCtx 1501 a.app.Srv().Store.SetContext(newCtx) 1502 defer func() { 1503 a.app.Srv().Store.SetContext(origCtx) 1504 a.ctx = origCtx 1505 }() 1506 1507 defer span.Finish() 1508 resultVar0 := a.app.Config() 1509 1510 return resultVar0 1511 } 1512 1513 func (a *OpenTracingAppLayer) ConvertBotToUser(bot *model.Bot, userPatch *model.UserPatch, sysadmin bool) (*model.User, *model.AppError) { 1514 origCtx := a.ctx 1515 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertBotToUser") 1516 1517 a.ctx = newCtx 1518 a.app.Srv().Store.SetContext(newCtx) 1519 defer func() { 1520 a.app.Srv().Store.SetContext(origCtx) 1521 a.ctx = origCtx 1522 }() 1523 1524 defer span.Finish() 1525 resultVar0, resultVar1 := a.app.ConvertBotToUser(bot, userPatch, sysadmin) 1526 1527 if resultVar1 != nil { 1528 span.LogFields(spanlog.Error(resultVar1)) 1529 ext.Error.Set(span, true) 1530 } 1531 1532 return resultVar0, resultVar1 1533 } 1534 1535 func (a *OpenTracingAppLayer) ConvertUserToBot(user *model.User) (*model.Bot, *model.AppError) { 1536 origCtx := a.ctx 1537 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertUserToBot") 1538 1539 a.ctx = newCtx 1540 a.app.Srv().Store.SetContext(newCtx) 1541 defer func() { 1542 a.app.Srv().Store.SetContext(origCtx) 1543 a.ctx = origCtx 1544 }() 1545 1546 defer span.Finish() 1547 resultVar0, resultVar1 := a.app.ConvertUserToBot(user) 1548 1549 if resultVar1 != nil { 1550 span.LogFields(spanlog.Error(resultVar1)) 1551 ext.Error.Set(span, true) 1552 } 1553 1554 return resultVar0, resultVar1 1555 } 1556 1557 func (a *OpenTracingAppLayer) CopyFileInfos(userID string, fileIds []string) ([]string, *model.AppError) { 1558 origCtx := a.ctx 1559 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CopyFileInfos") 1560 1561 a.ctx = newCtx 1562 a.app.Srv().Store.SetContext(newCtx) 1563 defer func() { 1564 a.app.Srv().Store.SetContext(origCtx) 1565 a.ctx = origCtx 1566 }() 1567 1568 defer span.Finish() 1569 resultVar0, resultVar1 := a.app.CopyFileInfos(userID, fileIds) 1570 1571 if resultVar1 != nil { 1572 span.LogFields(spanlog.Error(resultVar1)) 1573 ext.Error.Set(span, true) 1574 } 1575 1576 return resultVar0, resultVar1 1577 } 1578 1579 func (a *OpenTracingAppLayer) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) { 1580 origCtx := a.ctx 1581 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBot") 1582 1583 a.ctx = newCtx 1584 a.app.Srv().Store.SetContext(newCtx) 1585 defer func() { 1586 a.app.Srv().Store.SetContext(origCtx) 1587 a.ctx = origCtx 1588 }() 1589 1590 defer span.Finish() 1591 resultVar0, resultVar1 := a.app.CreateBot(bot) 1592 1593 if resultVar1 != nil { 1594 span.LogFields(spanlog.Error(resultVar1)) 1595 ext.Error.Set(span, true) 1596 } 1597 1598 return resultVar0, resultVar1 1599 } 1600 1601 func (a *OpenTracingAppLayer) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) { 1602 origCtx := a.ctx 1603 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannel") 1604 1605 a.ctx = newCtx 1606 a.app.Srv().Store.SetContext(newCtx) 1607 defer func() { 1608 a.app.Srv().Store.SetContext(origCtx) 1609 a.ctx = origCtx 1610 }() 1611 1612 defer span.Finish() 1613 resultVar0, resultVar1 := a.app.CreateChannel(channel, addMember) 1614 1615 if resultVar1 != nil { 1616 span.LogFields(spanlog.Error(resultVar1)) 1617 ext.Error.Set(span, true) 1618 } 1619 1620 return resultVar0, resultVar1 1621 } 1622 1623 func (a *OpenTracingAppLayer) CreateChannelScheme(channel *model.Channel) (*model.Scheme, *model.AppError) { 1624 origCtx := a.ctx 1625 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelScheme") 1626 1627 a.ctx = newCtx 1628 a.app.Srv().Store.SetContext(newCtx) 1629 defer func() { 1630 a.app.Srv().Store.SetContext(origCtx) 1631 a.ctx = origCtx 1632 }() 1633 1634 defer span.Finish() 1635 resultVar0, resultVar1 := a.app.CreateChannelScheme(channel) 1636 1637 if resultVar1 != nil { 1638 span.LogFields(spanlog.Error(resultVar1)) 1639 ext.Error.Set(span, true) 1640 } 1641 1642 return resultVar0, resultVar1 1643 } 1644 1645 func (a *OpenTracingAppLayer) CreateChannelWithUser(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { 1646 origCtx := a.ctx 1647 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelWithUser") 1648 1649 a.ctx = newCtx 1650 a.app.Srv().Store.SetContext(newCtx) 1651 defer func() { 1652 a.app.Srv().Store.SetContext(origCtx) 1653 a.ctx = origCtx 1654 }() 1655 1656 defer span.Finish() 1657 resultVar0, resultVar1 := a.app.CreateChannelWithUser(channel, userID) 1658 1659 if resultVar1 != nil { 1660 span.LogFields(spanlog.Error(resultVar1)) 1661 ext.Error.Set(span, true) 1662 } 1663 1664 return resultVar0, resultVar1 1665 } 1666 1667 func (a *OpenTracingAppLayer) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) { 1668 origCtx := a.ctx 1669 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommand") 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.CreateCommand(cmd) 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) CreateCommandPost(post *model.Post, teamID string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { 1690 origCtx := a.ctx 1691 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandPost") 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 span.SetTag("teamID", teamID) 1701 1702 span.SetTag("skipSlackParsing", skipSlackParsing) 1703 1704 defer span.Finish() 1705 resultVar0, resultVar1 := a.app.CreateCommandPost(post, teamID, response, skipSlackParsing) 1706 1707 if resultVar1 != nil { 1708 span.LogFields(spanlog.Error(resultVar1)) 1709 ext.Error.Set(span, true) 1710 } 1711 1712 return resultVar0, resultVar1 1713 } 1714 1715 func (a *OpenTracingAppLayer) CreateCommandWebhook(commandID string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { 1716 origCtx := a.ctx 1717 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandWebhook") 1718 1719 a.ctx = newCtx 1720 a.app.Srv().Store.SetContext(newCtx) 1721 defer func() { 1722 a.app.Srv().Store.SetContext(origCtx) 1723 a.ctx = origCtx 1724 }() 1725 1726 defer span.Finish() 1727 resultVar0, resultVar1 := a.app.CreateCommandWebhook(commandID, args) 1728 1729 if resultVar1 != nil { 1730 span.LogFields(spanlog.Error(resultVar1)) 1731 ext.Error.Set(span, true) 1732 } 1733 1734 return resultVar0, resultVar1 1735 } 1736 1737 func (a *OpenTracingAppLayer) CreateDefaultChannels(teamID string) ([]*model.Channel, *model.AppError) { 1738 origCtx := a.ctx 1739 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultChannels") 1740 1741 a.ctx = newCtx 1742 a.app.Srv().Store.SetContext(newCtx) 1743 defer func() { 1744 a.app.Srv().Store.SetContext(origCtx) 1745 a.ctx = origCtx 1746 }() 1747 1748 defer span.Finish() 1749 resultVar0, resultVar1 := a.app.CreateDefaultChannels(teamID) 1750 1751 if resultVar1 != nil { 1752 span.LogFields(spanlog.Error(resultVar1)) 1753 ext.Error.Set(span, true) 1754 } 1755 1756 return resultVar0, resultVar1 1757 } 1758 1759 func (a *OpenTracingAppLayer) CreateDefaultMemberships(since int64) error { 1760 origCtx := a.ctx 1761 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultMemberships") 1762 1763 a.ctx = newCtx 1764 a.app.Srv().Store.SetContext(newCtx) 1765 defer func() { 1766 a.app.Srv().Store.SetContext(origCtx) 1767 a.ctx = origCtx 1768 }() 1769 1770 defer span.Finish() 1771 resultVar0 := a.app.CreateDefaultMemberships(since) 1772 1773 if resultVar0 != nil { 1774 span.LogFields(spanlog.Error(resultVar0)) 1775 ext.Error.Set(span, true) 1776 } 1777 1778 return resultVar0 1779 } 1780 1781 func (a *OpenTracingAppLayer) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) { 1782 origCtx := a.ctx 1783 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateEmoji") 1784 1785 a.ctx = newCtx 1786 a.app.Srv().Store.SetContext(newCtx) 1787 defer func() { 1788 a.app.Srv().Store.SetContext(origCtx) 1789 a.ctx = origCtx 1790 }() 1791 1792 defer span.Finish() 1793 resultVar0, resultVar1 := a.app.CreateEmoji(sessionUserId, emoji, multiPartImageData) 1794 1795 if resultVar1 != nil { 1796 span.LogFields(spanlog.Error(resultVar1)) 1797 ext.Error.Set(span, true) 1798 } 1799 1800 return resultVar0, resultVar1 1801 } 1802 1803 func (a *OpenTracingAppLayer) CreateGroup(group *model.Group) (*model.Group, *model.AppError) { 1804 origCtx := a.ctx 1805 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroup") 1806 1807 a.ctx = newCtx 1808 a.app.Srv().Store.SetContext(newCtx) 1809 defer func() { 1810 a.app.Srv().Store.SetContext(origCtx) 1811 a.ctx = origCtx 1812 }() 1813 1814 defer span.Finish() 1815 resultVar0, resultVar1 := a.app.CreateGroup(group) 1816 1817 if resultVar1 != nil { 1818 span.LogFields(spanlog.Error(resultVar1)) 1819 ext.Error.Set(span, true) 1820 } 1821 1822 return resultVar0, resultVar1 1823 } 1824 1825 func (a *OpenTracingAppLayer) CreateGroupChannel(userIDs []string, creatorId string) (*model.Channel, *model.AppError) { 1826 origCtx := a.ctx 1827 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroupChannel") 1828 1829 a.ctx = newCtx 1830 a.app.Srv().Store.SetContext(newCtx) 1831 defer func() { 1832 a.app.Srv().Store.SetContext(origCtx) 1833 a.ctx = origCtx 1834 }() 1835 1836 defer span.Finish() 1837 resultVar0, resultVar1 := a.app.CreateGroupChannel(userIDs, creatorId) 1838 1839 if resultVar1 != nil { 1840 span.LogFields(spanlog.Error(resultVar1)) 1841 ext.Error.Set(span, true) 1842 } 1843 1844 return resultVar0, resultVar1 1845 } 1846 1847 func (a *OpenTracingAppLayer) CreateGuest(user *model.User) (*model.User, *model.AppError) { 1848 origCtx := a.ctx 1849 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGuest") 1850 1851 a.ctx = newCtx 1852 a.app.Srv().Store.SetContext(newCtx) 1853 defer func() { 1854 a.app.Srv().Store.SetContext(origCtx) 1855 a.ctx = origCtx 1856 }() 1857 1858 defer span.Finish() 1859 resultVar0, resultVar1 := a.app.CreateGuest(user) 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) CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 1870 origCtx := a.ctx 1871 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateIncomingWebhookForChannel") 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.CreateIncomingWebhookForChannel(creatorId, channel, hook) 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) CreateJob(job *model.Job) (*model.Job, *model.AppError) { 1892 origCtx := a.ctx 1893 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateJob") 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.CreateJob(job) 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) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 1914 origCtx := a.ctx 1915 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthApp") 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, resultVar1 := a.app.CreateOAuthApp(app) 1926 1927 if resultVar1 != nil { 1928 span.LogFields(spanlog.Error(resultVar1)) 1929 ext.Error.Set(span, true) 1930 } 1931 1932 return resultVar0, resultVar1 1933 } 1934 1935 func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) { 1936 origCtx := a.ctx 1937 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthStateToken") 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.CreateOAuthStateToken(extra) 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) CreateOAuthUser(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { 1958 origCtx := a.ctx 1959 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser") 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.CreateOAuthUser(service, userData, teamID, tokenUser) 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) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 1980 origCtx := a.ctx 1981 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOutgoingWebhook") 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.CreateOutgoingWebhook(hook) 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) CreatePasswordRecoveryToken(userID string, email string) (*model.Token, *model.AppError) { 2002 origCtx := a.ctx 2003 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePasswordRecoveryToken") 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.CreatePasswordRecoveryToken(userID, email) 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) CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError) { 2024 origCtx := a.ctx 2025 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePost") 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.CreatePost(post, channel, triggerWebhooks, setOnline) 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) CreatePostAsUser(post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError) { 2046 origCtx := a.ctx 2047 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostAsUser") 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.CreatePostAsUser(post, currentSessionId, setOnline) 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) CreatePostMissingChannel(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) { 2068 origCtx := a.ctx 2069 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostMissingChannel") 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.CreatePostMissingChannel(post, triggerWebhooks) 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) CreateRole(role *model.Role) (*model.Role, *model.AppError) { 2090 origCtx := a.ctx 2091 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateRole") 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.CreateRole(role) 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) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 2112 origCtx := a.ctx 2113 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateScheme") 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.CreateScheme(scheme) 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) CreateSession(session *model.Session) (*model.Session, *model.AppError) { 2134 origCtx := a.ctx 2135 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSession") 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.CreateSession(session) 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) CreateSidebarCategory(userID string, teamID string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { 2156 origCtx := a.ctx 2157 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSidebarCategory") 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.CreateSidebarCategory(userID, teamID, newCategory) 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) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { 2178 origCtx := a.ctx 2179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeam") 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.CreateTeam(team) 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) CreateTeamWithUser(team *model.Team, userID string) (*model.Team, *model.AppError) { 2200 origCtx := a.ctx 2201 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeamWithUser") 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.CreateTeamWithUser(team, userID) 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) CreateTermsOfService(text string, userID string) (*model.TermsOfService, *model.AppError) { 2222 origCtx := a.ctx 2223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTermsOfService") 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.CreateTermsOfService(text, userID) 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) CreateUploadSession(us *model.UploadSession) (*model.UploadSession, *model.AppError) { 2244 origCtx := a.ctx 2245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUploadSession") 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.CreateUploadSession(us) 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) CreateUser(user *model.User) (*model.User, *model.AppError) { 2266 origCtx := a.ctx 2267 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUser") 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.CreateUser(user) 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) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) { 2288 origCtx := a.ctx 2289 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAccessToken") 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.CreateUserAccessToken(token) 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) CreateUserAsAdmin(user *model.User, redirect string) (*model.User, *model.AppError) { 2310 origCtx := a.ctx 2311 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAsAdmin") 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.CreateUserAsAdmin(user, redirect) 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) CreateUserFromSignup(user *model.User, redirect string) (*model.User, *model.AppError) { 2332 origCtx := a.ctx 2333 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserFromSignup") 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.CreateUserFromSignup(user, redirect) 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) CreateUserWithInviteId(user *model.User, inviteId string, redirect string) (*model.User, *model.AppError) { 2354 origCtx := a.ctx 2355 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithInviteId") 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.CreateUserWithInviteId(user, inviteId, redirect) 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) CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError) { 2376 origCtx := a.ctx 2377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithToken") 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.CreateUserWithToken(user, token) 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) CreateWebhookPost(userID string, channel *model.Channel, text string, overrideUsername string, overrideIconURL string, overrideIconEmoji string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { 2398 origCtx := a.ctx 2399 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateWebhookPost") 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.CreateWebhookPost(userID, channel, text, overrideUsername, overrideIconURL, overrideIconEmoji, props, postType, postRootId) 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) CreateZipFileAndAddFiles(fileBackend filesstore.FileBackend, fileDatas []model.FileData, zipFileName string, directory string) error { 2420 origCtx := a.ctx 2421 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateZipFileAndAddFiles") 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 := a.app.CreateZipFileAndAddFiles(fileBackend, fileDatas, zipFileName, directory) 2432 2433 if resultVar0 != nil { 2434 span.LogFields(spanlog.Error(resultVar0)) 2435 ext.Error.Set(span, true) 2436 } 2437 2438 return resultVar0 2439 } 2440 2441 func (a *OpenTracingAppLayer) DBHealthCheckDelete() error { 2442 origCtx := a.ctx 2443 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DBHealthCheckDelete") 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 := a.app.DBHealthCheckDelete() 2454 2455 if resultVar0 != nil { 2456 span.LogFields(spanlog.Error(resultVar0)) 2457 ext.Error.Set(span, true) 2458 } 2459 2460 return resultVar0 2461 } 2462 2463 func (a *OpenTracingAppLayer) DBHealthCheckWrite() error { 2464 origCtx := a.ctx 2465 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DBHealthCheckWrite") 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 := a.app.DBHealthCheckWrite() 2476 2477 if resultVar0 != nil { 2478 span.LogFields(spanlog.Error(resultVar0)) 2479 ext.Error.Set(span, true) 2480 } 2481 2482 return resultVar0 2483 } 2484 2485 func (a *OpenTracingAppLayer) DeactivateGuests() *model.AppError { 2486 origCtx := a.ctx 2487 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateGuests") 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 := a.app.DeactivateGuests() 2498 2499 if resultVar0 != nil { 2500 span.LogFields(spanlog.Error(resultVar0)) 2501 ext.Error.Set(span, true) 2502 } 2503 2504 return resultVar0 2505 } 2506 2507 func (a *OpenTracingAppLayer) DeactivateMfa(userID string) *model.AppError { 2508 origCtx := a.ctx 2509 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateMfa") 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 := a.app.DeactivateMfa(userID) 2520 2521 if resultVar0 != nil { 2522 span.LogFields(spanlog.Error(resultVar0)) 2523 ext.Error.Set(span, true) 2524 } 2525 2526 return resultVar0 2527 } 2528 2529 func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userID string, appId string) *model.AppError { 2530 origCtx := a.ctx 2531 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser") 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 := a.app.DeauthorizeOAuthAppForUser(userID, appId) 2542 2543 if resultVar0 != nil { 2544 span.LogFields(spanlog.Error(resultVar0)) 2545 ext.Error.Set(span, true) 2546 } 2547 2548 return resultVar0 2549 } 2550 2551 func (a *OpenTracingAppLayer) DefaultChannelNames() []string { 2552 origCtx := a.ctx 2553 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DefaultChannelNames") 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 := a.app.DefaultChannelNames() 2564 2565 return resultVar0 2566 } 2567 2568 func (a *OpenTracingAppLayer) DeleteAllExpiredPluginKeys() *model.AppError { 2569 origCtx := a.ctx 2570 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllExpiredPluginKeys") 2571 2572 a.ctx = newCtx 2573 a.app.Srv().Store.SetContext(newCtx) 2574 defer func() { 2575 a.app.Srv().Store.SetContext(origCtx) 2576 a.ctx = origCtx 2577 }() 2578 2579 defer span.Finish() 2580 resultVar0 := a.app.DeleteAllExpiredPluginKeys() 2581 2582 if resultVar0 != nil { 2583 span.LogFields(spanlog.Error(resultVar0)) 2584 ext.Error.Set(span, true) 2585 } 2586 2587 return resultVar0 2588 } 2589 2590 func (a *OpenTracingAppLayer) DeleteAllKeysForPlugin(pluginId string) *model.AppError { 2591 origCtx := a.ctx 2592 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllKeysForPlugin") 2593 2594 a.ctx = newCtx 2595 a.app.Srv().Store.SetContext(newCtx) 2596 defer func() { 2597 a.app.Srv().Store.SetContext(origCtx) 2598 a.ctx = origCtx 2599 }() 2600 2601 defer span.Finish() 2602 resultVar0 := a.app.DeleteAllKeysForPlugin(pluginId) 2603 2604 if resultVar0 != nil { 2605 span.LogFields(spanlog.Error(resultVar0)) 2606 ext.Error.Set(span, true) 2607 } 2608 2609 return resultVar0 2610 } 2611 2612 func (a *OpenTracingAppLayer) DeleteBotIconImage(botUserId string) *model.AppError { 2613 origCtx := a.ctx 2614 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBotIconImage") 2615 2616 a.ctx = newCtx 2617 a.app.Srv().Store.SetContext(newCtx) 2618 defer func() { 2619 a.app.Srv().Store.SetContext(origCtx) 2620 a.ctx = origCtx 2621 }() 2622 2623 defer span.Finish() 2624 resultVar0 := a.app.DeleteBotIconImage(botUserId) 2625 2626 if resultVar0 != nil { 2627 span.LogFields(spanlog.Error(resultVar0)) 2628 ext.Error.Set(span, true) 2629 } 2630 2631 return resultVar0 2632 } 2633 2634 func (a *OpenTracingAppLayer) DeleteBrandImage() *model.AppError { 2635 origCtx := a.ctx 2636 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBrandImage") 2637 2638 a.ctx = newCtx 2639 a.app.Srv().Store.SetContext(newCtx) 2640 defer func() { 2641 a.app.Srv().Store.SetContext(origCtx) 2642 a.ctx = origCtx 2643 }() 2644 2645 defer span.Finish() 2646 resultVar0 := a.app.DeleteBrandImage() 2647 2648 if resultVar0 != nil { 2649 span.LogFields(spanlog.Error(resultVar0)) 2650 ext.Error.Set(span, true) 2651 } 2652 2653 return resultVar0 2654 } 2655 2656 func (a *OpenTracingAppLayer) DeleteChannel(channel *model.Channel, userID string) *model.AppError { 2657 origCtx := a.ctx 2658 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannel") 2659 2660 a.ctx = newCtx 2661 a.app.Srv().Store.SetContext(newCtx) 2662 defer func() { 2663 a.app.Srv().Store.SetContext(origCtx) 2664 a.ctx = origCtx 2665 }() 2666 2667 defer span.Finish() 2668 resultVar0 := a.app.DeleteChannel(channel, userID) 2669 2670 if resultVar0 != nil { 2671 span.LogFields(spanlog.Error(resultVar0)) 2672 ext.Error.Set(span, true) 2673 } 2674 2675 return resultVar0 2676 } 2677 2678 func (a *OpenTracingAppLayer) DeleteChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 2679 origCtx := a.ctx 2680 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannelScheme") 2681 2682 a.ctx = newCtx 2683 a.app.Srv().Store.SetContext(newCtx) 2684 defer func() { 2685 a.app.Srv().Store.SetContext(origCtx) 2686 a.ctx = origCtx 2687 }() 2688 2689 defer span.Finish() 2690 resultVar0, resultVar1 := a.app.DeleteChannelScheme(channel) 2691 2692 if resultVar1 != nil { 2693 span.LogFields(spanlog.Error(resultVar1)) 2694 ext.Error.Set(span, true) 2695 } 2696 2697 return resultVar0, resultVar1 2698 } 2699 2700 func (a *OpenTracingAppLayer) DeleteCommand(commandID string) *model.AppError { 2701 origCtx := a.ctx 2702 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteCommand") 2703 2704 a.ctx = newCtx 2705 a.app.Srv().Store.SetContext(newCtx) 2706 defer func() { 2707 a.app.Srv().Store.SetContext(origCtx) 2708 a.ctx = origCtx 2709 }() 2710 2711 defer span.Finish() 2712 resultVar0 := a.app.DeleteCommand(commandID) 2713 2714 if resultVar0 != nil { 2715 span.LogFields(spanlog.Error(resultVar0)) 2716 ext.Error.Set(span, true) 2717 } 2718 2719 return resultVar0 2720 } 2721 2722 func (a *OpenTracingAppLayer) DeleteEmoji(emoji *model.Emoji) *model.AppError { 2723 origCtx := a.ctx 2724 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEmoji") 2725 2726 a.ctx = newCtx 2727 a.app.Srv().Store.SetContext(newCtx) 2728 defer func() { 2729 a.app.Srv().Store.SetContext(origCtx) 2730 a.ctx = origCtx 2731 }() 2732 2733 defer span.Finish() 2734 resultVar0 := a.app.DeleteEmoji(emoji) 2735 2736 if resultVar0 != nil { 2737 span.LogFields(spanlog.Error(resultVar0)) 2738 ext.Error.Set(span, true) 2739 } 2740 2741 return resultVar0 2742 } 2743 2744 func (a *OpenTracingAppLayer) DeleteEphemeralPost(userID string, postId string) { 2745 origCtx := a.ctx 2746 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEphemeralPost") 2747 2748 a.ctx = newCtx 2749 a.app.Srv().Store.SetContext(newCtx) 2750 defer func() { 2751 a.app.Srv().Store.SetContext(origCtx) 2752 a.ctx = origCtx 2753 }() 2754 2755 defer span.Finish() 2756 a.app.DeleteEphemeralPost(userID, postId) 2757 } 2758 2759 func (a *OpenTracingAppLayer) DeleteExport(name string) *model.AppError { 2760 origCtx := a.ctx 2761 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteExport") 2762 2763 a.ctx = newCtx 2764 a.app.Srv().Store.SetContext(newCtx) 2765 defer func() { 2766 a.app.Srv().Store.SetContext(origCtx) 2767 a.ctx = origCtx 2768 }() 2769 2770 defer span.Finish() 2771 resultVar0 := a.app.DeleteExport(name) 2772 2773 if resultVar0 != nil { 2774 span.LogFields(spanlog.Error(resultVar0)) 2775 ext.Error.Set(span, true) 2776 } 2777 2778 return resultVar0 2779 } 2780 2781 func (a *OpenTracingAppLayer) DeleteFlaggedPosts(postId string) { 2782 origCtx := a.ctx 2783 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteFlaggedPosts") 2784 2785 a.ctx = newCtx 2786 a.app.Srv().Store.SetContext(newCtx) 2787 defer func() { 2788 a.app.Srv().Store.SetContext(origCtx) 2789 a.ctx = origCtx 2790 }() 2791 2792 defer span.Finish() 2793 a.app.DeleteFlaggedPosts(postId) 2794 } 2795 2796 func (a *OpenTracingAppLayer) DeleteGroup(groupID string) (*model.Group, *model.AppError) { 2797 origCtx := a.ctx 2798 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroup") 2799 2800 a.ctx = newCtx 2801 a.app.Srv().Store.SetContext(newCtx) 2802 defer func() { 2803 a.app.Srv().Store.SetContext(origCtx) 2804 a.ctx = origCtx 2805 }() 2806 2807 defer span.Finish() 2808 resultVar0, resultVar1 := a.app.DeleteGroup(groupID) 2809 2810 if resultVar1 != nil { 2811 span.LogFields(spanlog.Error(resultVar1)) 2812 ext.Error.Set(span, true) 2813 } 2814 2815 return resultVar0, resultVar1 2816 } 2817 2818 func (a *OpenTracingAppLayer) DeleteGroupConstrainedMemberships() error { 2819 origCtx := a.ctx 2820 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupConstrainedMemberships") 2821 2822 a.ctx = newCtx 2823 a.app.Srv().Store.SetContext(newCtx) 2824 defer func() { 2825 a.app.Srv().Store.SetContext(origCtx) 2826 a.ctx = origCtx 2827 }() 2828 2829 defer span.Finish() 2830 resultVar0 := a.app.DeleteGroupConstrainedMemberships() 2831 2832 if resultVar0 != nil { 2833 span.LogFields(spanlog.Error(resultVar0)) 2834 ext.Error.Set(span, true) 2835 } 2836 2837 return resultVar0 2838 } 2839 2840 func (a *OpenTracingAppLayer) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 2841 origCtx := a.ctx 2842 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupMember") 2843 2844 a.ctx = newCtx 2845 a.app.Srv().Store.SetContext(newCtx) 2846 defer func() { 2847 a.app.Srv().Store.SetContext(origCtx) 2848 a.ctx = origCtx 2849 }() 2850 2851 defer span.Finish() 2852 resultVar0, resultVar1 := a.app.DeleteGroupMember(groupID, userID) 2853 2854 if resultVar1 != nil { 2855 span.LogFields(spanlog.Error(resultVar1)) 2856 ext.Error.Set(span, true) 2857 } 2858 2859 return resultVar0, resultVar1 2860 } 2861 2862 func (a *OpenTracingAppLayer) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 2863 origCtx := a.ctx 2864 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupSyncable") 2865 2866 a.ctx = newCtx 2867 a.app.Srv().Store.SetContext(newCtx) 2868 defer func() { 2869 a.app.Srv().Store.SetContext(origCtx) 2870 a.ctx = origCtx 2871 }() 2872 2873 defer span.Finish() 2874 resultVar0, resultVar1 := a.app.DeleteGroupSyncable(groupID, syncableID, syncableType) 2875 2876 if resultVar1 != nil { 2877 span.LogFields(spanlog.Error(resultVar1)) 2878 ext.Error.Set(span, true) 2879 } 2880 2881 return resultVar0, resultVar1 2882 } 2883 2884 func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookID string) *model.AppError { 2885 origCtx := a.ctx 2886 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteIncomingWebhook") 2887 2888 a.ctx = newCtx 2889 a.app.Srv().Store.SetContext(newCtx) 2890 defer func() { 2891 a.app.Srv().Store.SetContext(origCtx) 2892 a.ctx = origCtx 2893 }() 2894 2895 defer span.Finish() 2896 resultVar0 := a.app.DeleteIncomingWebhook(hookID) 2897 2898 if resultVar0 != nil { 2899 span.LogFields(spanlog.Error(resultVar0)) 2900 ext.Error.Set(span, true) 2901 } 2902 2903 return resultVar0 2904 } 2905 2906 func (a *OpenTracingAppLayer) DeleteOAuthApp(appId string) *model.AppError { 2907 origCtx := a.ctx 2908 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOAuthApp") 2909 2910 a.ctx = newCtx 2911 a.app.Srv().Store.SetContext(newCtx) 2912 defer func() { 2913 a.app.Srv().Store.SetContext(origCtx) 2914 a.ctx = origCtx 2915 }() 2916 2917 defer span.Finish() 2918 resultVar0 := a.app.DeleteOAuthApp(appId) 2919 2920 if resultVar0 != nil { 2921 span.LogFields(spanlog.Error(resultVar0)) 2922 ext.Error.Set(span, true) 2923 } 2924 2925 return resultVar0 2926 } 2927 2928 func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookID string) *model.AppError { 2929 origCtx := a.ctx 2930 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOutgoingWebhook") 2931 2932 a.ctx = newCtx 2933 a.app.Srv().Store.SetContext(newCtx) 2934 defer func() { 2935 a.app.Srv().Store.SetContext(origCtx) 2936 a.ctx = origCtx 2937 }() 2938 2939 defer span.Finish() 2940 resultVar0 := a.app.DeleteOutgoingWebhook(hookID) 2941 2942 if resultVar0 != nil { 2943 span.LogFields(spanlog.Error(resultVar0)) 2944 ext.Error.Set(span, true) 2945 } 2946 2947 return resultVar0 2948 } 2949 2950 func (a *OpenTracingAppLayer) DeletePluginKey(pluginId string, key string) *model.AppError { 2951 origCtx := a.ctx 2952 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePluginKey") 2953 2954 a.ctx = newCtx 2955 a.app.Srv().Store.SetContext(newCtx) 2956 defer func() { 2957 a.app.Srv().Store.SetContext(origCtx) 2958 a.ctx = origCtx 2959 }() 2960 2961 defer span.Finish() 2962 resultVar0 := a.app.DeletePluginKey(pluginId, key) 2963 2964 if resultVar0 != nil { 2965 span.LogFields(spanlog.Error(resultVar0)) 2966 ext.Error.Set(span, true) 2967 } 2968 2969 return resultVar0 2970 } 2971 2972 func (a *OpenTracingAppLayer) DeletePost(postId string, deleteByID string) (*model.Post, *model.AppError) { 2973 origCtx := a.ctx 2974 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePost") 2975 2976 a.ctx = newCtx 2977 a.app.Srv().Store.SetContext(newCtx) 2978 defer func() { 2979 a.app.Srv().Store.SetContext(origCtx) 2980 a.ctx = origCtx 2981 }() 2982 2983 defer span.Finish() 2984 resultVar0, resultVar1 := a.app.DeletePost(postId, deleteByID) 2985 2986 if resultVar1 != nil { 2987 span.LogFields(spanlog.Error(resultVar1)) 2988 ext.Error.Set(span, true) 2989 } 2990 2991 return resultVar0, resultVar1 2992 } 2993 2994 func (a *OpenTracingAppLayer) DeletePostFiles(post *model.Post) { 2995 origCtx := a.ctx 2996 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePostFiles") 2997 2998 a.ctx = newCtx 2999 a.app.Srv().Store.SetContext(newCtx) 3000 defer func() { 3001 a.app.Srv().Store.SetContext(origCtx) 3002 a.ctx = origCtx 3003 }() 3004 3005 defer span.Finish() 3006 a.app.DeletePostFiles(post) 3007 } 3008 3009 func (a *OpenTracingAppLayer) DeletePreferences(userID string, preferences model.Preferences) *model.AppError { 3010 origCtx := a.ctx 3011 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePreferences") 3012 3013 a.ctx = newCtx 3014 a.app.Srv().Store.SetContext(newCtx) 3015 defer func() { 3016 a.app.Srv().Store.SetContext(origCtx) 3017 a.ctx = origCtx 3018 }() 3019 3020 defer span.Finish() 3021 resultVar0 := a.app.DeletePreferences(userID, preferences) 3022 3023 if resultVar0 != nil { 3024 span.LogFields(spanlog.Error(resultVar0)) 3025 ext.Error.Set(span, true) 3026 } 3027 3028 return resultVar0 3029 } 3030 3031 func (a *OpenTracingAppLayer) DeletePublicKey(name string) *model.AppError { 3032 origCtx := a.ctx 3033 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePublicKey") 3034 3035 a.ctx = newCtx 3036 a.app.Srv().Store.SetContext(newCtx) 3037 defer func() { 3038 a.app.Srv().Store.SetContext(origCtx) 3039 a.ctx = origCtx 3040 }() 3041 3042 defer span.Finish() 3043 resultVar0 := a.app.DeletePublicKey(name) 3044 3045 if resultVar0 != nil { 3046 span.LogFields(spanlog.Error(resultVar0)) 3047 ext.Error.Set(span, true) 3048 } 3049 3050 return resultVar0 3051 } 3052 3053 func (a *OpenTracingAppLayer) DeleteReactionForPost(reaction *model.Reaction) *model.AppError { 3054 origCtx := a.ctx 3055 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteReactionForPost") 3056 3057 a.ctx = newCtx 3058 a.app.Srv().Store.SetContext(newCtx) 3059 defer func() { 3060 a.app.Srv().Store.SetContext(origCtx) 3061 a.ctx = origCtx 3062 }() 3063 3064 defer span.Finish() 3065 resultVar0 := a.app.DeleteReactionForPost(reaction) 3066 3067 if resultVar0 != nil { 3068 span.LogFields(spanlog.Error(resultVar0)) 3069 ext.Error.Set(span, true) 3070 } 3071 3072 return resultVar0 3073 } 3074 3075 func (a *OpenTracingAppLayer) DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) { 3076 origCtx := a.ctx 3077 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteScheme") 3078 3079 a.ctx = newCtx 3080 a.app.Srv().Store.SetContext(newCtx) 3081 defer func() { 3082 a.app.Srv().Store.SetContext(origCtx) 3083 a.ctx = origCtx 3084 }() 3085 3086 defer span.Finish() 3087 resultVar0, resultVar1 := a.app.DeleteScheme(schemeId) 3088 3089 if resultVar1 != nil { 3090 span.LogFields(spanlog.Error(resultVar1)) 3091 ext.Error.Set(span, true) 3092 } 3093 3094 return resultVar0, resultVar1 3095 } 3096 3097 func (a *OpenTracingAppLayer) DeleteSidebarCategory(userID string, teamID string, categoryId string) *model.AppError { 3098 origCtx := a.ctx 3099 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSidebarCategory") 3100 3101 a.ctx = newCtx 3102 a.app.Srv().Store.SetContext(newCtx) 3103 defer func() { 3104 a.app.Srv().Store.SetContext(origCtx) 3105 a.ctx = origCtx 3106 }() 3107 3108 defer span.Finish() 3109 resultVar0 := a.app.DeleteSidebarCategory(userID, teamID, categoryId) 3110 3111 if resultVar0 != nil { 3112 span.LogFields(spanlog.Error(resultVar0)) 3113 ext.Error.Set(span, true) 3114 } 3115 3116 return resultVar0 3117 } 3118 3119 func (a *OpenTracingAppLayer) DeleteToken(token *model.Token) *model.AppError { 3120 origCtx := a.ctx 3121 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteToken") 3122 3123 a.ctx = newCtx 3124 a.app.Srv().Store.SetContext(newCtx) 3125 defer func() { 3126 a.app.Srv().Store.SetContext(origCtx) 3127 a.ctx = origCtx 3128 }() 3129 3130 defer span.Finish() 3131 resultVar0 := a.app.DeleteToken(token) 3132 3133 if resultVar0 != nil { 3134 span.LogFields(spanlog.Error(resultVar0)) 3135 ext.Error.Set(span, true) 3136 } 3137 3138 return resultVar0 3139 } 3140 3141 func (a *OpenTracingAppLayer) DemoteUserToGuest(user *model.User) *model.AppError { 3142 origCtx := a.ctx 3143 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DemoteUserToGuest") 3144 3145 a.ctx = newCtx 3146 a.app.Srv().Store.SetContext(newCtx) 3147 defer func() { 3148 a.app.Srv().Store.SetContext(origCtx) 3149 a.ctx = origCtx 3150 }() 3151 3152 defer span.Finish() 3153 resultVar0 := a.app.DemoteUserToGuest(user) 3154 3155 if resultVar0 != nil { 3156 span.LogFields(spanlog.Error(resultVar0)) 3157 ext.Error.Set(span, true) 3158 } 3159 3160 return resultVar0 3161 } 3162 3163 func (a *OpenTracingAppLayer) DisableAutoResponder(userID string, asAdmin bool) *model.AppError { 3164 origCtx := a.ctx 3165 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableAutoResponder") 3166 3167 a.ctx = newCtx 3168 a.app.Srv().Store.SetContext(newCtx) 3169 defer func() { 3170 a.app.Srv().Store.SetContext(origCtx) 3171 a.ctx = origCtx 3172 }() 3173 3174 defer span.Finish() 3175 resultVar0 := a.app.DisableAutoResponder(userID, asAdmin) 3176 3177 if resultVar0 != nil { 3178 span.LogFields(spanlog.Error(resultVar0)) 3179 ext.Error.Set(span, true) 3180 } 3181 3182 return resultVar0 3183 } 3184 3185 func (a *OpenTracingAppLayer) DisablePlugin(id string) *model.AppError { 3186 origCtx := a.ctx 3187 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisablePlugin") 3188 3189 a.ctx = newCtx 3190 a.app.Srv().Store.SetContext(newCtx) 3191 defer func() { 3192 a.app.Srv().Store.SetContext(origCtx) 3193 a.ctx = origCtx 3194 }() 3195 3196 defer span.Finish() 3197 resultVar0 := a.app.DisablePlugin(id) 3198 3199 if resultVar0 != nil { 3200 span.LogFields(spanlog.Error(resultVar0)) 3201 ext.Error.Set(span, true) 3202 } 3203 3204 return resultVar0 3205 } 3206 3207 func (a *OpenTracingAppLayer) DisableUserAccessToken(token *model.UserAccessToken) *model.AppError { 3208 origCtx := a.ctx 3209 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableUserAccessToken") 3210 3211 a.ctx = newCtx 3212 a.app.Srv().Store.SetContext(newCtx) 3213 defer func() { 3214 a.app.Srv().Store.SetContext(origCtx) 3215 a.ctx = origCtx 3216 }() 3217 3218 defer span.Finish() 3219 resultVar0 := a.app.DisableUserAccessToken(token) 3220 3221 if resultVar0 != nil { 3222 span.LogFields(spanlog.Error(resultVar0)) 3223 ext.Error.Set(span, true) 3224 } 3225 3226 return resultVar0 3227 } 3228 3229 func (a *OpenTracingAppLayer) DoActionRequest(rawURL string, body []byte) (*http.Response, *model.AppError) { 3230 origCtx := a.ctx 3231 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoActionRequest") 3232 3233 a.ctx = newCtx 3234 a.app.Srv().Store.SetContext(newCtx) 3235 defer func() { 3236 a.app.Srv().Store.SetContext(origCtx) 3237 a.ctx = origCtx 3238 }() 3239 3240 defer span.Finish() 3241 resultVar0, resultVar1 := a.app.DoActionRequest(rawURL, body) 3242 3243 if resultVar1 != nil { 3244 span.LogFields(spanlog.Error(resultVar1)) 3245 ext.Error.Set(span, true) 3246 } 3247 3248 return resultVar0, resultVar1 3249 } 3250 3251 func (a *OpenTracingAppLayer) DoAdvancedPermissionsMigration() { 3252 origCtx := a.ctx 3253 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAdvancedPermissionsMigration") 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 a.app.DoAdvancedPermissionsMigration() 3264 } 3265 3266 func (a *OpenTracingAppLayer) DoAppMigrations() { 3267 origCtx := a.ctx 3268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAppMigrations") 3269 3270 a.ctx = newCtx 3271 a.app.Srv().Store.SetContext(newCtx) 3272 defer func() { 3273 a.app.Srv().Store.SetContext(origCtx) 3274 a.ctx = origCtx 3275 }() 3276 3277 defer span.Finish() 3278 a.app.DoAppMigrations() 3279 } 3280 3281 func (a *OpenTracingAppLayer) DoCommandRequest(cmd *model.Command, p url.Values) (*model.Command, *model.CommandResponse, *model.AppError) { 3282 origCtx := a.ctx 3283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoCommandRequest") 3284 3285 a.ctx = newCtx 3286 a.app.Srv().Store.SetContext(newCtx) 3287 defer func() { 3288 a.app.Srv().Store.SetContext(origCtx) 3289 a.ctx = origCtx 3290 }() 3291 3292 defer span.Finish() 3293 resultVar0, resultVar1, resultVar2 := a.app.DoCommandRequest(cmd, p) 3294 3295 if resultVar2 != nil { 3296 span.LogFields(spanlog.Error(resultVar2)) 3297 ext.Error.Set(span, true) 3298 } 3299 3300 return resultVar0, resultVar1, resultVar2 3301 } 3302 3303 func (a *OpenTracingAppLayer) DoEmojisPermissionsMigration() { 3304 origCtx := a.ctx 3305 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoEmojisPermissionsMigration") 3306 3307 a.ctx = newCtx 3308 a.app.Srv().Store.SetContext(newCtx) 3309 defer func() { 3310 a.app.Srv().Store.SetContext(origCtx) 3311 a.ctx = origCtx 3312 }() 3313 3314 defer span.Finish() 3315 a.app.DoEmojisPermissionsMigration() 3316 } 3317 3318 func (a *OpenTracingAppLayer) DoGuestRolesCreationMigration() { 3319 origCtx := a.ctx 3320 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoGuestRolesCreationMigration") 3321 3322 a.ctx = newCtx 3323 a.app.Srv().Store.SetContext(newCtx) 3324 defer func() { 3325 a.app.Srv().Store.SetContext(origCtx) 3326 a.ctx = origCtx 3327 }() 3328 3329 defer span.Finish() 3330 a.app.DoGuestRolesCreationMigration() 3331 } 3332 3333 func (a *OpenTracingAppLayer) DoLocalRequest(rawURL string, body []byte) (*http.Response, *model.AppError) { 3334 origCtx := a.ctx 3335 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLocalRequest") 3336 3337 a.ctx = newCtx 3338 a.app.Srv().Store.SetContext(newCtx) 3339 defer func() { 3340 a.app.Srv().Store.SetContext(origCtx) 3341 a.ctx = origCtx 3342 }() 3343 3344 defer span.Finish() 3345 resultVar0, resultVar1 := a.app.DoLocalRequest(rawURL, body) 3346 3347 if resultVar1 != nil { 3348 span.LogFields(spanlog.Error(resultVar1)) 3349 ext.Error.Set(span, true) 3350 } 3351 3352 return resultVar0, resultVar1 3353 } 3354 3355 func (a *OpenTracingAppLayer) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string, isMobile bool, isOAuthUser bool, isSaml bool) *model.AppError { 3356 origCtx := a.ctx 3357 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLogin") 3358 3359 a.ctx = newCtx 3360 a.app.Srv().Store.SetContext(newCtx) 3361 defer func() { 3362 a.app.Srv().Store.SetContext(origCtx) 3363 a.ctx = origCtx 3364 }() 3365 3366 defer span.Finish() 3367 resultVar0 := a.app.DoLogin(w, r, user, deviceId, isMobile, isOAuthUser, isSaml) 3368 3369 if resultVar0 != nil { 3370 span.LogFields(spanlog.Error(resultVar0)) 3371 ext.Error.Set(span, true) 3372 } 3373 3374 return resultVar0 3375 } 3376 3377 func (a *OpenTracingAppLayer) DoPermissionsMigrations() error { 3378 origCtx := a.ctx 3379 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPermissionsMigrations") 3380 3381 a.ctx = newCtx 3382 a.app.Srv().Store.SetContext(newCtx) 3383 defer func() { 3384 a.app.Srv().Store.SetContext(origCtx) 3385 a.ctx = origCtx 3386 }() 3387 3388 defer span.Finish() 3389 resultVar0 := a.app.DoPermissionsMigrations() 3390 3391 if resultVar0 != nil { 3392 span.LogFields(spanlog.Error(resultVar0)) 3393 ext.Error.Set(span, true) 3394 } 3395 3396 return resultVar0 3397 } 3398 3399 func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userID string, selectedOption string) (string, *model.AppError) { 3400 origCtx := a.ctx 3401 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostAction") 3402 3403 a.ctx = newCtx 3404 a.app.Srv().Store.SetContext(newCtx) 3405 defer func() { 3406 a.app.Srv().Store.SetContext(origCtx) 3407 a.ctx = origCtx 3408 }() 3409 3410 defer span.Finish() 3411 resultVar0, resultVar1 := a.app.DoPostAction(postId, actionId, userID, selectedOption) 3412 3413 if resultVar1 != nil { 3414 span.LogFields(spanlog.Error(resultVar1)) 3415 ext.Error.Set(span, true) 3416 } 3417 3418 return resultVar0, resultVar1 3419 } 3420 3421 func (a *OpenTracingAppLayer) DoPostActionWithCookie(postId string, actionId string, userID string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { 3422 origCtx := a.ctx 3423 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostActionWithCookie") 3424 3425 a.ctx = newCtx 3426 a.app.Srv().Store.SetContext(newCtx) 3427 defer func() { 3428 a.app.Srv().Store.SetContext(origCtx) 3429 a.ctx = origCtx 3430 }() 3431 3432 defer span.Finish() 3433 resultVar0, resultVar1 := a.app.DoPostActionWithCookie(postId, actionId, userID, selectedOption, cookie) 3434 3435 if resultVar1 != nil { 3436 span.LogFields(spanlog.Error(resultVar1)) 3437 ext.Error.Set(span, true) 3438 } 3439 3440 return resultVar0, resultVar1 3441 } 3442 3443 func (a *OpenTracingAppLayer) DoSystemConsoleRolesCreationMigration() { 3444 origCtx := a.ctx 3445 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoSystemConsoleRolesCreationMigration") 3446 3447 a.ctx = newCtx 3448 a.app.Srv().Store.SetContext(newCtx) 3449 defer func() { 3450 a.app.Srv().Store.SetContext(origCtx) 3451 a.ctx = origCtx 3452 }() 3453 3454 defer span.Finish() 3455 a.app.DoSystemConsoleRolesCreationMigration() 3456 } 3457 3458 func (a *OpenTracingAppLayer) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) { 3459 origCtx := a.ctx 3460 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFile") 3461 3462 a.ctx = newCtx 3463 a.app.Srv().Store.SetContext(newCtx) 3464 defer func() { 3465 a.app.Srv().Store.SetContext(origCtx) 3466 a.ctx = origCtx 3467 }() 3468 3469 defer span.Finish() 3470 resultVar0, resultVar1 := a.app.DoUploadFile(now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3471 3472 if resultVar1 != nil { 3473 span.LogFields(spanlog.Error(resultVar1)) 3474 ext.Error.Set(span, true) 3475 } 3476 3477 return resultVar0, resultVar1 3478 } 3479 3480 func (a *OpenTracingAppLayer) DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) { 3481 origCtx := a.ctx 3482 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFileExpectModification") 3483 3484 a.ctx = newCtx 3485 a.app.Srv().Store.SetContext(newCtx) 3486 defer func() { 3487 a.app.Srv().Store.SetContext(origCtx) 3488 a.ctx = origCtx 3489 }() 3490 3491 defer span.Finish() 3492 resultVar0, resultVar1, resultVar2 := a.app.DoUploadFileExpectModification(now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3493 3494 if resultVar2 != nil { 3495 span.LogFields(spanlog.Error(resultVar2)) 3496 ext.Error.Set(span, true) 3497 } 3498 3499 return resultVar0, resultVar1, resultVar2 3500 } 3501 3502 func (a *OpenTracingAppLayer) DoubleCheckPassword(user *model.User, password string) *model.AppError { 3503 origCtx := a.ctx 3504 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoubleCheckPassword") 3505 3506 a.ctx = newCtx 3507 a.app.Srv().Store.SetContext(newCtx) 3508 defer func() { 3509 a.app.Srv().Store.SetContext(origCtx) 3510 a.ctx = origCtx 3511 }() 3512 3513 defer span.Finish() 3514 resultVar0 := a.app.DoubleCheckPassword(user, password) 3515 3516 if resultVar0 != nil { 3517 span.LogFields(spanlog.Error(resultVar0)) 3518 ext.Error.Set(span, true) 3519 } 3520 3521 return resultVar0 3522 } 3523 3524 func (a *OpenTracingAppLayer) DownloadFromURL(downloadURL string) ([]byte, error) { 3525 origCtx := a.ctx 3526 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DownloadFromURL") 3527 3528 a.ctx = newCtx 3529 a.app.Srv().Store.SetContext(newCtx) 3530 defer func() { 3531 a.app.Srv().Store.SetContext(origCtx) 3532 a.ctx = origCtx 3533 }() 3534 3535 defer span.Finish() 3536 resultVar0, resultVar1 := a.app.DownloadFromURL(downloadURL) 3537 3538 if resultVar1 != nil { 3539 span.LogFields(spanlog.Error(resultVar1)) 3540 ext.Error.Set(span, true) 3541 } 3542 3543 return resultVar0, resultVar1 3544 } 3545 3546 func (a *OpenTracingAppLayer) EnablePlugin(id string) *model.AppError { 3547 origCtx := a.ctx 3548 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnablePlugin") 3549 3550 a.ctx = newCtx 3551 a.app.Srv().Store.SetContext(newCtx) 3552 defer func() { 3553 a.app.Srv().Store.SetContext(origCtx) 3554 a.ctx = origCtx 3555 }() 3556 3557 defer span.Finish() 3558 resultVar0 := a.app.EnablePlugin(id) 3559 3560 if resultVar0 != nil { 3561 span.LogFields(spanlog.Error(resultVar0)) 3562 ext.Error.Set(span, true) 3563 } 3564 3565 return resultVar0 3566 } 3567 3568 func (a *OpenTracingAppLayer) EnableUserAccessToken(token *model.UserAccessToken) *model.AppError { 3569 origCtx := a.ctx 3570 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnableUserAccessToken") 3571 3572 a.ctx = newCtx 3573 a.app.Srv().Store.SetContext(newCtx) 3574 defer func() { 3575 a.app.Srv().Store.SetContext(origCtx) 3576 a.ctx = origCtx 3577 }() 3578 3579 defer span.Finish() 3580 resultVar0 := a.app.EnableUserAccessToken(token) 3581 3582 if resultVar0 != nil { 3583 span.LogFields(spanlog.Error(resultVar0)) 3584 ext.Error.Set(span, true) 3585 } 3586 3587 return resultVar0 3588 } 3589 3590 func (a *OpenTracingAppLayer) EnvironmentConfig() map[string]interface{} { 3591 origCtx := a.ctx 3592 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnvironmentConfig") 3593 3594 a.ctx = newCtx 3595 a.app.Srv().Store.SetContext(newCtx) 3596 defer func() { 3597 a.app.Srv().Store.SetContext(origCtx) 3598 a.ctx = origCtx 3599 }() 3600 3601 defer span.Finish() 3602 resultVar0 := a.app.EnvironmentConfig() 3603 3604 return resultVar0 3605 } 3606 3607 func (a *OpenTracingAppLayer) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { 3608 origCtx := a.ctx 3609 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExecuteCommand") 3610 3611 a.ctx = newCtx 3612 a.app.Srv().Store.SetContext(newCtx) 3613 defer func() { 3614 a.app.Srv().Store.SetContext(origCtx) 3615 a.ctx = origCtx 3616 }() 3617 3618 span.SetTag("args", args) 3619 3620 defer span.Finish() 3621 resultVar0, resultVar1 := a.app.ExecuteCommand(args) 3622 3623 if resultVar1 != nil { 3624 span.LogFields(spanlog.Error(resultVar1)) 3625 ext.Error.Set(span, true) 3626 } 3627 3628 return resultVar0, resultVar1 3629 } 3630 3631 func (a *OpenTracingAppLayer) ExportPermissions(w io.Writer) error { 3632 origCtx := a.ctx 3633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExportPermissions") 3634 3635 a.ctx = newCtx 3636 a.app.Srv().Store.SetContext(newCtx) 3637 defer func() { 3638 a.app.Srv().Store.SetContext(origCtx) 3639 a.ctx = origCtx 3640 }() 3641 3642 defer span.Finish() 3643 resultVar0 := a.app.ExportPermissions(w) 3644 3645 if resultVar0 != nil { 3646 span.LogFields(spanlog.Error(resultVar0)) 3647 ext.Error.Set(span, true) 3648 } 3649 3650 return resultVar0 3651 } 3652 3653 func (a *OpenTracingAppLayer) ExtendSessionExpiryIfNeeded(session *model.Session) bool { 3654 origCtx := a.ctx 3655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExtendSessionExpiryIfNeeded") 3656 3657 a.ctx = newCtx 3658 a.app.Srv().Store.SetContext(newCtx) 3659 defer func() { 3660 a.app.Srv().Store.SetContext(origCtx) 3661 a.ctx = origCtx 3662 }() 3663 3664 defer span.Finish() 3665 resultVar0 := a.app.ExtendSessionExpiryIfNeeded(session) 3666 3667 return resultVar0 3668 } 3669 3670 func (a *OpenTracingAppLayer) FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) { 3671 origCtx := a.ctx 3672 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FetchSamlMetadataFromIdp") 3673 3674 a.ctx = newCtx 3675 a.app.Srv().Store.SetContext(newCtx) 3676 defer func() { 3677 a.app.Srv().Store.SetContext(origCtx) 3678 a.ctx = origCtx 3679 }() 3680 3681 defer span.Finish() 3682 resultVar0, resultVar1 := a.app.FetchSamlMetadataFromIdp(url) 3683 3684 if resultVar1 != nil { 3685 span.LogFields(spanlog.Error(resultVar1)) 3686 ext.Error.Set(span, true) 3687 } 3688 3689 return resultVar0, resultVar1 3690 } 3691 3692 func (a *OpenTracingAppLayer) FileBackend() (filesstore.FileBackend, *model.AppError) { 3693 origCtx := a.ctx 3694 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileBackend") 3695 3696 a.ctx = newCtx 3697 a.app.Srv().Store.SetContext(newCtx) 3698 defer func() { 3699 a.app.Srv().Store.SetContext(origCtx) 3700 a.ctx = origCtx 3701 }() 3702 3703 defer span.Finish() 3704 resultVar0, resultVar1 := a.app.FileBackend() 3705 3706 if resultVar1 != nil { 3707 span.LogFields(spanlog.Error(resultVar1)) 3708 ext.Error.Set(span, true) 3709 } 3710 3711 return resultVar0, resultVar1 3712 } 3713 3714 func (a *OpenTracingAppLayer) FileExists(path string) (bool, *model.AppError) { 3715 origCtx := a.ctx 3716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileExists") 3717 3718 a.ctx = newCtx 3719 a.app.Srv().Store.SetContext(newCtx) 3720 defer func() { 3721 a.app.Srv().Store.SetContext(origCtx) 3722 a.ctx = origCtx 3723 }() 3724 3725 defer span.Finish() 3726 resultVar0, resultVar1 := a.app.FileExists(path) 3727 3728 if resultVar1 != nil { 3729 span.LogFields(spanlog.Error(resultVar1)) 3730 ext.Error.Set(span, true) 3731 } 3732 3733 return resultVar0, resultVar1 3734 } 3735 3736 func (a *OpenTracingAppLayer) FileModTime(path string) (time.Time, *model.AppError) { 3737 origCtx := a.ctx 3738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileModTime") 3739 3740 a.ctx = newCtx 3741 a.app.Srv().Store.SetContext(newCtx) 3742 defer func() { 3743 a.app.Srv().Store.SetContext(origCtx) 3744 a.ctx = origCtx 3745 }() 3746 3747 defer span.Finish() 3748 resultVar0, resultVar1 := a.app.FileModTime(path) 3749 3750 if resultVar1 != nil { 3751 span.LogFields(spanlog.Error(resultVar1)) 3752 ext.Error.Set(span, true) 3753 } 3754 3755 return resultVar0, resultVar1 3756 } 3757 3758 func (a *OpenTracingAppLayer) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) { 3759 origCtx := a.ctx 3760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileReader") 3761 3762 a.ctx = newCtx 3763 a.app.Srv().Store.SetContext(newCtx) 3764 defer func() { 3765 a.app.Srv().Store.SetContext(origCtx) 3766 a.ctx = origCtx 3767 }() 3768 3769 defer span.Finish() 3770 resultVar0, resultVar1 := a.app.FileReader(path) 3771 3772 if resultVar1 != nil { 3773 span.LogFields(spanlog.Error(resultVar1)) 3774 ext.Error.Set(span, true) 3775 } 3776 3777 return resultVar0, resultVar1 3778 } 3779 3780 func (a *OpenTracingAppLayer) FileSize(path string) (int64, *model.AppError) { 3781 origCtx := a.ctx 3782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileSize") 3783 3784 a.ctx = newCtx 3785 a.app.Srv().Store.SetContext(newCtx) 3786 defer func() { 3787 a.app.Srv().Store.SetContext(origCtx) 3788 a.ctx = origCtx 3789 }() 3790 3791 defer span.Finish() 3792 resultVar0, resultVar1 := a.app.FileSize(path) 3793 3794 if resultVar1 != nil { 3795 span.LogFields(spanlog.Error(resultVar1)) 3796 ext.Error.Set(span, true) 3797 } 3798 3799 return resultVar0, resultVar1 3800 } 3801 3802 func (a *OpenTracingAppLayer) FillInChannelProps(channel *model.Channel) *model.AppError { 3803 origCtx := a.ctx 3804 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelProps") 3805 3806 a.ctx = newCtx 3807 a.app.Srv().Store.SetContext(newCtx) 3808 defer func() { 3809 a.app.Srv().Store.SetContext(origCtx) 3810 a.ctx = origCtx 3811 }() 3812 3813 defer span.Finish() 3814 resultVar0 := a.app.FillInChannelProps(channel) 3815 3816 if resultVar0 != nil { 3817 span.LogFields(spanlog.Error(resultVar0)) 3818 ext.Error.Set(span, true) 3819 } 3820 3821 return resultVar0 3822 } 3823 3824 func (a *OpenTracingAppLayer) FillInChannelsProps(channelList *model.ChannelList) *model.AppError { 3825 origCtx := a.ctx 3826 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelsProps") 3827 3828 a.ctx = newCtx 3829 a.app.Srv().Store.SetContext(newCtx) 3830 defer func() { 3831 a.app.Srv().Store.SetContext(origCtx) 3832 a.ctx = origCtx 3833 }() 3834 3835 defer span.Finish() 3836 resultVar0 := a.app.FillInChannelsProps(channelList) 3837 3838 if resultVar0 != nil { 3839 span.LogFields(spanlog.Error(resultVar0)) 3840 ext.Error.Set(span, true) 3841 } 3842 3843 return resultVar0 3844 } 3845 3846 func (a *OpenTracingAppLayer) FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError { 3847 origCtx := a.ctx 3848 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInPostProps") 3849 3850 a.ctx = newCtx 3851 a.app.Srv().Store.SetContext(newCtx) 3852 defer func() { 3853 a.app.Srv().Store.SetContext(origCtx) 3854 a.ctx = origCtx 3855 }() 3856 3857 defer span.Finish() 3858 resultVar0 := a.app.FillInPostProps(post, channel) 3859 3860 if resultVar0 != nil { 3861 span.LogFields(spanlog.Error(resultVar0)) 3862 ext.Error.Set(span, true) 3863 } 3864 3865 return resultVar0 3866 } 3867 3868 func (a *OpenTracingAppLayer) FilterNonGroupChannelMembers(userIDs []string, channel *model.Channel) ([]string, error) { 3869 origCtx := a.ctx 3870 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupChannelMembers") 3871 3872 a.ctx = newCtx 3873 a.app.Srv().Store.SetContext(newCtx) 3874 defer func() { 3875 a.app.Srv().Store.SetContext(origCtx) 3876 a.ctx = origCtx 3877 }() 3878 3879 defer span.Finish() 3880 resultVar0, resultVar1 := a.app.FilterNonGroupChannelMembers(userIDs, channel) 3881 3882 if resultVar1 != nil { 3883 span.LogFields(spanlog.Error(resultVar1)) 3884 ext.Error.Set(span, true) 3885 } 3886 3887 return resultVar0, resultVar1 3888 } 3889 3890 func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIDs []string, team *model.Team) ([]string, error) { 3891 origCtx := a.ctx 3892 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupTeamMembers") 3893 3894 a.ctx = newCtx 3895 a.app.Srv().Store.SetContext(newCtx) 3896 defer func() { 3897 a.app.Srv().Store.SetContext(origCtx) 3898 a.ctx = origCtx 3899 }() 3900 3901 defer span.Finish() 3902 resultVar0, resultVar1 := a.app.FilterNonGroupTeamMembers(userIDs, team) 3903 3904 if resultVar1 != nil { 3905 span.LogFields(spanlog.Error(resultVar1)) 3906 ext.Error.Set(span, true) 3907 } 3908 3909 return resultVar0, resultVar1 3910 } 3911 3912 func (a *OpenTracingAppLayer) FilterUsersByVisible(viewer *model.User, otherUsers []*model.User) ([]*model.User, *model.AppError) { 3913 origCtx := a.ctx 3914 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterUsersByVisible") 3915 3916 a.ctx = newCtx 3917 a.app.Srv().Store.SetContext(newCtx) 3918 defer func() { 3919 a.app.Srv().Store.SetContext(origCtx) 3920 a.ctx = origCtx 3921 }() 3922 3923 defer span.Finish() 3924 resultVar0, resultVar1 := a.app.FilterUsersByVisible(viewer, otherUsers) 3925 3926 if resultVar1 != nil { 3927 span.LogFields(spanlog.Error(resultVar1)) 3928 ext.Error.Set(span, true) 3929 } 3930 3931 return resultVar0, resultVar1 3932 } 3933 3934 func (a *OpenTracingAppLayer) FindTeamByName(name string) bool { 3935 origCtx := a.ctx 3936 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FindTeamByName") 3937 3938 a.ctx = newCtx 3939 a.app.Srv().Store.SetContext(newCtx) 3940 defer func() { 3941 a.app.Srv().Store.SetContext(origCtx) 3942 a.ctx = origCtx 3943 }() 3944 3945 defer span.Finish() 3946 resultVar0 := a.app.FindTeamByName(name) 3947 3948 return resultVar0 3949 } 3950 3951 func (a *OpenTracingAppLayer) GenerateMfaSecret(userID string) (*model.MfaSecret, *model.AppError) { 3952 origCtx := a.ctx 3953 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateMfaSecret") 3954 3955 a.ctx = newCtx 3956 a.app.Srv().Store.SetContext(newCtx) 3957 defer func() { 3958 a.app.Srv().Store.SetContext(origCtx) 3959 a.ctx = origCtx 3960 }() 3961 3962 defer span.Finish() 3963 resultVar0, resultVar1 := a.app.GenerateMfaSecret(userID) 3964 3965 if resultVar1 != nil { 3966 span.LogFields(spanlog.Error(resultVar1)) 3967 ext.Error.Set(span, true) 3968 } 3969 3970 return resultVar0, resultVar1 3971 } 3972 3973 func (a *OpenTracingAppLayer) GeneratePublicLink(siteURL string, info *model.FileInfo) string { 3974 origCtx := a.ctx 3975 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GeneratePublicLink") 3976 3977 a.ctx = newCtx 3978 a.app.Srv().Store.SetContext(newCtx) 3979 defer func() { 3980 a.app.Srv().Store.SetContext(origCtx) 3981 a.ctx = origCtx 3982 }() 3983 3984 defer span.Finish() 3985 resultVar0 := a.app.GeneratePublicLink(siteURL, info) 3986 3987 return resultVar0 3988 } 3989 3990 func (a *OpenTracingAppLayer) GenerateSupportPacket() []model.FileData { 3991 origCtx := a.ctx 3992 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateSupportPacket") 3993 3994 a.ctx = newCtx 3995 a.app.Srv().Store.SetContext(newCtx) 3996 defer func() { 3997 a.app.Srv().Store.SetContext(origCtx) 3998 a.ctx = origCtx 3999 }() 4000 4001 defer span.Finish() 4002 resultVar0 := a.app.GenerateSupportPacket() 4003 4004 return resultVar0 4005 } 4006 4007 func (a *OpenTracingAppLayer) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) { 4008 origCtx := a.ctx 4009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetActivePluginManifests") 4010 4011 a.ctx = newCtx 4012 a.app.Srv().Store.SetContext(newCtx) 4013 defer func() { 4014 a.app.Srv().Store.SetContext(origCtx) 4015 a.ctx = origCtx 4016 }() 4017 4018 defer span.Finish() 4019 resultVar0, resultVar1 := a.app.GetActivePluginManifests() 4020 4021 if resultVar1 != nil { 4022 span.LogFields(spanlog.Error(resultVar1)) 4023 ext.Error.Set(span, true) 4024 } 4025 4026 return resultVar0, resultVar1 4027 } 4028 4029 func (a *OpenTracingAppLayer) GetAllChannels(page int, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) { 4030 origCtx := a.ctx 4031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannels") 4032 4033 a.ctx = newCtx 4034 a.app.Srv().Store.SetContext(newCtx) 4035 defer func() { 4036 a.app.Srv().Store.SetContext(origCtx) 4037 a.ctx = origCtx 4038 }() 4039 4040 defer span.Finish() 4041 resultVar0, resultVar1 := a.app.GetAllChannels(page, perPage, opts) 4042 4043 if resultVar1 != nil { 4044 span.LogFields(spanlog.Error(resultVar1)) 4045 ext.Error.Set(span, true) 4046 } 4047 4048 return resultVar0, resultVar1 4049 } 4050 4051 func (a *OpenTracingAppLayer) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.AppError) { 4052 origCtx := a.ctx 4053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannelsCount") 4054 4055 a.ctx = newCtx 4056 a.app.Srv().Store.SetContext(newCtx) 4057 defer func() { 4058 a.app.Srv().Store.SetContext(origCtx) 4059 a.ctx = origCtx 4060 }() 4061 4062 defer span.Finish() 4063 resultVar0, resultVar1 := a.app.GetAllChannelsCount(opts) 4064 4065 if resultVar1 != nil { 4066 span.LogFields(spanlog.Error(resultVar1)) 4067 ext.Error.Set(span, true) 4068 } 4069 4070 return resultVar0, resultVar1 4071 } 4072 4073 func (a *OpenTracingAppLayer) GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError) { 4074 origCtx := a.ctx 4075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllLdapGroupsPage") 4076 4077 a.ctx = newCtx 4078 a.app.Srv().Store.SetContext(newCtx) 4079 defer func() { 4080 a.app.Srv().Store.SetContext(origCtx) 4081 a.ctx = origCtx 4082 }() 4083 4084 defer span.Finish() 4085 resultVar0, resultVar1, resultVar2 := a.app.GetAllLdapGroupsPage(page, perPage, opts) 4086 4087 if resultVar2 != nil { 4088 span.LogFields(spanlog.Error(resultVar2)) 4089 ext.Error.Set(span, true) 4090 } 4091 4092 return resultVar0, resultVar1, resultVar2 4093 } 4094 4095 func (a *OpenTracingAppLayer) GetAllPrivateTeams() ([]*model.Team, *model.AppError) { 4096 origCtx := a.ctx 4097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeams") 4098 4099 a.ctx = newCtx 4100 a.app.Srv().Store.SetContext(newCtx) 4101 defer func() { 4102 a.app.Srv().Store.SetContext(origCtx) 4103 a.ctx = origCtx 4104 }() 4105 4106 defer span.Finish() 4107 resultVar0, resultVar1 := a.app.GetAllPrivateTeams() 4108 4109 if resultVar1 != nil { 4110 span.LogFields(spanlog.Error(resultVar1)) 4111 ext.Error.Set(span, true) 4112 } 4113 4114 return resultVar0, resultVar1 4115 } 4116 4117 func (a *OpenTracingAppLayer) GetAllPrivateTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 4118 origCtx := a.ctx 4119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeamsPage") 4120 4121 a.ctx = newCtx 4122 a.app.Srv().Store.SetContext(newCtx) 4123 defer func() { 4124 a.app.Srv().Store.SetContext(origCtx) 4125 a.ctx = origCtx 4126 }() 4127 4128 defer span.Finish() 4129 resultVar0, resultVar1 := a.app.GetAllPrivateTeamsPage(offset, limit) 4130 4131 if resultVar1 != nil { 4132 span.LogFields(spanlog.Error(resultVar1)) 4133 ext.Error.Set(span, true) 4134 } 4135 4136 return resultVar0, resultVar1 4137 } 4138 4139 func (a *OpenTracingAppLayer) GetAllPrivateTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 4140 origCtx := a.ctx 4141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeamsPageWithCount") 4142 4143 a.ctx = newCtx 4144 a.app.Srv().Store.SetContext(newCtx) 4145 defer func() { 4146 a.app.Srv().Store.SetContext(origCtx) 4147 a.ctx = origCtx 4148 }() 4149 4150 defer span.Finish() 4151 resultVar0, resultVar1 := a.app.GetAllPrivateTeamsPageWithCount(offset, limit) 4152 4153 if resultVar1 != nil { 4154 span.LogFields(spanlog.Error(resultVar1)) 4155 ext.Error.Set(span, true) 4156 } 4157 4158 return resultVar0, resultVar1 4159 } 4160 4161 func (a *OpenTracingAppLayer) GetAllPublicTeams() ([]*model.Team, *model.AppError) { 4162 origCtx := a.ctx 4163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeams") 4164 4165 a.ctx = newCtx 4166 a.app.Srv().Store.SetContext(newCtx) 4167 defer func() { 4168 a.app.Srv().Store.SetContext(origCtx) 4169 a.ctx = origCtx 4170 }() 4171 4172 defer span.Finish() 4173 resultVar0, resultVar1 := a.app.GetAllPublicTeams() 4174 4175 if resultVar1 != nil { 4176 span.LogFields(spanlog.Error(resultVar1)) 4177 ext.Error.Set(span, true) 4178 } 4179 4180 return resultVar0, resultVar1 4181 } 4182 4183 func (a *OpenTracingAppLayer) GetAllPublicTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 4184 origCtx := a.ctx 4185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeamsPage") 4186 4187 a.ctx = newCtx 4188 a.app.Srv().Store.SetContext(newCtx) 4189 defer func() { 4190 a.app.Srv().Store.SetContext(origCtx) 4191 a.ctx = origCtx 4192 }() 4193 4194 defer span.Finish() 4195 resultVar0, resultVar1 := a.app.GetAllPublicTeamsPage(offset, limit) 4196 4197 if resultVar1 != nil { 4198 span.LogFields(spanlog.Error(resultVar1)) 4199 ext.Error.Set(span, true) 4200 } 4201 4202 return resultVar0, resultVar1 4203 } 4204 4205 func (a *OpenTracingAppLayer) GetAllPublicTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 4206 origCtx := a.ctx 4207 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeamsPageWithCount") 4208 4209 a.ctx = newCtx 4210 a.app.Srv().Store.SetContext(newCtx) 4211 defer func() { 4212 a.app.Srv().Store.SetContext(origCtx) 4213 a.ctx = origCtx 4214 }() 4215 4216 defer span.Finish() 4217 resultVar0, resultVar1 := a.app.GetAllPublicTeamsPageWithCount(offset, limit) 4218 4219 if resultVar1 != nil { 4220 span.LogFields(spanlog.Error(resultVar1)) 4221 ext.Error.Set(span, true) 4222 } 4223 4224 return resultVar0, resultVar1 4225 } 4226 4227 func (a *OpenTracingAppLayer) GetAllRoles() ([]*model.Role, *model.AppError) { 4228 origCtx := a.ctx 4229 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllRoles") 4230 4231 a.ctx = newCtx 4232 a.app.Srv().Store.SetContext(newCtx) 4233 defer func() { 4234 a.app.Srv().Store.SetContext(origCtx) 4235 a.ctx = origCtx 4236 }() 4237 4238 defer span.Finish() 4239 resultVar0, resultVar1 := a.app.GetAllRoles() 4240 4241 if resultVar1 != nil { 4242 span.LogFields(spanlog.Error(resultVar1)) 4243 ext.Error.Set(span, true) 4244 } 4245 4246 return resultVar0, resultVar1 4247 } 4248 4249 func (a *OpenTracingAppLayer) GetAllStatuses() map[string]*model.Status { 4250 origCtx := a.ctx 4251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllStatuses") 4252 4253 a.ctx = newCtx 4254 a.app.Srv().Store.SetContext(newCtx) 4255 defer func() { 4256 a.app.Srv().Store.SetContext(origCtx) 4257 a.ctx = origCtx 4258 }() 4259 4260 defer span.Finish() 4261 resultVar0 := a.app.GetAllStatuses() 4262 4263 return resultVar0 4264 } 4265 4266 func (a *OpenTracingAppLayer) GetAllTeams() ([]*model.Team, *model.AppError) { 4267 origCtx := a.ctx 4268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeams") 4269 4270 a.ctx = newCtx 4271 a.app.Srv().Store.SetContext(newCtx) 4272 defer func() { 4273 a.app.Srv().Store.SetContext(origCtx) 4274 a.ctx = origCtx 4275 }() 4276 4277 defer span.Finish() 4278 resultVar0, resultVar1 := a.app.GetAllTeams() 4279 4280 if resultVar1 != nil { 4281 span.LogFields(spanlog.Error(resultVar1)) 4282 ext.Error.Set(span, true) 4283 } 4284 4285 return resultVar0, resultVar1 4286 } 4287 4288 func (a *OpenTracingAppLayer) GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 4289 origCtx := a.ctx 4290 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPage") 4291 4292 a.ctx = newCtx 4293 a.app.Srv().Store.SetContext(newCtx) 4294 defer func() { 4295 a.app.Srv().Store.SetContext(origCtx) 4296 a.ctx = origCtx 4297 }() 4298 4299 defer span.Finish() 4300 resultVar0, resultVar1 := a.app.GetAllTeamsPage(offset, limit) 4301 4302 if resultVar1 != nil { 4303 span.LogFields(spanlog.Error(resultVar1)) 4304 ext.Error.Set(span, true) 4305 } 4306 4307 return resultVar0, resultVar1 4308 } 4309 4310 func (a *OpenTracingAppLayer) GetAllTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 4311 origCtx := a.ctx 4312 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPageWithCount") 4313 4314 a.ctx = newCtx 4315 a.app.Srv().Store.SetContext(newCtx) 4316 defer func() { 4317 a.app.Srv().Store.SetContext(origCtx) 4318 a.ctx = origCtx 4319 }() 4320 4321 defer span.Finish() 4322 resultVar0, resultVar1 := a.app.GetAllTeamsPageWithCount(offset, limit) 4323 4324 if resultVar1 != nil { 4325 span.LogFields(spanlog.Error(resultVar1)) 4326 ext.Error.Set(span, true) 4327 } 4328 4329 return resultVar0, resultVar1 4330 } 4331 4332 func (a *OpenTracingAppLayer) GetAnalytics(name string, teamID string) (model.AnalyticsRows, *model.AppError) { 4333 origCtx := a.ctx 4334 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAnalytics") 4335 4336 a.ctx = newCtx 4337 a.app.Srv().Store.SetContext(newCtx) 4338 defer func() { 4339 a.app.Srv().Store.SetContext(origCtx) 4340 a.ctx = origCtx 4341 }() 4342 4343 defer span.Finish() 4344 resultVar0, resultVar1 := a.app.GetAnalytics(name, teamID) 4345 4346 if resultVar1 != nil { 4347 span.LogFields(spanlog.Error(resultVar1)) 4348 ext.Error.Set(span, true) 4349 } 4350 4351 return resultVar0, resultVar1 4352 } 4353 4354 func (a *OpenTracingAppLayer) GetAudits(userID string, limit int) (model.Audits, *model.AppError) { 4355 origCtx := a.ctx 4356 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAudits") 4357 4358 a.ctx = newCtx 4359 a.app.Srv().Store.SetContext(newCtx) 4360 defer func() { 4361 a.app.Srv().Store.SetContext(origCtx) 4362 a.ctx = origCtx 4363 }() 4364 4365 defer span.Finish() 4366 resultVar0, resultVar1 := a.app.GetAudits(userID, limit) 4367 4368 if resultVar1 != nil { 4369 span.LogFields(spanlog.Error(resultVar1)) 4370 ext.Error.Set(span, true) 4371 } 4372 4373 return resultVar0, resultVar1 4374 } 4375 4376 func (a *OpenTracingAppLayer) GetAuditsPage(userID string, page int, perPage int) (model.Audits, *model.AppError) { 4377 origCtx := a.ctx 4378 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuditsPage") 4379 4380 a.ctx = newCtx 4381 a.app.Srv().Store.SetContext(newCtx) 4382 defer func() { 4383 a.app.Srv().Store.SetContext(origCtx) 4384 a.ctx = origCtx 4385 }() 4386 4387 defer span.Finish() 4388 resultVar0, resultVar1 := a.app.GetAuditsPage(userID, page, perPage) 4389 4390 if resultVar1 != nil { 4391 span.LogFields(spanlog.Error(resultVar1)) 4392 ext.Error.Set(span, true) 4393 } 4394 4395 return resultVar0, resultVar1 4396 } 4397 4398 func (a *OpenTracingAppLayer) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) { 4399 origCtx := a.ctx 4400 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizationCode") 4401 4402 a.ctx = newCtx 4403 a.app.Srv().Store.SetContext(newCtx) 4404 defer func() { 4405 a.app.Srv().Store.SetContext(origCtx) 4406 a.ctx = origCtx 4407 }() 4408 4409 defer span.Finish() 4410 resultVar0, resultVar1 := a.app.GetAuthorizationCode(w, r, service, props, loginHint) 4411 4412 if resultVar1 != nil { 4413 span.LogFields(spanlog.Error(resultVar1)) 4414 ext.Error.Set(span, true) 4415 } 4416 4417 return resultVar0, resultVar1 4418 } 4419 4420 func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 4421 origCtx := a.ctx 4422 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizedAppsForUser") 4423 4424 a.ctx = newCtx 4425 a.app.Srv().Store.SetContext(newCtx) 4426 defer func() { 4427 a.app.Srv().Store.SetContext(origCtx) 4428 a.ctx = origCtx 4429 }() 4430 4431 defer span.Finish() 4432 resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userID, page, perPage) 4433 4434 if resultVar1 != nil { 4435 span.LogFields(spanlog.Error(resultVar1)) 4436 ext.Error.Set(span, true) 4437 } 4438 4439 return resultVar0, resultVar1 4440 } 4441 4442 func (a *OpenTracingAppLayer) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) { 4443 origCtx := a.ctx 4444 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBot") 4445 4446 a.ctx = newCtx 4447 a.app.Srv().Store.SetContext(newCtx) 4448 defer func() { 4449 a.app.Srv().Store.SetContext(origCtx) 4450 a.ctx = origCtx 4451 }() 4452 4453 defer span.Finish() 4454 resultVar0, resultVar1 := a.app.GetBot(botUserId, includeDeleted) 4455 4456 if resultVar1 != nil { 4457 span.LogFields(spanlog.Error(resultVar1)) 4458 ext.Error.Set(span, true) 4459 } 4460 4461 return resultVar0, resultVar1 4462 } 4463 4464 func (a *OpenTracingAppLayer) GetBotIconImage(botUserId string) ([]byte, *model.AppError) { 4465 origCtx := a.ctx 4466 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBotIconImage") 4467 4468 a.ctx = newCtx 4469 a.app.Srv().Store.SetContext(newCtx) 4470 defer func() { 4471 a.app.Srv().Store.SetContext(origCtx) 4472 a.ctx = origCtx 4473 }() 4474 4475 defer span.Finish() 4476 resultVar0, resultVar1 := a.app.GetBotIconImage(botUserId) 4477 4478 if resultVar1 != nil { 4479 span.LogFields(spanlog.Error(resultVar1)) 4480 ext.Error.Set(span, true) 4481 } 4482 4483 return resultVar0, resultVar1 4484 } 4485 4486 func (a *OpenTracingAppLayer) GetBots(options *model.BotGetOptions) (model.BotList, *model.AppError) { 4487 origCtx := a.ctx 4488 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBots") 4489 4490 a.ctx = newCtx 4491 a.app.Srv().Store.SetContext(newCtx) 4492 defer func() { 4493 a.app.Srv().Store.SetContext(origCtx) 4494 a.ctx = origCtx 4495 }() 4496 4497 defer span.Finish() 4498 resultVar0, resultVar1 := a.app.GetBots(options) 4499 4500 if resultVar1 != nil { 4501 span.LogFields(spanlog.Error(resultVar1)) 4502 ext.Error.Set(span, true) 4503 } 4504 4505 return resultVar0, resultVar1 4506 } 4507 4508 func (a *OpenTracingAppLayer) GetBrandImage() ([]byte, *model.AppError) { 4509 origCtx := a.ctx 4510 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBrandImage") 4511 4512 a.ctx = newCtx 4513 a.app.Srv().Store.SetContext(newCtx) 4514 defer func() { 4515 a.app.Srv().Store.SetContext(origCtx) 4516 a.ctx = origCtx 4517 }() 4518 4519 defer span.Finish() 4520 resultVar0, resultVar1 := a.app.GetBrandImage() 4521 4522 if resultVar1 != nil { 4523 span.LogFields(spanlog.Error(resultVar1)) 4524 ext.Error.Set(span, true) 4525 } 4526 4527 return resultVar0, resultVar1 4528 } 4529 4530 func (a *OpenTracingAppLayer) GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError) { 4531 origCtx := a.ctx 4532 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBulkReactionsForPosts") 4533 4534 a.ctx = newCtx 4535 a.app.Srv().Store.SetContext(newCtx) 4536 defer func() { 4537 a.app.Srv().Store.SetContext(origCtx) 4538 a.ctx = origCtx 4539 }() 4540 4541 defer span.Finish() 4542 resultVar0, resultVar1 := a.app.GetBulkReactionsForPosts(postIds) 4543 4544 if resultVar1 != nil { 4545 span.LogFields(spanlog.Error(resultVar1)) 4546 ext.Error.Set(span, true) 4547 } 4548 4549 return resultVar0, resultVar1 4550 } 4551 4552 func (a *OpenTracingAppLayer) GetChannel(channelId string) (*model.Channel, *model.AppError) { 4553 origCtx := a.ctx 4554 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannel") 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.GetChannel(channelId) 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) GetChannelByName(channelName string, teamID string, includeDeleted bool) (*model.Channel, *model.AppError) { 4575 origCtx := a.ctx 4576 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByName") 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.GetChannelByName(channelName, teamID, includeDeleted) 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) GetChannelByNameForTeamName(channelName string, teamName string, includeDeleted bool) (*model.Channel, *model.AppError) { 4597 origCtx := a.ctx 4598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByNameForTeamName") 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.GetChannelByNameForTeamName(channelName, teamName, includeDeleted) 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) GetChannelCounts(teamID string, userID string) (*model.ChannelCounts, *model.AppError) { 4619 origCtx := a.ctx 4620 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelCounts") 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.GetChannelCounts(teamID, userID) 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) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) { 4641 origCtx := a.ctx 4642 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGroupUsers") 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.GetChannelGroupUsers(channelID) 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) GetChannelGuestCount(channelId string) (int64, *model.AppError) { 4663 origCtx := a.ctx 4664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGuestCount") 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.GetChannelGuestCount(channelId) 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) GetChannelMember(channelId string, userID string) (*model.ChannelMember, *model.AppError) { 4685 origCtx := a.ctx 4686 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMember") 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.GetChannelMember(channelId, userID) 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) GetChannelMemberCount(channelId string) (int64, *model.AppError) { 4707 origCtx := a.ctx 4708 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMemberCount") 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.GetChannelMemberCount(channelId) 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) GetChannelMembersByIds(channelId string, userIDs []string) (*model.ChannelMembers, *model.AppError) { 4729 origCtx := a.ctx 4730 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersByIds") 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.GetChannelMembersByIds(channelId, userIDs) 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) GetChannelMembersForUser(teamID string, userID string) (*model.ChannelMembers, *model.AppError) { 4751 origCtx := a.ctx 4752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUser") 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.GetChannelMembersForUser(teamID, userID) 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) GetChannelMembersForUserWithPagination(teamID string, userID string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) { 4773 origCtx := a.ctx 4774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUserWithPagination") 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.GetChannelMembersForUserWithPagination(teamID, userID, page, perPage) 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) GetChannelMembersPage(channelId string, page int, perPage int) (*model.ChannelMembers, *model.AppError) { 4795 origCtx := a.ctx 4796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersPage") 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.GetChannelMembersPage(channelId, page, perPage) 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) GetChannelMembersTimezones(channelId string) ([]string, *model.AppError) { 4817 origCtx := a.ctx 4818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersTimezones") 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.GetChannelMembersTimezones(channelId) 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) GetChannelModerationsForChannel(channel *model.Channel) ([]*model.ChannelModeration, *model.AppError) { 4839 origCtx := a.ctx 4840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelModerationsForChannel") 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.GetChannelModerationsForChannel(channel) 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) GetChannelPinnedPostCount(channelId string) (int64, *model.AppError) { 4861 origCtx := a.ctx 4862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelPinnedPostCount") 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.GetChannelPinnedPostCount(channelId) 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) GetChannelUnread(channelId string, userID string) (*model.ChannelUnread, *model.AppError) { 4883 origCtx := a.ctx 4884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelUnread") 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.GetChannelUnread(channelId, userID) 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) GetChannelsByNames(channelNames []string, teamID string) ([]*model.Channel, *model.AppError) { 4905 origCtx := a.ctx 4906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsByNames") 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.GetChannelsByNames(channelNames, teamID) 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) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError) { 4927 origCtx := a.ctx 4928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForScheme") 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.GetChannelsForScheme(scheme, offset, limit) 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) GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError) { 4949 origCtx := a.ctx 4950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForSchemePage") 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.GetChannelsForSchemePage(scheme, page, perPage) 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) GetChannelsForUser(teamID string, userID string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { 4971 origCtx := a.ctx 4972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForUser") 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.GetChannelsForUser(teamID, userID, includeDeleted, lastDeleteAt) 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) GetChannelsUserNotIn(teamID string, userID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 4993 origCtx := a.ctx 4994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsUserNotIn") 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.GetChannelsUserNotIn(teamID, userID, offset, limit) 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) GetCloudSession(token string) (*model.Session, *model.AppError) { 5015 origCtx := a.ctx 5016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCloudSession") 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.GetCloudSession(token) 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) GetClusterId() string { 5037 origCtx := a.ctx 5038 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterId") 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 := a.app.GetClusterId() 5049 5050 return resultVar0 5051 } 5052 5053 func (a *OpenTracingAppLayer) GetClusterPluginStatuses() (model.PluginStatuses, *model.AppError) { 5054 origCtx := a.ctx 5055 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterPluginStatuses") 5056 5057 a.ctx = newCtx 5058 a.app.Srv().Store.SetContext(newCtx) 5059 defer func() { 5060 a.app.Srv().Store.SetContext(origCtx) 5061 a.ctx = origCtx 5062 }() 5063 5064 defer span.Finish() 5065 resultVar0, resultVar1 := a.app.GetClusterPluginStatuses() 5066 5067 if resultVar1 != nil { 5068 span.LogFields(spanlog.Error(resultVar1)) 5069 ext.Error.Set(span, true) 5070 } 5071 5072 return resultVar0, resultVar1 5073 } 5074 5075 func (a *OpenTracingAppLayer) GetClusterStatus() []*model.ClusterInfo { 5076 origCtx := a.ctx 5077 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterStatus") 5078 5079 a.ctx = newCtx 5080 a.app.Srv().Store.SetContext(newCtx) 5081 defer func() { 5082 a.app.Srv().Store.SetContext(origCtx) 5083 a.ctx = origCtx 5084 }() 5085 5086 defer span.Finish() 5087 resultVar0 := a.app.GetClusterStatus() 5088 5089 return resultVar0 5090 } 5091 5092 func (a *OpenTracingAppLayer) GetCommand(commandID string) (*model.Command, *model.AppError) { 5093 origCtx := a.ctx 5094 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommand") 5095 5096 a.ctx = newCtx 5097 a.app.Srv().Store.SetContext(newCtx) 5098 defer func() { 5099 a.app.Srv().Store.SetContext(origCtx) 5100 a.ctx = origCtx 5101 }() 5102 5103 defer span.Finish() 5104 resultVar0, resultVar1 := a.app.GetCommand(commandID) 5105 5106 if resultVar1 != nil { 5107 span.LogFields(spanlog.Error(resultVar1)) 5108 ext.Error.Set(span, true) 5109 } 5110 5111 return resultVar0, resultVar1 5112 } 5113 5114 func (a *OpenTracingAppLayer) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) { 5115 origCtx := a.ctx 5116 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceFile") 5117 5118 a.ctx = newCtx 5119 a.app.Srv().Store.SetContext(newCtx) 5120 defer func() { 5121 a.app.Srv().Store.SetContext(origCtx) 5122 a.ctx = origCtx 5123 }() 5124 5125 defer span.Finish() 5126 resultVar0, resultVar1 := a.app.GetComplianceFile(job) 5127 5128 if resultVar1 != nil { 5129 span.LogFields(spanlog.Error(resultVar1)) 5130 ext.Error.Set(span, true) 5131 } 5132 5133 return resultVar0, resultVar1 5134 } 5135 5136 func (a *OpenTracingAppLayer) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) { 5137 origCtx := a.ctx 5138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReport") 5139 5140 a.ctx = newCtx 5141 a.app.Srv().Store.SetContext(newCtx) 5142 defer func() { 5143 a.app.Srv().Store.SetContext(origCtx) 5144 a.ctx = origCtx 5145 }() 5146 5147 defer span.Finish() 5148 resultVar0, resultVar1 := a.app.GetComplianceReport(reportId) 5149 5150 if resultVar1 != nil { 5151 span.LogFields(spanlog.Error(resultVar1)) 5152 ext.Error.Set(span, true) 5153 } 5154 5155 return resultVar0, resultVar1 5156 } 5157 5158 func (a *OpenTracingAppLayer) GetComplianceReports(page int, perPage int) (model.Compliances, *model.AppError) { 5159 origCtx := a.ctx 5160 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReports") 5161 5162 a.ctx = newCtx 5163 a.app.Srv().Store.SetContext(newCtx) 5164 defer func() { 5165 a.app.Srv().Store.SetContext(origCtx) 5166 a.ctx = origCtx 5167 }() 5168 5169 defer span.Finish() 5170 resultVar0, resultVar1 := a.app.GetComplianceReports(page, perPage) 5171 5172 if resultVar1 != nil { 5173 span.LogFields(spanlog.Error(resultVar1)) 5174 ext.Error.Set(span, true) 5175 } 5176 5177 return resultVar0, resultVar1 5178 } 5179 5180 func (a *OpenTracingAppLayer) GetConfigFile(name string) ([]byte, error) { 5181 origCtx := a.ctx 5182 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetConfigFile") 5183 5184 a.ctx = newCtx 5185 a.app.Srv().Store.SetContext(newCtx) 5186 defer func() { 5187 a.app.Srv().Store.SetContext(origCtx) 5188 a.ctx = origCtx 5189 }() 5190 5191 defer span.Finish() 5192 resultVar0, resultVar1 := a.app.GetConfigFile(name) 5193 5194 if resultVar1 != nil { 5195 span.LogFields(spanlog.Error(resultVar1)) 5196 ext.Error.Set(span, true) 5197 } 5198 5199 return resultVar0, resultVar1 5200 } 5201 5202 func (a *OpenTracingAppLayer) GetCookieDomain() string { 5203 origCtx := a.ctx 5204 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCookieDomain") 5205 5206 a.ctx = newCtx 5207 a.app.Srv().Store.SetContext(newCtx) 5208 defer func() { 5209 a.app.Srv().Store.SetContext(origCtx) 5210 a.ctx = origCtx 5211 }() 5212 5213 defer span.Finish() 5214 resultVar0 := a.app.GetCookieDomain() 5215 5216 return resultVar0 5217 } 5218 5219 func (a *OpenTracingAppLayer) GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError) { 5220 origCtx := a.ctx 5221 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDataRetentionPolicy") 5222 5223 a.ctx = newCtx 5224 a.app.Srv().Store.SetContext(newCtx) 5225 defer func() { 5226 a.app.Srv().Store.SetContext(origCtx) 5227 a.ctx = origCtx 5228 }() 5229 5230 defer span.Finish() 5231 resultVar0, resultVar1 := a.app.GetDataRetentionPolicy() 5232 5233 if resultVar1 != nil { 5234 span.LogFields(spanlog.Error(resultVar1)) 5235 ext.Error.Set(span, true) 5236 } 5237 5238 return resultVar0, resultVar1 5239 } 5240 5241 func (a *OpenTracingAppLayer) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) { 5242 origCtx := a.ctx 5243 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDefaultProfileImage") 5244 5245 a.ctx = newCtx 5246 a.app.Srv().Store.SetContext(newCtx) 5247 defer func() { 5248 a.app.Srv().Store.SetContext(origCtx) 5249 a.ctx = origCtx 5250 }() 5251 5252 defer span.Finish() 5253 resultVar0, resultVar1 := a.app.GetDefaultProfileImage(user) 5254 5255 if resultVar1 != nil { 5256 span.LogFields(spanlog.Error(resultVar1)) 5257 ext.Error.Set(span, true) 5258 } 5259 5260 return resultVar0, resultVar1 5261 } 5262 5263 func (a *OpenTracingAppLayer) GetDeletedChannels(teamID string, offset int, limit int, userID string) (*model.ChannelList, *model.AppError) { 5264 origCtx := a.ctx 5265 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDeletedChannels") 5266 5267 a.ctx = newCtx 5268 a.app.Srv().Store.SetContext(newCtx) 5269 defer func() { 5270 a.app.Srv().Store.SetContext(origCtx) 5271 a.ctx = origCtx 5272 }() 5273 5274 defer span.Finish() 5275 resultVar0, resultVar1 := a.app.GetDeletedChannels(teamID, offset, limit, userID) 5276 5277 if resultVar1 != nil { 5278 span.LogFields(spanlog.Error(resultVar1)) 5279 ext.Error.Set(span, true) 5280 } 5281 5282 return resultVar0, resultVar1 5283 } 5284 5285 func (a *OpenTracingAppLayer) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { 5286 origCtx := a.ctx 5287 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmoji") 5288 5289 a.ctx = newCtx 5290 a.app.Srv().Store.SetContext(newCtx) 5291 defer func() { 5292 a.app.Srv().Store.SetContext(origCtx) 5293 a.ctx = origCtx 5294 }() 5295 5296 defer span.Finish() 5297 resultVar0, resultVar1 := a.app.GetEmoji(emojiId) 5298 5299 if resultVar1 != nil { 5300 span.LogFields(spanlog.Error(resultVar1)) 5301 ext.Error.Set(span, true) 5302 } 5303 5304 return resultVar0, resultVar1 5305 } 5306 5307 func (a *OpenTracingAppLayer) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) { 5308 origCtx := a.ctx 5309 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiByName") 5310 5311 a.ctx = newCtx 5312 a.app.Srv().Store.SetContext(newCtx) 5313 defer func() { 5314 a.app.Srv().Store.SetContext(origCtx) 5315 a.ctx = origCtx 5316 }() 5317 5318 defer span.Finish() 5319 resultVar0, resultVar1 := a.app.GetEmojiByName(emojiName) 5320 5321 if resultVar1 != nil { 5322 span.LogFields(spanlog.Error(resultVar1)) 5323 ext.Error.Set(span, true) 5324 } 5325 5326 return resultVar0, resultVar1 5327 } 5328 5329 func (a *OpenTracingAppLayer) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { 5330 origCtx := a.ctx 5331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiImage") 5332 5333 a.ctx = newCtx 5334 a.app.Srv().Store.SetContext(newCtx) 5335 defer func() { 5336 a.app.Srv().Store.SetContext(origCtx) 5337 a.ctx = origCtx 5338 }() 5339 5340 defer span.Finish() 5341 resultVar0, resultVar1, resultVar2 := a.app.GetEmojiImage(emojiId) 5342 5343 if resultVar2 != nil { 5344 span.LogFields(spanlog.Error(resultVar2)) 5345 ext.Error.Set(span, true) 5346 } 5347 5348 return resultVar0, resultVar1, resultVar2 5349 } 5350 5351 func (a *OpenTracingAppLayer) GetEmojiList(page int, perPage int, sort string) ([]*model.Emoji, *model.AppError) { 5352 origCtx := a.ctx 5353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiList") 5354 5355 a.ctx = newCtx 5356 a.app.Srv().Store.SetContext(newCtx) 5357 defer func() { 5358 a.app.Srv().Store.SetContext(origCtx) 5359 a.ctx = origCtx 5360 }() 5361 5362 defer span.Finish() 5363 resultVar0, resultVar1 := a.app.GetEmojiList(page, perPage, sort) 5364 5365 if resultVar1 != nil { 5366 span.LogFields(spanlog.Error(resultVar1)) 5367 ext.Error.Set(span, true) 5368 } 5369 5370 return resultVar0, resultVar1 5371 } 5372 5373 func (a *OpenTracingAppLayer) GetEmojiStaticUrl(emojiName string) (string, *model.AppError) { 5374 origCtx := a.ctx 5375 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiStaticUrl") 5376 5377 a.ctx = newCtx 5378 a.app.Srv().Store.SetContext(newCtx) 5379 defer func() { 5380 a.app.Srv().Store.SetContext(origCtx) 5381 a.ctx = origCtx 5382 }() 5383 5384 defer span.Finish() 5385 resultVar0, resultVar1 := a.app.GetEmojiStaticUrl(emojiName) 5386 5387 if resultVar1 != nil { 5388 span.LogFields(spanlog.Error(resultVar1)) 5389 ext.Error.Set(span, true) 5390 } 5391 5392 return resultVar0, resultVar1 5393 } 5394 5395 func (a *OpenTracingAppLayer) GetEnvironmentConfig() map[string]interface{} { 5396 origCtx := a.ctx 5397 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEnvironmentConfig") 5398 5399 a.ctx = newCtx 5400 a.app.Srv().Store.SetContext(newCtx) 5401 defer func() { 5402 a.app.Srv().Store.SetContext(origCtx) 5403 a.ctx = origCtx 5404 }() 5405 5406 defer span.Finish() 5407 resultVar0 := a.app.GetEnvironmentConfig() 5408 5409 return resultVar0 5410 } 5411 5412 func (a *OpenTracingAppLayer) GetErrorListForEmailsOverLimit(emailList []string, cloudUserLimit int64) ([]string, []*model.EmailInviteWithError, *model.AppError) { 5413 origCtx := a.ctx 5414 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetErrorListForEmailsOverLimit") 5415 5416 a.ctx = newCtx 5417 a.app.Srv().Store.SetContext(newCtx) 5418 defer func() { 5419 a.app.Srv().Store.SetContext(origCtx) 5420 a.ctx = origCtx 5421 }() 5422 5423 defer span.Finish() 5424 resultVar0, resultVar1, resultVar2 := a.app.GetErrorListForEmailsOverLimit(emailList, cloudUserLimit) 5425 5426 if resultVar2 != nil { 5427 span.LogFields(spanlog.Error(resultVar2)) 5428 ext.Error.Set(span, true) 5429 } 5430 5431 return resultVar0, resultVar1, resultVar2 5432 } 5433 5434 func (a *OpenTracingAppLayer) GetFile(fileId string) ([]byte, *model.AppError) { 5435 origCtx := a.ctx 5436 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFile") 5437 5438 a.ctx = newCtx 5439 a.app.Srv().Store.SetContext(newCtx) 5440 defer func() { 5441 a.app.Srv().Store.SetContext(origCtx) 5442 a.ctx = origCtx 5443 }() 5444 5445 defer span.Finish() 5446 resultVar0, resultVar1 := a.app.GetFile(fileId) 5447 5448 if resultVar1 != nil { 5449 span.LogFields(spanlog.Error(resultVar1)) 5450 ext.Error.Set(span, true) 5451 } 5452 5453 return resultVar0, resultVar1 5454 } 5455 5456 func (a *OpenTracingAppLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { 5457 origCtx := a.ctx 5458 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfo") 5459 5460 a.ctx = newCtx 5461 a.app.Srv().Store.SetContext(newCtx) 5462 defer func() { 5463 a.app.Srv().Store.SetContext(origCtx) 5464 a.ctx = origCtx 5465 }() 5466 5467 defer span.Finish() 5468 resultVar0, resultVar1 := a.app.GetFileInfo(fileId) 5469 5470 if resultVar1 != nil { 5471 span.LogFields(spanlog.Error(resultVar1)) 5472 ext.Error.Set(span, true) 5473 } 5474 5475 return resultVar0, resultVar1 5476 } 5477 5478 func (a *OpenTracingAppLayer) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) { 5479 origCtx := a.ctx 5480 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfos") 5481 5482 a.ctx = newCtx 5483 a.app.Srv().Store.SetContext(newCtx) 5484 defer func() { 5485 a.app.Srv().Store.SetContext(origCtx) 5486 a.ctx = origCtx 5487 }() 5488 5489 defer span.Finish() 5490 resultVar0, resultVar1 := a.app.GetFileInfos(page, perPage, opt) 5491 5492 if resultVar1 != nil { 5493 span.LogFields(spanlog.Error(resultVar1)) 5494 ext.Error.Set(span, true) 5495 } 5496 5497 return resultVar0, resultVar1 5498 } 5499 5500 func (a *OpenTracingAppLayer) GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError) { 5501 origCtx := a.ctx 5502 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPost") 5503 5504 a.ctx = newCtx 5505 a.app.Srv().Store.SetContext(newCtx) 5506 defer func() { 5507 a.app.Srv().Store.SetContext(origCtx) 5508 a.ctx = origCtx 5509 }() 5510 5511 defer span.Finish() 5512 resultVar0, resultVar1 := a.app.GetFileInfosForPost(postId, fromMaster) 5513 5514 if resultVar1 != nil { 5515 span.LogFields(spanlog.Error(resultVar1)) 5516 ext.Error.Set(span, true) 5517 } 5518 5519 return resultVar0, resultVar1 5520 } 5521 5522 func (a *OpenTracingAppLayer) GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError) { 5523 origCtx := a.ctx 5524 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPostWithMigration") 5525 5526 a.ctx = newCtx 5527 a.app.Srv().Store.SetContext(newCtx) 5528 defer func() { 5529 a.app.Srv().Store.SetContext(origCtx) 5530 a.ctx = origCtx 5531 }() 5532 5533 defer span.Finish() 5534 resultVar0, resultVar1 := a.app.GetFileInfosForPostWithMigration(postId) 5535 5536 if resultVar1 != nil { 5537 span.LogFields(spanlog.Error(resultVar1)) 5538 ext.Error.Set(span, true) 5539 } 5540 5541 return resultVar0, resultVar1 5542 } 5543 5544 func (a *OpenTracingAppLayer) GetFilteredUsersStats(options *model.UserCountOptions) (*model.UsersStats, *model.AppError) { 5545 origCtx := a.ctx 5546 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFilteredUsersStats") 5547 5548 a.ctx = newCtx 5549 a.app.Srv().Store.SetContext(newCtx) 5550 defer func() { 5551 a.app.Srv().Store.SetContext(origCtx) 5552 a.ctx = origCtx 5553 }() 5554 5555 defer span.Finish() 5556 resultVar0, resultVar1 := a.app.GetFilteredUsersStats(options) 5557 5558 if resultVar1 != nil { 5559 span.LogFields(spanlog.Error(resultVar1)) 5560 ext.Error.Set(span, true) 5561 } 5562 5563 return resultVar0, resultVar1 5564 } 5565 5566 func (a *OpenTracingAppLayer) GetFlaggedPosts(userID string, offset int, limit int) (*model.PostList, *model.AppError) { 5567 origCtx := a.ctx 5568 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPosts") 5569 5570 a.ctx = newCtx 5571 a.app.Srv().Store.SetContext(newCtx) 5572 defer func() { 5573 a.app.Srv().Store.SetContext(origCtx) 5574 a.ctx = origCtx 5575 }() 5576 5577 defer span.Finish() 5578 resultVar0, resultVar1 := a.app.GetFlaggedPosts(userID, offset, limit) 5579 5580 if resultVar1 != nil { 5581 span.LogFields(spanlog.Error(resultVar1)) 5582 ext.Error.Set(span, true) 5583 } 5584 5585 return resultVar0, resultVar1 5586 } 5587 5588 func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userID string, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { 5589 origCtx := a.ctx 5590 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForChannel") 5591 5592 a.ctx = newCtx 5593 a.app.Srv().Store.SetContext(newCtx) 5594 defer func() { 5595 a.app.Srv().Store.SetContext(origCtx) 5596 a.ctx = origCtx 5597 }() 5598 5599 defer span.Finish() 5600 resultVar0, resultVar1 := a.app.GetFlaggedPostsForChannel(userID, channelId, offset, limit) 5601 5602 if resultVar1 != nil { 5603 span.LogFields(spanlog.Error(resultVar1)) 5604 ext.Error.Set(span, true) 5605 } 5606 5607 return resultVar0, resultVar1 5608 } 5609 5610 func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userID string, teamID string, offset int, limit int) (*model.PostList, *model.AppError) { 5611 origCtx := a.ctx 5612 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForTeam") 5613 5614 a.ctx = newCtx 5615 a.app.Srv().Store.SetContext(newCtx) 5616 defer func() { 5617 a.app.Srv().Store.SetContext(origCtx) 5618 a.ctx = origCtx 5619 }() 5620 5621 defer span.Finish() 5622 resultVar0, resultVar1 := a.app.GetFlaggedPostsForTeam(userID, teamID, offset, limit) 5623 5624 if resultVar1 != nil { 5625 span.LogFields(spanlog.Error(resultVar1)) 5626 ext.Error.Set(span, true) 5627 } 5628 5629 return resultVar0, resultVar1 5630 } 5631 5632 func (a *OpenTracingAppLayer) GetGroup(id string) (*model.Group, *model.AppError) { 5633 origCtx := a.ctx 5634 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroup") 5635 5636 a.ctx = newCtx 5637 a.app.Srv().Store.SetContext(newCtx) 5638 defer func() { 5639 a.app.Srv().Store.SetContext(origCtx) 5640 a.ctx = origCtx 5641 }() 5642 5643 defer span.Finish() 5644 resultVar0, resultVar1 := a.app.GetGroup(id) 5645 5646 if resultVar1 != nil { 5647 span.LogFields(spanlog.Error(resultVar1)) 5648 ext.Error.Set(span, true) 5649 } 5650 5651 return resultVar0, resultVar1 5652 } 5653 5654 func (a *OpenTracingAppLayer) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) { 5655 origCtx := a.ctx 5656 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByName") 5657 5658 a.ctx = newCtx 5659 a.app.Srv().Store.SetContext(newCtx) 5660 defer func() { 5661 a.app.Srv().Store.SetContext(origCtx) 5662 a.ctx = origCtx 5663 }() 5664 5665 defer span.Finish() 5666 resultVar0, resultVar1 := a.app.GetGroupByName(name, opts) 5667 5668 if resultVar1 != nil { 5669 span.LogFields(spanlog.Error(resultVar1)) 5670 ext.Error.Set(span, true) 5671 } 5672 5673 return resultVar0, resultVar1 5674 } 5675 5676 func (a *OpenTracingAppLayer) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) { 5677 origCtx := a.ctx 5678 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByRemoteID") 5679 5680 a.ctx = newCtx 5681 a.app.Srv().Store.SetContext(newCtx) 5682 defer func() { 5683 a.app.Srv().Store.SetContext(origCtx) 5684 a.ctx = origCtx 5685 }() 5686 5687 defer span.Finish() 5688 resultVar0, resultVar1 := a.app.GetGroupByRemoteID(remoteID, groupSource) 5689 5690 if resultVar1 != nil { 5691 span.LogFields(spanlog.Error(resultVar1)) 5692 ext.Error.Set(span, true) 5693 } 5694 5695 return resultVar0, resultVar1 5696 } 5697 5698 func (a *OpenTracingAppLayer) GetGroupChannel(userIDs []string) (*model.Channel, *model.AppError) { 5699 origCtx := a.ctx 5700 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupChannel") 5701 5702 a.ctx = newCtx 5703 a.app.Srv().Store.SetContext(newCtx) 5704 defer func() { 5705 a.app.Srv().Store.SetContext(origCtx) 5706 a.ctx = origCtx 5707 }() 5708 5709 defer span.Finish() 5710 resultVar0, resultVar1 := a.app.GetGroupChannel(userIDs) 5711 5712 if resultVar1 != nil { 5713 span.LogFields(spanlog.Error(resultVar1)) 5714 ext.Error.Set(span, true) 5715 } 5716 5717 return resultVar0, resultVar1 5718 } 5719 5720 func (a *OpenTracingAppLayer) GetGroupMemberCount(groupID string) (int64, *model.AppError) { 5721 origCtx := a.ctx 5722 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberCount") 5723 5724 a.ctx = newCtx 5725 a.app.Srv().Store.SetContext(newCtx) 5726 defer func() { 5727 a.app.Srv().Store.SetContext(origCtx) 5728 a.ctx = origCtx 5729 }() 5730 5731 defer span.Finish() 5732 resultVar0, resultVar1 := a.app.GetGroupMemberCount(groupID) 5733 5734 if resultVar1 != nil { 5735 span.LogFields(spanlog.Error(resultVar1)) 5736 ext.Error.Set(span, true) 5737 } 5738 5739 return resultVar0, resultVar1 5740 } 5741 5742 func (a *OpenTracingAppLayer) GetGroupMemberUsers(groupID string) ([]*model.User, *model.AppError) { 5743 origCtx := a.ctx 5744 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsers") 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 := a.app.GetGroupMemberUsers(groupID) 5755 5756 if resultVar1 != nil { 5757 span.LogFields(spanlog.Error(resultVar1)) 5758 ext.Error.Set(span, true) 5759 } 5760 5761 return resultVar0, resultVar1 5762 } 5763 5764 func (a *OpenTracingAppLayer) GetGroupMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, int, *model.AppError) { 5765 origCtx := a.ctx 5766 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsersPage") 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, resultVar2 := a.app.GetGroupMemberUsersPage(groupID, page, perPage) 5777 5778 if resultVar2 != nil { 5779 span.LogFields(spanlog.Error(resultVar2)) 5780 ext.Error.Set(span, true) 5781 } 5782 5783 return resultVar0, resultVar1, resultVar2 5784 } 5785 5786 func (a *OpenTracingAppLayer) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 5787 origCtx := a.ctx 5788 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncable") 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.GetGroupSyncable(groupID, syncableID, syncableType) 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) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) { 5809 origCtx := a.ctx 5810 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncables") 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.GetGroupSyncables(groupID, syncableType) 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) GetGroups(page int, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) { 5831 origCtx := a.ctx 5832 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroups") 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.GetGroups(page, perPage, opts) 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) GetGroupsAssociatedToChannelsByTeam(teamID string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { 5853 origCtx := a.ctx 5854 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsAssociatedToChannelsByTeam") 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.GetGroupsAssociatedToChannelsByTeam(teamID, opts) 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) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 5875 origCtx := a.ctx 5876 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByChannel") 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, resultVar2 := a.app.GetGroupsByChannel(channelId, opts) 5887 5888 if resultVar2 != nil { 5889 span.LogFields(spanlog.Error(resultVar2)) 5890 ext.Error.Set(span, true) 5891 } 5892 5893 return resultVar0, resultVar1, resultVar2 5894 } 5895 5896 func (a *OpenTracingAppLayer) GetGroupsByIDs(groupIDs []string) ([]*model.Group, *model.AppError) { 5897 origCtx := a.ctx 5898 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByIDs") 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.GetGroupsByIDs(groupIDs) 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) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) { 5919 origCtx := a.ctx 5920 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsBySource") 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.GetGroupsBySource(groupSource) 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) GetGroupsByTeam(teamID string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 5941 origCtx := a.ctx 5942 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByTeam") 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, resultVar2 := a.app.GetGroupsByTeam(teamID, opts) 5953 5954 if resultVar2 != nil { 5955 span.LogFields(spanlog.Error(resultVar2)) 5956 ext.Error.Set(span, true) 5957 } 5958 5959 return resultVar0, resultVar1, resultVar2 5960 } 5961 5962 func (a *OpenTracingAppLayer) GetGroupsByUserId(userID string) ([]*model.Group, *model.AppError) { 5963 origCtx := a.ctx 5964 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByUserId") 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.GetGroupsByUserId(userID) 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) GetHubForUserId(userID string) *app.Hub { 5985 origCtx := a.ctx 5986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetHubForUserId") 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 := a.app.GetHubForUserId(userID) 5997 5998 return resultVar0 5999 } 6000 6001 func (a *OpenTracingAppLayer) GetIncomingWebhook(hookID string) (*model.IncomingWebhook, *model.AppError) { 6002 origCtx := a.ctx 6003 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhook") 6004 6005 a.ctx = newCtx 6006 a.app.Srv().Store.SetContext(newCtx) 6007 defer func() { 6008 a.app.Srv().Store.SetContext(origCtx) 6009 a.ctx = origCtx 6010 }() 6011 6012 defer span.Finish() 6013 resultVar0, resultVar1 := a.app.GetIncomingWebhook(hookID) 6014 6015 if resultVar1 != nil { 6016 span.LogFields(spanlog.Error(resultVar1)) 6017 ext.Error.Set(span, true) 6018 } 6019 6020 return resultVar0, resultVar1 6021 } 6022 6023 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6024 origCtx := a.ctx 6025 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPage") 6026 6027 a.ctx = newCtx 6028 a.app.Srv().Store.SetContext(newCtx) 6029 defer func() { 6030 a.app.Srv().Store.SetContext(origCtx) 6031 a.ctx = origCtx 6032 }() 6033 6034 defer span.Finish() 6035 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPage(teamID, page, perPage) 6036 6037 if resultVar1 != nil { 6038 span.LogFields(spanlog.Error(resultVar1)) 6039 ext.Error.Set(span, true) 6040 } 6041 6042 return resultVar0, resultVar1 6043 } 6044 6045 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6046 origCtx := a.ctx 6047 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPageByUser") 6048 6049 a.ctx = newCtx 6050 a.app.Srv().Store.SetContext(newCtx) 6051 defer func() { 6052 a.app.Srv().Store.SetContext(origCtx) 6053 a.ctx = origCtx 6054 }() 6055 6056 defer span.Finish() 6057 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPageByUser(teamID, userID, page, perPage) 6058 6059 if resultVar1 != nil { 6060 span.LogFields(spanlog.Error(resultVar1)) 6061 ext.Error.Set(span, true) 6062 } 6063 6064 return resultVar0, resultVar1 6065 } 6066 6067 func (a *OpenTracingAppLayer) GetIncomingWebhooksPage(page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6068 origCtx := a.ctx 6069 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPage") 6070 6071 a.ctx = newCtx 6072 a.app.Srv().Store.SetContext(newCtx) 6073 defer func() { 6074 a.app.Srv().Store.SetContext(origCtx) 6075 a.ctx = origCtx 6076 }() 6077 6078 defer span.Finish() 6079 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPage(page, perPage) 6080 6081 if resultVar1 != nil { 6082 span.LogFields(spanlog.Error(resultVar1)) 6083 ext.Error.Set(span, true) 6084 } 6085 6086 return resultVar0, resultVar1 6087 } 6088 6089 func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 6090 origCtx := a.ctx 6091 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPageByUser") 6092 6093 a.ctx = newCtx 6094 a.app.Srv().Store.SetContext(newCtx) 6095 defer func() { 6096 a.app.Srv().Store.SetContext(origCtx) 6097 a.ctx = origCtx 6098 }() 6099 6100 defer span.Finish() 6101 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPageByUser(userID, page, perPage) 6102 6103 if resultVar1 != nil { 6104 span.LogFields(spanlog.Error(resultVar1)) 6105 ext.Error.Set(span, true) 6106 } 6107 6108 return resultVar0, resultVar1 6109 } 6110 6111 func (a *OpenTracingAppLayer) GetJob(id string) (*model.Job, *model.AppError) { 6112 origCtx := a.ctx 6113 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJob") 6114 6115 a.ctx = newCtx 6116 a.app.Srv().Store.SetContext(newCtx) 6117 defer func() { 6118 a.app.Srv().Store.SetContext(origCtx) 6119 a.ctx = origCtx 6120 }() 6121 6122 defer span.Finish() 6123 resultVar0, resultVar1 := a.app.GetJob(id) 6124 6125 if resultVar1 != nil { 6126 span.LogFields(spanlog.Error(resultVar1)) 6127 ext.Error.Set(span, true) 6128 } 6129 6130 return resultVar0, resultVar1 6131 } 6132 6133 func (a *OpenTracingAppLayer) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) { 6134 origCtx := a.ctx 6135 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobs") 6136 6137 a.ctx = newCtx 6138 a.app.Srv().Store.SetContext(newCtx) 6139 defer func() { 6140 a.app.Srv().Store.SetContext(origCtx) 6141 a.ctx = origCtx 6142 }() 6143 6144 defer span.Finish() 6145 resultVar0, resultVar1 := a.app.GetJobs(offset, limit) 6146 6147 if resultVar1 != nil { 6148 span.LogFields(spanlog.Error(resultVar1)) 6149 ext.Error.Set(span, true) 6150 } 6151 6152 return resultVar0, resultVar1 6153 } 6154 6155 func (a *OpenTracingAppLayer) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 6156 origCtx := a.ctx 6157 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByType") 6158 6159 a.ctx = newCtx 6160 a.app.Srv().Store.SetContext(newCtx) 6161 defer func() { 6162 a.app.Srv().Store.SetContext(origCtx) 6163 a.ctx = origCtx 6164 }() 6165 6166 defer span.Finish() 6167 resultVar0, resultVar1 := a.app.GetJobsByType(jobType, offset, limit) 6168 6169 if resultVar1 != nil { 6170 span.LogFields(spanlog.Error(resultVar1)) 6171 ext.Error.Set(span, true) 6172 } 6173 6174 return resultVar0, resultVar1 6175 } 6176 6177 func (a *OpenTracingAppLayer) GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError) { 6178 origCtx := a.ctx 6179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypePage") 6180 6181 a.ctx = newCtx 6182 a.app.Srv().Store.SetContext(newCtx) 6183 defer func() { 6184 a.app.Srv().Store.SetContext(origCtx) 6185 a.ctx = origCtx 6186 }() 6187 6188 defer span.Finish() 6189 resultVar0, resultVar1 := a.app.GetJobsByTypePage(jobType, page, perPage) 6190 6191 if resultVar1 != nil { 6192 span.LogFields(spanlog.Error(resultVar1)) 6193 ext.Error.Set(span, true) 6194 } 6195 6196 return resultVar0, resultVar1 6197 } 6198 6199 func (a *OpenTracingAppLayer) GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError) { 6200 origCtx := a.ctx 6201 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsPage") 6202 6203 a.ctx = newCtx 6204 a.app.Srv().Store.SetContext(newCtx) 6205 defer func() { 6206 a.app.Srv().Store.SetContext(origCtx) 6207 a.ctx = origCtx 6208 }() 6209 6210 defer span.Finish() 6211 resultVar0, resultVar1 := a.app.GetJobsPage(page, perPage) 6212 6213 if resultVar1 != nil { 6214 span.LogFields(spanlog.Error(resultVar1)) 6215 ext.Error.Set(span, true) 6216 } 6217 6218 return resultVar0, resultVar1 6219 } 6220 6221 func (a *OpenTracingAppLayer) GetKnownUsers(userID string) ([]string, *model.AppError) { 6222 origCtx := a.ctx 6223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetKnownUsers") 6224 6225 a.ctx = newCtx 6226 a.app.Srv().Store.SetContext(newCtx) 6227 defer func() { 6228 a.app.Srv().Store.SetContext(origCtx) 6229 a.ctx = origCtx 6230 }() 6231 6232 defer span.Finish() 6233 resultVar0, resultVar1 := a.app.GetKnownUsers(userID) 6234 6235 if resultVar1 != nil { 6236 span.LogFields(spanlog.Error(resultVar1)) 6237 ext.Error.Set(span, true) 6238 } 6239 6240 return resultVar0, resultVar1 6241 } 6242 6243 func (a *OpenTracingAppLayer) GetLatestTermsOfService() (*model.TermsOfService, *model.AppError) { 6244 origCtx := a.ctx 6245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLatestTermsOfService") 6246 6247 a.ctx = newCtx 6248 a.app.Srv().Store.SetContext(newCtx) 6249 defer func() { 6250 a.app.Srv().Store.SetContext(origCtx) 6251 a.ctx = origCtx 6252 }() 6253 6254 defer span.Finish() 6255 resultVar0, resultVar1 := a.app.GetLatestTermsOfService() 6256 6257 if resultVar1 != nil { 6258 span.LogFields(spanlog.Error(resultVar1)) 6259 ext.Error.Set(span, true) 6260 } 6261 6262 return resultVar0, resultVar1 6263 } 6264 6265 func (a *OpenTracingAppLayer) GetLdapGroup(ldapGroupID string) (*model.Group, *model.AppError) { 6266 origCtx := a.ctx 6267 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLdapGroup") 6268 6269 a.ctx = newCtx 6270 a.app.Srv().Store.SetContext(newCtx) 6271 defer func() { 6272 a.app.Srv().Store.SetContext(origCtx) 6273 a.ctx = origCtx 6274 }() 6275 6276 defer span.Finish() 6277 resultVar0, resultVar1 := a.app.GetLdapGroup(ldapGroupID) 6278 6279 if resultVar1 != nil { 6280 span.LogFields(spanlog.Error(resultVar1)) 6281 ext.Error.Set(span, true) 6282 } 6283 6284 return resultVar0, resultVar1 6285 } 6286 6287 func (a *OpenTracingAppLayer) GetLogs(page int, perPage int) ([]string, *model.AppError) { 6288 origCtx := a.ctx 6289 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogs") 6290 6291 a.ctx = newCtx 6292 a.app.Srv().Store.SetContext(newCtx) 6293 defer func() { 6294 a.app.Srv().Store.SetContext(origCtx) 6295 a.ctx = origCtx 6296 }() 6297 6298 defer span.Finish() 6299 resultVar0, resultVar1 := a.app.GetLogs(page, perPage) 6300 6301 if resultVar1 != nil { 6302 span.LogFields(spanlog.Error(resultVar1)) 6303 ext.Error.Set(span, true) 6304 } 6305 6306 return resultVar0, resultVar1 6307 } 6308 6309 func (a *OpenTracingAppLayer) GetLogsSkipSend(page int, perPage int) ([]string, *model.AppError) { 6310 origCtx := a.ctx 6311 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogsSkipSend") 6312 6313 a.ctx = newCtx 6314 a.app.Srv().Store.SetContext(newCtx) 6315 defer func() { 6316 a.app.Srv().Store.SetContext(origCtx) 6317 a.ctx = origCtx 6318 }() 6319 6320 defer span.Finish() 6321 resultVar0, resultVar1 := a.app.GetLogsSkipSend(page, perPage) 6322 6323 if resultVar1 != nil { 6324 span.LogFields(spanlog.Error(resultVar1)) 6325 ext.Error.Set(span, true) 6326 } 6327 6328 return resultVar0, resultVar1 6329 } 6330 6331 func (a *OpenTracingAppLayer) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) { 6332 origCtx := a.ctx 6333 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMarketplacePlugins") 6334 6335 a.ctx = newCtx 6336 a.app.Srv().Store.SetContext(newCtx) 6337 defer func() { 6338 a.app.Srv().Store.SetContext(origCtx) 6339 a.ctx = origCtx 6340 }() 6341 6342 defer span.Finish() 6343 resultVar0, resultVar1 := a.app.GetMarketplacePlugins(filter) 6344 6345 if resultVar1 != nil { 6346 span.LogFields(spanlog.Error(resultVar1)) 6347 ext.Error.Set(span, true) 6348 } 6349 6350 return resultVar0, resultVar1 6351 } 6352 6353 func (a *OpenTracingAppLayer) GetMemberCountsByGroup(channelID string, includeTimezones bool) ([]*model.ChannelMemberCountByGroup, *model.AppError) { 6354 origCtx := a.ctx 6355 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMemberCountsByGroup") 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.GetMemberCountsByGroup(channelID, includeTimezones) 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) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string { 6376 origCtx := a.ctx 6377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMessageForNotification") 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 := a.app.GetMessageForNotification(post, translateFunc) 6388 6389 return resultVar0 6390 } 6391 6392 func (a *OpenTracingAppLayer) GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) { 6393 origCtx := a.ctx 6394 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMultipleEmojiByName") 6395 6396 a.ctx = newCtx 6397 a.app.Srv().Store.SetContext(newCtx) 6398 defer func() { 6399 a.app.Srv().Store.SetContext(origCtx) 6400 a.ctx = origCtx 6401 }() 6402 6403 defer span.Finish() 6404 resultVar0, resultVar1 := a.app.GetMultipleEmojiByName(names) 6405 6406 if resultVar1 != nil { 6407 span.LogFields(spanlog.Error(resultVar1)) 6408 ext.Error.Set(span, true) 6409 } 6410 6411 return resultVar0, resultVar1 6412 } 6413 6414 func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 6415 origCtx := a.ctx 6416 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNewUsersForTeamPage") 6417 6418 a.ctx = newCtx 6419 a.app.Srv().Store.SetContext(newCtx) 6420 defer func() { 6421 a.app.Srv().Store.SetContext(origCtx) 6422 a.ctx = origCtx 6423 }() 6424 6425 defer span.Finish() 6426 resultVar0, resultVar1 := a.app.GetNewUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) 6427 6428 if resultVar1 != nil { 6429 span.LogFields(spanlog.Error(resultVar1)) 6430 ext.Error.Set(span, true) 6431 } 6432 6433 return resultVar0, resultVar1 6434 } 6435 6436 func (a *OpenTracingAppLayer) GetNextPostIdFromPostList(postList *model.PostList) string { 6437 origCtx := a.ctx 6438 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNextPostIdFromPostList") 6439 6440 a.ctx = newCtx 6441 a.app.Srv().Store.SetContext(newCtx) 6442 defer func() { 6443 a.app.Srv().Store.SetContext(origCtx) 6444 a.ctx = origCtx 6445 }() 6446 6447 defer span.Finish() 6448 resultVar0 := a.app.GetNextPostIdFromPostList(postList) 6449 6450 return resultVar0 6451 } 6452 6453 func (a *OpenTracingAppLayer) GetNotificationNameFormat(user *model.User) string { 6454 origCtx := a.ctx 6455 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNotificationNameFormat") 6456 6457 a.ctx = newCtx 6458 a.app.Srv().Store.SetContext(newCtx) 6459 defer func() { 6460 a.app.Srv().Store.SetContext(origCtx) 6461 a.ctx = origCtx 6462 }() 6463 6464 defer span.Finish() 6465 resultVar0 := a.app.GetNotificationNameFormat(user) 6466 6467 return resultVar0 6468 } 6469 6470 func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamID string) (int, *model.AppError) { 6471 origCtx := a.ctx 6472 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNumberOfChannelsOnTeam") 6473 6474 a.ctx = newCtx 6475 a.app.Srv().Store.SetContext(newCtx) 6476 defer func() { 6477 a.app.Srv().Store.SetContext(origCtx) 6478 a.ctx = origCtx 6479 }() 6480 6481 defer span.Finish() 6482 resultVar0, resultVar1 := a.app.GetNumberOfChannelsOnTeam(teamID) 6483 6484 if resultVar1 != nil { 6485 span.LogFields(spanlog.Error(resultVar1)) 6486 ext.Error.Set(span, true) 6487 } 6488 6489 return resultVar0, resultVar1 6490 } 6491 6492 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(clientId string, grantType string, redirectUri string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) { 6493 origCtx := a.ctx 6494 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForCodeFlow") 6495 6496 a.ctx = newCtx 6497 a.app.Srv().Store.SetContext(newCtx) 6498 defer func() { 6499 a.app.Srv().Store.SetContext(origCtx) 6500 a.ctx = origCtx 6501 }() 6502 6503 defer span.Finish() 6504 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken) 6505 6506 if resultVar1 != nil { 6507 span.LogFields(spanlog.Error(resultVar1)) 6508 ext.Error.Set(span, true) 6509 } 6510 6511 return resultVar0, resultVar1 6512 } 6513 6514 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userID string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { 6515 origCtx := a.ctx 6516 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow") 6517 6518 a.ctx = newCtx 6519 a.app.Srv().Store.SetContext(newCtx) 6520 defer func() { 6521 a.app.Srv().Store.SetContext(origCtx) 6522 a.ctx = origCtx 6523 }() 6524 6525 defer span.Finish() 6526 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userID, authRequest) 6527 6528 if resultVar1 != nil { 6529 span.LogFields(spanlog.Error(resultVar1)) 6530 ext.Error.Set(span, true) 6531 } 6532 6533 return resultVar0, resultVar1 6534 } 6535 6536 func (a *OpenTracingAppLayer) GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError) { 6537 origCtx := a.ctx 6538 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApp") 6539 6540 a.ctx = newCtx 6541 a.app.Srv().Store.SetContext(newCtx) 6542 defer func() { 6543 a.app.Srv().Store.SetContext(origCtx) 6544 a.ctx = origCtx 6545 }() 6546 6547 defer span.Finish() 6548 resultVar0, resultVar1 := a.app.GetOAuthApp(appId) 6549 6550 if resultVar1 != nil { 6551 span.LogFields(spanlog.Error(resultVar1)) 6552 ext.Error.Set(span, true) 6553 } 6554 6555 return resultVar0, resultVar1 6556 } 6557 6558 func (a *OpenTracingAppLayer) GetOAuthApps(page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6559 origCtx := a.ctx 6560 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApps") 6561 6562 a.ctx = newCtx 6563 a.app.Srv().Store.SetContext(newCtx) 6564 defer func() { 6565 a.app.Srv().Store.SetContext(origCtx) 6566 a.ctx = origCtx 6567 }() 6568 6569 defer span.Finish() 6570 resultVar0, resultVar1 := a.app.GetOAuthApps(page, perPage) 6571 6572 if resultVar1 != nil { 6573 span.LogFields(spanlog.Error(resultVar1)) 6574 ext.Error.Set(span, true) 6575 } 6576 6577 return resultVar0, resultVar1 6578 } 6579 6580 func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userID string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6581 origCtx := a.ctx 6582 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAppsByCreator") 6583 6584 a.ctx = newCtx 6585 a.app.Srv().Store.SetContext(newCtx) 6586 defer func() { 6587 a.app.Srv().Store.SetContext(origCtx) 6588 a.ctx = origCtx 6589 }() 6590 6591 defer span.Finish() 6592 resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userID, page, perPage) 6593 6594 if resultVar1 != nil { 6595 span.LogFields(spanlog.Error(resultVar1)) 6596 ext.Error.Set(span, true) 6597 } 6598 6599 return resultVar0, resultVar1 6600 } 6601 6602 func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 6603 origCtx := a.ctx 6604 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthCodeRedirect") 6605 6606 a.ctx = newCtx 6607 a.app.Srv().Store.SetContext(newCtx) 6608 defer func() { 6609 a.app.Srv().Store.SetContext(origCtx) 6610 a.ctx = origCtx 6611 }() 6612 6613 defer span.Finish() 6614 resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userID, authRequest) 6615 6616 if resultVar1 != nil { 6617 span.LogFields(spanlog.Error(resultVar1)) 6618 ext.Error.Set(span, true) 6619 } 6620 6621 return resultVar0, resultVar1 6622 } 6623 6624 func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userID string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 6625 origCtx := a.ctx 6626 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect") 6627 6628 a.ctx = newCtx 6629 a.app.Srv().Store.SetContext(newCtx) 6630 defer func() { 6631 a.app.Srv().Store.SetContext(origCtx) 6632 a.ctx = origCtx 6633 }() 6634 6635 defer span.Finish() 6636 resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userID, authRequest) 6637 6638 if resultVar1 != nil { 6639 span.LogFields(spanlog.Error(resultVar1)) 6640 ext.Error.Set(span, true) 6641 } 6642 6643 return resultVar0, resultVar1 6644 } 6645 6646 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) { 6647 origCtx := a.ctx 6648 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint") 6649 6650 a.ctx = newCtx 6651 a.app.Srv().Store.SetContext(newCtx) 6652 defer func() { 6653 a.app.Srv().Store.SetContext(origCtx) 6654 a.ctx = origCtx 6655 }() 6656 6657 defer span.Finish() 6658 resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, teamID, action, redirectTo, loginHint, isMobile) 6659 6660 if resultVar1 != nil { 6661 span.LogFields(spanlog.Error(resultVar1)) 6662 ext.Error.Set(span, true) 6663 } 6664 6665 return resultVar0, resultVar1 6666 } 6667 6668 func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, teamID string) (string, *model.AppError) { 6669 origCtx := a.ctx 6670 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint") 6671 6672 a.ctx = newCtx 6673 a.app.Srv().Store.SetContext(newCtx) 6674 defer func() { 6675 a.app.Srv().Store.SetContext(origCtx) 6676 a.ctx = origCtx 6677 }() 6678 6679 defer span.Finish() 6680 resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, teamID) 6681 6682 if resultVar1 != nil { 6683 span.LogFields(spanlog.Error(resultVar1)) 6684 ext.Error.Set(span, true) 6685 } 6686 6687 return resultVar0, resultVar1 6688 } 6689 6690 func (a *OpenTracingAppLayer) GetOAuthStateToken(token string) (*model.Token, *model.AppError) { 6691 origCtx := a.ctx 6692 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthStateToken") 6693 6694 a.ctx = newCtx 6695 a.app.Srv().Store.SetContext(newCtx) 6696 defer func() { 6697 a.app.Srv().Store.SetContext(origCtx) 6698 a.ctx = origCtx 6699 }() 6700 6701 defer span.Finish() 6702 resultVar0, resultVar1 := a.app.GetOAuthStateToken(token) 6703 6704 if resultVar1 != nil { 6705 span.LogFields(spanlog.Error(resultVar1)) 6706 ext.Error.Set(span, true) 6707 } 6708 6709 return resultVar0, resultVar1 6710 } 6711 6712 func (a *OpenTracingAppLayer) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph { 6713 origCtx := a.ctx 6714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOpenGraphMetadata") 6715 6716 a.ctx = newCtx 6717 a.app.Srv().Store.SetContext(newCtx) 6718 defer func() { 6719 a.app.Srv().Store.SetContext(origCtx) 6720 a.ctx = origCtx 6721 }() 6722 6723 defer span.Finish() 6724 resultVar0 := a.app.GetOpenGraphMetadata(requestURL) 6725 6726 return resultVar0 6727 } 6728 6729 func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userID string, otherUserID string) (*model.Channel, *model.AppError) { 6730 origCtx := a.ctx 6731 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOrCreateDirectChannel") 6732 6733 a.ctx = newCtx 6734 a.app.Srv().Store.SetContext(newCtx) 6735 defer func() { 6736 a.app.Srv().Store.SetContext(origCtx) 6737 a.ctx = origCtx 6738 }() 6739 6740 defer span.Finish() 6741 resultVar0, resultVar1 := a.app.GetOrCreateDirectChannel(userID, otherUserID) 6742 6743 if resultVar1 != nil { 6744 span.LogFields(spanlog.Error(resultVar1)) 6745 ext.Error.Set(span, true) 6746 } 6747 6748 return resultVar0, resultVar1 6749 } 6750 6751 func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookID string) (*model.OutgoingWebhook, *model.AppError) { 6752 origCtx := a.ctx 6753 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhook") 6754 6755 a.ctx = newCtx 6756 a.app.Srv().Store.SetContext(newCtx) 6757 defer func() { 6758 a.app.Srv().Store.SetContext(origCtx) 6759 a.ctx = origCtx 6760 }() 6761 6762 defer span.Finish() 6763 resultVar0, resultVar1 := a.app.GetOutgoingWebhook(hookID) 6764 6765 if resultVar1 != nil { 6766 span.LogFields(spanlog.Error(resultVar1)) 6767 ext.Error.Set(span, true) 6768 } 6769 6770 return resultVar0, resultVar1 6771 } 6772 6773 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6774 origCtx := a.ctx 6775 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForChannelPageByUser") 6776 6777 a.ctx = newCtx 6778 a.app.Srv().Store.SetContext(newCtx) 6779 defer func() { 6780 a.app.Srv().Store.SetContext(origCtx) 6781 a.ctx = origCtx 6782 }() 6783 6784 defer span.Finish() 6785 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForChannelPageByUser(channelId, userID, page, perPage) 6786 6787 if resultVar1 != nil { 6788 span.LogFields(spanlog.Error(resultVar1)) 6789 ext.Error.Set(span, true) 6790 } 6791 6792 return resultVar0, resultVar1 6793 } 6794 6795 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6796 origCtx := a.ctx 6797 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPage") 6798 6799 a.ctx = newCtx 6800 a.app.Srv().Store.SetContext(newCtx) 6801 defer func() { 6802 a.app.Srv().Store.SetContext(origCtx) 6803 a.ctx = origCtx 6804 }() 6805 6806 defer span.Finish() 6807 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPage(teamID, page, perPage) 6808 6809 if resultVar1 != nil { 6810 span.LogFields(spanlog.Error(resultVar1)) 6811 ext.Error.Set(span, true) 6812 } 6813 6814 return resultVar0, resultVar1 6815 } 6816 6817 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamID string, userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6818 origCtx := a.ctx 6819 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPageByUser") 6820 6821 a.ctx = newCtx 6822 a.app.Srv().Store.SetContext(newCtx) 6823 defer func() { 6824 a.app.Srv().Store.SetContext(origCtx) 6825 a.ctx = origCtx 6826 }() 6827 6828 defer span.Finish() 6829 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPageByUser(teamID, userID, page, perPage) 6830 6831 if resultVar1 != nil { 6832 span.LogFields(spanlog.Error(resultVar1)) 6833 ext.Error.Set(span, true) 6834 } 6835 6836 return resultVar0, resultVar1 6837 } 6838 6839 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPage(page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6840 origCtx := a.ctx 6841 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPage") 6842 6843 a.ctx = newCtx 6844 a.app.Srv().Store.SetContext(newCtx) 6845 defer func() { 6846 a.app.Srv().Store.SetContext(origCtx) 6847 a.ctx = origCtx 6848 }() 6849 6850 defer span.Finish() 6851 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPage(page, perPage) 6852 6853 if resultVar1 != nil { 6854 span.LogFields(spanlog.Error(resultVar1)) 6855 ext.Error.Set(span, true) 6856 } 6857 6858 return resultVar0, resultVar1 6859 } 6860 6861 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userID string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6862 origCtx := a.ctx 6863 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPageByUser") 6864 6865 a.ctx = newCtx 6866 a.app.Srv().Store.SetContext(newCtx) 6867 defer func() { 6868 a.app.Srv().Store.SetContext(origCtx) 6869 a.ctx = origCtx 6870 }() 6871 6872 defer span.Finish() 6873 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPageByUser(userID, page, perPage) 6874 6875 if resultVar1 != nil { 6876 span.LogFields(spanlog.Error(resultVar1)) 6877 ext.Error.Set(span, true) 6878 } 6879 6880 return resultVar0, resultVar1 6881 } 6882 6883 func (a *OpenTracingAppLayer) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) { 6884 origCtx := a.ctx 6885 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPasswordRecoveryToken") 6886 6887 a.ctx = newCtx 6888 a.app.Srv().Store.SetContext(newCtx) 6889 defer func() { 6890 a.app.Srv().Store.SetContext(origCtx) 6891 a.ctx = origCtx 6892 }() 6893 6894 defer span.Finish() 6895 resultVar0, resultVar1 := a.app.GetPasswordRecoveryToken(token) 6896 6897 if resultVar1 != nil { 6898 span.LogFields(spanlog.Error(resultVar1)) 6899 ext.Error.Set(span, true) 6900 } 6901 6902 return resultVar0, resultVar1 6903 } 6904 6905 func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userID string) (*model.PostList, *model.AppError) { 6906 origCtx := a.ctx 6907 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPermalinkPost") 6908 6909 a.ctx = newCtx 6910 a.app.Srv().Store.SetContext(newCtx) 6911 defer func() { 6912 a.app.Srv().Store.SetContext(origCtx) 6913 a.ctx = origCtx 6914 }() 6915 6916 defer span.Finish() 6917 resultVar0, resultVar1 := a.app.GetPermalinkPost(postId, userID) 6918 6919 if resultVar1 != nil { 6920 span.LogFields(spanlog.Error(resultVar1)) 6921 ext.Error.Set(span, true) 6922 } 6923 6924 return resultVar0, resultVar1 6925 } 6926 6927 func (a *OpenTracingAppLayer) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError) { 6928 origCtx := a.ctx 6929 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPinnedPosts") 6930 6931 a.ctx = newCtx 6932 a.app.Srv().Store.SetContext(newCtx) 6933 defer func() { 6934 a.app.Srv().Store.SetContext(origCtx) 6935 a.ctx = origCtx 6936 }() 6937 6938 defer span.Finish() 6939 resultVar0, resultVar1 := a.app.GetPinnedPosts(channelId) 6940 6941 if resultVar1 != nil { 6942 span.LogFields(spanlog.Error(resultVar1)) 6943 ext.Error.Set(span, true) 6944 } 6945 6946 return resultVar0, resultVar1 6947 } 6948 6949 func (a *OpenTracingAppLayer) GetPluginKey(pluginId string, key string) ([]byte, *model.AppError) { 6950 origCtx := a.ctx 6951 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginKey") 6952 6953 a.ctx = newCtx 6954 a.app.Srv().Store.SetContext(newCtx) 6955 defer func() { 6956 a.app.Srv().Store.SetContext(origCtx) 6957 a.ctx = origCtx 6958 }() 6959 6960 defer span.Finish() 6961 resultVar0, resultVar1 := a.app.GetPluginKey(pluginId, key) 6962 6963 if resultVar1 != nil { 6964 span.LogFields(spanlog.Error(resultVar1)) 6965 ext.Error.Set(span, true) 6966 } 6967 6968 return resultVar0, resultVar1 6969 } 6970 6971 func (a *OpenTracingAppLayer) GetPluginPublicKeyFiles() ([]string, *model.AppError) { 6972 origCtx := a.ctx 6973 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginPublicKeyFiles") 6974 6975 a.ctx = newCtx 6976 a.app.Srv().Store.SetContext(newCtx) 6977 defer func() { 6978 a.app.Srv().Store.SetContext(origCtx) 6979 a.ctx = origCtx 6980 }() 6981 6982 defer span.Finish() 6983 resultVar0, resultVar1 := a.app.GetPluginPublicKeyFiles() 6984 6985 if resultVar1 != nil { 6986 span.LogFields(spanlog.Error(resultVar1)) 6987 ext.Error.Set(span, true) 6988 } 6989 6990 return resultVar0, resultVar1 6991 } 6992 6993 func (a *OpenTracingAppLayer) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) { 6994 origCtx := a.ctx 6995 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatus") 6996 6997 a.ctx = newCtx 6998 a.app.Srv().Store.SetContext(newCtx) 6999 defer func() { 7000 a.app.Srv().Store.SetContext(origCtx) 7001 a.ctx = origCtx 7002 }() 7003 7004 defer span.Finish() 7005 resultVar0, resultVar1 := a.app.GetPluginStatus(id) 7006 7007 if resultVar1 != nil { 7008 span.LogFields(spanlog.Error(resultVar1)) 7009 ext.Error.Set(span, true) 7010 } 7011 7012 return resultVar0, resultVar1 7013 } 7014 7015 func (a *OpenTracingAppLayer) GetPluginStatuses() (model.PluginStatuses, *model.AppError) { 7016 origCtx := a.ctx 7017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatuses") 7018 7019 a.ctx = newCtx 7020 a.app.Srv().Store.SetContext(newCtx) 7021 defer func() { 7022 a.app.Srv().Store.SetContext(origCtx) 7023 a.ctx = origCtx 7024 }() 7025 7026 defer span.Finish() 7027 resultVar0, resultVar1 := a.app.GetPluginStatuses() 7028 7029 if resultVar1 != nil { 7030 span.LogFields(spanlog.Error(resultVar1)) 7031 ext.Error.Set(span, true) 7032 } 7033 7034 return resultVar0, resultVar1 7035 } 7036 7037 func (a *OpenTracingAppLayer) GetPlugins() (*model.PluginsResponse, *model.AppError) { 7038 origCtx := a.ctx 7039 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPlugins") 7040 7041 a.ctx = newCtx 7042 a.app.Srv().Store.SetContext(newCtx) 7043 defer func() { 7044 a.app.Srv().Store.SetContext(origCtx) 7045 a.ctx = origCtx 7046 }() 7047 7048 defer span.Finish() 7049 resultVar0, resultVar1 := a.app.GetPlugins() 7050 7051 if resultVar1 != nil { 7052 span.LogFields(spanlog.Error(resultVar1)) 7053 ext.Error.Set(span, true) 7054 } 7055 7056 return resultVar0, resultVar1 7057 } 7058 7059 func (a *OpenTracingAppLayer) GetPluginsEnvironment() *plugin.Environment { 7060 origCtx := a.ctx 7061 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginsEnvironment") 7062 7063 a.ctx = newCtx 7064 a.app.Srv().Store.SetContext(newCtx) 7065 defer func() { 7066 a.app.Srv().Store.SetContext(origCtx) 7067 a.ctx = origCtx 7068 }() 7069 7070 defer span.Finish() 7071 resultVar0 := a.app.GetPluginsEnvironment() 7072 7073 return resultVar0 7074 } 7075 7076 func (a *OpenTracingAppLayer) GetPostAfterTime(channelId string, time int64) (*model.Post, *model.AppError) { 7077 origCtx := a.ctx 7078 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostAfterTime") 7079 7080 a.ctx = newCtx 7081 a.app.Srv().Store.SetContext(newCtx) 7082 defer func() { 7083 a.app.Srv().Store.SetContext(origCtx) 7084 a.ctx = origCtx 7085 }() 7086 7087 defer span.Finish() 7088 resultVar0, resultVar1 := a.app.GetPostAfterTime(channelId, time) 7089 7090 if resultVar1 != nil { 7091 span.LogFields(spanlog.Error(resultVar1)) 7092 ext.Error.Set(span, true) 7093 } 7094 7095 return resultVar0, resultVar1 7096 } 7097 7098 func (a *OpenTracingAppLayer) GetPostIdAfterTime(channelId string, time int64) (string, *model.AppError) { 7099 origCtx := a.ctx 7100 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdAfterTime") 7101 7102 a.ctx = newCtx 7103 a.app.Srv().Store.SetContext(newCtx) 7104 defer func() { 7105 a.app.Srv().Store.SetContext(origCtx) 7106 a.ctx = origCtx 7107 }() 7108 7109 defer span.Finish() 7110 resultVar0, resultVar1 := a.app.GetPostIdAfterTime(channelId, time) 7111 7112 if resultVar1 != nil { 7113 span.LogFields(spanlog.Error(resultVar1)) 7114 ext.Error.Set(span, true) 7115 } 7116 7117 return resultVar0, resultVar1 7118 } 7119 7120 func (a *OpenTracingAppLayer) GetPostIdBeforeTime(channelId string, time int64) (string, *model.AppError) { 7121 origCtx := a.ctx 7122 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdBeforeTime") 7123 7124 a.ctx = newCtx 7125 a.app.Srv().Store.SetContext(newCtx) 7126 defer func() { 7127 a.app.Srv().Store.SetContext(origCtx) 7128 a.ctx = origCtx 7129 }() 7130 7131 defer span.Finish() 7132 resultVar0, resultVar1 := a.app.GetPostIdBeforeTime(channelId, time) 7133 7134 if resultVar1 != nil { 7135 span.LogFields(spanlog.Error(resultVar1)) 7136 ext.Error.Set(span, true) 7137 } 7138 7139 return resultVar0, resultVar1 7140 } 7141 7142 func (a *OpenTracingAppLayer) GetPostThread(postId string, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { 7143 origCtx := a.ctx 7144 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostThread") 7145 7146 a.ctx = newCtx 7147 a.app.Srv().Store.SetContext(newCtx) 7148 defer func() { 7149 a.app.Srv().Store.SetContext(origCtx) 7150 a.ctx = origCtx 7151 }() 7152 7153 defer span.Finish() 7154 resultVar0, resultVar1 := a.app.GetPostThread(postId, skipFetchThreads, collapsedThreads, collapsedThreadsExtended) 7155 7156 if resultVar1 != nil { 7157 span.LogFields(spanlog.Error(resultVar1)) 7158 ext.Error.Set(span, true) 7159 } 7160 7161 return resultVar0, resultVar1 7162 } 7163 7164 func (a *OpenTracingAppLayer) GetPosts(channelId string, offset int, limit int) (*model.PostList, *model.AppError) { 7165 origCtx := a.ctx 7166 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPosts") 7167 7168 a.ctx = newCtx 7169 a.app.Srv().Store.SetContext(newCtx) 7170 defer func() { 7171 a.app.Srv().Store.SetContext(origCtx) 7172 a.ctx = origCtx 7173 }() 7174 7175 defer span.Finish() 7176 resultVar0, resultVar1 := a.app.GetPosts(channelId, offset, limit) 7177 7178 if resultVar1 != nil { 7179 span.LogFields(spanlog.Error(resultVar1)) 7180 ext.Error.Set(span, true) 7181 } 7182 7183 return resultVar0, resultVar1 7184 } 7185 7186 func (a *OpenTracingAppLayer) GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7187 origCtx := a.ctx 7188 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAfterPost") 7189 7190 a.ctx = newCtx 7191 a.app.Srv().Store.SetContext(newCtx) 7192 defer func() { 7193 a.app.Srv().Store.SetContext(origCtx) 7194 a.ctx = origCtx 7195 }() 7196 7197 defer span.Finish() 7198 resultVar0, resultVar1 := a.app.GetPostsAfterPost(options) 7199 7200 if resultVar1 != nil { 7201 span.LogFields(spanlog.Error(resultVar1)) 7202 ext.Error.Set(span, true) 7203 } 7204 7205 return resultVar0, resultVar1 7206 } 7207 7208 func (a *OpenTracingAppLayer) GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7209 origCtx := a.ctx 7210 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAroundPost") 7211 7212 a.ctx = newCtx 7213 a.app.Srv().Store.SetContext(newCtx) 7214 defer func() { 7215 a.app.Srv().Store.SetContext(origCtx) 7216 a.ctx = origCtx 7217 }() 7218 7219 defer span.Finish() 7220 resultVar0, resultVar1 := a.app.GetPostsAroundPost(before, options) 7221 7222 if resultVar1 != nil { 7223 span.LogFields(spanlog.Error(resultVar1)) 7224 ext.Error.Set(span, true) 7225 } 7226 7227 return resultVar0, resultVar1 7228 } 7229 7230 func (a *OpenTracingAppLayer) GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7231 origCtx := a.ctx 7232 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsBeforePost") 7233 7234 a.ctx = newCtx 7235 a.app.Srv().Store.SetContext(newCtx) 7236 defer func() { 7237 a.app.Srv().Store.SetContext(origCtx) 7238 a.ctx = origCtx 7239 }() 7240 7241 defer span.Finish() 7242 resultVar0, resultVar1 := a.app.GetPostsBeforePost(options) 7243 7244 if resultVar1 != nil { 7245 span.LogFields(spanlog.Error(resultVar1)) 7246 ext.Error.Set(span, true) 7247 } 7248 7249 return resultVar0, resultVar1 7250 } 7251 7252 func (a *OpenTracingAppLayer) GetPostsEtag(channelId string, collapsedThreads bool) string { 7253 origCtx := a.ctx 7254 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsEtag") 7255 7256 a.ctx = newCtx 7257 a.app.Srv().Store.SetContext(newCtx) 7258 defer func() { 7259 a.app.Srv().Store.SetContext(origCtx) 7260 a.ctx = origCtx 7261 }() 7262 7263 defer span.Finish() 7264 resultVar0 := a.app.GetPostsEtag(channelId, collapsedThreads) 7265 7266 return resultVar0 7267 } 7268 7269 func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelId string, userID string, limitBefore int, limitAfter int, skipFetchThreads bool, collapsedThreads bool, collapsedThreadsExtended bool) (*model.PostList, *model.AppError) { 7270 origCtx := a.ctx 7271 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsForChannelAroundLastUnread") 7272 7273 a.ctx = newCtx 7274 a.app.Srv().Store.SetContext(newCtx) 7275 defer func() { 7276 a.app.Srv().Store.SetContext(origCtx) 7277 a.ctx = origCtx 7278 }() 7279 7280 defer span.Finish() 7281 resultVar0, resultVar1 := a.app.GetPostsForChannelAroundLastUnread(channelId, userID, limitBefore, limitAfter, skipFetchThreads, collapsedThreads, collapsedThreadsExtended) 7282 7283 if resultVar1 != nil { 7284 span.LogFields(spanlog.Error(resultVar1)) 7285 ext.Error.Set(span, true) 7286 } 7287 7288 return resultVar0, resultVar1 7289 } 7290 7291 func (a *OpenTracingAppLayer) GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 7292 origCtx := a.ctx 7293 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsPage") 7294 7295 a.ctx = newCtx 7296 a.app.Srv().Store.SetContext(newCtx) 7297 defer func() { 7298 a.app.Srv().Store.SetContext(origCtx) 7299 a.ctx = origCtx 7300 }() 7301 7302 defer span.Finish() 7303 resultVar0, resultVar1 := a.app.GetPostsPage(options) 7304 7305 if resultVar1 != nil { 7306 span.LogFields(spanlog.Error(resultVar1)) 7307 ext.Error.Set(span, true) 7308 } 7309 7310 return resultVar0, resultVar1 7311 } 7312 7313 func (a *OpenTracingAppLayer) GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) { 7314 origCtx := a.ctx 7315 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsSince") 7316 7317 a.ctx = newCtx 7318 a.app.Srv().Store.SetContext(newCtx) 7319 defer func() { 7320 a.app.Srv().Store.SetContext(origCtx) 7321 a.ctx = origCtx 7322 }() 7323 7324 defer span.Finish() 7325 resultVar0, resultVar1 := a.app.GetPostsSince(options) 7326 7327 if resultVar1 != nil { 7328 span.LogFields(spanlog.Error(resultVar1)) 7329 ext.Error.Set(span, true) 7330 } 7331 7332 return resultVar0, resultVar1 7333 } 7334 7335 func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userID string, category string, preferenceName string) (*model.Preference, *model.AppError) { 7336 origCtx := a.ctx 7337 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryAndNameForUser") 7338 7339 a.ctx = newCtx 7340 a.app.Srv().Store.SetContext(newCtx) 7341 defer func() { 7342 a.app.Srv().Store.SetContext(origCtx) 7343 a.ctx = origCtx 7344 }() 7345 7346 defer span.Finish() 7347 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userID, category, preferenceName) 7348 7349 if resultVar1 != nil { 7350 span.LogFields(spanlog.Error(resultVar1)) 7351 ext.Error.Set(span, true) 7352 } 7353 7354 return resultVar0, resultVar1 7355 } 7356 7357 func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userID string, category string) (model.Preferences, *model.AppError) { 7358 origCtx := a.ctx 7359 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryForUser") 7360 7361 a.ctx = newCtx 7362 a.app.Srv().Store.SetContext(newCtx) 7363 defer func() { 7364 a.app.Srv().Store.SetContext(origCtx) 7365 a.ctx = origCtx 7366 }() 7367 7368 defer span.Finish() 7369 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userID, category) 7370 7371 if resultVar1 != nil { 7372 span.LogFields(spanlog.Error(resultVar1)) 7373 ext.Error.Set(span, true) 7374 } 7375 7376 return resultVar0, resultVar1 7377 } 7378 7379 func (a *OpenTracingAppLayer) GetPreferencesForUser(userID string) (model.Preferences, *model.AppError) { 7380 origCtx := a.ctx 7381 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferencesForUser") 7382 7383 a.ctx = newCtx 7384 a.app.Srv().Store.SetContext(newCtx) 7385 defer func() { 7386 a.app.Srv().Store.SetContext(origCtx) 7387 a.ctx = origCtx 7388 }() 7389 7390 defer span.Finish() 7391 resultVar0, resultVar1 := a.app.GetPreferencesForUser(userID) 7392 7393 if resultVar1 != nil { 7394 span.LogFields(spanlog.Error(resultVar1)) 7395 ext.Error.Set(span, true) 7396 } 7397 7398 return resultVar0, resultVar1 7399 } 7400 7401 func (a *OpenTracingAppLayer) GetPrevPostIdFromPostList(postList *model.PostList) string { 7402 origCtx := a.ctx 7403 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrevPostIdFromPostList") 7404 7405 a.ctx = newCtx 7406 a.app.Srv().Store.SetContext(newCtx) 7407 defer func() { 7408 a.app.Srv().Store.SetContext(origCtx) 7409 a.ctx = origCtx 7410 }() 7411 7412 defer span.Finish() 7413 resultVar0 := a.app.GetPrevPostIdFromPostList(postList) 7414 7415 return resultVar0 7416 } 7417 7418 func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7419 origCtx := a.ctx 7420 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrivateChannelsForTeam") 7421 7422 a.ctx = newCtx 7423 a.app.Srv().Store.SetContext(newCtx) 7424 defer func() { 7425 a.app.Srv().Store.SetContext(origCtx) 7426 a.ctx = origCtx 7427 }() 7428 7429 defer span.Finish() 7430 resultVar0, resultVar1 := a.app.GetPrivateChannelsForTeam(teamID, offset, limit) 7431 7432 if resultVar1 != nil { 7433 span.LogFields(spanlog.Error(resultVar1)) 7434 ext.Error.Set(span, true) 7435 } 7436 7437 return resultVar0, resultVar1 7438 } 7439 7440 func (a *OpenTracingAppLayer) GetProductNotices(userID string, teamID string, client model.NoticeClientType, clientVersion string, locale string) (model.NoticeMessages, *model.AppError) { 7441 origCtx := a.ctx 7442 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProductNotices") 7443 7444 a.ctx = newCtx 7445 a.app.Srv().Store.SetContext(newCtx) 7446 defer func() { 7447 a.app.Srv().Store.SetContext(origCtx) 7448 a.ctx = origCtx 7449 }() 7450 7451 defer span.Finish() 7452 resultVar0, resultVar1 := a.app.GetProductNotices(userID, teamID, client, clientVersion, locale) 7453 7454 if resultVar1 != nil { 7455 span.LogFields(spanlog.Error(resultVar1)) 7456 ext.Error.Set(span, true) 7457 } 7458 7459 return resultVar0, resultVar1 7460 } 7461 7462 func (a *OpenTracingAppLayer) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) { 7463 origCtx := a.ctx 7464 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProfileImage") 7465 7466 a.ctx = newCtx 7467 a.app.Srv().Store.SetContext(newCtx) 7468 defer func() { 7469 a.app.Srv().Store.SetContext(origCtx) 7470 a.ctx = origCtx 7471 }() 7472 7473 defer span.Finish() 7474 resultVar0, resultVar1, resultVar2 := a.app.GetProfileImage(user) 7475 7476 if resultVar2 != nil { 7477 span.LogFields(spanlog.Error(resultVar2)) 7478 ext.Error.Set(span, true) 7479 } 7480 7481 return resultVar0, resultVar1, resultVar2 7482 } 7483 7484 func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamID string, channelIds []string) (*model.ChannelList, *model.AppError) { 7485 origCtx := a.ctx 7486 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsByIdsForTeam") 7487 7488 a.ctx = newCtx 7489 a.app.Srv().Store.SetContext(newCtx) 7490 defer func() { 7491 a.app.Srv().Store.SetContext(origCtx) 7492 a.ctx = origCtx 7493 }() 7494 7495 defer span.Finish() 7496 resultVar0, resultVar1 := a.app.GetPublicChannelsByIdsForTeam(teamID, channelIds) 7497 7498 if resultVar1 != nil { 7499 span.LogFields(spanlog.Error(resultVar1)) 7500 ext.Error.Set(span, true) 7501 } 7502 7503 return resultVar0, resultVar1 7504 } 7505 7506 func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamID string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7507 origCtx := a.ctx 7508 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsForTeam") 7509 7510 a.ctx = newCtx 7511 a.app.Srv().Store.SetContext(newCtx) 7512 defer func() { 7513 a.app.Srv().Store.SetContext(origCtx) 7514 a.ctx = origCtx 7515 }() 7516 7517 defer span.Finish() 7518 resultVar0, resultVar1 := a.app.GetPublicChannelsForTeam(teamID, offset, limit) 7519 7520 if resultVar1 != nil { 7521 span.LogFields(spanlog.Error(resultVar1)) 7522 ext.Error.Set(span, true) 7523 } 7524 7525 return resultVar0, resultVar1 7526 } 7527 7528 func (a *OpenTracingAppLayer) GetPublicKey(name string) ([]byte, *model.AppError) { 7529 origCtx := a.ctx 7530 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicKey") 7531 7532 a.ctx = newCtx 7533 a.app.Srv().Store.SetContext(newCtx) 7534 defer func() { 7535 a.app.Srv().Store.SetContext(origCtx) 7536 a.ctx = origCtx 7537 }() 7538 7539 defer span.Finish() 7540 resultVar0, resultVar1 := a.app.GetPublicKey(name) 7541 7542 if resultVar1 != nil { 7543 span.LogFields(spanlog.Error(resultVar1)) 7544 ext.Error.Set(span, true) 7545 } 7546 7547 return resultVar0, resultVar1 7548 } 7549 7550 func (a *OpenTracingAppLayer) GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) { 7551 origCtx := a.ctx 7552 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetReactionsForPost") 7553 7554 a.ctx = newCtx 7555 a.app.Srv().Store.SetContext(newCtx) 7556 defer func() { 7557 a.app.Srv().Store.SetContext(origCtx) 7558 a.ctx = origCtx 7559 }() 7560 7561 defer span.Finish() 7562 resultVar0, resultVar1 := a.app.GetReactionsForPost(postId) 7563 7564 if resultVar1 != nil { 7565 span.LogFields(spanlog.Error(resultVar1)) 7566 ext.Error.Set(span, true) 7567 } 7568 7569 return resultVar0, resultVar1 7570 } 7571 7572 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamID string) (map[string]*model.User, *model.AppError) { 7573 origCtx := a.ctx 7574 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeam") 7575 7576 a.ctx = newCtx 7577 a.app.Srv().Store.SetContext(newCtx) 7578 defer func() { 7579 a.app.Srv().Store.SetContext(origCtx) 7580 a.ctx = origCtx 7581 }() 7582 7583 defer span.Finish() 7584 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeam(teamID) 7585 7586 if resultVar1 != nil { 7587 span.LogFields(spanlog.Error(resultVar1)) 7588 ext.Error.Set(span, true) 7589 } 7590 7591 return resultVar0, resultVar1 7592 } 7593 7594 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamID string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 7595 origCtx := a.ctx 7596 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeamPage") 7597 7598 a.ctx = newCtx 7599 a.app.Srv().Store.SetContext(newCtx) 7600 defer func() { 7601 a.app.Srv().Store.SetContext(origCtx) 7602 a.ctx = origCtx 7603 }() 7604 7605 defer span.Finish() 7606 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeamPage(teamID, page, perPage, asAdmin, viewRestrictions) 7607 7608 if resultVar1 != nil { 7609 span.LogFields(spanlog.Error(resultVar1)) 7610 ext.Error.Set(span, true) 7611 } 7612 7613 return resultVar0, resultVar1 7614 } 7615 7616 func (a *OpenTracingAppLayer) GetRole(id string) (*model.Role, *model.AppError) { 7617 origCtx := a.ctx 7618 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRole") 7619 7620 a.ctx = newCtx 7621 a.app.Srv().Store.SetContext(newCtx) 7622 defer func() { 7623 a.app.Srv().Store.SetContext(origCtx) 7624 a.ctx = origCtx 7625 }() 7626 7627 defer span.Finish() 7628 resultVar0, resultVar1 := a.app.GetRole(id) 7629 7630 if resultVar1 != nil { 7631 span.LogFields(spanlog.Error(resultVar1)) 7632 ext.Error.Set(span, true) 7633 } 7634 7635 return resultVar0, resultVar1 7636 } 7637 7638 func (a *OpenTracingAppLayer) GetRoleByName(name string) (*model.Role, *model.AppError) { 7639 origCtx := a.ctx 7640 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRoleByName") 7641 7642 a.ctx = newCtx 7643 a.app.Srv().Store.SetContext(newCtx) 7644 defer func() { 7645 a.app.Srv().Store.SetContext(origCtx) 7646 a.ctx = origCtx 7647 }() 7648 7649 defer span.Finish() 7650 resultVar0, resultVar1 := a.app.GetRoleByName(name) 7651 7652 if resultVar1 != nil { 7653 span.LogFields(spanlog.Error(resultVar1)) 7654 ext.Error.Set(span, true) 7655 } 7656 7657 return resultVar0, resultVar1 7658 } 7659 7660 func (a *OpenTracingAppLayer) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) { 7661 origCtx := a.ctx 7662 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRolesByNames") 7663 7664 a.ctx = newCtx 7665 a.app.Srv().Store.SetContext(newCtx) 7666 defer func() { 7667 a.app.Srv().Store.SetContext(origCtx) 7668 a.ctx = origCtx 7669 }() 7670 7671 defer span.Finish() 7672 resultVar0, resultVar1 := a.app.GetRolesByNames(names) 7673 7674 if resultVar1 != nil { 7675 span.LogFields(spanlog.Error(resultVar1)) 7676 ext.Error.Set(span, true) 7677 } 7678 7679 return resultVar0, resultVar1 7680 } 7681 7682 func (a *OpenTracingAppLayer) GetSamlCertificateStatus() *model.SamlCertificateStatus { 7683 origCtx := a.ctx 7684 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlCertificateStatus") 7685 7686 a.ctx = newCtx 7687 a.app.Srv().Store.SetContext(newCtx) 7688 defer func() { 7689 a.app.Srv().Store.SetContext(origCtx) 7690 a.ctx = origCtx 7691 }() 7692 7693 defer span.Finish() 7694 resultVar0 := a.app.GetSamlCertificateStatus() 7695 7696 return resultVar0 7697 } 7698 7699 func (a *OpenTracingAppLayer) GetSamlMetadata() (string, *model.AppError) { 7700 origCtx := a.ctx 7701 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadata") 7702 7703 a.ctx = newCtx 7704 a.app.Srv().Store.SetContext(newCtx) 7705 defer func() { 7706 a.app.Srv().Store.SetContext(origCtx) 7707 a.ctx = origCtx 7708 }() 7709 7710 defer span.Finish() 7711 resultVar0, resultVar1 := a.app.GetSamlMetadata() 7712 7713 if resultVar1 != nil { 7714 span.LogFields(spanlog.Error(resultVar1)) 7715 ext.Error.Set(span, true) 7716 } 7717 7718 return resultVar0, resultVar1 7719 } 7720 7721 func (a *OpenTracingAppLayer) GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError) { 7722 origCtx := a.ctx 7723 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadataFromIdp") 7724 7725 a.ctx = newCtx 7726 a.app.Srv().Store.SetContext(newCtx) 7727 defer func() { 7728 a.app.Srv().Store.SetContext(origCtx) 7729 a.ctx = origCtx 7730 }() 7731 7732 defer span.Finish() 7733 resultVar0, resultVar1 := a.app.GetSamlMetadataFromIdp(idpMetadataUrl) 7734 7735 if resultVar1 != nil { 7736 span.LogFields(spanlog.Error(resultVar1)) 7737 ext.Error.Set(span, true) 7738 } 7739 7740 return resultVar0, resultVar1 7741 } 7742 7743 func (a *OpenTracingAppLayer) GetSanitizeOptions(asAdmin bool) map[string]bool { 7744 origCtx := a.ctx 7745 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizeOptions") 7746 7747 a.ctx = newCtx 7748 a.app.Srv().Store.SetContext(newCtx) 7749 defer func() { 7750 a.app.Srv().Store.SetContext(origCtx) 7751 a.ctx = origCtx 7752 }() 7753 7754 defer span.Finish() 7755 resultVar0 := a.app.GetSanitizeOptions(asAdmin) 7756 7757 return resultVar0 7758 } 7759 7760 func (a *OpenTracingAppLayer) GetSanitizedConfig() *model.Config { 7761 origCtx := a.ctx 7762 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizedConfig") 7763 7764 a.ctx = newCtx 7765 a.app.Srv().Store.SetContext(newCtx) 7766 defer func() { 7767 a.app.Srv().Store.SetContext(origCtx) 7768 a.ctx = origCtx 7769 }() 7770 7771 defer span.Finish() 7772 resultVar0 := a.app.GetSanitizedConfig() 7773 7774 return resultVar0 7775 } 7776 7777 func (a *OpenTracingAppLayer) GetScheme(id string) (*model.Scheme, *model.AppError) { 7778 origCtx := a.ctx 7779 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetScheme") 7780 7781 a.ctx = newCtx 7782 a.app.Srv().Store.SetContext(newCtx) 7783 defer func() { 7784 a.app.Srv().Store.SetContext(origCtx) 7785 a.ctx = origCtx 7786 }() 7787 7788 defer span.Finish() 7789 resultVar0, resultVar1 := a.app.GetScheme(id) 7790 7791 if resultVar1 != nil { 7792 span.LogFields(spanlog.Error(resultVar1)) 7793 ext.Error.Set(span, true) 7794 } 7795 7796 return resultVar0, resultVar1 7797 } 7798 7799 func (a *OpenTracingAppLayer) GetSchemeByName(name string) (*model.Scheme, *model.AppError) { 7800 origCtx := a.ctx 7801 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeByName") 7802 7803 a.ctx = newCtx 7804 a.app.Srv().Store.SetContext(newCtx) 7805 defer func() { 7806 a.app.Srv().Store.SetContext(origCtx) 7807 a.ctx = origCtx 7808 }() 7809 7810 defer span.Finish() 7811 resultVar0, resultVar1 := a.app.GetSchemeByName(name) 7812 7813 if resultVar1 != nil { 7814 span.LogFields(spanlog.Error(resultVar1)) 7815 ext.Error.Set(span, true) 7816 } 7817 7818 return resultVar0, resultVar1 7819 } 7820 7821 func (a *OpenTracingAppLayer) GetSchemeRolesForChannel(channelId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 7822 origCtx := a.ctx 7823 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForChannel") 7824 7825 a.ctx = newCtx 7826 a.app.Srv().Store.SetContext(newCtx) 7827 defer func() { 7828 a.app.Srv().Store.SetContext(origCtx) 7829 a.ctx = origCtx 7830 }() 7831 7832 defer span.Finish() 7833 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForChannel(channelId) 7834 7835 if resultVar3 != nil { 7836 span.LogFields(spanlog.Error(resultVar3)) 7837 ext.Error.Set(span, true) 7838 } 7839 7840 return resultVar0, resultVar1, resultVar2, resultVar3 7841 } 7842 7843 func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamID string) (string, string, string, *model.AppError) { 7844 origCtx := a.ctx 7845 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForTeam") 7846 7847 a.ctx = newCtx 7848 a.app.Srv().Store.SetContext(newCtx) 7849 defer func() { 7850 a.app.Srv().Store.SetContext(origCtx) 7851 a.ctx = origCtx 7852 }() 7853 7854 defer span.Finish() 7855 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForTeam(teamID) 7856 7857 if resultVar3 != nil { 7858 span.LogFields(spanlog.Error(resultVar3)) 7859 ext.Error.Set(span, true) 7860 } 7861 7862 return resultVar0, resultVar1, resultVar2, resultVar3 7863 } 7864 7865 func (a *OpenTracingAppLayer) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) { 7866 origCtx := a.ctx 7867 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemes") 7868 7869 a.ctx = newCtx 7870 a.app.Srv().Store.SetContext(newCtx) 7871 defer func() { 7872 a.app.Srv().Store.SetContext(origCtx) 7873 a.ctx = origCtx 7874 }() 7875 7876 defer span.Finish() 7877 resultVar0, resultVar1 := a.app.GetSchemes(scope, offset, limit) 7878 7879 if resultVar1 != nil { 7880 span.LogFields(spanlog.Error(resultVar1)) 7881 ext.Error.Set(span, true) 7882 } 7883 7884 return resultVar0, resultVar1 7885 } 7886 7887 func (a *OpenTracingAppLayer) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) { 7888 origCtx := a.ctx 7889 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemesPage") 7890 7891 a.ctx = newCtx 7892 a.app.Srv().Store.SetContext(newCtx) 7893 defer func() { 7894 a.app.Srv().Store.SetContext(origCtx) 7895 a.ctx = origCtx 7896 }() 7897 7898 defer span.Finish() 7899 resultVar0, resultVar1 := a.app.GetSchemesPage(scope, page, perPage) 7900 7901 if resultVar1 != nil { 7902 span.LogFields(spanlog.Error(resultVar1)) 7903 ext.Error.Set(span, true) 7904 } 7905 7906 return resultVar0, resultVar1 7907 } 7908 7909 func (a *OpenTracingAppLayer) GetSession(token string) (*model.Session, *model.AppError) { 7910 origCtx := a.ctx 7911 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSession") 7912 7913 a.ctx = newCtx 7914 a.app.Srv().Store.SetContext(newCtx) 7915 defer func() { 7916 a.app.Srv().Store.SetContext(origCtx) 7917 a.ctx = origCtx 7918 }() 7919 7920 defer span.Finish() 7921 resultVar0, resultVar1 := a.app.GetSession(token) 7922 7923 if resultVar1 != nil { 7924 span.LogFields(spanlog.Error(resultVar1)) 7925 ext.Error.Set(span, true) 7926 } 7927 7928 return resultVar0, resultVar1 7929 } 7930 7931 func (a *OpenTracingAppLayer) GetSessionById(sessionId string) (*model.Session, *model.AppError) { 7932 origCtx := a.ctx 7933 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionById") 7934 7935 a.ctx = newCtx 7936 a.app.Srv().Store.SetContext(newCtx) 7937 defer func() { 7938 a.app.Srv().Store.SetContext(origCtx) 7939 a.ctx = origCtx 7940 }() 7941 7942 defer span.Finish() 7943 resultVar0, resultVar1 := a.app.GetSessionById(sessionId) 7944 7945 if resultVar1 != nil { 7946 span.LogFields(spanlog.Error(resultVar1)) 7947 ext.Error.Set(span, true) 7948 } 7949 7950 return resultVar0, resultVar1 7951 } 7952 7953 func (a *OpenTracingAppLayer) GetSessionLengthInMillis(session *model.Session) int64 { 7954 origCtx := a.ctx 7955 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionLengthInMillis") 7956 7957 a.ctx = newCtx 7958 a.app.Srv().Store.SetContext(newCtx) 7959 defer func() { 7960 a.app.Srv().Store.SetContext(origCtx) 7961 a.ctx = origCtx 7962 }() 7963 7964 defer span.Finish() 7965 resultVar0 := a.app.GetSessionLengthInMillis(session) 7966 7967 return resultVar0 7968 } 7969 7970 func (a *OpenTracingAppLayer) GetSessions(userID string) ([]*model.Session, *model.AppError) { 7971 origCtx := a.ctx 7972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions") 7973 7974 a.ctx = newCtx 7975 a.app.Srv().Store.SetContext(newCtx) 7976 defer func() { 7977 a.app.Srv().Store.SetContext(origCtx) 7978 a.ctx = origCtx 7979 }() 7980 7981 defer span.Finish() 7982 resultVar0, resultVar1 := a.app.GetSessions(userID) 7983 7984 if resultVar1 != nil { 7985 span.LogFields(spanlog.Error(resultVar1)) 7986 ext.Error.Set(span, true) 7987 } 7988 7989 return resultVar0, resultVar1 7990 } 7991 7992 func (a *OpenTracingAppLayer) GetSidebarCategories(userID string, teamID string) (*model.OrderedSidebarCategories, *model.AppError) { 7993 origCtx := a.ctx 7994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategories") 7995 7996 a.ctx = newCtx 7997 a.app.Srv().Store.SetContext(newCtx) 7998 defer func() { 7999 a.app.Srv().Store.SetContext(origCtx) 8000 a.ctx = origCtx 8001 }() 8002 8003 defer span.Finish() 8004 resultVar0, resultVar1 := a.app.GetSidebarCategories(userID, teamID) 8005 8006 if resultVar1 != nil { 8007 span.LogFields(spanlog.Error(resultVar1)) 8008 ext.Error.Set(span, true) 8009 } 8010 8011 return resultVar0, resultVar1 8012 } 8013 8014 func (a *OpenTracingAppLayer) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError) { 8015 origCtx := a.ctx 8016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategory") 8017 8018 a.ctx = newCtx 8019 a.app.Srv().Store.SetContext(newCtx) 8020 defer func() { 8021 a.app.Srv().Store.SetContext(origCtx) 8022 a.ctx = origCtx 8023 }() 8024 8025 defer span.Finish() 8026 resultVar0, resultVar1 := a.app.GetSidebarCategory(categoryId) 8027 8028 if resultVar1 != nil { 8029 span.LogFields(spanlog.Error(resultVar1)) 8030 ext.Error.Set(span, true) 8031 } 8032 8033 return resultVar0, resultVar1 8034 } 8035 8036 func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userID string, teamID string) ([]string, *model.AppError) { 8037 origCtx := a.ctx 8038 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategoryOrder") 8039 8040 a.ctx = newCtx 8041 a.app.Srv().Store.SetContext(newCtx) 8042 defer func() { 8043 a.app.Srv().Store.SetContext(origCtx) 8044 a.ctx = origCtx 8045 }() 8046 8047 defer span.Finish() 8048 resultVar0, resultVar1 := a.app.GetSidebarCategoryOrder(userID, teamID) 8049 8050 if resultVar1 != nil { 8051 span.LogFields(spanlog.Error(resultVar1)) 8052 ext.Error.Set(span, true) 8053 } 8054 8055 return resultVar0, resultVar1 8056 } 8057 8058 func (a *OpenTracingAppLayer) GetSinglePost(postId string) (*model.Post, *model.AppError) { 8059 origCtx := a.ctx 8060 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSinglePost") 8061 8062 a.ctx = newCtx 8063 a.app.Srv().Store.SetContext(newCtx) 8064 defer func() { 8065 a.app.Srv().Store.SetContext(origCtx) 8066 a.ctx = origCtx 8067 }() 8068 8069 defer span.Finish() 8070 resultVar0, resultVar1 := a.app.GetSinglePost(postId) 8071 8072 if resultVar1 != nil { 8073 span.LogFields(spanlog.Error(resultVar1)) 8074 ext.Error.Set(span, true) 8075 } 8076 8077 return resultVar0, resultVar1 8078 } 8079 8080 func (a *OpenTracingAppLayer) GetSiteURL() string { 8081 origCtx := a.ctx 8082 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSiteURL") 8083 8084 a.ctx = newCtx 8085 a.app.Srv().Store.SetContext(newCtx) 8086 defer func() { 8087 a.app.Srv().Store.SetContext(origCtx) 8088 a.ctx = origCtx 8089 }() 8090 8091 defer span.Finish() 8092 resultVar0 := a.app.GetSiteURL() 8093 8094 return resultVar0 8095 } 8096 8097 func (a *OpenTracingAppLayer) GetStatus(userID string) (*model.Status, *model.AppError) { 8098 origCtx := a.ctx 8099 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatus") 8100 8101 a.ctx = newCtx 8102 a.app.Srv().Store.SetContext(newCtx) 8103 defer func() { 8104 a.app.Srv().Store.SetContext(origCtx) 8105 a.ctx = origCtx 8106 }() 8107 8108 defer span.Finish() 8109 resultVar0, resultVar1 := a.app.GetStatus(userID) 8110 8111 if resultVar1 != nil { 8112 span.LogFields(spanlog.Error(resultVar1)) 8113 ext.Error.Set(span, true) 8114 } 8115 8116 return resultVar0, resultVar1 8117 } 8118 8119 func (a *OpenTracingAppLayer) GetStatusFromCache(userID string) *model.Status { 8120 origCtx := a.ctx 8121 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusFromCache") 8122 8123 a.ctx = newCtx 8124 a.app.Srv().Store.SetContext(newCtx) 8125 defer func() { 8126 a.app.Srv().Store.SetContext(origCtx) 8127 a.ctx = origCtx 8128 }() 8129 8130 defer span.Finish() 8131 resultVar0 := a.app.GetStatusFromCache(userID) 8132 8133 return resultVar0 8134 } 8135 8136 func (a *OpenTracingAppLayer) GetStatusesByIds(userIDs []string) (map[string]interface{}, *model.AppError) { 8137 origCtx := a.ctx 8138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusesByIds") 8139 8140 a.ctx = newCtx 8141 a.app.Srv().Store.SetContext(newCtx) 8142 defer func() { 8143 a.app.Srv().Store.SetContext(origCtx) 8144 a.ctx = origCtx 8145 }() 8146 8147 defer span.Finish() 8148 resultVar0, resultVar1 := a.app.GetStatusesByIds(userIDs) 8149 8150 if resultVar1 != nil { 8151 span.LogFields(spanlog.Error(resultVar1)) 8152 ext.Error.Set(span, true) 8153 } 8154 8155 return resultVar0, resultVar1 8156 } 8157 8158 func (a *OpenTracingAppLayer) GetSuggestions(commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion { 8159 origCtx := a.ctx 8160 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSuggestions") 8161 8162 a.ctx = newCtx 8163 a.app.Srv().Store.SetContext(newCtx) 8164 defer func() { 8165 a.app.Srv().Store.SetContext(origCtx) 8166 a.ctx = origCtx 8167 }() 8168 8169 defer span.Finish() 8170 resultVar0 := a.app.GetSuggestions(commandArgs, commands, roleID) 8171 8172 return resultVar0 8173 } 8174 8175 func (a *OpenTracingAppLayer) GetTeam(teamID string) (*model.Team, *model.AppError) { 8176 origCtx := a.ctx 8177 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeam") 8178 8179 a.ctx = newCtx 8180 a.app.Srv().Store.SetContext(newCtx) 8181 defer func() { 8182 a.app.Srv().Store.SetContext(origCtx) 8183 a.ctx = origCtx 8184 }() 8185 8186 defer span.Finish() 8187 resultVar0, resultVar1 := a.app.GetTeam(teamID) 8188 8189 if resultVar1 != nil { 8190 span.LogFields(spanlog.Error(resultVar1)) 8191 ext.Error.Set(span, true) 8192 } 8193 8194 return resultVar0, resultVar1 8195 } 8196 8197 func (a *OpenTracingAppLayer) GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError) { 8198 origCtx := a.ctx 8199 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByInviteId") 8200 8201 a.ctx = newCtx 8202 a.app.Srv().Store.SetContext(newCtx) 8203 defer func() { 8204 a.app.Srv().Store.SetContext(origCtx) 8205 a.ctx = origCtx 8206 }() 8207 8208 defer span.Finish() 8209 resultVar0, resultVar1 := a.app.GetTeamByInviteId(inviteId) 8210 8211 if resultVar1 != nil { 8212 span.LogFields(spanlog.Error(resultVar1)) 8213 ext.Error.Set(span, true) 8214 } 8215 8216 return resultVar0, resultVar1 8217 } 8218 8219 func (a *OpenTracingAppLayer) GetTeamByName(name string) (*model.Team, *model.AppError) { 8220 origCtx := a.ctx 8221 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByName") 8222 8223 a.ctx = newCtx 8224 a.app.Srv().Store.SetContext(newCtx) 8225 defer func() { 8226 a.app.Srv().Store.SetContext(origCtx) 8227 a.ctx = origCtx 8228 }() 8229 8230 defer span.Finish() 8231 resultVar0, resultVar1 := a.app.GetTeamByName(name) 8232 8233 if resultVar1 != nil { 8234 span.LogFields(spanlog.Error(resultVar1)) 8235 ext.Error.Set(span, true) 8236 } 8237 8238 return resultVar0, resultVar1 8239 } 8240 8241 func (a *OpenTracingAppLayer) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) { 8242 origCtx := a.ctx 8243 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamGroupUsers") 8244 8245 a.ctx = newCtx 8246 a.app.Srv().Store.SetContext(newCtx) 8247 defer func() { 8248 a.app.Srv().Store.SetContext(origCtx) 8249 a.ctx = origCtx 8250 }() 8251 8252 defer span.Finish() 8253 resultVar0, resultVar1 := a.app.GetTeamGroupUsers(teamID) 8254 8255 if resultVar1 != nil { 8256 span.LogFields(spanlog.Error(resultVar1)) 8257 ext.Error.Set(span, true) 8258 } 8259 8260 return resultVar0, resultVar1 8261 } 8262 8263 func (a *OpenTracingAppLayer) GetTeamIcon(team *model.Team) ([]byte, *model.AppError) { 8264 origCtx := a.ctx 8265 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIcon") 8266 8267 a.ctx = newCtx 8268 a.app.Srv().Store.SetContext(newCtx) 8269 defer func() { 8270 a.app.Srv().Store.SetContext(origCtx) 8271 a.ctx = origCtx 8272 }() 8273 8274 defer span.Finish() 8275 resultVar0, resultVar1 := a.app.GetTeamIcon(team) 8276 8277 if resultVar1 != nil { 8278 span.LogFields(spanlog.Error(resultVar1)) 8279 ext.Error.Set(span, true) 8280 } 8281 8282 return resultVar0, resultVar1 8283 } 8284 8285 func (a *OpenTracingAppLayer) GetTeamIdFromQuery(query url.Values) (string, *model.AppError) { 8286 origCtx := a.ctx 8287 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIdFromQuery") 8288 8289 a.ctx = newCtx 8290 a.app.Srv().Store.SetContext(newCtx) 8291 defer func() { 8292 a.app.Srv().Store.SetContext(origCtx) 8293 a.ctx = origCtx 8294 }() 8295 8296 defer span.Finish() 8297 resultVar0, resultVar1 := a.app.GetTeamIdFromQuery(query) 8298 8299 if resultVar1 != nil { 8300 span.LogFields(spanlog.Error(resultVar1)) 8301 ext.Error.Set(span, true) 8302 } 8303 8304 return resultVar0, resultVar1 8305 } 8306 8307 func (a *OpenTracingAppLayer) GetTeamMember(teamID string, userID string) (*model.TeamMember, *model.AppError) { 8308 origCtx := a.ctx 8309 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMember") 8310 8311 a.ctx = newCtx 8312 a.app.Srv().Store.SetContext(newCtx) 8313 defer func() { 8314 a.app.Srv().Store.SetContext(origCtx) 8315 a.ctx = origCtx 8316 }() 8317 8318 defer span.Finish() 8319 resultVar0, resultVar1 := a.app.GetTeamMember(teamID, userID) 8320 8321 if resultVar1 != nil { 8322 span.LogFields(spanlog.Error(resultVar1)) 8323 ext.Error.Set(span, true) 8324 } 8325 8326 return resultVar0, resultVar1 8327 } 8328 8329 func (a *OpenTracingAppLayer) GetTeamMembers(teamID string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { 8330 origCtx := a.ctx 8331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembers") 8332 8333 a.ctx = newCtx 8334 a.app.Srv().Store.SetContext(newCtx) 8335 defer func() { 8336 a.app.Srv().Store.SetContext(origCtx) 8337 a.ctx = origCtx 8338 }() 8339 8340 defer span.Finish() 8341 resultVar0, resultVar1 := a.app.GetTeamMembers(teamID, offset, limit, teamMembersGetOptions) 8342 8343 if resultVar1 != nil { 8344 span.LogFields(spanlog.Error(resultVar1)) 8345 ext.Error.Set(span, true) 8346 } 8347 8348 return resultVar0, resultVar1 8349 } 8350 8351 func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamID string, userIDs []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { 8352 origCtx := a.ctx 8353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersByIds") 8354 8355 a.ctx = newCtx 8356 a.app.Srv().Store.SetContext(newCtx) 8357 defer func() { 8358 a.app.Srv().Store.SetContext(origCtx) 8359 a.ctx = origCtx 8360 }() 8361 8362 defer span.Finish() 8363 resultVar0, resultVar1 := a.app.GetTeamMembersByIds(teamID, userIDs, restrictions) 8364 8365 if resultVar1 != nil { 8366 span.LogFields(spanlog.Error(resultVar1)) 8367 ext.Error.Set(span, true) 8368 } 8369 8370 return resultVar0, resultVar1 8371 } 8372 8373 func (a *OpenTracingAppLayer) GetTeamMembersForUser(userID string) ([]*model.TeamMember, *model.AppError) { 8374 origCtx := a.ctx 8375 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUser") 8376 8377 a.ctx = newCtx 8378 a.app.Srv().Store.SetContext(newCtx) 8379 defer func() { 8380 a.app.Srv().Store.SetContext(origCtx) 8381 a.ctx = origCtx 8382 }() 8383 8384 defer span.Finish() 8385 resultVar0, resultVar1 := a.app.GetTeamMembersForUser(userID) 8386 8387 if resultVar1 != nil { 8388 span.LogFields(spanlog.Error(resultVar1)) 8389 ext.Error.Set(span, true) 8390 } 8391 8392 return resultVar0, resultVar1 8393 } 8394 8395 func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userID string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { 8396 origCtx := a.ctx 8397 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUserWithPagination") 8398 8399 a.ctx = newCtx 8400 a.app.Srv().Store.SetContext(newCtx) 8401 defer func() { 8402 a.app.Srv().Store.SetContext(origCtx) 8403 a.ctx = origCtx 8404 }() 8405 8406 defer span.Finish() 8407 resultVar0, resultVar1 := a.app.GetTeamMembersForUserWithPagination(userID, page, perPage) 8408 8409 if resultVar1 != nil { 8410 span.LogFields(spanlog.Error(resultVar1)) 8411 ext.Error.Set(span, true) 8412 } 8413 8414 return resultVar0, resultVar1 8415 } 8416 8417 func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamID string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 8418 origCtx := a.ctx 8419 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamSchemeChannelRoles") 8420 8421 a.ctx = newCtx 8422 a.app.Srv().Store.SetContext(newCtx) 8423 defer func() { 8424 a.app.Srv().Store.SetContext(origCtx) 8425 a.ctx = origCtx 8426 }() 8427 8428 defer span.Finish() 8429 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetTeamSchemeChannelRoles(teamID) 8430 8431 if resultVar3 != nil { 8432 span.LogFields(spanlog.Error(resultVar3)) 8433 ext.Error.Set(span, true) 8434 } 8435 8436 return resultVar0, resultVar1, resultVar2, resultVar3 8437 } 8438 8439 func (a *OpenTracingAppLayer) GetTeamStats(teamID string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { 8440 origCtx := a.ctx 8441 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamStats") 8442 8443 a.ctx = newCtx 8444 a.app.Srv().Store.SetContext(newCtx) 8445 defer func() { 8446 a.app.Srv().Store.SetContext(origCtx) 8447 a.ctx = origCtx 8448 }() 8449 8450 defer span.Finish() 8451 resultVar0, resultVar1 := a.app.GetTeamStats(teamID, restrictions) 8452 8453 if resultVar1 != nil { 8454 span.LogFields(spanlog.Error(resultVar1)) 8455 ext.Error.Set(span, true) 8456 } 8457 8458 return resultVar0, resultVar1 8459 } 8460 8461 func (a *OpenTracingAppLayer) GetTeamUnread(teamID string, userID string) (*model.TeamUnread, *model.AppError) { 8462 origCtx := a.ctx 8463 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamUnread") 8464 8465 a.ctx = newCtx 8466 a.app.Srv().Store.SetContext(newCtx) 8467 defer func() { 8468 a.app.Srv().Store.SetContext(origCtx) 8469 a.ctx = origCtx 8470 }() 8471 8472 defer span.Finish() 8473 resultVar0, resultVar1 := a.app.GetTeamUnread(teamID, userID) 8474 8475 if resultVar1 != nil { 8476 span.LogFields(spanlog.Error(resultVar1)) 8477 ext.Error.Set(span, true) 8478 } 8479 8480 return resultVar0, resultVar1 8481 } 8482 8483 func (a *OpenTracingAppLayer) GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError) { 8484 origCtx := a.ctx 8485 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForScheme") 8486 8487 a.ctx = newCtx 8488 a.app.Srv().Store.SetContext(newCtx) 8489 defer func() { 8490 a.app.Srv().Store.SetContext(origCtx) 8491 a.ctx = origCtx 8492 }() 8493 8494 defer span.Finish() 8495 resultVar0, resultVar1 := a.app.GetTeamsForScheme(scheme, offset, limit) 8496 8497 if resultVar1 != nil { 8498 span.LogFields(spanlog.Error(resultVar1)) 8499 ext.Error.Set(span, true) 8500 } 8501 8502 return resultVar0, resultVar1 8503 } 8504 8505 func (a *OpenTracingAppLayer) GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError) { 8506 origCtx := a.ctx 8507 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForSchemePage") 8508 8509 a.ctx = newCtx 8510 a.app.Srv().Store.SetContext(newCtx) 8511 defer func() { 8512 a.app.Srv().Store.SetContext(origCtx) 8513 a.ctx = origCtx 8514 }() 8515 8516 defer span.Finish() 8517 resultVar0, resultVar1 := a.app.GetTeamsForSchemePage(scheme, page, perPage) 8518 8519 if resultVar1 != nil { 8520 span.LogFields(spanlog.Error(resultVar1)) 8521 ext.Error.Set(span, true) 8522 } 8523 8524 return resultVar0, resultVar1 8525 } 8526 8527 func (a *OpenTracingAppLayer) GetTeamsForUser(userID string) ([]*model.Team, *model.AppError) { 8528 origCtx := a.ctx 8529 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForUser") 8530 8531 a.ctx = newCtx 8532 a.app.Srv().Store.SetContext(newCtx) 8533 defer func() { 8534 a.app.Srv().Store.SetContext(origCtx) 8535 a.ctx = origCtx 8536 }() 8537 8538 defer span.Finish() 8539 resultVar0, resultVar1 := a.app.GetTeamsForUser(userID) 8540 8541 if resultVar1 != nil { 8542 span.LogFields(spanlog.Error(resultVar1)) 8543 ext.Error.Set(span, true) 8544 } 8545 8546 return resultVar0, resultVar1 8547 } 8548 8549 func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userID string) ([]*model.TeamUnread, *model.AppError) { 8550 origCtx := a.ctx 8551 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsUnreadForUser") 8552 8553 a.ctx = newCtx 8554 a.app.Srv().Store.SetContext(newCtx) 8555 defer func() { 8556 a.app.Srv().Store.SetContext(origCtx) 8557 a.ctx = origCtx 8558 }() 8559 8560 defer span.Finish() 8561 resultVar0, resultVar1 := a.app.GetTeamsUnreadForUser(excludeTeamId, userID) 8562 8563 if resultVar1 != nil { 8564 span.LogFields(spanlog.Error(resultVar1)) 8565 ext.Error.Set(span, true) 8566 } 8567 8568 return resultVar0, resultVar1 8569 } 8570 8571 func (a *OpenTracingAppLayer) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) { 8572 origCtx := a.ctx 8573 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTermsOfService") 8574 8575 a.ctx = newCtx 8576 a.app.Srv().Store.SetContext(newCtx) 8577 defer func() { 8578 a.app.Srv().Store.SetContext(origCtx) 8579 a.ctx = origCtx 8580 }() 8581 8582 defer span.Finish() 8583 resultVar0, resultVar1 := a.app.GetTermsOfService(id) 8584 8585 if resultVar1 != nil { 8586 span.LogFields(spanlog.Error(resultVar1)) 8587 ext.Error.Set(span, true) 8588 } 8589 8590 return resultVar0, resultVar1 8591 } 8592 8593 func (a *OpenTracingAppLayer) GetThreadForUser(userID string, teamID string, threadId string, extended bool) (*model.ThreadResponse, *model.AppError) { 8594 origCtx := a.ctx 8595 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadForUser") 8596 8597 a.ctx = newCtx 8598 a.app.Srv().Store.SetContext(newCtx) 8599 defer func() { 8600 a.app.Srv().Store.SetContext(origCtx) 8601 a.ctx = origCtx 8602 }() 8603 8604 defer span.Finish() 8605 resultVar0, resultVar1 := a.app.GetThreadForUser(userID, teamID, threadId, extended) 8606 8607 if resultVar1 != nil { 8608 span.LogFields(spanlog.Error(resultVar1)) 8609 ext.Error.Set(span, true) 8610 } 8611 8612 return resultVar0, resultVar1 8613 } 8614 8615 func (a *OpenTracingAppLayer) GetThreadMembershipsForUser(userID string, teamID string) ([]*model.ThreadMembership, error) { 8616 origCtx := a.ctx 8617 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadMembershipsForUser") 8618 8619 a.ctx = newCtx 8620 a.app.Srv().Store.SetContext(newCtx) 8621 defer func() { 8622 a.app.Srv().Store.SetContext(origCtx) 8623 a.ctx = origCtx 8624 }() 8625 8626 defer span.Finish() 8627 resultVar0, resultVar1 := a.app.GetThreadMembershipsForUser(userID, teamID) 8628 8629 if resultVar1 != nil { 8630 span.LogFields(spanlog.Error(resultVar1)) 8631 ext.Error.Set(span, true) 8632 } 8633 8634 return resultVar0, resultVar1 8635 } 8636 8637 func (a *OpenTracingAppLayer) GetThreadMentionsForUserPerChannel(userId string, teamId string) (map[string]int64, *model.AppError) { 8638 origCtx := a.ctx 8639 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadMentionsForUserPerChannel") 8640 8641 a.ctx = newCtx 8642 a.app.Srv().Store.SetContext(newCtx) 8643 defer func() { 8644 a.app.Srv().Store.SetContext(origCtx) 8645 a.ctx = origCtx 8646 }() 8647 8648 defer span.Finish() 8649 resultVar0, resultVar1 := a.app.GetThreadMentionsForUserPerChannel(userId, teamId) 8650 8651 if resultVar1 != nil { 8652 span.LogFields(spanlog.Error(resultVar1)) 8653 ext.Error.Set(span, true) 8654 } 8655 8656 return resultVar0, resultVar1 8657 } 8658 8659 func (a *OpenTracingAppLayer) GetThreadsForUser(userID string, teamID string, options model.GetUserThreadsOpts) (*model.Threads, *model.AppError) { 8660 origCtx := a.ctx 8661 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetThreadsForUser") 8662 8663 a.ctx = newCtx 8664 a.app.Srv().Store.SetContext(newCtx) 8665 defer func() { 8666 a.app.Srv().Store.SetContext(origCtx) 8667 a.ctx = origCtx 8668 }() 8669 8670 defer span.Finish() 8671 resultVar0, resultVar1 := a.app.GetThreadsForUser(userID, teamID, options) 8672 8673 if resultVar1 != nil { 8674 span.LogFields(spanlog.Error(resultVar1)) 8675 ext.Error.Set(span, true) 8676 } 8677 8678 return resultVar0, resultVar1 8679 } 8680 8681 func (a *OpenTracingAppLayer) GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) { 8682 origCtx := a.ctx 8683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTotalUsersStats") 8684 8685 a.ctx = newCtx 8686 a.app.Srv().Store.SetContext(newCtx) 8687 defer func() { 8688 a.app.Srv().Store.SetContext(origCtx) 8689 a.ctx = origCtx 8690 }() 8691 8692 defer span.Finish() 8693 resultVar0, resultVar1 := a.app.GetTotalUsersStats(viewRestrictions) 8694 8695 if resultVar1 != nil { 8696 span.LogFields(spanlog.Error(resultVar1)) 8697 ext.Error.Set(span, true) 8698 } 8699 8700 return resultVar0, resultVar1 8701 } 8702 8703 func (a *OpenTracingAppLayer) GetUploadSession(uploadId string) (*model.UploadSession, *model.AppError) { 8704 origCtx := a.ctx 8705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUploadSession") 8706 8707 a.ctx = newCtx 8708 a.app.Srv().Store.SetContext(newCtx) 8709 defer func() { 8710 a.app.Srv().Store.SetContext(origCtx) 8711 a.ctx = origCtx 8712 }() 8713 8714 defer span.Finish() 8715 resultVar0, resultVar1 := a.app.GetUploadSession(uploadId) 8716 8717 if resultVar1 != nil { 8718 span.LogFields(spanlog.Error(resultVar1)) 8719 ext.Error.Set(span, true) 8720 } 8721 8722 return resultVar0, resultVar1 8723 } 8724 8725 func (a *OpenTracingAppLayer) GetUploadSessionsForUser(userID string) ([]*model.UploadSession, *model.AppError) { 8726 origCtx := a.ctx 8727 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUploadSessionsForUser") 8728 8729 a.ctx = newCtx 8730 a.app.Srv().Store.SetContext(newCtx) 8731 defer func() { 8732 a.app.Srv().Store.SetContext(origCtx) 8733 a.ctx = origCtx 8734 }() 8735 8736 defer span.Finish() 8737 resultVar0, resultVar1 := a.app.GetUploadSessionsForUser(userID) 8738 8739 if resultVar1 != nil { 8740 span.LogFields(spanlog.Error(resultVar1)) 8741 ext.Error.Set(span, true) 8742 } 8743 8744 return resultVar0, resultVar1 8745 } 8746 8747 func (a *OpenTracingAppLayer) GetUser(userID string) (*model.User, *model.AppError) { 8748 origCtx := a.ctx 8749 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUser") 8750 8751 a.ctx = newCtx 8752 a.app.Srv().Store.SetContext(newCtx) 8753 defer func() { 8754 a.app.Srv().Store.SetContext(origCtx) 8755 a.ctx = origCtx 8756 }() 8757 8758 defer span.Finish() 8759 resultVar0, resultVar1 := a.app.GetUser(userID) 8760 8761 if resultVar1 != nil { 8762 span.LogFields(spanlog.Error(resultVar1)) 8763 ext.Error.Set(span, true) 8764 } 8765 8766 return resultVar0, resultVar1 8767 } 8768 8769 func (a *OpenTracingAppLayer) GetUserAccessToken(tokenID string, sanitize bool) (*model.UserAccessToken, *model.AppError) { 8770 origCtx := a.ctx 8771 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessToken") 8772 8773 a.ctx = newCtx 8774 a.app.Srv().Store.SetContext(newCtx) 8775 defer func() { 8776 a.app.Srv().Store.SetContext(origCtx) 8777 a.ctx = origCtx 8778 }() 8779 8780 defer span.Finish() 8781 resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenID, sanitize) 8782 8783 if resultVar1 != nil { 8784 span.LogFields(spanlog.Error(resultVar1)) 8785 ext.Error.Set(span, true) 8786 } 8787 8788 return resultVar0, resultVar1 8789 } 8790 8791 func (a *OpenTracingAppLayer) GetUserAccessTokens(page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 8792 origCtx := a.ctx 8793 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokens") 8794 8795 a.ctx = newCtx 8796 a.app.Srv().Store.SetContext(newCtx) 8797 defer func() { 8798 a.app.Srv().Store.SetContext(origCtx) 8799 a.ctx = origCtx 8800 }() 8801 8802 defer span.Finish() 8803 resultVar0, resultVar1 := a.app.GetUserAccessTokens(page, perPage) 8804 8805 if resultVar1 != nil { 8806 span.LogFields(spanlog.Error(resultVar1)) 8807 ext.Error.Set(span, true) 8808 } 8809 8810 return resultVar0, resultVar1 8811 } 8812 8813 func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userID string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 8814 origCtx := a.ctx 8815 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokensForUser") 8816 8817 a.ctx = newCtx 8818 a.app.Srv().Store.SetContext(newCtx) 8819 defer func() { 8820 a.app.Srv().Store.SetContext(origCtx) 8821 a.ctx = origCtx 8822 }() 8823 8824 defer span.Finish() 8825 resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userID, page, perPage) 8826 8827 if resultVar1 != nil { 8828 span.LogFields(spanlog.Error(resultVar1)) 8829 ext.Error.Set(span, true) 8830 } 8831 8832 return resultVar0, resultVar1 8833 } 8834 8835 func (a *OpenTracingAppLayer) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) { 8836 origCtx := a.ctx 8837 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByAuth") 8838 8839 a.ctx = newCtx 8840 a.app.Srv().Store.SetContext(newCtx) 8841 defer func() { 8842 a.app.Srv().Store.SetContext(origCtx) 8843 a.ctx = origCtx 8844 }() 8845 8846 defer span.Finish() 8847 resultVar0, resultVar1 := a.app.GetUserByAuth(authData, authService) 8848 8849 if resultVar1 != nil { 8850 span.LogFields(spanlog.Error(resultVar1)) 8851 ext.Error.Set(span, true) 8852 } 8853 8854 return resultVar0, resultVar1 8855 } 8856 8857 func (a *OpenTracingAppLayer) GetUserByEmail(email string) (*model.User, *model.AppError) { 8858 origCtx := a.ctx 8859 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByEmail") 8860 8861 a.ctx = newCtx 8862 a.app.Srv().Store.SetContext(newCtx) 8863 defer func() { 8864 a.app.Srv().Store.SetContext(origCtx) 8865 a.ctx = origCtx 8866 }() 8867 8868 defer span.Finish() 8869 resultVar0, resultVar1 := a.app.GetUserByEmail(email) 8870 8871 if resultVar1 != nil { 8872 span.LogFields(spanlog.Error(resultVar1)) 8873 ext.Error.Set(span, true) 8874 } 8875 8876 return resultVar0, resultVar1 8877 } 8878 8879 func (a *OpenTracingAppLayer) GetUserByUsername(username string) (*model.User, *model.AppError) { 8880 origCtx := a.ctx 8881 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByUsername") 8882 8883 a.ctx = newCtx 8884 a.app.Srv().Store.SetContext(newCtx) 8885 defer func() { 8886 a.app.Srv().Store.SetContext(origCtx) 8887 a.ctx = origCtx 8888 }() 8889 8890 defer span.Finish() 8891 resultVar0, resultVar1 := a.app.GetUserByUsername(username) 8892 8893 if resultVar1 != nil { 8894 span.LogFields(spanlog.Error(resultVar1)) 8895 ext.Error.Set(span, true) 8896 } 8897 8898 return resultVar0, resultVar1 8899 } 8900 8901 func (a *OpenTracingAppLayer) GetUserForLogin(id string, loginId string) (*model.User, *model.AppError) { 8902 origCtx := a.ctx 8903 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserForLogin") 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.GetUserForLogin(id, loginId) 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) GetUserStatusesByIds(userIDs []string) ([]*model.Status, *model.AppError) { 8924 origCtx := a.ctx 8925 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserStatusesByIds") 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.GetUserStatusesByIds(userIDs) 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) GetUserTermsOfService(userID string) (*model.UserTermsOfService, *model.AppError) { 8946 origCtx := a.ctx 8947 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserTermsOfService") 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.GetUserTermsOfService(userID) 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) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 8968 origCtx := a.ctx 8969 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsers") 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.GetUsers(options) 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) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError) { 8990 origCtx := a.ctx 8991 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByGroupChannelIds") 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.GetUsersByGroupChannelIds(channelIds, asAdmin) 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) GetUsersByIds(userIDs []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { 9012 origCtx := a.ctx 9013 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByIds") 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.GetUsersByIds(userIDs, options) 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) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9034 origCtx := a.ctx 9035 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByUsernames") 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.GetUsersByUsernames(usernames, asAdmin, viewRestrictions) 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) GetUsersEtag(restrictionsHash string) string { 9056 origCtx := a.ctx 9057 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersEtag") 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 := a.app.GetUsersEtag(restrictionsHash) 9068 9069 return resultVar0 9070 } 9071 9072 func (a *OpenTracingAppLayer) GetUsersInChannel(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9073 origCtx := a.ctx 9074 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannel") 9075 9076 a.ctx = newCtx 9077 a.app.Srv().Store.SetContext(newCtx) 9078 defer func() { 9079 a.app.Srv().Store.SetContext(origCtx) 9080 a.ctx = origCtx 9081 }() 9082 9083 defer span.Finish() 9084 resultVar0, resultVar1 := a.app.GetUsersInChannel(options) 9085 9086 if resultVar1 != nil { 9087 span.LogFields(spanlog.Error(resultVar1)) 9088 ext.Error.Set(span, true) 9089 } 9090 9091 return resultVar0, resultVar1 9092 } 9093 9094 func (a *OpenTracingAppLayer) GetUsersInChannelByStatus(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9095 origCtx := a.ctx 9096 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelByStatus") 9097 9098 a.ctx = newCtx 9099 a.app.Srv().Store.SetContext(newCtx) 9100 defer func() { 9101 a.app.Srv().Store.SetContext(origCtx) 9102 a.ctx = origCtx 9103 }() 9104 9105 defer span.Finish() 9106 resultVar0, resultVar1 := a.app.GetUsersInChannelByStatus(options) 9107 9108 if resultVar1 != nil { 9109 span.LogFields(spanlog.Error(resultVar1)) 9110 ext.Error.Set(span, true) 9111 } 9112 9113 return resultVar0, resultVar1 9114 } 9115 9116 func (a *OpenTracingAppLayer) GetUsersInChannelMap(options *model.UserGetOptions, asAdmin bool) (map[string]*model.User, *model.AppError) { 9117 origCtx := a.ctx 9118 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelMap") 9119 9120 a.ctx = newCtx 9121 a.app.Srv().Store.SetContext(newCtx) 9122 defer func() { 9123 a.app.Srv().Store.SetContext(origCtx) 9124 a.ctx = origCtx 9125 }() 9126 9127 defer span.Finish() 9128 resultVar0, resultVar1 := a.app.GetUsersInChannelMap(options, asAdmin) 9129 9130 if resultVar1 != nil { 9131 span.LogFields(spanlog.Error(resultVar1)) 9132 ext.Error.Set(span, true) 9133 } 9134 9135 return resultVar0, resultVar1 9136 } 9137 9138 func (a *OpenTracingAppLayer) GetUsersInChannelPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9139 origCtx := a.ctx 9140 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPage") 9141 9142 a.ctx = newCtx 9143 a.app.Srv().Store.SetContext(newCtx) 9144 defer func() { 9145 a.app.Srv().Store.SetContext(origCtx) 9146 a.ctx = origCtx 9147 }() 9148 9149 defer span.Finish() 9150 resultVar0, resultVar1 := a.app.GetUsersInChannelPage(options, asAdmin) 9151 9152 if resultVar1 != nil { 9153 span.LogFields(spanlog.Error(resultVar1)) 9154 ext.Error.Set(span, true) 9155 } 9156 9157 return resultVar0, resultVar1 9158 } 9159 9160 func (a *OpenTracingAppLayer) GetUsersInChannelPageByStatus(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9161 origCtx := a.ctx 9162 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPageByStatus") 9163 9164 a.ctx = newCtx 9165 a.app.Srv().Store.SetContext(newCtx) 9166 defer func() { 9167 a.app.Srv().Store.SetContext(origCtx) 9168 a.ctx = origCtx 9169 }() 9170 9171 defer span.Finish() 9172 resultVar0, resultVar1 := a.app.GetUsersInChannelPageByStatus(options, asAdmin) 9173 9174 if resultVar1 != nil { 9175 span.LogFields(spanlog.Error(resultVar1)) 9176 ext.Error.Set(span, true) 9177 } 9178 9179 return resultVar0, resultVar1 9180 } 9181 9182 func (a *OpenTracingAppLayer) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9183 origCtx := a.ctx 9184 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeam") 9185 9186 a.ctx = newCtx 9187 a.app.Srv().Store.SetContext(newCtx) 9188 defer func() { 9189 a.app.Srv().Store.SetContext(origCtx) 9190 a.ctx = origCtx 9191 }() 9192 9193 defer span.Finish() 9194 resultVar0, resultVar1 := a.app.GetUsersInTeam(options) 9195 9196 if resultVar1 != nil { 9197 span.LogFields(spanlog.Error(resultVar1)) 9198 ext.Error.Set(span, true) 9199 } 9200 9201 return resultVar0, resultVar1 9202 } 9203 9204 func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamID string, restrictionsHash string) string { 9205 origCtx := a.ctx 9206 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamEtag") 9207 9208 a.ctx = newCtx 9209 a.app.Srv().Store.SetContext(newCtx) 9210 defer func() { 9211 a.app.Srv().Store.SetContext(origCtx) 9212 a.ctx = origCtx 9213 }() 9214 9215 defer span.Finish() 9216 resultVar0 := a.app.GetUsersInTeamEtag(teamID, restrictionsHash) 9217 9218 return resultVar0 9219 } 9220 9221 func (a *OpenTracingAppLayer) GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9222 origCtx := a.ctx 9223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamPage") 9224 9225 a.ctx = newCtx 9226 a.app.Srv().Store.SetContext(newCtx) 9227 defer func() { 9228 a.app.Srv().Store.SetContext(origCtx) 9229 a.ctx = origCtx 9230 }() 9231 9232 defer span.Finish() 9233 resultVar0, resultVar1 := a.app.GetUsersInTeamPage(options, asAdmin) 9234 9235 if resultVar1 != nil { 9236 span.LogFields(spanlog.Error(resultVar1)) 9237 ext.Error.Set(span, true) 9238 } 9239 9240 return resultVar0, resultVar1 9241 } 9242 9243 func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamID string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9244 origCtx := a.ctx 9245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannel") 9246 9247 a.ctx = newCtx 9248 a.app.Srv().Store.SetContext(newCtx) 9249 defer func() { 9250 a.app.Srv().Store.SetContext(origCtx) 9251 a.ctx = origCtx 9252 }() 9253 9254 defer span.Finish() 9255 resultVar0, resultVar1 := a.app.GetUsersNotInChannel(teamID, channelId, groupConstrained, offset, limit, viewRestrictions) 9256 9257 if resultVar1 != nil { 9258 span.LogFields(spanlog.Error(resultVar1)) 9259 ext.Error.Set(span, true) 9260 } 9261 9262 return resultVar0, resultVar1 9263 } 9264 9265 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) { 9266 origCtx := a.ctx 9267 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelMap") 9268 9269 a.ctx = newCtx 9270 a.app.Srv().Store.SetContext(newCtx) 9271 defer func() { 9272 a.app.Srv().Store.SetContext(origCtx) 9273 a.ctx = origCtx 9274 }() 9275 9276 defer span.Finish() 9277 resultVar0, resultVar1 := a.app.GetUsersNotInChannelMap(teamID, channelId, groupConstrained, offset, limit, asAdmin, viewRestrictions) 9278 9279 if resultVar1 != nil { 9280 span.LogFields(spanlog.Error(resultVar1)) 9281 ext.Error.Set(span, true) 9282 } 9283 9284 return resultVar0, resultVar1 9285 } 9286 9287 func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamID string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9288 origCtx := a.ctx 9289 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelPage") 9290 9291 a.ctx = newCtx 9292 a.app.Srv().Store.SetContext(newCtx) 9293 defer func() { 9294 a.app.Srv().Store.SetContext(origCtx) 9295 a.ctx = origCtx 9296 }() 9297 9298 defer span.Finish() 9299 resultVar0, resultVar1 := a.app.GetUsersNotInChannelPage(teamID, channelId, groupConstrained, page, perPage, asAdmin, viewRestrictions) 9300 9301 if resultVar1 != nil { 9302 span.LogFields(spanlog.Error(resultVar1)) 9303 ext.Error.Set(span, true) 9304 } 9305 9306 return resultVar0, resultVar1 9307 } 9308 9309 func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamID string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9310 origCtx := a.ctx 9311 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeam") 9312 9313 a.ctx = newCtx 9314 a.app.Srv().Store.SetContext(newCtx) 9315 defer func() { 9316 a.app.Srv().Store.SetContext(origCtx) 9317 a.ctx = origCtx 9318 }() 9319 9320 defer span.Finish() 9321 resultVar0, resultVar1 := a.app.GetUsersNotInTeam(teamID, groupConstrained, offset, limit, viewRestrictions) 9322 9323 if resultVar1 != nil { 9324 span.LogFields(spanlog.Error(resultVar1)) 9325 ext.Error.Set(span, true) 9326 } 9327 9328 return resultVar0, resultVar1 9329 } 9330 9331 func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamID string, restrictionsHash string) string { 9332 origCtx := a.ctx 9333 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamEtag") 9334 9335 a.ctx = newCtx 9336 a.app.Srv().Store.SetContext(newCtx) 9337 defer func() { 9338 a.app.Srv().Store.SetContext(origCtx) 9339 a.ctx = origCtx 9340 }() 9341 9342 defer span.Finish() 9343 resultVar0 := a.app.GetUsersNotInTeamEtag(teamID, restrictionsHash) 9344 9345 return resultVar0 9346 } 9347 9348 func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamID string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 9349 origCtx := a.ctx 9350 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamPage") 9351 9352 a.ctx = newCtx 9353 a.app.Srv().Store.SetContext(newCtx) 9354 defer func() { 9355 a.app.Srv().Store.SetContext(origCtx) 9356 a.ctx = origCtx 9357 }() 9358 9359 defer span.Finish() 9360 resultVar0, resultVar1 := a.app.GetUsersNotInTeamPage(teamID, groupConstrained, page, perPage, asAdmin, viewRestrictions) 9361 9362 if resultVar1 != nil { 9363 span.LogFields(spanlog.Error(resultVar1)) 9364 ext.Error.Set(span, true) 9365 } 9366 9367 return resultVar0, resultVar1 9368 } 9369 9370 func (a *OpenTracingAppLayer) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9371 origCtx := a.ctx 9372 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersPage") 9373 9374 a.ctx = newCtx 9375 a.app.Srv().Store.SetContext(newCtx) 9376 defer func() { 9377 a.app.Srv().Store.SetContext(origCtx) 9378 a.ctx = origCtx 9379 }() 9380 9381 defer span.Finish() 9382 resultVar0, resultVar1 := a.app.GetUsersPage(options, asAdmin) 9383 9384 if resultVar1 != nil { 9385 span.LogFields(spanlog.Error(resultVar1)) 9386 ext.Error.Set(span, true) 9387 } 9388 9389 return resultVar0, resultVar1 9390 } 9391 9392 func (a *OpenTracingAppLayer) GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 9393 origCtx := a.ctx 9394 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeam") 9395 9396 a.ctx = newCtx 9397 a.app.Srv().Store.SetContext(newCtx) 9398 defer func() { 9399 a.app.Srv().Store.SetContext(origCtx) 9400 a.ctx = origCtx 9401 }() 9402 9403 defer span.Finish() 9404 resultVar0, resultVar1 := a.app.GetUsersWithoutTeam(options) 9405 9406 if resultVar1 != nil { 9407 span.LogFields(spanlog.Error(resultVar1)) 9408 ext.Error.Set(span, true) 9409 } 9410 9411 return resultVar0, resultVar1 9412 } 9413 9414 func (a *OpenTracingAppLayer) GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 9415 origCtx := a.ctx 9416 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeamPage") 9417 9418 a.ctx = newCtx 9419 a.app.Srv().Store.SetContext(newCtx) 9420 defer func() { 9421 a.app.Srv().Store.SetContext(origCtx) 9422 a.ctx = origCtx 9423 }() 9424 9425 defer span.Finish() 9426 resultVar0, resultVar1 := a.app.GetUsersWithoutTeamPage(options, asAdmin) 9427 9428 if resultVar1 != nil { 9429 span.LogFields(spanlog.Error(resultVar1)) 9430 ext.Error.Set(span, true) 9431 } 9432 9433 return resultVar0, resultVar1 9434 } 9435 9436 func (a *OpenTracingAppLayer) GetVerifyEmailToken(token string) (*model.Token, *model.AppError) { 9437 origCtx := a.ctx 9438 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetVerifyEmailToken") 9439 9440 a.ctx = newCtx 9441 a.app.Srv().Store.SetContext(newCtx) 9442 defer func() { 9443 a.app.Srv().Store.SetContext(origCtx) 9444 a.ctx = origCtx 9445 }() 9446 9447 defer span.Finish() 9448 resultVar0, resultVar1 := a.app.GetVerifyEmailToken(token) 9449 9450 if resultVar1 != nil { 9451 span.LogFields(spanlog.Error(resultVar1)) 9452 ext.Error.Set(span, true) 9453 } 9454 9455 return resultVar0, resultVar1 9456 } 9457 9458 func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userID string) (*model.ViewUsersRestrictions, *model.AppError) { 9459 origCtx := a.ctx 9460 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetViewUsersRestrictions") 9461 9462 a.ctx = newCtx 9463 a.app.Srv().Store.SetContext(newCtx) 9464 defer func() { 9465 a.app.Srv().Store.SetContext(origCtx) 9466 a.ctx = origCtx 9467 }() 9468 9469 defer span.Finish() 9470 resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userID) 9471 9472 if resultVar1 != nil { 9473 span.LogFields(spanlog.Error(resultVar1)) 9474 ext.Error.Set(span, true) 9475 } 9476 9477 return resultVar0, resultVar1 9478 } 9479 9480 func (a *OpenTracingAppLayer) GetWarnMetricsStatus() (map[string]*model.WarnMetricStatus, *model.AppError) { 9481 origCtx := a.ctx 9482 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetWarnMetricsStatus") 9483 9484 a.ctx = newCtx 9485 a.app.Srv().Store.SetContext(newCtx) 9486 defer func() { 9487 a.app.Srv().Store.SetContext(origCtx) 9488 a.ctx = origCtx 9489 }() 9490 9491 defer span.Finish() 9492 resultVar0, resultVar1 := a.app.GetWarnMetricsStatus() 9493 9494 if resultVar1 != nil { 9495 span.LogFields(spanlog.Error(resultVar1)) 9496 ext.Error.Set(span, true) 9497 } 9498 9499 return resultVar0, resultVar1 9500 } 9501 9502 func (a *OpenTracingAppLayer) Handle404(w http.ResponseWriter, r *http.Request) { 9503 origCtx := a.ctx 9504 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Handle404") 9505 9506 a.ctx = newCtx 9507 a.app.Srv().Store.SetContext(newCtx) 9508 defer func() { 9509 a.app.Srv().Store.SetContext(origCtx) 9510 a.ctx = origCtx 9511 }() 9512 9513 defer span.Finish() 9514 a.app.Handle404(w, r) 9515 } 9516 9517 func (a *OpenTracingAppLayer) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) { 9518 origCtx := a.ctx 9519 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponse") 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.HandleCommandResponse(command, args, response, builtIn) 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) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError) { 9540 origCtx := a.ctx 9541 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponsePost") 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.HandleCommandResponsePost(command, args, response, builtIn) 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) HandleCommandWebhook(hookID string, response *model.CommandResponse) *model.AppError { 9562 origCtx := a.ctx 9563 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandWebhook") 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 := a.app.HandleCommandWebhook(hookID, response) 9574 9575 if resultVar0 != nil { 9576 span.LogFields(spanlog.Error(resultVar0)) 9577 ext.Error.Set(span, true) 9578 } 9579 9580 return resultVar0 9581 } 9582 9583 func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) { 9584 origCtx := a.ctx 9585 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleImages") 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 a.app.HandleImages(previewPathList, thumbnailPathList, fileData) 9596 } 9597 9598 func (a *OpenTracingAppLayer) HandleIncomingWebhook(hookID string, req *model.IncomingWebhookRequest) *model.AppError { 9599 origCtx := a.ctx 9600 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleIncomingWebhook") 9601 9602 a.ctx = newCtx 9603 a.app.Srv().Store.SetContext(newCtx) 9604 defer func() { 9605 a.app.Srv().Store.SetContext(origCtx) 9606 a.ctx = origCtx 9607 }() 9608 9609 defer span.Finish() 9610 resultVar0 := a.app.HandleIncomingWebhook(hookID, req) 9611 9612 if resultVar0 != nil { 9613 span.LogFields(spanlog.Error(resultVar0)) 9614 ext.Error.Set(span, true) 9615 } 9616 9617 return resultVar0 9618 } 9619 9620 func (a *OpenTracingAppLayer) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) { 9621 origCtx := a.ctx 9622 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleMessageExportConfig") 9623 9624 a.ctx = newCtx 9625 a.app.Srv().Store.SetContext(newCtx) 9626 defer func() { 9627 a.app.Srv().Store.SetContext(origCtx) 9628 a.ctx = origCtx 9629 }() 9630 9631 defer span.Finish() 9632 a.app.HandleMessageExportConfig(cfg, appCfg) 9633 } 9634 9635 func (a *OpenTracingAppLayer) HasPermissionTo(askingUserId string, permission *model.Permission) bool { 9636 origCtx := a.ctx 9637 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionTo") 9638 9639 a.ctx = newCtx 9640 a.app.Srv().Store.SetContext(newCtx) 9641 defer func() { 9642 a.app.Srv().Store.SetContext(origCtx) 9643 a.ctx = origCtx 9644 }() 9645 9646 defer span.Finish() 9647 resultVar0 := a.app.HasPermissionTo(askingUserId, permission) 9648 9649 return resultVar0 9650 } 9651 9652 func (a *OpenTracingAppLayer) HasPermissionToChannel(askingUserId string, channelId string, permission *model.Permission) bool { 9653 origCtx := a.ctx 9654 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannel") 9655 9656 a.ctx = newCtx 9657 a.app.Srv().Store.SetContext(newCtx) 9658 defer func() { 9659 a.app.Srv().Store.SetContext(origCtx) 9660 a.ctx = origCtx 9661 }() 9662 9663 defer span.Finish() 9664 resultVar0 := a.app.HasPermissionToChannel(askingUserId, channelId, permission) 9665 9666 return resultVar0 9667 } 9668 9669 func (a *OpenTracingAppLayer) HasPermissionToChannelByPost(askingUserId string, postId string, permission *model.Permission) bool { 9670 origCtx := a.ctx 9671 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannelByPost") 9672 9673 a.ctx = newCtx 9674 a.app.Srv().Store.SetContext(newCtx) 9675 defer func() { 9676 a.app.Srv().Store.SetContext(origCtx) 9677 a.ctx = origCtx 9678 }() 9679 9680 defer span.Finish() 9681 resultVar0 := a.app.HasPermissionToChannelByPost(askingUserId, postId, permission) 9682 9683 return resultVar0 9684 } 9685 9686 func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamID string, permission *model.Permission) bool { 9687 origCtx := a.ctx 9688 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToTeam") 9689 9690 a.ctx = newCtx 9691 a.app.Srv().Store.SetContext(newCtx) 9692 defer func() { 9693 a.app.Srv().Store.SetContext(origCtx) 9694 a.ctx = origCtx 9695 }() 9696 9697 defer span.Finish() 9698 resultVar0 := a.app.HasPermissionToTeam(askingUserId, teamID, permission) 9699 9700 return resultVar0 9701 } 9702 9703 func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userID string) bool { 9704 origCtx := a.ctx 9705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToUser") 9706 9707 a.ctx = newCtx 9708 a.app.Srv().Store.SetContext(newCtx) 9709 defer func() { 9710 a.app.Srv().Store.SetContext(origCtx) 9711 a.ctx = origCtx 9712 }() 9713 9714 defer span.Finish() 9715 resultVar0 := a.app.HasPermissionToUser(askingUserId, userID) 9716 9717 return resultVar0 9718 } 9719 9720 func (a *OpenTracingAppLayer) HubRegister(webConn *app.WebConn) { 9721 origCtx := a.ctx 9722 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubRegister") 9723 9724 a.ctx = newCtx 9725 a.app.Srv().Store.SetContext(newCtx) 9726 defer func() { 9727 a.app.Srv().Store.SetContext(origCtx) 9728 a.ctx = origCtx 9729 }() 9730 9731 defer span.Finish() 9732 a.app.HubRegister(webConn) 9733 } 9734 9735 func (a *OpenTracingAppLayer) HubStart() { 9736 origCtx := a.ctx 9737 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStart") 9738 9739 a.ctx = newCtx 9740 a.app.Srv().Store.SetContext(newCtx) 9741 defer func() { 9742 a.app.Srv().Store.SetContext(origCtx) 9743 a.ctx = origCtx 9744 }() 9745 9746 defer span.Finish() 9747 a.app.HubStart() 9748 } 9749 9750 func (a *OpenTracingAppLayer) HubStop() { 9751 origCtx := a.ctx 9752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStop") 9753 9754 a.ctx = newCtx 9755 a.app.Srv().Store.SetContext(newCtx) 9756 defer func() { 9757 a.app.Srv().Store.SetContext(origCtx) 9758 a.ctx = origCtx 9759 }() 9760 9761 defer span.Finish() 9762 a.app.HubStop() 9763 } 9764 9765 func (a *OpenTracingAppLayer) HubUnregister(webConn *app.WebConn) { 9766 origCtx := a.ctx 9767 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubUnregister") 9768 9769 a.ctx = newCtx 9770 a.app.Srv().Store.SetContext(newCtx) 9771 defer func() { 9772 a.app.Srv().Store.SetContext(origCtx) 9773 a.ctx = origCtx 9774 }() 9775 9776 defer span.Finish() 9777 a.app.HubUnregister(webConn) 9778 } 9779 9780 func (a *OpenTracingAppLayer) ImageProxyAdder() func(string) string { 9781 origCtx := a.ctx 9782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyAdder") 9783 9784 a.ctx = newCtx 9785 a.app.Srv().Store.SetContext(newCtx) 9786 defer func() { 9787 a.app.Srv().Store.SetContext(origCtx) 9788 a.ctx = origCtx 9789 }() 9790 9791 defer span.Finish() 9792 resultVar0 := a.app.ImageProxyAdder() 9793 9794 return resultVar0 9795 } 9796 9797 func (a *OpenTracingAppLayer) ImageProxyRemover() (f func(string) string) { 9798 origCtx := a.ctx 9799 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyRemover") 9800 9801 a.ctx = newCtx 9802 a.app.Srv().Store.SetContext(newCtx) 9803 defer func() { 9804 a.app.Srv().Store.SetContext(origCtx) 9805 a.ctx = origCtx 9806 }() 9807 9808 defer span.Finish() 9809 resultVar0 := a.app.ImageProxyRemover() 9810 9811 return resultVar0 9812 } 9813 9814 func (a *OpenTracingAppLayer) ImportPermissions(jsonl io.Reader) error { 9815 origCtx := a.ctx 9816 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImportPermissions") 9817 9818 a.ctx = newCtx 9819 a.app.Srv().Store.SetContext(newCtx) 9820 defer func() { 9821 a.app.Srv().Store.SetContext(origCtx) 9822 a.ctx = origCtx 9823 }() 9824 9825 defer span.Finish() 9826 resultVar0 := a.app.ImportPermissions(jsonl) 9827 9828 if resultVar0 != nil { 9829 span.LogFields(spanlog.Error(resultVar0)) 9830 ext.Error.Set(span, true) 9831 } 9832 9833 return resultVar0 9834 } 9835 9836 func (a *OpenTracingAppLayer) InitPlugins(pluginDir string, webappPluginDir string) { 9837 origCtx := a.ctx 9838 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPlugins") 9839 9840 a.ctx = newCtx 9841 a.app.Srv().Store.SetContext(newCtx) 9842 defer func() { 9843 a.app.Srv().Store.SetContext(origCtx) 9844 a.ctx = origCtx 9845 }() 9846 9847 defer span.Finish() 9848 a.app.InitPlugins(pluginDir, webappPluginDir) 9849 } 9850 9851 func (a *OpenTracingAppLayer) InitPostMetadata() { 9852 origCtx := a.ctx 9853 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPostMetadata") 9854 9855 a.ctx = newCtx 9856 a.app.Srv().Store.SetContext(newCtx) 9857 defer func() { 9858 a.app.Srv().Store.SetContext(origCtx) 9859 a.ctx = origCtx 9860 }() 9861 9862 defer span.Finish() 9863 a.app.InitPostMetadata() 9864 } 9865 9866 func (a *OpenTracingAppLayer) InitServer() { 9867 origCtx := a.ctx 9868 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitServer") 9869 9870 a.ctx = newCtx 9871 a.app.Srv().Store.SetContext(newCtx) 9872 defer func() { 9873 a.app.Srv().Store.SetContext(origCtx) 9874 a.ctx = origCtx 9875 }() 9876 9877 defer span.Finish() 9878 a.app.InitServer() 9879 } 9880 9881 func (a *OpenTracingAppLayer) InstallMarketplacePlugin(request *model.InstallMarketplacePluginRequest) (*model.Manifest, *model.AppError) { 9882 origCtx := a.ctx 9883 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallMarketplacePlugin") 9884 9885 a.ctx = newCtx 9886 a.app.Srv().Store.SetContext(newCtx) 9887 defer func() { 9888 a.app.Srv().Store.SetContext(origCtx) 9889 a.ctx = origCtx 9890 }() 9891 9892 defer span.Finish() 9893 resultVar0, resultVar1 := a.app.InstallMarketplacePlugin(request) 9894 9895 if resultVar1 != nil { 9896 span.LogFields(spanlog.Error(resultVar1)) 9897 ext.Error.Set(span, true) 9898 } 9899 9900 return resultVar0, resultVar1 9901 } 9902 9903 func (a *OpenTracingAppLayer) InstallPlugin(pluginFile io.ReadSeeker, replace bool) (*model.Manifest, *model.AppError) { 9904 origCtx := a.ctx 9905 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPlugin") 9906 9907 a.ctx = newCtx 9908 a.app.Srv().Store.SetContext(newCtx) 9909 defer func() { 9910 a.app.Srv().Store.SetContext(origCtx) 9911 a.ctx = origCtx 9912 }() 9913 9914 defer span.Finish() 9915 resultVar0, resultVar1 := a.app.InstallPlugin(pluginFile, replace) 9916 9917 if resultVar1 != nil { 9918 span.LogFields(spanlog.Error(resultVar1)) 9919 ext.Error.Set(span, true) 9920 } 9921 9922 return resultVar0, resultVar1 9923 } 9924 9925 func (a *OpenTracingAppLayer) InstallPluginFromData(data model.PluginEventData) { 9926 origCtx := a.ctx 9927 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginFromData") 9928 9929 a.ctx = newCtx 9930 a.app.Srv().Store.SetContext(newCtx) 9931 defer func() { 9932 a.app.Srv().Store.SetContext(origCtx) 9933 a.ctx = origCtx 9934 }() 9935 9936 defer span.Finish() 9937 a.app.InstallPluginFromData(data) 9938 } 9939 9940 func (a *OpenTracingAppLayer) InstallPluginWithSignature(pluginFile io.ReadSeeker, signature io.ReadSeeker) (*model.Manifest, *model.AppError) { 9941 origCtx := a.ctx 9942 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginWithSignature") 9943 9944 a.ctx = newCtx 9945 a.app.Srv().Store.SetContext(newCtx) 9946 defer func() { 9947 a.app.Srv().Store.SetContext(origCtx) 9948 a.ctx = origCtx 9949 }() 9950 9951 defer span.Finish() 9952 resultVar0, resultVar1 := a.app.InstallPluginWithSignature(pluginFile, signature) 9953 9954 if resultVar1 != nil { 9955 span.LogFields(spanlog.Error(resultVar1)) 9956 ext.Error.Set(span, true) 9957 } 9958 9959 return resultVar0, resultVar1 9960 } 9961 9962 func (a *OpenTracingAppLayer) InvalidateAllEmailInvites() *model.AppError { 9963 origCtx := a.ctx 9964 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllEmailInvites") 9965 9966 a.ctx = newCtx 9967 a.app.Srv().Store.SetContext(newCtx) 9968 defer func() { 9969 a.app.Srv().Store.SetContext(origCtx) 9970 a.ctx = origCtx 9971 }() 9972 9973 defer span.Finish() 9974 resultVar0 := a.app.InvalidateAllEmailInvites() 9975 9976 if resultVar0 != nil { 9977 span.LogFields(spanlog.Error(resultVar0)) 9978 ext.Error.Set(span, true) 9979 } 9980 9981 return resultVar0 9982 } 9983 9984 func (a *OpenTracingAppLayer) InvalidateCacheForUser(userID string) { 9985 origCtx := a.ctx 9986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateCacheForUser") 9987 9988 a.ctx = newCtx 9989 a.app.Srv().Store.SetContext(newCtx) 9990 defer func() { 9991 a.app.Srv().Store.SetContext(origCtx) 9992 a.ctx = origCtx 9993 }() 9994 9995 defer span.Finish() 9996 a.app.InvalidateCacheForUser(userID) 9997 } 9998 9999 func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userID string) { 10000 origCtx := a.ctx 10001 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateWebConnSessionCacheForUser") 10002 10003 a.ctx = newCtx 10004 a.app.Srv().Store.SetContext(newCtx) 10005 defer func() { 10006 a.app.Srv().Store.SetContext(origCtx) 10007 a.ctx = origCtx 10008 }() 10009 10010 defer span.Finish() 10011 a.app.InvalidateWebConnSessionCacheForUser(userID) 10012 } 10013 10014 func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamID string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { 10015 origCtx := a.ctx 10016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannels") 10017 10018 a.ctx = newCtx 10019 a.app.Srv().Store.SetContext(newCtx) 10020 defer func() { 10021 a.app.Srv().Store.SetContext(origCtx) 10022 a.ctx = origCtx 10023 }() 10024 10025 defer span.Finish() 10026 resultVar0 := a.app.InviteGuestsToChannels(teamID, guestsInvite, senderId) 10027 10028 if resultVar0 != nil { 10029 span.LogFields(spanlog.Error(resultVar0)) 10030 ext.Error.Set(span, true) 10031 } 10032 10033 return resultVar0 10034 } 10035 10036 func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamID string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 10037 origCtx := a.ctx 10038 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannelsGracefully") 10039 10040 a.ctx = newCtx 10041 a.app.Srv().Store.SetContext(newCtx) 10042 defer func() { 10043 a.app.Srv().Store.SetContext(origCtx) 10044 a.ctx = origCtx 10045 }() 10046 10047 defer span.Finish() 10048 resultVar0, resultVar1 := a.app.InviteGuestsToChannelsGracefully(teamID, guestsInvite, senderId) 10049 10050 if resultVar1 != nil { 10051 span.LogFields(spanlog.Error(resultVar1)) 10052 ext.Error.Set(span, true) 10053 } 10054 10055 return resultVar0, resultVar1 10056 } 10057 10058 func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamID string, senderId string) *model.AppError { 10059 origCtx := a.ctx 10060 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeam") 10061 10062 a.ctx = newCtx 10063 a.app.Srv().Store.SetContext(newCtx) 10064 defer func() { 10065 a.app.Srv().Store.SetContext(origCtx) 10066 a.ctx = origCtx 10067 }() 10068 10069 defer span.Finish() 10070 resultVar0 := a.app.InviteNewUsersToTeam(emailList, teamID, senderId) 10071 10072 if resultVar0 != nil { 10073 span.LogFields(spanlog.Error(resultVar0)) 10074 ext.Error.Set(span, true) 10075 } 10076 10077 return resultVar0 10078 } 10079 10080 func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, teamID string, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 10081 origCtx := a.ctx 10082 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeamGracefully") 10083 10084 a.ctx = newCtx 10085 a.app.Srv().Store.SetContext(newCtx) 10086 defer func() { 10087 a.app.Srv().Store.SetContext(origCtx) 10088 a.ctx = origCtx 10089 }() 10090 10091 defer span.Finish() 10092 resultVar0, resultVar1 := a.app.InviteNewUsersToTeamGracefully(emailList, teamID, senderId) 10093 10094 if resultVar1 != nil { 10095 span.LogFields(spanlog.Error(resultVar1)) 10096 ext.Error.Set(span, true) 10097 } 10098 10099 return resultVar0, resultVar1 10100 } 10101 10102 func (a *OpenTracingAppLayer) IsFirstUserAccount() bool { 10103 origCtx := a.ctx 10104 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsFirstUserAccount") 10105 10106 a.ctx = newCtx 10107 a.app.Srv().Store.SetContext(newCtx) 10108 defer func() { 10109 a.app.Srv().Store.SetContext(origCtx) 10110 a.ctx = origCtx 10111 }() 10112 10113 defer span.Finish() 10114 resultVar0 := a.app.IsFirstUserAccount() 10115 10116 return resultVar0 10117 } 10118 10119 func (a *OpenTracingAppLayer) IsLeader() bool { 10120 origCtx := a.ctx 10121 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsLeader") 10122 10123 a.ctx = newCtx 10124 a.app.Srv().Store.SetContext(newCtx) 10125 defer func() { 10126 a.app.Srv().Store.SetContext(origCtx) 10127 a.ctx = origCtx 10128 }() 10129 10130 defer span.Finish() 10131 resultVar0 := a.app.IsLeader() 10132 10133 return resultVar0 10134 } 10135 10136 func (a *OpenTracingAppLayer) IsPasswordValid(password string) *model.AppError { 10137 origCtx := a.ctx 10138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPasswordValid") 10139 10140 a.ctx = newCtx 10141 a.app.Srv().Store.SetContext(newCtx) 10142 defer func() { 10143 a.app.Srv().Store.SetContext(origCtx) 10144 a.ctx = origCtx 10145 }() 10146 10147 defer span.Finish() 10148 resultVar0 := a.app.IsPasswordValid(password) 10149 10150 if resultVar0 != nil { 10151 span.LogFields(spanlog.Error(resultVar0)) 10152 ext.Error.Set(span, true) 10153 } 10154 10155 return resultVar0 10156 } 10157 10158 func (a *OpenTracingAppLayer) IsPhase2MigrationCompleted() *model.AppError { 10159 origCtx := a.ctx 10160 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPhase2MigrationCompleted") 10161 10162 a.ctx = newCtx 10163 a.app.Srv().Store.SetContext(newCtx) 10164 defer func() { 10165 a.app.Srv().Store.SetContext(origCtx) 10166 a.ctx = origCtx 10167 }() 10168 10169 defer span.Finish() 10170 resultVar0 := a.app.IsPhase2MigrationCompleted() 10171 10172 if resultVar0 != nil { 10173 span.LogFields(spanlog.Error(resultVar0)) 10174 ext.Error.Set(span, true) 10175 } 10176 10177 return resultVar0 10178 } 10179 10180 func (a *OpenTracingAppLayer) IsUserAway(lastActivityAt int64) bool { 10181 origCtx := a.ctx 10182 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserAway") 10183 10184 a.ctx = newCtx 10185 a.app.Srv().Store.SetContext(newCtx) 10186 defer func() { 10187 a.app.Srv().Store.SetContext(origCtx) 10188 a.ctx = origCtx 10189 }() 10190 10191 defer span.Finish() 10192 resultVar0 := a.app.IsUserAway(lastActivityAt) 10193 10194 return resultVar0 10195 } 10196 10197 func (a *OpenTracingAppLayer) IsUserSignUpAllowed() *model.AppError { 10198 origCtx := a.ctx 10199 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserSignUpAllowed") 10200 10201 a.ctx = newCtx 10202 a.app.Srv().Store.SetContext(newCtx) 10203 defer func() { 10204 a.app.Srv().Store.SetContext(origCtx) 10205 a.ctx = origCtx 10206 }() 10207 10208 defer span.Finish() 10209 resultVar0 := a.app.IsUserSignUpAllowed() 10210 10211 if resultVar0 != nil { 10212 span.LogFields(spanlog.Error(resultVar0)) 10213 ext.Error.Set(span, true) 10214 } 10215 10216 return resultVar0 10217 } 10218 10219 func (a *OpenTracingAppLayer) IsUsernameTaken(name string) bool { 10220 origCtx := a.ctx 10221 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUsernameTaken") 10222 10223 a.ctx = newCtx 10224 a.app.Srv().Store.SetContext(newCtx) 10225 defer func() { 10226 a.app.Srv().Store.SetContext(origCtx) 10227 a.ctx = origCtx 10228 }() 10229 10230 defer span.Finish() 10231 resultVar0 := a.app.IsUsernameTaken(name) 10232 10233 return resultVar0 10234 } 10235 10236 func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userID string) *model.AppError { 10237 origCtx := a.ctx 10238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinChannel") 10239 10240 a.ctx = newCtx 10241 a.app.Srv().Store.SetContext(newCtx) 10242 defer func() { 10243 a.app.Srv().Store.SetContext(origCtx) 10244 a.ctx = origCtx 10245 }() 10246 10247 defer span.Finish() 10248 resultVar0 := a.app.JoinChannel(channel, userID) 10249 10250 if resultVar0 != nil { 10251 span.LogFields(spanlog.Error(resultVar0)) 10252 ext.Error.Set(span, true) 10253 } 10254 10255 return resultVar0 10256 } 10257 10258 func (a *OpenTracingAppLayer) JoinDefaultChannels(teamID string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { 10259 origCtx := a.ctx 10260 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinDefaultChannels") 10261 10262 a.ctx = newCtx 10263 a.app.Srv().Store.SetContext(newCtx) 10264 defer func() { 10265 a.app.Srv().Store.SetContext(origCtx) 10266 a.ctx = origCtx 10267 }() 10268 10269 defer span.Finish() 10270 resultVar0 := a.app.JoinDefaultChannels(teamID, user, shouldBeAdmin, userRequestorId) 10271 10272 if resultVar0 != nil { 10273 span.LogFields(spanlog.Error(resultVar0)) 10274 ext.Error.Set(span, true) 10275 } 10276 10277 return resultVar0 10278 } 10279 10280 func (a *OpenTracingAppLayer) JoinUserToTeam(team *model.Team, user *model.User, userRequestorId string) *model.AppError { 10281 origCtx := a.ctx 10282 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinUserToTeam") 10283 10284 a.ctx = newCtx 10285 a.app.Srv().Store.SetContext(newCtx) 10286 defer func() { 10287 a.app.Srv().Store.SetContext(origCtx) 10288 a.ctx = origCtx 10289 }() 10290 10291 defer span.Finish() 10292 resultVar0 := a.app.JoinUserToTeam(team, user, userRequestorId) 10293 10294 if resultVar0 != nil { 10295 span.LogFields(spanlog.Error(resultVar0)) 10296 ext.Error.Set(span, true) 10297 } 10298 10299 return resultVar0 10300 } 10301 10302 func (a *OpenTracingAppLayer) LeaveChannel(channelId string, userID string) *model.AppError { 10303 origCtx := a.ctx 10304 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveChannel") 10305 10306 a.ctx = newCtx 10307 a.app.Srv().Store.SetContext(newCtx) 10308 defer func() { 10309 a.app.Srv().Store.SetContext(origCtx) 10310 a.ctx = origCtx 10311 }() 10312 10313 defer span.Finish() 10314 resultVar0 := a.app.LeaveChannel(channelId, userID) 10315 10316 if resultVar0 != nil { 10317 span.LogFields(spanlog.Error(resultVar0)) 10318 ext.Error.Set(span, true) 10319 } 10320 10321 return resultVar0 10322 } 10323 10324 func (a *OpenTracingAppLayer) LeaveTeam(team *model.Team, user *model.User, requestorId string) *model.AppError { 10325 origCtx := a.ctx 10326 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveTeam") 10327 10328 a.ctx = newCtx 10329 a.app.Srv().Store.SetContext(newCtx) 10330 defer func() { 10331 a.app.Srv().Store.SetContext(origCtx) 10332 a.ctx = origCtx 10333 }() 10334 10335 defer span.Finish() 10336 resultVar0 := a.app.LeaveTeam(team, user, requestorId) 10337 10338 if resultVar0 != nil { 10339 span.LogFields(spanlog.Error(resultVar0)) 10340 ext.Error.Set(span, true) 10341 } 10342 10343 return resultVar0 10344 } 10345 10346 func (a *OpenTracingAppLayer) LimitedClientConfig() map[string]string { 10347 origCtx := a.ctx 10348 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfig") 10349 10350 a.ctx = newCtx 10351 a.app.Srv().Store.SetContext(newCtx) 10352 defer func() { 10353 a.app.Srv().Store.SetContext(origCtx) 10354 a.ctx = origCtx 10355 }() 10356 10357 defer span.Finish() 10358 resultVar0 := a.app.LimitedClientConfig() 10359 10360 return resultVar0 10361 } 10362 10363 func (a *OpenTracingAppLayer) LimitedClientConfigWithComputed() map[string]string { 10364 origCtx := a.ctx 10365 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfigWithComputed") 10366 10367 a.ctx = newCtx 10368 a.app.Srv().Store.SetContext(newCtx) 10369 defer func() { 10370 a.app.Srv().Store.SetContext(origCtx) 10371 a.ctx = origCtx 10372 }() 10373 10374 defer span.Finish() 10375 resultVar0 := a.app.LimitedClientConfigWithComputed() 10376 10377 return resultVar0 10378 } 10379 10380 func (a *OpenTracingAppLayer) ListAllCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 10381 origCtx := a.ctx 10382 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAllCommands") 10383 10384 a.ctx = newCtx 10385 a.app.Srv().Store.SetContext(newCtx) 10386 defer func() { 10387 a.app.Srv().Store.SetContext(origCtx) 10388 a.ctx = origCtx 10389 }() 10390 10391 defer span.Finish() 10392 resultVar0, resultVar1 := a.app.ListAllCommands(teamID, T) 10393 10394 if resultVar1 != nil { 10395 span.LogFields(spanlog.Error(resultVar1)) 10396 ext.Error.Set(span, true) 10397 } 10398 10399 return resultVar0, resultVar1 10400 } 10401 10402 func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamID string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 10403 origCtx := a.ctx 10404 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAutocompleteCommands") 10405 10406 a.ctx = newCtx 10407 a.app.Srv().Store.SetContext(newCtx) 10408 defer func() { 10409 a.app.Srv().Store.SetContext(origCtx) 10410 a.ctx = origCtx 10411 }() 10412 10413 span.SetTag("teamID", teamID) 10414 10415 defer span.Finish() 10416 resultVar0, resultVar1 := a.app.ListAutocompleteCommands(teamID, T) 10417 10418 if resultVar1 != nil { 10419 span.LogFields(spanlog.Error(resultVar1)) 10420 ext.Error.Set(span, true) 10421 } 10422 10423 return resultVar0, resultVar1 10424 } 10425 10426 func (a *OpenTracingAppLayer) ListDirectory(path string) ([]string, *model.AppError) { 10427 origCtx := a.ctx 10428 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListDirectory") 10429 10430 a.ctx = newCtx 10431 a.app.Srv().Store.SetContext(newCtx) 10432 defer func() { 10433 a.app.Srv().Store.SetContext(origCtx) 10434 a.ctx = origCtx 10435 }() 10436 10437 defer span.Finish() 10438 resultVar0, resultVar1 := a.app.ListDirectory(path) 10439 10440 if resultVar1 != nil { 10441 span.LogFields(spanlog.Error(resultVar1)) 10442 ext.Error.Set(span, true) 10443 } 10444 10445 return resultVar0, resultVar1 10446 } 10447 10448 func (a *OpenTracingAppLayer) ListExports() ([]string, *model.AppError) { 10449 origCtx := a.ctx 10450 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListExports") 10451 10452 a.ctx = newCtx 10453 a.app.Srv().Store.SetContext(newCtx) 10454 defer func() { 10455 a.app.Srv().Store.SetContext(origCtx) 10456 a.ctx = origCtx 10457 }() 10458 10459 defer span.Finish() 10460 resultVar0, resultVar1 := a.app.ListExports() 10461 10462 if resultVar1 != nil { 10463 span.LogFields(spanlog.Error(resultVar1)) 10464 ext.Error.Set(span, true) 10465 } 10466 10467 return resultVar0, resultVar1 10468 } 10469 10470 func (a *OpenTracingAppLayer) ListImports() ([]string, *model.AppError) { 10471 origCtx := a.ctx 10472 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListImports") 10473 10474 a.ctx = newCtx 10475 a.app.Srv().Store.SetContext(newCtx) 10476 defer func() { 10477 a.app.Srv().Store.SetContext(origCtx) 10478 a.ctx = origCtx 10479 }() 10480 10481 defer span.Finish() 10482 resultVar0, resultVar1 := a.app.ListImports() 10483 10484 if resultVar1 != nil { 10485 span.LogFields(spanlog.Error(resultVar1)) 10486 ext.Error.Set(span, true) 10487 } 10488 10489 return resultVar0, resultVar1 10490 } 10491 10492 func (a *OpenTracingAppLayer) ListPluginKeys(pluginId string, page int, perPage int) ([]string, *model.AppError) { 10493 origCtx := a.ctx 10494 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListPluginKeys") 10495 10496 a.ctx = newCtx 10497 a.app.Srv().Store.SetContext(newCtx) 10498 defer func() { 10499 a.app.Srv().Store.SetContext(origCtx) 10500 a.ctx = origCtx 10501 }() 10502 10503 defer span.Finish() 10504 resultVar0, resultVar1 := a.app.ListPluginKeys(pluginId, page, perPage) 10505 10506 if resultVar1 != nil { 10507 span.LogFields(spanlog.Error(resultVar1)) 10508 ext.Error.Set(span, true) 10509 } 10510 10511 return resultVar0, resultVar1 10512 } 10513 10514 func (a *OpenTracingAppLayer) ListTeamCommands(teamID string) ([]*model.Command, *model.AppError) { 10515 origCtx := a.ctx 10516 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListTeamCommands") 10517 10518 a.ctx = newCtx 10519 a.app.Srv().Store.SetContext(newCtx) 10520 defer func() { 10521 a.app.Srv().Store.SetContext(origCtx) 10522 a.ctx = origCtx 10523 }() 10524 10525 defer span.Finish() 10526 resultVar0, resultVar1 := a.app.ListTeamCommands(teamID) 10527 10528 if resultVar1 != nil { 10529 span.LogFields(spanlog.Error(resultVar1)) 10530 ext.Error.Set(span, true) 10531 } 10532 10533 return resultVar0, resultVar1 10534 } 10535 10536 func (a *OpenTracingAppLayer) LogAuditRec(rec *audit.Record, err error) { 10537 origCtx := a.ctx 10538 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRec") 10539 10540 a.ctx = newCtx 10541 a.app.Srv().Store.SetContext(newCtx) 10542 defer func() { 10543 a.app.Srv().Store.SetContext(origCtx) 10544 a.ctx = origCtx 10545 }() 10546 10547 defer span.Finish() 10548 a.app.LogAuditRec(rec, err) 10549 } 10550 10551 func (a *OpenTracingAppLayer) LogAuditRecWithLevel(rec *audit.Record, level mlog.LogLevel, err error) { 10552 origCtx := a.ctx 10553 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRecWithLevel") 10554 10555 a.ctx = newCtx 10556 a.app.Srv().Store.SetContext(newCtx) 10557 defer func() { 10558 a.app.Srv().Store.SetContext(origCtx) 10559 a.ctx = origCtx 10560 }() 10561 10562 defer span.Finish() 10563 a.app.LogAuditRecWithLevel(rec, level, err) 10564 } 10565 10566 func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, teamID string, tokenUser *model.User) (*model.User, *model.AppError) { 10567 origCtx := a.ctx 10568 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth") 10569 10570 a.ctx = newCtx 10571 a.app.Srv().Store.SetContext(newCtx) 10572 defer func() { 10573 a.app.Srv().Store.SetContext(origCtx) 10574 a.ctx = origCtx 10575 }() 10576 10577 defer span.Finish() 10578 resultVar0, resultVar1 := a.app.LoginByOAuth(service, userData, teamID, tokenUser) 10579 10580 if resultVar1 != nil { 10581 span.LogFields(spanlog.Error(resultVar1)) 10582 ext.Error.Set(span, true) 10583 } 10584 10585 return resultVar0, resultVar1 10586 } 10587 10588 func (a *OpenTracingAppLayer) MakeAuditRecord(event string, initialStatus string) *audit.Record { 10589 origCtx := a.ctx 10590 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakeAuditRecord") 10591 10592 a.ctx = newCtx 10593 a.app.Srv().Store.SetContext(newCtx) 10594 defer func() { 10595 a.app.Srv().Store.SetContext(origCtx) 10596 a.ctx = origCtx 10597 }() 10598 10599 defer span.Finish() 10600 resultVar0 := a.app.MakeAuditRecord(event, initialStatus) 10601 10602 return resultVar0 10603 } 10604 10605 func (a *OpenTracingAppLayer) MakePermissionError(permissions []*model.Permission) *model.AppError { 10606 origCtx := a.ctx 10607 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakePermissionError") 10608 10609 a.ctx = newCtx 10610 a.app.Srv().Store.SetContext(newCtx) 10611 defer func() { 10612 a.app.Srv().Store.SetContext(origCtx) 10613 a.ctx = origCtx 10614 }() 10615 10616 defer span.Finish() 10617 resultVar0 := a.app.MakePermissionError(permissions) 10618 10619 if resultVar0 != nil { 10620 span.LogFields(spanlog.Error(resultVar0)) 10621 ext.Error.Set(span, true) 10622 } 10623 10624 return resultVar0 10625 } 10626 10627 func (a *OpenTracingAppLayer) MarkChannelAsUnreadFromPost(postID string, userID string) (*model.ChannelUnreadAt, *model.AppError) { 10628 origCtx := a.ctx 10629 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelAsUnreadFromPost") 10630 10631 a.ctx = newCtx 10632 a.app.Srv().Store.SetContext(newCtx) 10633 defer func() { 10634 a.app.Srv().Store.SetContext(origCtx) 10635 a.ctx = origCtx 10636 }() 10637 10638 defer span.Finish() 10639 resultVar0, resultVar1 := a.app.MarkChannelAsUnreadFromPost(postID, userID) 10640 10641 if resultVar1 != nil { 10642 span.LogFields(spanlog.Error(resultVar1)) 10643 ext.Error.Set(span, true) 10644 } 10645 10646 return resultVar0, resultVar1 10647 } 10648 10649 func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIds []string, userID string, currentSessionId string) (map[string]int64, *model.AppError) { 10650 origCtx := a.ctx 10651 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelsAsViewed") 10652 10653 a.ctx = newCtx 10654 a.app.Srv().Store.SetContext(newCtx) 10655 defer func() { 10656 a.app.Srv().Store.SetContext(origCtx) 10657 a.ctx = origCtx 10658 }() 10659 10660 defer span.Finish() 10661 resultVar0, resultVar1 := a.app.MarkChannelsAsViewed(channelIds, userID, currentSessionId) 10662 10663 if resultVar1 != nil { 10664 span.LogFields(spanlog.Error(resultVar1)) 10665 ext.Error.Set(span, true) 10666 } 10667 10668 return resultVar0, resultVar1 10669 } 10670 10671 func (a *OpenTracingAppLayer) MaxPostSize() int { 10672 origCtx := a.ctx 10673 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MaxPostSize") 10674 10675 a.ctx = newCtx 10676 a.app.Srv().Store.SetContext(newCtx) 10677 defer func() { 10678 a.app.Srv().Store.SetContext(origCtx) 10679 a.ctx = origCtx 10680 }() 10681 10682 defer span.Finish() 10683 resultVar0 := a.app.MaxPostSize() 10684 10685 return resultVar0 10686 } 10687 10688 func (a *OpenTracingAppLayer) MentionsToPublicChannels(message string, teamID string) model.ChannelMentionMap { 10689 origCtx := a.ctx 10690 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToPublicChannels") 10691 10692 a.ctx = newCtx 10693 a.app.Srv().Store.SetContext(newCtx) 10694 defer func() { 10695 a.app.Srv().Store.SetContext(origCtx) 10696 a.ctx = origCtx 10697 }() 10698 10699 defer span.Finish() 10700 resultVar0 := a.app.MentionsToPublicChannels(message, teamID) 10701 10702 return resultVar0 10703 } 10704 10705 func (a *OpenTracingAppLayer) MentionsToTeamMembers(message string, teamID string) model.UserMentionMap { 10706 origCtx := a.ctx 10707 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MentionsToTeamMembers") 10708 10709 a.ctx = newCtx 10710 a.app.Srv().Store.SetContext(newCtx) 10711 defer func() { 10712 a.app.Srv().Store.SetContext(origCtx) 10713 a.ctx = origCtx 10714 }() 10715 10716 defer span.Finish() 10717 resultVar0 := a.app.MentionsToTeamMembers(message, teamID) 10718 10719 return resultVar0 10720 } 10721 10722 func (a *OpenTracingAppLayer) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { 10723 origCtx := a.ctx 10724 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateFilenamesToFileInfos") 10725 10726 a.ctx = newCtx 10727 a.app.Srv().Store.SetContext(newCtx) 10728 defer func() { 10729 a.app.Srv().Store.SetContext(origCtx) 10730 a.ctx = origCtx 10731 }() 10732 10733 defer span.Finish() 10734 resultVar0 := a.app.MigrateFilenamesToFileInfos(post) 10735 10736 return resultVar0 10737 } 10738 10739 func (a *OpenTracingAppLayer) MigrateIdLDAP(toAttribute string) *model.AppError { 10740 origCtx := a.ctx 10741 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateIdLDAP") 10742 10743 a.ctx = newCtx 10744 a.app.Srv().Store.SetContext(newCtx) 10745 defer func() { 10746 a.app.Srv().Store.SetContext(origCtx) 10747 a.ctx = origCtx 10748 }() 10749 10750 defer span.Finish() 10751 resultVar0 := a.app.MigrateIdLDAP(toAttribute) 10752 10753 if resultVar0 != nil { 10754 span.LogFields(spanlog.Error(resultVar0)) 10755 ext.Error.Set(span, true) 10756 } 10757 10758 return resultVar0 10759 } 10760 10761 func (a *OpenTracingAppLayer) MoveChannel(team *model.Team, channel *model.Channel, user *model.User) *model.AppError { 10762 origCtx := a.ctx 10763 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveChannel") 10764 10765 a.ctx = newCtx 10766 a.app.Srv().Store.SetContext(newCtx) 10767 defer func() { 10768 a.app.Srv().Store.SetContext(origCtx) 10769 a.ctx = origCtx 10770 }() 10771 10772 defer span.Finish() 10773 resultVar0 := a.app.MoveChannel(team, channel, user) 10774 10775 if resultVar0 != nil { 10776 span.LogFields(spanlog.Error(resultVar0)) 10777 ext.Error.Set(span, true) 10778 } 10779 10780 return resultVar0 10781 } 10782 10783 func (a *OpenTracingAppLayer) MoveCommand(team *model.Team, command *model.Command) *model.AppError { 10784 origCtx := a.ctx 10785 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveCommand") 10786 10787 a.ctx = newCtx 10788 a.app.Srv().Store.SetContext(newCtx) 10789 defer func() { 10790 a.app.Srv().Store.SetContext(origCtx) 10791 a.ctx = origCtx 10792 }() 10793 10794 defer span.Finish() 10795 resultVar0 := a.app.MoveCommand(team, command) 10796 10797 if resultVar0 != nil { 10798 span.LogFields(spanlog.Error(resultVar0)) 10799 ext.Error.Set(span, true) 10800 } 10801 10802 return resultVar0 10803 } 10804 10805 func (a *OpenTracingAppLayer) MoveFile(oldPath string, newPath string) *model.AppError { 10806 origCtx := a.ctx 10807 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveFile") 10808 10809 a.ctx = newCtx 10810 a.app.Srv().Store.SetContext(newCtx) 10811 defer func() { 10812 a.app.Srv().Store.SetContext(origCtx) 10813 a.ctx = origCtx 10814 }() 10815 10816 defer span.Finish() 10817 resultVar0 := a.app.MoveFile(oldPath, newPath) 10818 10819 if resultVar0 != nil { 10820 span.LogFields(spanlog.Error(resultVar0)) 10821 ext.Error.Set(span, true) 10822 } 10823 10824 return resultVar0 10825 } 10826 10827 func (a *OpenTracingAppLayer) NewClusterDiscoveryService() *app.ClusterDiscoveryService { 10828 origCtx := a.ctx 10829 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewClusterDiscoveryService") 10830 10831 a.ctx = newCtx 10832 a.app.Srv().Store.SetContext(newCtx) 10833 defer func() { 10834 a.app.Srv().Store.SetContext(origCtx) 10835 a.ctx = origCtx 10836 }() 10837 10838 defer span.Finish() 10839 resultVar0 := a.app.NewClusterDiscoveryService() 10840 10841 return resultVar0 10842 } 10843 10844 func (a *OpenTracingAppLayer) NewPluginAPI(manifest *model.Manifest) plugin.API { 10845 origCtx := a.ctx 10846 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewPluginAPI") 10847 10848 a.ctx = newCtx 10849 a.app.Srv().Store.SetContext(newCtx) 10850 defer func() { 10851 a.app.Srv().Store.SetContext(origCtx) 10852 a.ctx = origCtx 10853 }() 10854 10855 defer span.Finish() 10856 resultVar0 := a.app.NewPluginAPI(manifest) 10857 10858 return resultVar0 10859 } 10860 10861 func (a *OpenTracingAppLayer) NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *app.WebConn { 10862 origCtx := a.ctx 10863 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebConn") 10864 10865 a.ctx = newCtx 10866 a.app.Srv().Store.SetContext(newCtx) 10867 defer func() { 10868 a.app.Srv().Store.SetContext(origCtx) 10869 a.ctx = origCtx 10870 }() 10871 10872 defer span.Finish() 10873 resultVar0 := a.app.NewWebConn(ws, session, t, locale) 10874 10875 return resultVar0 10876 } 10877 10878 func (a *OpenTracingAppLayer) NewWebHub() *app.Hub { 10879 origCtx := a.ctx 10880 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebHub") 10881 10882 a.ctx = newCtx 10883 a.app.Srv().Store.SetContext(newCtx) 10884 defer func() { 10885 a.app.Srv().Store.SetContext(origCtx) 10886 a.ctx = origCtx 10887 }() 10888 10889 defer span.Finish() 10890 resultVar0 := a.app.NewWebHub() 10891 10892 return resultVar0 10893 } 10894 10895 func (a *OpenTracingAppLayer) NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError { 10896 origCtx := a.ctx 10897 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifyAndSetWarnMetricAck") 10898 10899 a.ctx = newCtx 10900 a.app.Srv().Store.SetContext(newCtx) 10901 defer func() { 10902 a.app.Srv().Store.SetContext(origCtx) 10903 a.ctx = origCtx 10904 }() 10905 10906 defer span.Finish() 10907 resultVar0 := a.app.NotifyAndSetWarnMetricAck(warnMetricId, sender, forceAck, isBot) 10908 10909 if resultVar0 != nil { 10910 span.LogFields(spanlog.Error(resultVar0)) 10911 ext.Error.Set(span, true) 10912 } 10913 10914 return resultVar0 10915 } 10916 10917 func (a *OpenTracingAppLayer) NotifySessionsExpired() *model.AppError { 10918 origCtx := a.ctx 10919 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifySessionsExpired") 10920 10921 a.ctx = newCtx 10922 a.app.Srv().Store.SetContext(newCtx) 10923 defer func() { 10924 a.app.Srv().Store.SetContext(origCtx) 10925 a.ctx = origCtx 10926 }() 10927 10928 defer span.Finish() 10929 resultVar0 := a.app.NotifySessionsExpired() 10930 10931 if resultVar0 != nil { 10932 span.LogFields(spanlog.Error(resultVar0)) 10933 ext.Error.Set(span, true) 10934 } 10935 10936 return resultVar0 10937 } 10938 10939 func (a *OpenTracingAppLayer) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError { 10940 origCtx := a.ctx 10941 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OpenInteractiveDialog") 10942 10943 a.ctx = newCtx 10944 a.app.Srv().Store.SetContext(newCtx) 10945 defer func() { 10946 a.app.Srv().Store.SetContext(origCtx) 10947 a.ctx = origCtx 10948 }() 10949 10950 defer span.Finish() 10951 resultVar0 := a.app.OpenInteractiveDialog(request) 10952 10953 if resultVar0 != nil { 10954 span.LogFields(spanlog.Error(resultVar0)) 10955 ext.Error.Set(span, true) 10956 } 10957 10958 return resultVar0 10959 } 10960 10961 func (a *OpenTracingAppLayer) OriginChecker() func(*http.Request) bool { 10962 origCtx := a.ctx 10963 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OriginChecker") 10964 10965 a.ctx = newCtx 10966 a.app.Srv().Store.SetContext(newCtx) 10967 defer func() { 10968 a.app.Srv().Store.SetContext(origCtx) 10969 a.ctx = origCtx 10970 }() 10971 10972 defer span.Finish() 10973 resultVar0 := a.app.OriginChecker() 10974 10975 return resultVar0 10976 } 10977 10978 func (a *OpenTracingAppLayer) OverrideIconURLIfEmoji(post *model.Post) { 10979 origCtx := a.ctx 10980 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OverrideIconURLIfEmoji") 10981 10982 a.ctx = newCtx 10983 a.app.Srv().Store.SetContext(newCtx) 10984 defer func() { 10985 a.app.Srv().Store.SetContext(origCtx) 10986 a.ctx = origCtx 10987 }() 10988 10989 defer span.Finish() 10990 a.app.OverrideIconURLIfEmoji(post) 10991 } 10992 10993 func (a *OpenTracingAppLayer) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) { 10994 origCtx := a.ctx 10995 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchBot") 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, resultVar1 := a.app.PatchBot(botUserId, botPatch) 11006 11007 if resultVar1 != nil { 11008 span.LogFields(spanlog.Error(resultVar1)) 11009 ext.Error.Set(span, true) 11010 } 11011 11012 return resultVar0, resultVar1 11013 } 11014 11015 func (a *OpenTracingAppLayer) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userID string) (*model.Channel, *model.AppError) { 11016 origCtx := a.ctx 11017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannel") 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, resultVar1 := a.app.PatchChannel(channel, patch, userID) 11028 11029 if resultVar1 != nil { 11030 span.LogFields(spanlog.Error(resultVar1)) 11031 ext.Error.Set(span, true) 11032 } 11033 11034 return resultVar0, resultVar1 11035 } 11036 11037 func (a *OpenTracingAppLayer) PatchChannelModerationsForChannel(channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) { 11038 origCtx := a.ctx 11039 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannelModerationsForChannel") 11040 11041 a.ctx = newCtx 11042 a.app.Srv().Store.SetContext(newCtx) 11043 defer func() { 11044 a.app.Srv().Store.SetContext(origCtx) 11045 a.ctx = origCtx 11046 }() 11047 11048 defer span.Finish() 11049 resultVar0, resultVar1 := a.app.PatchChannelModerationsForChannel(channel, channelModerationsPatch) 11050 11051 if resultVar1 != nil { 11052 span.LogFields(spanlog.Error(resultVar1)) 11053 ext.Error.Set(span, true) 11054 } 11055 11056 return resultVar0, resultVar1 11057 } 11058 11059 func (a *OpenTracingAppLayer) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError) { 11060 origCtx := a.ctx 11061 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchPost") 11062 11063 a.ctx = newCtx 11064 a.app.Srv().Store.SetContext(newCtx) 11065 defer func() { 11066 a.app.Srv().Store.SetContext(origCtx) 11067 a.ctx = origCtx 11068 }() 11069 11070 defer span.Finish() 11071 resultVar0, resultVar1 := a.app.PatchPost(postId, patch) 11072 11073 if resultVar1 != nil { 11074 span.LogFields(spanlog.Error(resultVar1)) 11075 ext.Error.Set(span, true) 11076 } 11077 11078 return resultVar0, resultVar1 11079 } 11080 11081 func (a *OpenTracingAppLayer) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) { 11082 origCtx := a.ctx 11083 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchRole") 11084 11085 a.ctx = newCtx 11086 a.app.Srv().Store.SetContext(newCtx) 11087 defer func() { 11088 a.app.Srv().Store.SetContext(origCtx) 11089 a.ctx = origCtx 11090 }() 11091 11092 defer span.Finish() 11093 resultVar0, resultVar1 := a.app.PatchRole(role, patch) 11094 11095 if resultVar1 != nil { 11096 span.LogFields(spanlog.Error(resultVar1)) 11097 ext.Error.Set(span, true) 11098 } 11099 11100 return resultVar0, resultVar1 11101 } 11102 11103 func (a *OpenTracingAppLayer) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) { 11104 origCtx := a.ctx 11105 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchScheme") 11106 11107 a.ctx = newCtx 11108 a.app.Srv().Store.SetContext(newCtx) 11109 defer func() { 11110 a.app.Srv().Store.SetContext(origCtx) 11111 a.ctx = origCtx 11112 }() 11113 11114 defer span.Finish() 11115 resultVar0, resultVar1 := a.app.PatchScheme(scheme, patch) 11116 11117 if resultVar1 != nil { 11118 span.LogFields(spanlog.Error(resultVar1)) 11119 ext.Error.Set(span, true) 11120 } 11121 11122 return resultVar0, resultVar1 11123 } 11124 11125 func (a *OpenTracingAppLayer) PatchTeam(teamID string, patch *model.TeamPatch) (*model.Team, *model.AppError) { 11126 origCtx := a.ctx 11127 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchTeam") 11128 11129 a.ctx = newCtx 11130 a.app.Srv().Store.SetContext(newCtx) 11131 defer func() { 11132 a.app.Srv().Store.SetContext(origCtx) 11133 a.ctx = origCtx 11134 }() 11135 11136 defer span.Finish() 11137 resultVar0, resultVar1 := a.app.PatchTeam(teamID, patch) 11138 11139 if resultVar1 != nil { 11140 span.LogFields(spanlog.Error(resultVar1)) 11141 ext.Error.Set(span, true) 11142 } 11143 11144 return resultVar0, resultVar1 11145 } 11146 11147 func (a *OpenTracingAppLayer) PatchUser(userID string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { 11148 origCtx := a.ctx 11149 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchUser") 11150 11151 a.ctx = newCtx 11152 a.app.Srv().Store.SetContext(newCtx) 11153 defer func() { 11154 a.app.Srv().Store.SetContext(origCtx) 11155 a.ctx = origCtx 11156 }() 11157 11158 defer span.Finish() 11159 resultVar0, resultVar1 := a.app.PatchUser(userID, patch, asAdmin) 11160 11161 if resultVar1 != nil { 11162 span.LogFields(spanlog.Error(resultVar1)) 11163 ext.Error.Set(span, true) 11164 } 11165 11166 return resultVar0, resultVar1 11167 } 11168 11169 func (a *OpenTracingAppLayer) PermanentDeleteAllUsers() *model.AppError { 11170 origCtx := a.ctx 11171 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteAllUsers") 11172 11173 a.ctx = newCtx 11174 a.app.Srv().Store.SetContext(newCtx) 11175 defer func() { 11176 a.app.Srv().Store.SetContext(origCtx) 11177 a.ctx = origCtx 11178 }() 11179 11180 defer span.Finish() 11181 resultVar0 := a.app.PermanentDeleteAllUsers() 11182 11183 if resultVar0 != nil { 11184 span.LogFields(spanlog.Error(resultVar0)) 11185 ext.Error.Set(span, true) 11186 } 11187 11188 return resultVar0 11189 } 11190 11191 func (a *OpenTracingAppLayer) PermanentDeleteBot(botUserId string) *model.AppError { 11192 origCtx := a.ctx 11193 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteBot") 11194 11195 a.ctx = newCtx 11196 a.app.Srv().Store.SetContext(newCtx) 11197 defer func() { 11198 a.app.Srv().Store.SetContext(origCtx) 11199 a.ctx = origCtx 11200 }() 11201 11202 defer span.Finish() 11203 resultVar0 := a.app.PermanentDeleteBot(botUserId) 11204 11205 if resultVar0 != nil { 11206 span.LogFields(spanlog.Error(resultVar0)) 11207 ext.Error.Set(span, true) 11208 } 11209 11210 return resultVar0 11211 } 11212 11213 func (a *OpenTracingAppLayer) PermanentDeleteChannel(channel *model.Channel) *model.AppError { 11214 origCtx := a.ctx 11215 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteChannel") 11216 11217 a.ctx = newCtx 11218 a.app.Srv().Store.SetContext(newCtx) 11219 defer func() { 11220 a.app.Srv().Store.SetContext(origCtx) 11221 a.ctx = origCtx 11222 }() 11223 11224 defer span.Finish() 11225 resultVar0 := a.app.PermanentDeleteChannel(channel) 11226 11227 if resultVar0 != nil { 11228 span.LogFields(spanlog.Error(resultVar0)) 11229 ext.Error.Set(span, true) 11230 } 11231 11232 return resultVar0 11233 } 11234 11235 func (a *OpenTracingAppLayer) PermanentDeleteTeam(team *model.Team) *model.AppError { 11236 origCtx := a.ctx 11237 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeam") 11238 11239 a.ctx = newCtx 11240 a.app.Srv().Store.SetContext(newCtx) 11241 defer func() { 11242 a.app.Srv().Store.SetContext(origCtx) 11243 a.ctx = origCtx 11244 }() 11245 11246 defer span.Finish() 11247 resultVar0 := a.app.PermanentDeleteTeam(team) 11248 11249 if resultVar0 != nil { 11250 span.LogFields(spanlog.Error(resultVar0)) 11251 ext.Error.Set(span, true) 11252 } 11253 11254 return resultVar0 11255 } 11256 11257 func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamID string) *model.AppError { 11258 origCtx := a.ctx 11259 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeamId") 11260 11261 a.ctx = newCtx 11262 a.app.Srv().Store.SetContext(newCtx) 11263 defer func() { 11264 a.app.Srv().Store.SetContext(origCtx) 11265 a.ctx = origCtx 11266 }() 11267 11268 defer span.Finish() 11269 resultVar0 := a.app.PermanentDeleteTeamId(teamID) 11270 11271 if resultVar0 != nil { 11272 span.LogFields(spanlog.Error(resultVar0)) 11273 ext.Error.Set(span, true) 11274 } 11275 11276 return resultVar0 11277 } 11278 11279 func (a *OpenTracingAppLayer) PermanentDeleteUser(user *model.User) *model.AppError { 11280 origCtx := a.ctx 11281 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteUser") 11282 11283 a.ctx = newCtx 11284 a.app.Srv().Store.SetContext(newCtx) 11285 defer func() { 11286 a.app.Srv().Store.SetContext(origCtx) 11287 a.ctx = origCtx 11288 }() 11289 11290 defer span.Finish() 11291 resultVar0 := a.app.PermanentDeleteUser(user) 11292 11293 if resultVar0 != nil { 11294 span.LogFields(spanlog.Error(resultVar0)) 11295 ext.Error.Set(span, true) 11296 } 11297 11298 return resultVar0 11299 } 11300 11301 func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamID string) []*model.Command { 11302 origCtx := a.ctx 11303 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginCommandsForTeam") 11304 11305 a.ctx = newCtx 11306 a.app.Srv().Store.SetContext(newCtx) 11307 defer func() { 11308 a.app.Srv().Store.SetContext(origCtx) 11309 a.ctx = origCtx 11310 }() 11311 11312 defer span.Finish() 11313 resultVar0 := a.app.PluginCommandsForTeam(teamID) 11314 11315 return resultVar0 11316 } 11317 11318 func (a *OpenTracingAppLayer) PluginContext() *plugin.Context { 11319 origCtx := a.ctx 11320 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginContext") 11321 11322 a.ctx = newCtx 11323 a.app.Srv().Store.SetContext(newCtx) 11324 defer func() { 11325 a.app.Srv().Store.SetContext(origCtx) 11326 a.ctx = origCtx 11327 }() 11328 11329 defer span.Finish() 11330 resultVar0 := a.app.PluginContext() 11331 11332 return resultVar0 11333 } 11334 11335 func (a *OpenTracingAppLayer) PostActionCookieSecret() []byte { 11336 origCtx := a.ctx 11337 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostActionCookieSecret") 11338 11339 a.ctx = newCtx 11340 a.app.Srv().Store.SetContext(newCtx) 11341 defer func() { 11342 a.app.Srv().Store.SetContext(origCtx) 11343 a.ctx = origCtx 11344 }() 11345 11346 defer span.Finish() 11347 resultVar0 := a.app.PostActionCookieSecret() 11348 11349 return resultVar0 11350 } 11351 11352 func (a *OpenTracingAppLayer) PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError { 11353 origCtx := a.ctx 11354 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostAddToChannelMessage") 11355 11356 a.ctx = newCtx 11357 a.app.Srv().Store.SetContext(newCtx) 11358 defer func() { 11359 a.app.Srv().Store.SetContext(origCtx) 11360 a.ctx = origCtx 11361 }() 11362 11363 defer span.Finish() 11364 resultVar0 := a.app.PostAddToChannelMessage(user, addedUser, channel, postRootId) 11365 11366 if resultVar0 != nil { 11367 span.LogFields(spanlog.Error(resultVar0)) 11368 ext.Error.Set(span, true) 11369 } 11370 11371 return resultVar0 11372 } 11373 11374 func (a *OpenTracingAppLayer) PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch { 11375 origCtx := a.ctx 11376 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostPatchWithProxyRemovedFromImageURLs") 11377 11378 a.ctx = newCtx 11379 a.app.Srv().Store.SetContext(newCtx) 11380 defer func() { 11381 a.app.Srv().Store.SetContext(origCtx) 11382 a.ctx = origCtx 11383 }() 11384 11385 defer span.Finish() 11386 resultVar0 := a.app.PostPatchWithProxyRemovedFromImageURLs(patch) 11387 11388 return resultVar0 11389 } 11390 11391 func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userID string, channel *model.Channel, oldChannelDisplayName string, newChannelDisplayName string) *model.AppError { 11392 origCtx := a.ctx 11393 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelDisplayNameMessage") 11394 11395 a.ctx = newCtx 11396 a.app.Srv().Store.SetContext(newCtx) 11397 defer func() { 11398 a.app.Srv().Store.SetContext(origCtx) 11399 a.ctx = origCtx 11400 }() 11401 11402 defer span.Finish() 11403 resultVar0 := a.app.PostUpdateChannelDisplayNameMessage(userID, channel, oldChannelDisplayName, newChannelDisplayName) 11404 11405 if resultVar0 != nil { 11406 span.LogFields(spanlog.Error(resultVar0)) 11407 ext.Error.Set(span, true) 11408 } 11409 11410 return resultVar0 11411 } 11412 11413 func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userID string, channel *model.Channel, oldChannelHeader string, newChannelHeader string) *model.AppError { 11414 origCtx := a.ctx 11415 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelHeaderMessage") 11416 11417 a.ctx = newCtx 11418 a.app.Srv().Store.SetContext(newCtx) 11419 defer func() { 11420 a.app.Srv().Store.SetContext(origCtx) 11421 a.ctx = origCtx 11422 }() 11423 11424 defer span.Finish() 11425 resultVar0 := a.app.PostUpdateChannelHeaderMessage(userID, channel, oldChannelHeader, newChannelHeader) 11426 11427 if resultVar0 != nil { 11428 span.LogFields(spanlog.Error(resultVar0)) 11429 ext.Error.Set(span, true) 11430 } 11431 11432 return resultVar0 11433 } 11434 11435 func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(userID string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { 11436 origCtx := a.ctx 11437 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelPurposeMessage") 11438 11439 a.ctx = newCtx 11440 a.app.Srv().Store.SetContext(newCtx) 11441 defer func() { 11442 a.app.Srv().Store.SetContext(origCtx) 11443 a.ctx = origCtx 11444 }() 11445 11446 defer span.Finish() 11447 resultVar0 := a.app.PostUpdateChannelPurposeMessage(userID, channel, oldChannelPurpose, newChannelPurpose) 11448 11449 if resultVar0 != nil { 11450 span.LogFields(spanlog.Error(resultVar0)) 11451 ext.Error.Set(span, true) 11452 } 11453 11454 return resultVar0 11455 } 11456 11457 func (a *OpenTracingAppLayer) PostWithProxyAddedToImageURLs(post *model.Post) *model.Post { 11458 origCtx := a.ctx 11459 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyAddedToImageURLs") 11460 11461 a.ctx = newCtx 11462 a.app.Srv().Store.SetContext(newCtx) 11463 defer func() { 11464 a.app.Srv().Store.SetContext(origCtx) 11465 a.ctx = origCtx 11466 }() 11467 11468 defer span.Finish() 11469 resultVar0 := a.app.PostWithProxyAddedToImageURLs(post) 11470 11471 return resultVar0 11472 } 11473 11474 func (a *OpenTracingAppLayer) PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post { 11475 origCtx := a.ctx 11476 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyRemovedFromImageURLs") 11477 11478 a.ctx = newCtx 11479 a.app.Srv().Store.SetContext(newCtx) 11480 defer func() { 11481 a.app.Srv().Store.SetContext(origCtx) 11482 a.ctx = origCtx 11483 }() 11484 11485 defer span.Finish() 11486 resultVar0 := a.app.PostWithProxyRemovedFromImageURLs(post) 11487 11488 return resultVar0 11489 } 11490 11491 func (a *OpenTracingAppLayer) PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post { 11492 origCtx := a.ctx 11493 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostForClient") 11494 11495 a.ctx = newCtx 11496 a.app.Srv().Store.SetContext(newCtx) 11497 defer func() { 11498 a.app.Srv().Store.SetContext(origCtx) 11499 a.ctx = origCtx 11500 }() 11501 11502 defer span.Finish() 11503 resultVar0 := a.app.PreparePostForClient(originalPost, isNewPost, isEditPost) 11504 11505 return resultVar0 11506 } 11507 11508 func (a *OpenTracingAppLayer) PreparePostListForClient(originalList *model.PostList) *model.PostList { 11509 origCtx := a.ctx 11510 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostListForClient") 11511 11512 a.ctx = newCtx 11513 a.app.Srv().Store.SetContext(newCtx) 11514 defer func() { 11515 a.app.Srv().Store.SetContext(origCtx) 11516 a.ctx = origCtx 11517 }() 11518 11519 defer span.Finish() 11520 resultVar0 := a.app.PreparePostListForClient(originalList) 11521 11522 return resultVar0 11523 } 11524 11525 func (a *OpenTracingAppLayer) ProcessSlackAttachments(attachments []*model.SlackAttachment) []*model.SlackAttachment { 11526 origCtx := a.ctx 11527 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackAttachments") 11528 11529 a.ctx = newCtx 11530 a.app.Srv().Store.SetContext(newCtx) 11531 defer func() { 11532 a.app.Srv().Store.SetContext(origCtx) 11533 a.ctx = origCtx 11534 }() 11535 11536 defer span.Finish() 11537 resultVar0 := a.app.ProcessSlackAttachments(attachments) 11538 11539 return resultVar0 11540 } 11541 11542 func (a *OpenTracingAppLayer) ProcessSlackText(text string) string { 11543 origCtx := a.ctx 11544 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackText") 11545 11546 a.ctx = newCtx 11547 a.app.Srv().Store.SetContext(newCtx) 11548 defer func() { 11549 a.app.Srv().Store.SetContext(origCtx) 11550 a.ctx = origCtx 11551 }() 11552 11553 defer span.Finish() 11554 resultVar0 := a.app.ProcessSlackText(text) 11555 11556 return resultVar0 11557 } 11558 11559 func (a *OpenTracingAppLayer) PromoteGuestToUser(user *model.User, requestorId string) *model.AppError { 11560 origCtx := a.ctx 11561 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PromoteGuestToUser") 11562 11563 a.ctx = newCtx 11564 a.app.Srv().Store.SetContext(newCtx) 11565 defer func() { 11566 a.app.Srv().Store.SetContext(origCtx) 11567 a.ctx = origCtx 11568 }() 11569 11570 defer span.Finish() 11571 resultVar0 := a.app.PromoteGuestToUser(user, requestorId) 11572 11573 if resultVar0 != nil { 11574 span.LogFields(spanlog.Error(resultVar0)) 11575 ext.Error.Set(span, true) 11576 } 11577 11578 return resultVar0 11579 } 11580 11581 func (a *OpenTracingAppLayer) Publish(message *model.WebSocketEvent) { 11582 origCtx := a.ctx 11583 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Publish") 11584 11585 a.ctx = newCtx 11586 a.app.Srv().Store.SetContext(newCtx) 11587 defer func() { 11588 a.app.Srv().Store.SetContext(origCtx) 11589 a.ctx = origCtx 11590 }() 11591 11592 defer span.Finish() 11593 a.app.Publish(message) 11594 } 11595 11596 func (a *OpenTracingAppLayer) PublishSkipClusterSend(message *model.WebSocketEvent) { 11597 origCtx := a.ctx 11598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishSkipClusterSend") 11599 11600 a.ctx = newCtx 11601 a.app.Srv().Store.SetContext(newCtx) 11602 defer func() { 11603 a.app.Srv().Store.SetContext(origCtx) 11604 a.ctx = origCtx 11605 }() 11606 11607 defer span.Finish() 11608 a.app.PublishSkipClusterSend(message) 11609 } 11610 11611 func (a *OpenTracingAppLayer) PublishUserTyping(userID string, channelId string, parentId string) *model.AppError { 11612 origCtx := a.ctx 11613 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishUserTyping") 11614 11615 a.ctx = newCtx 11616 a.app.Srv().Store.SetContext(newCtx) 11617 defer func() { 11618 a.app.Srv().Store.SetContext(origCtx) 11619 a.ctx = origCtx 11620 }() 11621 11622 defer span.Finish() 11623 resultVar0 := a.app.PublishUserTyping(userID, channelId, parentId) 11624 11625 if resultVar0 != nil { 11626 span.LogFields(spanlog.Error(resultVar0)) 11627 ext.Error.Set(span, true) 11628 } 11629 11630 return resultVar0 11631 } 11632 11633 func (a *OpenTracingAppLayer) PurgeBleveIndexes() *model.AppError { 11634 origCtx := a.ctx 11635 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeBleveIndexes") 11636 11637 a.ctx = newCtx 11638 a.app.Srv().Store.SetContext(newCtx) 11639 defer func() { 11640 a.app.Srv().Store.SetContext(origCtx) 11641 a.ctx = origCtx 11642 }() 11643 11644 defer span.Finish() 11645 resultVar0 := a.app.PurgeBleveIndexes() 11646 11647 if resultVar0 != nil { 11648 span.LogFields(spanlog.Error(resultVar0)) 11649 ext.Error.Set(span, true) 11650 } 11651 11652 return resultVar0 11653 } 11654 11655 func (a *OpenTracingAppLayer) PurgeElasticsearchIndexes() *model.AppError { 11656 origCtx := a.ctx 11657 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeElasticsearchIndexes") 11658 11659 a.ctx = newCtx 11660 a.app.Srv().Store.SetContext(newCtx) 11661 defer func() { 11662 a.app.Srv().Store.SetContext(origCtx) 11663 a.ctx = origCtx 11664 }() 11665 11666 defer span.Finish() 11667 resultVar0 := a.app.PurgeElasticsearchIndexes() 11668 11669 if resultVar0 != nil { 11670 span.LogFields(spanlog.Error(resultVar0)) 11671 ext.Error.Set(span, true) 11672 } 11673 11674 return resultVar0 11675 } 11676 11677 func (a *OpenTracingAppLayer) ReadFile(path string) ([]byte, *model.AppError) { 11678 origCtx := a.ctx 11679 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReadFile") 11680 11681 a.ctx = newCtx 11682 a.app.Srv().Store.SetContext(newCtx) 11683 defer func() { 11684 a.app.Srv().Store.SetContext(origCtx) 11685 a.ctx = origCtx 11686 }() 11687 11688 defer span.Finish() 11689 resultVar0, resultVar1 := a.app.ReadFile(path) 11690 11691 if resultVar1 != nil { 11692 span.LogFields(spanlog.Error(resultVar1)) 11693 ext.Error.Set(span, true) 11694 } 11695 11696 return resultVar0, resultVar1 11697 } 11698 11699 func (a *OpenTracingAppLayer) RecycleDatabaseConnection() { 11700 origCtx := a.ctx 11701 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RecycleDatabaseConnection") 11702 11703 a.ctx = newCtx 11704 a.app.Srv().Store.SetContext(newCtx) 11705 defer func() { 11706 a.app.Srv().Store.SetContext(origCtx) 11707 a.ctx = origCtx 11708 }() 11709 11710 defer span.Finish() 11711 a.app.RecycleDatabaseConnection() 11712 } 11713 11714 func (a *OpenTracingAppLayer) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) { 11715 origCtx := a.ctx 11716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenCommandToken") 11717 11718 a.ctx = newCtx 11719 a.app.Srv().Store.SetContext(newCtx) 11720 defer func() { 11721 a.app.Srv().Store.SetContext(origCtx) 11722 a.ctx = origCtx 11723 }() 11724 11725 defer span.Finish() 11726 resultVar0, resultVar1 := a.app.RegenCommandToken(cmd) 11727 11728 if resultVar1 != nil { 11729 span.LogFields(spanlog.Error(resultVar1)) 11730 ext.Error.Set(span, true) 11731 } 11732 11733 return resultVar0, resultVar1 11734 } 11735 11736 func (a *OpenTracingAppLayer) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 11737 origCtx := a.ctx 11738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenOutgoingWebhookToken") 11739 11740 a.ctx = newCtx 11741 a.app.Srv().Store.SetContext(newCtx) 11742 defer func() { 11743 a.app.Srv().Store.SetContext(origCtx) 11744 a.ctx = origCtx 11745 }() 11746 11747 defer span.Finish() 11748 resultVar0, resultVar1 := a.app.RegenOutgoingWebhookToken(hook) 11749 11750 if resultVar1 != nil { 11751 span.LogFields(spanlog.Error(resultVar1)) 11752 ext.Error.Set(span, true) 11753 } 11754 11755 return resultVar0, resultVar1 11756 } 11757 11758 func (a *OpenTracingAppLayer) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 11759 origCtx := a.ctx 11760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateOAuthAppSecret") 11761 11762 a.ctx = newCtx 11763 a.app.Srv().Store.SetContext(newCtx) 11764 defer func() { 11765 a.app.Srv().Store.SetContext(origCtx) 11766 a.ctx = origCtx 11767 }() 11768 11769 defer span.Finish() 11770 resultVar0, resultVar1 := a.app.RegenerateOAuthAppSecret(app) 11771 11772 if resultVar1 != nil { 11773 span.LogFields(spanlog.Error(resultVar1)) 11774 ext.Error.Set(span, true) 11775 } 11776 11777 return resultVar0, resultVar1 11778 } 11779 11780 func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamID string) (*model.Team, *model.AppError) { 11781 origCtx := a.ctx 11782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateTeamInviteId") 11783 11784 a.ctx = newCtx 11785 a.app.Srv().Store.SetContext(newCtx) 11786 defer func() { 11787 a.app.Srv().Store.SetContext(origCtx) 11788 a.ctx = origCtx 11789 }() 11790 11791 defer span.Finish() 11792 resultVar0, resultVar1 := a.app.RegenerateTeamInviteId(teamID) 11793 11794 if resultVar1 != nil { 11795 span.LogFields(spanlog.Error(resultVar1)) 11796 ext.Error.Set(span, true) 11797 } 11798 11799 return resultVar0, resultVar1 11800 } 11801 11802 func (a *OpenTracingAppLayer) RegisterPluginCommand(pluginId string, command *model.Command) error { 11803 origCtx := a.ctx 11804 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegisterPluginCommand") 11805 11806 a.ctx = newCtx 11807 a.app.Srv().Store.SetContext(newCtx) 11808 defer func() { 11809 a.app.Srv().Store.SetContext(origCtx) 11810 a.ctx = origCtx 11811 }() 11812 11813 defer span.Finish() 11814 resultVar0 := a.app.RegisterPluginCommand(pluginId, command) 11815 11816 if resultVar0 != nil { 11817 span.LogFields(spanlog.Error(resultVar0)) 11818 ext.Error.Set(span, true) 11819 } 11820 11821 return resultVar0 11822 } 11823 11824 func (a *OpenTracingAppLayer) ReloadConfig() error { 11825 origCtx := a.ctx 11826 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReloadConfig") 11827 11828 a.ctx = newCtx 11829 a.app.Srv().Store.SetContext(newCtx) 11830 defer func() { 11831 a.app.Srv().Store.SetContext(origCtx) 11832 a.ctx = origCtx 11833 }() 11834 11835 defer span.Finish() 11836 resultVar0 := a.app.ReloadConfig() 11837 11838 if resultVar0 != nil { 11839 span.LogFields(spanlog.Error(resultVar0)) 11840 ext.Error.Set(span, true) 11841 } 11842 11843 return resultVar0 11844 } 11845 11846 func (a *OpenTracingAppLayer) RemoveAllDeactivatedMembersFromChannel(channel *model.Channel) *model.AppError { 11847 origCtx := a.ctx 11848 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveAllDeactivatedMembersFromChannel") 11849 11850 a.ctx = newCtx 11851 a.app.Srv().Store.SetContext(newCtx) 11852 defer func() { 11853 a.app.Srv().Store.SetContext(origCtx) 11854 a.ctx = origCtx 11855 }() 11856 11857 defer span.Finish() 11858 resultVar0 := a.app.RemoveAllDeactivatedMembersFromChannel(channel) 11859 11860 if resultVar0 != nil { 11861 span.LogFields(spanlog.Error(resultVar0)) 11862 ext.Error.Set(span, true) 11863 } 11864 11865 return resultVar0 11866 } 11867 11868 func (a *OpenTracingAppLayer) RemoveConfigListener(id string) { 11869 origCtx := a.ctx 11870 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveConfigListener") 11871 11872 a.ctx = newCtx 11873 a.app.Srv().Store.SetContext(newCtx) 11874 defer func() { 11875 a.app.Srv().Store.SetContext(origCtx) 11876 a.ctx = origCtx 11877 }() 11878 11879 defer span.Finish() 11880 a.app.RemoveConfigListener(id) 11881 } 11882 11883 func (a *OpenTracingAppLayer) RemoveCustomStatus(userID string) *model.AppError { 11884 origCtx := a.ctx 11885 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveCustomStatus") 11886 11887 a.ctx = newCtx 11888 a.app.Srv().Store.SetContext(newCtx) 11889 defer func() { 11890 a.app.Srv().Store.SetContext(origCtx) 11891 a.ctx = origCtx 11892 }() 11893 11894 defer span.Finish() 11895 resultVar0 := a.app.RemoveCustomStatus(userID) 11896 11897 if resultVar0 != nil { 11898 span.LogFields(spanlog.Error(resultVar0)) 11899 ext.Error.Set(span, true) 11900 } 11901 11902 return resultVar0 11903 } 11904 11905 func (a *OpenTracingAppLayer) RemoveDirectory(path string) *model.AppError { 11906 origCtx := a.ctx 11907 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveDirectory") 11908 11909 a.ctx = newCtx 11910 a.app.Srv().Store.SetContext(newCtx) 11911 defer func() { 11912 a.app.Srv().Store.SetContext(origCtx) 11913 a.ctx = origCtx 11914 }() 11915 11916 defer span.Finish() 11917 resultVar0 := a.app.RemoveDirectory(path) 11918 11919 if resultVar0 != nil { 11920 span.LogFields(spanlog.Error(resultVar0)) 11921 ext.Error.Set(span, true) 11922 } 11923 11924 return resultVar0 11925 } 11926 11927 func (a *OpenTracingAppLayer) RemoveFile(path string) *model.AppError { 11928 origCtx := a.ctx 11929 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveFile") 11930 11931 a.ctx = newCtx 11932 a.app.Srv().Store.SetContext(newCtx) 11933 defer func() { 11934 a.app.Srv().Store.SetContext(origCtx) 11935 a.ctx = origCtx 11936 }() 11937 11938 defer span.Finish() 11939 resultVar0 := a.app.RemoveFile(path) 11940 11941 if resultVar0 != nil { 11942 span.LogFields(spanlog.Error(resultVar0)) 11943 ext.Error.Set(span, true) 11944 } 11945 11946 return resultVar0 11947 } 11948 11949 func (a *OpenTracingAppLayer) RemoveLdapPrivateCertificate() *model.AppError { 11950 origCtx := a.ctx 11951 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLdapPrivateCertificate") 11952 11953 a.ctx = newCtx 11954 a.app.Srv().Store.SetContext(newCtx) 11955 defer func() { 11956 a.app.Srv().Store.SetContext(origCtx) 11957 a.ctx = origCtx 11958 }() 11959 11960 defer span.Finish() 11961 resultVar0 := a.app.RemoveLdapPrivateCertificate() 11962 11963 if resultVar0 != nil { 11964 span.LogFields(spanlog.Error(resultVar0)) 11965 ext.Error.Set(span, true) 11966 } 11967 11968 return resultVar0 11969 } 11970 11971 func (a *OpenTracingAppLayer) RemoveLdapPublicCertificate() *model.AppError { 11972 origCtx := a.ctx 11973 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLdapPublicCertificate") 11974 11975 a.ctx = newCtx 11976 a.app.Srv().Store.SetContext(newCtx) 11977 defer func() { 11978 a.app.Srv().Store.SetContext(origCtx) 11979 a.ctx = origCtx 11980 }() 11981 11982 defer span.Finish() 11983 resultVar0 := a.app.RemoveLdapPublicCertificate() 11984 11985 if resultVar0 != nil { 11986 span.LogFields(spanlog.Error(resultVar0)) 11987 ext.Error.Set(span, true) 11988 } 11989 11990 return resultVar0 11991 } 11992 11993 func (a *OpenTracingAppLayer) RemovePlugin(id string) *model.AppError { 11994 origCtx := a.ctx 11995 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePlugin") 11996 11997 a.ctx = newCtx 11998 a.app.Srv().Store.SetContext(newCtx) 11999 defer func() { 12000 a.app.Srv().Store.SetContext(origCtx) 12001 a.ctx = origCtx 12002 }() 12003 12004 defer span.Finish() 12005 resultVar0 := a.app.RemovePlugin(id) 12006 12007 if resultVar0 != nil { 12008 span.LogFields(spanlog.Error(resultVar0)) 12009 ext.Error.Set(span, true) 12010 } 12011 12012 return resultVar0 12013 } 12014 12015 func (a *OpenTracingAppLayer) RemovePluginFromData(data model.PluginEventData) { 12016 origCtx := a.ctx 12017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePluginFromData") 12018 12019 a.ctx = newCtx 12020 a.app.Srv().Store.SetContext(newCtx) 12021 defer func() { 12022 a.app.Srv().Store.SetContext(origCtx) 12023 a.ctx = origCtx 12024 }() 12025 12026 defer span.Finish() 12027 a.app.RemovePluginFromData(data) 12028 } 12029 12030 func (a *OpenTracingAppLayer) RemoveRecentCustomStatus(userID string, status *model.CustomStatus) *model.AppError { 12031 origCtx := a.ctx 12032 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveRecentCustomStatus") 12033 12034 a.ctx = newCtx 12035 a.app.Srv().Store.SetContext(newCtx) 12036 defer func() { 12037 a.app.Srv().Store.SetContext(origCtx) 12038 a.ctx = origCtx 12039 }() 12040 12041 defer span.Finish() 12042 resultVar0 := a.app.RemoveRecentCustomStatus(userID, status) 12043 12044 if resultVar0 != nil { 12045 span.LogFields(spanlog.Error(resultVar0)) 12046 ext.Error.Set(span, true) 12047 } 12048 12049 return resultVar0 12050 } 12051 12052 func (a *OpenTracingAppLayer) RemoveSamlIdpCertificate() *model.AppError { 12053 origCtx := a.ctx 12054 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlIdpCertificate") 12055 12056 a.ctx = newCtx 12057 a.app.Srv().Store.SetContext(newCtx) 12058 defer func() { 12059 a.app.Srv().Store.SetContext(origCtx) 12060 a.ctx = origCtx 12061 }() 12062 12063 defer span.Finish() 12064 resultVar0 := a.app.RemoveSamlIdpCertificate() 12065 12066 if resultVar0 != nil { 12067 span.LogFields(spanlog.Error(resultVar0)) 12068 ext.Error.Set(span, true) 12069 } 12070 12071 return resultVar0 12072 } 12073 12074 func (a *OpenTracingAppLayer) RemoveSamlPrivateCertificate() *model.AppError { 12075 origCtx := a.ctx 12076 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPrivateCertificate") 12077 12078 a.ctx = newCtx 12079 a.app.Srv().Store.SetContext(newCtx) 12080 defer func() { 12081 a.app.Srv().Store.SetContext(origCtx) 12082 a.ctx = origCtx 12083 }() 12084 12085 defer span.Finish() 12086 resultVar0 := a.app.RemoveSamlPrivateCertificate() 12087 12088 if resultVar0 != nil { 12089 span.LogFields(spanlog.Error(resultVar0)) 12090 ext.Error.Set(span, true) 12091 } 12092 12093 return resultVar0 12094 } 12095 12096 func (a *OpenTracingAppLayer) RemoveSamlPublicCertificate() *model.AppError { 12097 origCtx := a.ctx 12098 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPublicCertificate") 12099 12100 a.ctx = newCtx 12101 a.app.Srv().Store.SetContext(newCtx) 12102 defer func() { 12103 a.app.Srv().Store.SetContext(origCtx) 12104 a.ctx = origCtx 12105 }() 12106 12107 defer span.Finish() 12108 resultVar0 := a.app.RemoveSamlPublicCertificate() 12109 12110 if resultVar0 != nil { 12111 span.LogFields(spanlog.Error(resultVar0)) 12112 ext.Error.Set(span, true) 12113 } 12114 12115 return resultVar0 12116 } 12117 12118 func (a *OpenTracingAppLayer) RemoveTeamIcon(teamID string) *model.AppError { 12119 origCtx := a.ctx 12120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamIcon") 12121 12122 a.ctx = newCtx 12123 a.app.Srv().Store.SetContext(newCtx) 12124 defer func() { 12125 a.app.Srv().Store.SetContext(origCtx) 12126 a.ctx = origCtx 12127 }() 12128 12129 defer span.Finish() 12130 resultVar0 := a.app.RemoveTeamIcon(teamID) 12131 12132 if resultVar0 != nil { 12133 span.LogFields(spanlog.Error(resultVar0)) 12134 ext.Error.Set(span, true) 12135 } 12136 12137 return resultVar0 12138 } 12139 12140 func (a *OpenTracingAppLayer) RemoveTeamMemberFromTeam(teamMember *model.TeamMember, requestorId string) *model.AppError { 12141 origCtx := a.ctx 12142 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamMemberFromTeam") 12143 12144 a.ctx = newCtx 12145 a.app.Srv().Store.SetContext(newCtx) 12146 defer func() { 12147 a.app.Srv().Store.SetContext(origCtx) 12148 a.ctx = origCtx 12149 }() 12150 12151 defer span.Finish() 12152 resultVar0 := a.app.RemoveTeamMemberFromTeam(teamMember, requestorId) 12153 12154 if resultVar0 != nil { 12155 span.LogFields(spanlog.Error(resultVar0)) 12156 ext.Error.Set(span, true) 12157 } 12158 12159 return resultVar0 12160 } 12161 12162 func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIDToRemove string, removerUserId string, channel *model.Channel) *model.AppError { 12163 origCtx := a.ctx 12164 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromChannel") 12165 12166 a.ctx = newCtx 12167 a.app.Srv().Store.SetContext(newCtx) 12168 defer func() { 12169 a.app.Srv().Store.SetContext(origCtx) 12170 a.ctx = origCtx 12171 }() 12172 12173 defer span.Finish() 12174 resultVar0 := a.app.RemoveUserFromChannel(userIDToRemove, removerUserId, channel) 12175 12176 if resultVar0 != nil { 12177 span.LogFields(spanlog.Error(resultVar0)) 12178 ext.Error.Set(span, true) 12179 } 12180 12181 return resultVar0 12182 } 12183 12184 func (a *OpenTracingAppLayer) RemoveUserFromTeam(teamID string, userID string, requestorId string) *model.AppError { 12185 origCtx := a.ctx 12186 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromTeam") 12187 12188 a.ctx = newCtx 12189 a.app.Srv().Store.SetContext(newCtx) 12190 defer func() { 12191 a.app.Srv().Store.SetContext(origCtx) 12192 a.ctx = origCtx 12193 }() 12194 12195 defer span.Finish() 12196 resultVar0 := a.app.RemoveUserFromTeam(teamID, userID, requestorId) 12197 12198 if resultVar0 != nil { 12199 span.LogFields(spanlog.Error(resultVar0)) 12200 ext.Error.Set(span, true) 12201 } 12202 12203 return resultVar0 12204 } 12205 12206 func (a *OpenTracingAppLayer) RemoveUsersFromChannelNotMemberOfTeam(remover *model.User, channel *model.Channel, team *model.Team) *model.AppError { 12207 origCtx := a.ctx 12208 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUsersFromChannelNotMemberOfTeam") 12209 12210 a.ctx = newCtx 12211 a.app.Srv().Store.SetContext(newCtx) 12212 defer func() { 12213 a.app.Srv().Store.SetContext(origCtx) 12214 a.ctx = origCtx 12215 }() 12216 12217 defer span.Finish() 12218 resultVar0 := a.app.RemoveUsersFromChannelNotMemberOfTeam(remover, channel, team) 12219 12220 if resultVar0 != nil { 12221 span.LogFields(spanlog.Error(resultVar0)) 12222 ext.Error.Set(span, true) 12223 } 12224 12225 return resultVar0 12226 } 12227 12228 func (a *OpenTracingAppLayer) RenameChannel(channel *model.Channel, newChannelName string, newDisplayName string) (*model.Channel, *model.AppError) { 12229 origCtx := a.ctx 12230 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameChannel") 12231 12232 a.ctx = newCtx 12233 a.app.Srv().Store.SetContext(newCtx) 12234 defer func() { 12235 a.app.Srv().Store.SetContext(origCtx) 12236 a.ctx = origCtx 12237 }() 12238 12239 defer span.Finish() 12240 resultVar0, resultVar1 := a.app.RenameChannel(channel, newChannelName, newDisplayName) 12241 12242 if resultVar1 != nil { 12243 span.LogFields(spanlog.Error(resultVar1)) 12244 ext.Error.Set(span, true) 12245 } 12246 12247 return resultVar0, resultVar1 12248 } 12249 12250 func (a *OpenTracingAppLayer) RenameTeam(team *model.Team, newTeamName string, newDisplayName string) (*model.Team, *model.AppError) { 12251 origCtx := a.ctx 12252 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameTeam") 12253 12254 a.ctx = newCtx 12255 a.app.Srv().Store.SetContext(newCtx) 12256 defer func() { 12257 a.app.Srv().Store.SetContext(origCtx) 12258 a.ctx = origCtx 12259 }() 12260 12261 defer span.Finish() 12262 resultVar0, resultVar1 := a.app.RenameTeam(team, newTeamName, newDisplayName) 12263 12264 if resultVar1 != nil { 12265 span.LogFields(spanlog.Error(resultVar1)) 12266 ext.Error.Set(span, true) 12267 } 12268 12269 return resultVar0, resultVar1 12270 } 12271 12272 func (a *OpenTracingAppLayer) RequestLicenseAndAckWarnMetric(warnMetricId string, isBot bool) *model.AppError { 12273 origCtx := a.ctx 12274 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RequestLicenseAndAckWarnMetric") 12275 12276 a.ctx = newCtx 12277 a.app.Srv().Store.SetContext(newCtx) 12278 defer func() { 12279 a.app.Srv().Store.SetContext(origCtx) 12280 a.ctx = origCtx 12281 }() 12282 12283 defer span.Finish() 12284 resultVar0 := a.app.RequestLicenseAndAckWarnMetric(warnMetricId, isBot) 12285 12286 if resultVar0 != nil { 12287 span.LogFields(spanlog.Error(resultVar0)) 12288 ext.Error.Set(span, true) 12289 } 12290 12291 return resultVar0 12292 } 12293 12294 func (a *OpenTracingAppLayer) ResetPasswordFromToken(userSuppliedTokenString string, newPassword string) *model.AppError { 12295 origCtx := a.ctx 12296 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPasswordFromToken") 12297 12298 a.ctx = newCtx 12299 a.app.Srv().Store.SetContext(newCtx) 12300 defer func() { 12301 a.app.Srv().Store.SetContext(origCtx) 12302 a.ctx = origCtx 12303 }() 12304 12305 defer span.Finish() 12306 resultVar0 := a.app.ResetPasswordFromToken(userSuppliedTokenString, newPassword) 12307 12308 if resultVar0 != nil { 12309 span.LogFields(spanlog.Error(resultVar0)) 12310 ext.Error.Set(span, true) 12311 } 12312 12313 return resultVar0 12314 } 12315 12316 func (a *OpenTracingAppLayer) ResetPermissionsSystem() *model.AppError { 12317 origCtx := a.ctx 12318 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPermissionsSystem") 12319 12320 a.ctx = newCtx 12321 a.app.Srv().Store.SetContext(newCtx) 12322 defer func() { 12323 a.app.Srv().Store.SetContext(origCtx) 12324 a.ctx = origCtx 12325 }() 12326 12327 defer span.Finish() 12328 resultVar0 := a.app.ResetPermissionsSystem() 12329 12330 if resultVar0 != nil { 12331 span.LogFields(spanlog.Error(resultVar0)) 12332 ext.Error.Set(span, true) 12333 } 12334 12335 return resultVar0 12336 } 12337 12338 func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userID string) (*model.Channel, *model.AppError) { 12339 origCtx := a.ctx 12340 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreChannel") 12341 12342 a.ctx = newCtx 12343 a.app.Srv().Store.SetContext(newCtx) 12344 defer func() { 12345 a.app.Srv().Store.SetContext(origCtx) 12346 a.ctx = origCtx 12347 }() 12348 12349 defer span.Finish() 12350 resultVar0, resultVar1 := a.app.RestoreChannel(channel, userID) 12351 12352 if resultVar1 != nil { 12353 span.LogFields(spanlog.Error(resultVar1)) 12354 ext.Error.Set(span, true) 12355 } 12356 12357 return resultVar0, resultVar1 12358 } 12359 12360 func (a *OpenTracingAppLayer) RestoreTeam(teamID string) *model.AppError { 12361 origCtx := a.ctx 12362 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreTeam") 12363 12364 a.ctx = newCtx 12365 a.app.Srv().Store.SetContext(newCtx) 12366 defer func() { 12367 a.app.Srv().Store.SetContext(origCtx) 12368 a.ctx = origCtx 12369 }() 12370 12371 defer span.Finish() 12372 resultVar0 := a.app.RestoreTeam(teamID) 12373 12374 if resultVar0 != nil { 12375 span.LogFields(spanlog.Error(resultVar0)) 12376 ext.Error.Set(span, true) 12377 } 12378 12379 return resultVar0 12380 } 12381 12382 func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userID string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { 12383 origCtx := a.ctx 12384 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersGetByPermissions") 12385 12386 a.ctx = newCtx 12387 a.app.Srv().Store.SetContext(newCtx) 12388 defer func() { 12389 a.app.Srv().Store.SetContext(origCtx) 12390 a.ctx = origCtx 12391 }() 12392 12393 defer span.Finish() 12394 resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userID, options) 12395 12396 if resultVar1 != nil { 12397 span.LogFields(spanlog.Error(resultVar1)) 12398 ext.Error.Set(span, true) 12399 } 12400 12401 return resultVar0, resultVar1 12402 } 12403 12404 func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userID string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { 12405 origCtx := a.ctx 12406 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersSearchByPermissions") 12407 12408 a.ctx = newCtx 12409 a.app.Srv().Store.SetContext(newCtx) 12410 defer func() { 12411 a.app.Srv().Store.SetContext(origCtx) 12412 a.ctx = origCtx 12413 }() 12414 12415 defer span.Finish() 12416 resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userID, options) 12417 12418 if resultVar1 != nil { 12419 span.LogFields(spanlog.Error(resultVar1)) 12420 ext.Error.Set(span, true) 12421 } 12422 12423 return resultVar0, resultVar1 12424 } 12425 12426 func (a *OpenTracingAppLayer) RevokeAccessToken(token string) *model.AppError { 12427 origCtx := a.ctx 12428 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAccessToken") 12429 12430 a.ctx = newCtx 12431 a.app.Srv().Store.SetContext(newCtx) 12432 defer func() { 12433 a.app.Srv().Store.SetContext(origCtx) 12434 a.ctx = origCtx 12435 }() 12436 12437 defer span.Finish() 12438 resultVar0 := a.app.RevokeAccessToken(token) 12439 12440 if resultVar0 != nil { 12441 span.LogFields(spanlog.Error(resultVar0)) 12442 ext.Error.Set(span, true) 12443 } 12444 12445 return resultVar0 12446 } 12447 12448 func (a *OpenTracingAppLayer) RevokeAllSessions(userID string) *model.AppError { 12449 origCtx := a.ctx 12450 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions") 12451 12452 a.ctx = newCtx 12453 a.app.Srv().Store.SetContext(newCtx) 12454 defer func() { 12455 a.app.Srv().Store.SetContext(origCtx) 12456 a.ctx = origCtx 12457 }() 12458 12459 defer span.Finish() 12460 resultVar0 := a.app.RevokeAllSessions(userID) 12461 12462 if resultVar0 != nil { 12463 span.LogFields(spanlog.Error(resultVar0)) 12464 ext.Error.Set(span, true) 12465 } 12466 12467 return resultVar0 12468 } 12469 12470 func (a *OpenTracingAppLayer) RevokeSession(session *model.Session) *model.AppError { 12471 origCtx := a.ctx 12472 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSession") 12473 12474 a.ctx = newCtx 12475 a.app.Srv().Store.SetContext(newCtx) 12476 defer func() { 12477 a.app.Srv().Store.SetContext(origCtx) 12478 a.ctx = origCtx 12479 }() 12480 12481 defer span.Finish() 12482 resultVar0 := a.app.RevokeSession(session) 12483 12484 if resultVar0 != nil { 12485 span.LogFields(spanlog.Error(resultVar0)) 12486 ext.Error.Set(span, true) 12487 } 12488 12489 return resultVar0 12490 } 12491 12492 func (a *OpenTracingAppLayer) RevokeSessionById(sessionId string) *model.AppError { 12493 origCtx := a.ctx 12494 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionById") 12495 12496 a.ctx = newCtx 12497 a.app.Srv().Store.SetContext(newCtx) 12498 defer func() { 12499 a.app.Srv().Store.SetContext(origCtx) 12500 a.ctx = origCtx 12501 }() 12502 12503 defer span.Finish() 12504 resultVar0 := a.app.RevokeSessionById(sessionId) 12505 12506 if resultVar0 != nil { 12507 span.LogFields(spanlog.Error(resultVar0)) 12508 ext.Error.Set(span, true) 12509 } 12510 12511 return resultVar0 12512 } 12513 12514 func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userID string, deviceId string, currentSessionId string) *model.AppError { 12515 origCtx := a.ctx 12516 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId") 12517 12518 a.ctx = newCtx 12519 a.app.Srv().Store.SetContext(newCtx) 12520 defer func() { 12521 a.app.Srv().Store.SetContext(origCtx) 12522 a.ctx = origCtx 12523 }() 12524 12525 defer span.Finish() 12526 resultVar0 := a.app.RevokeSessionsForDeviceId(userID, deviceId, currentSessionId) 12527 12528 if resultVar0 != nil { 12529 span.LogFields(spanlog.Error(resultVar0)) 12530 ext.Error.Set(span, true) 12531 } 12532 12533 return resultVar0 12534 } 12535 12536 func (a *OpenTracingAppLayer) RevokeSessionsFromAllUsers() *model.AppError { 12537 origCtx := a.ctx 12538 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsFromAllUsers") 12539 12540 a.ctx = newCtx 12541 a.app.Srv().Store.SetContext(newCtx) 12542 defer func() { 12543 a.app.Srv().Store.SetContext(origCtx) 12544 a.ctx = origCtx 12545 }() 12546 12547 defer span.Finish() 12548 resultVar0 := a.app.RevokeSessionsFromAllUsers() 12549 12550 if resultVar0 != nil { 12551 span.LogFields(spanlog.Error(resultVar0)) 12552 ext.Error.Set(span, true) 12553 } 12554 12555 return resultVar0 12556 } 12557 12558 func (a *OpenTracingAppLayer) RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError { 12559 origCtx := a.ctx 12560 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeUserAccessToken") 12561 12562 a.ctx = newCtx 12563 a.app.Srv().Store.SetContext(newCtx) 12564 defer func() { 12565 a.app.Srv().Store.SetContext(origCtx) 12566 a.ctx = origCtx 12567 }() 12568 12569 defer span.Finish() 12570 resultVar0 := a.app.RevokeUserAccessToken(token) 12571 12572 if resultVar0 != nil { 12573 span.LogFields(spanlog.Error(resultVar0)) 12574 ext.Error.Set(span, true) 12575 } 12576 12577 return resultVar0 12578 } 12579 12580 func (a *OpenTracingAppLayer) RolesGrantPermission(roleNames []string, permissionId string) bool { 12581 origCtx := a.ctx 12582 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RolesGrantPermission") 12583 12584 a.ctx = newCtx 12585 a.app.Srv().Store.SetContext(newCtx) 12586 defer func() { 12587 a.app.Srv().Store.SetContext(origCtx) 12588 a.ctx = origCtx 12589 }() 12590 12591 defer span.Finish() 12592 resultVar0 := a.app.RolesGrantPermission(roleNames, permissionId) 12593 12594 return resultVar0 12595 } 12596 12597 func (a *OpenTracingAppLayer) SanitizeProfile(user *model.User, asAdmin bool) { 12598 origCtx := a.ctx 12599 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeProfile") 12600 12601 a.ctx = newCtx 12602 a.app.Srv().Store.SetContext(newCtx) 12603 defer func() { 12604 a.app.Srv().Store.SetContext(origCtx) 12605 a.ctx = origCtx 12606 }() 12607 12608 defer span.Finish() 12609 a.app.SanitizeProfile(user, asAdmin) 12610 } 12611 12612 func (a *OpenTracingAppLayer) SanitizeTeam(session model.Session, team *model.Team) *model.Team { 12613 origCtx := a.ctx 12614 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeam") 12615 12616 a.ctx = newCtx 12617 a.app.Srv().Store.SetContext(newCtx) 12618 defer func() { 12619 a.app.Srv().Store.SetContext(origCtx) 12620 a.ctx = origCtx 12621 }() 12622 12623 defer span.Finish() 12624 resultVar0 := a.app.SanitizeTeam(session, team) 12625 12626 return resultVar0 12627 } 12628 12629 func (a *OpenTracingAppLayer) SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team { 12630 origCtx := a.ctx 12631 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeams") 12632 12633 a.ctx = newCtx 12634 a.app.Srv().Store.SetContext(newCtx) 12635 defer func() { 12636 a.app.Srv().Store.SetContext(origCtx) 12637 a.ctx = origCtx 12638 }() 12639 12640 defer span.Finish() 12641 resultVar0 := a.app.SanitizeTeams(session, teams) 12642 12643 return resultVar0 12644 } 12645 12646 func (a *OpenTracingAppLayer) SaveAndBroadcastStatus(status *model.Status) { 12647 origCtx := a.ctx 12648 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveAndBroadcastStatus") 12649 12650 a.ctx = newCtx 12651 a.app.Srv().Store.SetContext(newCtx) 12652 defer func() { 12653 a.app.Srv().Store.SetContext(origCtx) 12654 a.ctx = origCtx 12655 }() 12656 12657 defer span.Finish() 12658 a.app.SaveAndBroadcastStatus(status) 12659 } 12660 12661 func (a *OpenTracingAppLayer) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError { 12662 origCtx := a.ctx 12663 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveBrandImage") 12664 12665 a.ctx = newCtx 12666 a.app.Srv().Store.SetContext(newCtx) 12667 defer func() { 12668 a.app.Srv().Store.SetContext(origCtx) 12669 a.ctx = origCtx 12670 }() 12671 12672 defer span.Finish() 12673 resultVar0 := a.app.SaveBrandImage(imageData) 12674 12675 if resultVar0 != nil { 12676 span.LogFields(spanlog.Error(resultVar0)) 12677 ext.Error.Set(span, true) 12678 } 12679 12680 return resultVar0 12681 } 12682 12683 func (a *OpenTracingAppLayer) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) { 12684 origCtx := a.ctx 12685 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveComplianceReport") 12686 12687 a.ctx = newCtx 12688 a.app.Srv().Store.SetContext(newCtx) 12689 defer func() { 12690 a.app.Srv().Store.SetContext(origCtx) 12691 a.ctx = origCtx 12692 }() 12693 12694 defer span.Finish() 12695 resultVar0, resultVar1 := a.app.SaveComplianceReport(job) 12696 12697 if resultVar1 != nil { 12698 span.LogFields(spanlog.Error(resultVar1)) 12699 ext.Error.Set(span, true) 12700 } 12701 12702 return resultVar0, resultVar1 12703 } 12704 12705 func (a *OpenTracingAppLayer) SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError { 12706 origCtx := a.ctx 12707 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveConfig") 12708 12709 a.ctx = newCtx 12710 a.app.Srv().Store.SetContext(newCtx) 12711 defer func() { 12712 a.app.Srv().Store.SetContext(origCtx) 12713 a.ctx = origCtx 12714 }() 12715 12716 defer span.Finish() 12717 resultVar0 := a.app.SaveConfig(newCfg, sendConfigChangeClusterMessage) 12718 12719 if resultVar0 != nil { 12720 span.LogFields(spanlog.Error(resultVar0)) 12721 ext.Error.Set(span, true) 12722 } 12723 12724 return resultVar0 12725 } 12726 12727 func (a *OpenTracingAppLayer) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) { 12728 origCtx := a.ctx 12729 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveReactionForPost") 12730 12731 a.ctx = newCtx 12732 a.app.Srv().Store.SetContext(newCtx) 12733 defer func() { 12734 a.app.Srv().Store.SetContext(origCtx) 12735 a.ctx = origCtx 12736 }() 12737 12738 defer span.Finish() 12739 resultVar0, resultVar1 := a.app.SaveReactionForPost(reaction) 12740 12741 if resultVar1 != nil { 12742 span.LogFields(spanlog.Error(resultVar1)) 12743 ext.Error.Set(span, true) 12744 } 12745 12746 return resultVar0, resultVar1 12747 } 12748 12749 func (a *OpenTracingAppLayer) SaveUserTermsOfService(userID string, termsOfServiceId string, accepted bool) *model.AppError { 12750 origCtx := a.ctx 12751 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveUserTermsOfService") 12752 12753 a.ctx = newCtx 12754 a.app.Srv().Store.SetContext(newCtx) 12755 defer func() { 12756 a.app.Srv().Store.SetContext(origCtx) 12757 a.ctx = origCtx 12758 }() 12759 12760 defer span.Finish() 12761 resultVar0 := a.app.SaveUserTermsOfService(userID, termsOfServiceId, accepted) 12762 12763 if resultVar0 != nil { 12764 span.LogFields(spanlog.Error(resultVar0)) 12765 ext.Error.Set(span, true) 12766 } 12767 12768 return resultVar0 12769 } 12770 12771 func (a *OpenTracingAppLayer) SchemesIterator(scope string, batchSize int) func() []*model.Scheme { 12772 origCtx := a.ctx 12773 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SchemesIterator") 12774 12775 a.ctx = newCtx 12776 a.app.Srv().Store.SetContext(newCtx) 12777 defer func() { 12778 a.app.Srv().Store.SetContext(origCtx) 12779 a.ctx = origCtx 12780 }() 12781 12782 defer span.Finish() 12783 resultVar0 := a.app.SchemesIterator(scope, batchSize) 12784 12785 return resultVar0 12786 } 12787 12788 func (a *OpenTracingAppLayer) SearchAllChannels(term string, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) { 12789 origCtx := a.ctx 12790 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllChannels") 12791 12792 a.ctx = newCtx 12793 a.app.Srv().Store.SetContext(newCtx) 12794 defer func() { 12795 a.app.Srv().Store.SetContext(origCtx) 12796 a.ctx = origCtx 12797 }() 12798 12799 defer span.Finish() 12800 resultVar0, resultVar1, resultVar2 := a.app.SearchAllChannels(term, opts) 12801 12802 if resultVar2 != nil { 12803 span.LogFields(spanlog.Error(resultVar2)) 12804 ext.Error.Set(span, true) 12805 } 12806 12807 return resultVar0, resultVar1, resultVar2 12808 } 12809 12810 func (a *OpenTracingAppLayer) SearchAllTeams(searchOpts *model.TeamSearch) ([]*model.Team, int64, *model.AppError) { 12811 origCtx := a.ctx 12812 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllTeams") 12813 12814 a.ctx = newCtx 12815 a.app.Srv().Store.SetContext(newCtx) 12816 defer func() { 12817 a.app.Srv().Store.SetContext(origCtx) 12818 a.ctx = origCtx 12819 }() 12820 12821 defer span.Finish() 12822 resultVar0, resultVar1, resultVar2 := a.app.SearchAllTeams(searchOpts) 12823 12824 if resultVar2 != nil { 12825 span.LogFields(spanlog.Error(resultVar2)) 12826 ext.Error.Set(span, true) 12827 } 12828 12829 return resultVar0, resultVar1, resultVar2 12830 } 12831 12832 func (a *OpenTracingAppLayer) SearchArchivedChannels(teamID string, term string, userID string) (*model.ChannelList, *model.AppError) { 12833 origCtx := a.ctx 12834 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchArchivedChannels") 12835 12836 a.ctx = newCtx 12837 a.app.Srv().Store.SetContext(newCtx) 12838 defer func() { 12839 a.app.Srv().Store.SetContext(origCtx) 12840 a.ctx = origCtx 12841 }() 12842 12843 defer span.Finish() 12844 resultVar0, resultVar1 := a.app.SearchArchivedChannels(teamID, term, userID) 12845 12846 if resultVar1 != nil { 12847 span.LogFields(spanlog.Error(resultVar1)) 12848 ext.Error.Set(span, true) 12849 } 12850 12851 return resultVar0, resultVar1 12852 } 12853 12854 func (a *OpenTracingAppLayer) SearchChannels(teamID string, term string) (*model.ChannelList, *model.AppError) { 12855 origCtx := a.ctx 12856 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannels") 12857 12858 a.ctx = newCtx 12859 a.app.Srv().Store.SetContext(newCtx) 12860 defer func() { 12861 a.app.Srv().Store.SetContext(origCtx) 12862 a.ctx = origCtx 12863 }() 12864 12865 defer span.Finish() 12866 resultVar0, resultVar1 := a.app.SearchChannels(teamID, term) 12867 12868 if resultVar1 != nil { 12869 span.LogFields(spanlog.Error(resultVar1)) 12870 ext.Error.Set(span, true) 12871 } 12872 12873 return resultVar0, resultVar1 12874 } 12875 12876 func (a *OpenTracingAppLayer) SearchChannelsForUser(userID string, teamID string, term string) (*model.ChannelList, *model.AppError) { 12877 origCtx := a.ctx 12878 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsForUser") 12879 12880 a.ctx = newCtx 12881 a.app.Srv().Store.SetContext(newCtx) 12882 defer func() { 12883 a.app.Srv().Store.SetContext(origCtx) 12884 a.ctx = origCtx 12885 }() 12886 12887 defer span.Finish() 12888 resultVar0, resultVar1 := a.app.SearchChannelsForUser(userID, teamID, term) 12889 12890 if resultVar1 != nil { 12891 span.LogFields(spanlog.Error(resultVar1)) 12892 ext.Error.Set(span, true) 12893 } 12894 12895 return resultVar0, resultVar1 12896 } 12897 12898 func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamID string, userID string, term string) (*model.ChannelList, *model.AppError) { 12899 origCtx := a.ctx 12900 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsUserNotIn") 12901 12902 a.ctx = newCtx 12903 a.app.Srv().Store.SetContext(newCtx) 12904 defer func() { 12905 a.app.Srv().Store.SetContext(origCtx) 12906 a.ctx = origCtx 12907 }() 12908 12909 defer span.Finish() 12910 resultVar0, resultVar1 := a.app.SearchChannelsUserNotIn(teamID, userID, term) 12911 12912 if resultVar1 != nil { 12913 span.LogFields(spanlog.Error(resultVar1)) 12914 ext.Error.Set(span, true) 12915 } 12916 12917 return resultVar0, resultVar1 12918 } 12919 12920 func (a *OpenTracingAppLayer) SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) { 12921 origCtx := a.ctx 12922 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEmoji") 12923 12924 a.ctx = newCtx 12925 a.app.Srv().Store.SetContext(newCtx) 12926 defer func() { 12927 a.app.Srv().Store.SetContext(origCtx) 12928 a.ctx = origCtx 12929 }() 12930 12931 defer span.Finish() 12932 resultVar0, resultVar1 := a.app.SearchEmoji(name, prefixOnly, limit) 12933 12934 if resultVar1 != nil { 12935 span.LogFields(spanlog.Error(resultVar1)) 12936 ext.Error.Set(span, true) 12937 } 12938 12939 return resultVar0, resultVar1 12940 } 12941 12942 func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker { 12943 origCtx := a.ctx 12944 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEngine") 12945 12946 a.ctx = newCtx 12947 a.app.Srv().Store.SetContext(newCtx) 12948 defer func() { 12949 a.app.Srv().Store.SetContext(origCtx) 12950 a.ctx = origCtx 12951 }() 12952 12953 defer span.Finish() 12954 resultVar0 := a.app.SearchEngine() 12955 12956 return resultVar0 12957 } 12958 12959 func (a *OpenTracingAppLayer) SearchGroupChannels(userID string, term string) (*model.ChannelList, *model.AppError) { 12960 origCtx := a.ctx 12961 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchGroupChannels") 12962 12963 a.ctx = newCtx 12964 a.app.Srv().Store.SetContext(newCtx) 12965 defer func() { 12966 a.app.Srv().Store.SetContext(origCtx) 12967 a.ctx = origCtx 12968 }() 12969 12970 defer span.Finish() 12971 resultVar0, resultVar1 := a.app.SearchGroupChannels(userID, term) 12972 12973 if resultVar1 != nil { 12974 span.LogFields(spanlog.Error(resultVar1)) 12975 ext.Error.Set(span, true) 12976 } 12977 12978 return resultVar0, resultVar1 12979 } 12980 12981 func (a *OpenTracingAppLayer) SearchPostsInTeam(teamID string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { 12982 origCtx := a.ctx 12983 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeam") 12984 12985 a.ctx = newCtx 12986 a.app.Srv().Store.SetContext(newCtx) 12987 defer func() { 12988 a.app.Srv().Store.SetContext(origCtx) 12989 a.ctx = origCtx 12990 }() 12991 12992 defer span.Finish() 12993 resultVar0, resultVar1 := a.app.SearchPostsInTeam(teamID, paramsList) 12994 12995 if resultVar1 != nil { 12996 span.LogFields(spanlog.Error(resultVar1)) 12997 ext.Error.Set(span, true) 12998 } 12999 13000 return resultVar0, resultVar1 13001 } 13002 13003 func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(terms string, userID string, teamID string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) { 13004 origCtx := a.ctx 13005 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeamForUser") 13006 13007 a.ctx = newCtx 13008 a.app.Srv().Store.SetContext(newCtx) 13009 defer func() { 13010 a.app.Srv().Store.SetContext(origCtx) 13011 a.ctx = origCtx 13012 }() 13013 13014 defer span.Finish() 13015 resultVar0, resultVar1 := a.app.SearchPostsInTeamForUser(terms, userID, teamID, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) 13016 13017 if resultVar1 != nil { 13018 span.LogFields(spanlog.Error(resultVar1)) 13019 ext.Error.Set(span, true) 13020 } 13021 13022 return resultVar0, resultVar1 13023 } 13024 13025 func (a *OpenTracingAppLayer) SearchPrivateTeams(term string) ([]*model.Team, *model.AppError) { 13026 origCtx := a.ctx 13027 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPrivateTeams") 13028 13029 a.ctx = newCtx 13030 a.app.Srv().Store.SetContext(newCtx) 13031 defer func() { 13032 a.app.Srv().Store.SetContext(origCtx) 13033 a.ctx = origCtx 13034 }() 13035 13036 defer span.Finish() 13037 resultVar0, resultVar1 := a.app.SearchPrivateTeams(term) 13038 13039 if resultVar1 != nil { 13040 span.LogFields(spanlog.Error(resultVar1)) 13041 ext.Error.Set(span, true) 13042 } 13043 13044 return resultVar0, resultVar1 13045 } 13046 13047 func (a *OpenTracingAppLayer) SearchPublicTeams(term string) ([]*model.Team, *model.AppError) { 13048 origCtx := a.ctx 13049 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPublicTeams") 13050 13051 a.ctx = newCtx 13052 a.app.Srv().Store.SetContext(newCtx) 13053 defer func() { 13054 a.app.Srv().Store.SetContext(origCtx) 13055 a.ctx = origCtx 13056 }() 13057 13058 defer span.Finish() 13059 resultVar0, resultVar1 := a.app.SearchPublicTeams(term) 13060 13061 if resultVar1 != nil { 13062 span.LogFields(spanlog.Error(resultVar1)) 13063 ext.Error.Set(span, true) 13064 } 13065 13066 return resultVar0, resultVar1 13067 } 13068 13069 func (a *OpenTracingAppLayer) SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) { 13070 origCtx := a.ctx 13071 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUserAccessTokens") 13072 13073 a.ctx = newCtx 13074 a.app.Srv().Store.SetContext(newCtx) 13075 defer func() { 13076 a.app.Srv().Store.SetContext(origCtx) 13077 a.ctx = origCtx 13078 }() 13079 13080 defer span.Finish() 13081 resultVar0, resultVar1 := a.app.SearchUserAccessTokens(term) 13082 13083 if resultVar1 != nil { 13084 span.LogFields(spanlog.Error(resultVar1)) 13085 ext.Error.Set(span, true) 13086 } 13087 13088 return resultVar0, resultVar1 13089 } 13090 13091 func (a *OpenTracingAppLayer) SearchUsers(props *model.UserSearch, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13092 origCtx := a.ctx 13093 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsers") 13094 13095 a.ctx = newCtx 13096 a.app.Srv().Store.SetContext(newCtx) 13097 defer func() { 13098 a.app.Srv().Store.SetContext(origCtx) 13099 a.ctx = origCtx 13100 }() 13101 13102 defer span.Finish() 13103 resultVar0, resultVar1 := a.app.SearchUsers(props, options) 13104 13105 if resultVar1 != nil { 13106 span.LogFields(spanlog.Error(resultVar1)) 13107 ext.Error.Set(span, true) 13108 } 13109 13110 return resultVar0, resultVar1 13111 } 13112 13113 func (a *OpenTracingAppLayer) SearchUsersInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13114 origCtx := a.ctx 13115 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInChannel") 13116 13117 a.ctx = newCtx 13118 a.app.Srv().Store.SetContext(newCtx) 13119 defer func() { 13120 a.app.Srv().Store.SetContext(origCtx) 13121 a.ctx = origCtx 13122 }() 13123 13124 defer span.Finish() 13125 resultVar0, resultVar1 := a.app.SearchUsersInChannel(channelId, term, options) 13126 13127 if resultVar1 != nil { 13128 span.LogFields(spanlog.Error(resultVar1)) 13129 ext.Error.Set(span, true) 13130 } 13131 13132 return resultVar0, resultVar1 13133 } 13134 13135 func (a *OpenTracingAppLayer) SearchUsersInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13136 origCtx := a.ctx 13137 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInGroup") 13138 13139 a.ctx = newCtx 13140 a.app.Srv().Store.SetContext(newCtx) 13141 defer func() { 13142 a.app.Srv().Store.SetContext(origCtx) 13143 a.ctx = origCtx 13144 }() 13145 13146 defer span.Finish() 13147 resultVar0, resultVar1 := a.app.SearchUsersInGroup(groupID, term, options) 13148 13149 if resultVar1 != nil { 13150 span.LogFields(spanlog.Error(resultVar1)) 13151 ext.Error.Set(span, true) 13152 } 13153 13154 return resultVar0, resultVar1 13155 } 13156 13157 func (a *OpenTracingAppLayer) SearchUsersInTeam(teamID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13158 origCtx := a.ctx 13159 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInTeam") 13160 13161 a.ctx = newCtx 13162 a.app.Srv().Store.SetContext(newCtx) 13163 defer func() { 13164 a.app.Srv().Store.SetContext(origCtx) 13165 a.ctx = origCtx 13166 }() 13167 13168 defer span.Finish() 13169 resultVar0, resultVar1 := a.app.SearchUsersInTeam(teamID, term, options) 13170 13171 if resultVar1 != nil { 13172 span.LogFields(spanlog.Error(resultVar1)) 13173 ext.Error.Set(span, true) 13174 } 13175 13176 return resultVar0, resultVar1 13177 } 13178 13179 func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamID string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13180 origCtx := a.ctx 13181 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInChannel") 13182 13183 a.ctx = newCtx 13184 a.app.Srv().Store.SetContext(newCtx) 13185 defer func() { 13186 a.app.Srv().Store.SetContext(origCtx) 13187 a.ctx = origCtx 13188 }() 13189 13190 defer span.Finish() 13191 resultVar0, resultVar1 := a.app.SearchUsersNotInChannel(teamID, channelId, term, options) 13192 13193 if resultVar1 != nil { 13194 span.LogFields(spanlog.Error(resultVar1)) 13195 ext.Error.Set(span, true) 13196 } 13197 13198 return resultVar0, resultVar1 13199 } 13200 13201 func (a *OpenTracingAppLayer) SearchUsersNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13202 origCtx := a.ctx 13203 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInTeam") 13204 13205 a.ctx = newCtx 13206 a.app.Srv().Store.SetContext(newCtx) 13207 defer func() { 13208 a.app.Srv().Store.SetContext(origCtx) 13209 a.ctx = origCtx 13210 }() 13211 13212 defer span.Finish() 13213 resultVar0, resultVar1 := a.app.SearchUsersNotInTeam(notInTeamId, term, options) 13214 13215 if resultVar1 != nil { 13216 span.LogFields(spanlog.Error(resultVar1)) 13217 ext.Error.Set(span, true) 13218 } 13219 13220 return resultVar0, resultVar1 13221 } 13222 13223 func (a *OpenTracingAppLayer) SearchUsersWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 13224 origCtx := a.ctx 13225 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersWithoutTeam") 13226 13227 a.ctx = newCtx 13228 a.app.Srv().Store.SetContext(newCtx) 13229 defer func() { 13230 a.app.Srv().Store.SetContext(origCtx) 13231 a.ctx = origCtx 13232 }() 13233 13234 defer span.Finish() 13235 resultVar0, resultVar1 := a.app.SearchUsersWithoutTeam(term, options) 13236 13237 if resultVar1 != nil { 13238 span.LogFields(spanlog.Error(resultVar1)) 13239 ext.Error.Set(span, true) 13240 } 13241 13242 return resultVar0, resultVar1 13243 } 13244 13245 func (a *OpenTracingAppLayer) SendAckToPushProxy(ack *model.PushNotificationAck) error { 13246 origCtx := a.ctx 13247 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAckToPushProxy") 13248 13249 a.ctx = newCtx 13250 a.app.Srv().Store.SetContext(newCtx) 13251 defer func() { 13252 a.app.Srv().Store.SetContext(origCtx) 13253 a.ctx = origCtx 13254 }() 13255 13256 defer span.Finish() 13257 resultVar0 := a.app.SendAckToPushProxy(ack) 13258 13259 if resultVar0 != nil { 13260 span.LogFields(spanlog.Error(resultVar0)) 13261 ext.Error.Set(span, true) 13262 } 13263 13264 return resultVar0 13265 } 13266 13267 func (a *OpenTracingAppLayer) SendAdminUpgradeRequestEmail(username string, subscription *model.Subscription) *model.AppError { 13268 origCtx := a.ctx 13269 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAdminUpgradeRequestEmail") 13270 13271 a.ctx = newCtx 13272 a.app.Srv().Store.SetContext(newCtx) 13273 defer func() { 13274 a.app.Srv().Store.SetContext(origCtx) 13275 a.ctx = origCtx 13276 }() 13277 13278 defer span.Finish() 13279 resultVar0 := a.app.SendAdminUpgradeRequestEmail(username, subscription) 13280 13281 if resultVar0 != nil { 13282 span.LogFields(spanlog.Error(resultVar0)) 13283 ext.Error.Set(span, true) 13284 } 13285 13286 return resultVar0 13287 } 13288 13289 func (a *OpenTracingAppLayer) SendAutoResponse(channel *model.Channel, receiver *model.User, post *model.Post) (bool, *model.AppError) { 13290 origCtx := a.ctx 13291 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponse") 13292 13293 a.ctx = newCtx 13294 a.app.Srv().Store.SetContext(newCtx) 13295 defer func() { 13296 a.app.Srv().Store.SetContext(origCtx) 13297 a.ctx = origCtx 13298 }() 13299 13300 defer span.Finish() 13301 resultVar0, resultVar1 := a.app.SendAutoResponse(channel, receiver, post) 13302 13303 if resultVar1 != nil { 13304 span.LogFields(spanlog.Error(resultVar1)) 13305 ext.Error.Set(span, true) 13306 } 13307 13308 return resultVar0, resultVar1 13309 } 13310 13311 func (a *OpenTracingAppLayer) SendAutoResponseIfNecessary(channel *model.Channel, sender *model.User, post *model.Post) (bool, *model.AppError) { 13312 origCtx := a.ctx 13313 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponseIfNecessary") 13314 13315 a.ctx = newCtx 13316 a.app.Srv().Store.SetContext(newCtx) 13317 defer func() { 13318 a.app.Srv().Store.SetContext(origCtx) 13319 a.ctx = origCtx 13320 }() 13321 13322 defer span.Finish() 13323 resultVar0, resultVar1 := a.app.SendAutoResponseIfNecessary(channel, sender, post) 13324 13325 if resultVar1 != nil { 13326 span.LogFields(spanlog.Error(resultVar1)) 13327 ext.Error.Set(span, true) 13328 } 13329 13330 return resultVar0, resultVar1 13331 } 13332 13333 func (a *OpenTracingAppLayer) SendEmailVerification(user *model.User, newEmail string, redirect string) *model.AppError { 13334 origCtx := a.ctx 13335 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEmailVerification") 13336 13337 a.ctx = newCtx 13338 a.app.Srv().Store.SetContext(newCtx) 13339 defer func() { 13340 a.app.Srv().Store.SetContext(origCtx) 13341 a.ctx = origCtx 13342 }() 13343 13344 defer span.Finish() 13345 resultVar0 := a.app.SendEmailVerification(user, newEmail, redirect) 13346 13347 if resultVar0 != nil { 13348 span.LogFields(spanlog.Error(resultVar0)) 13349 ext.Error.Set(span, true) 13350 } 13351 13352 return resultVar0 13353 } 13354 13355 func (a *OpenTracingAppLayer) SendEphemeralPost(userID string, post *model.Post) *model.Post { 13356 origCtx := a.ctx 13357 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEphemeralPost") 13358 13359 a.ctx = newCtx 13360 a.app.Srv().Store.SetContext(newCtx) 13361 defer func() { 13362 a.app.Srv().Store.SetContext(origCtx) 13363 a.ctx = origCtx 13364 }() 13365 13366 defer span.Finish() 13367 resultVar0 := a.app.SendEphemeralPost(userID, post) 13368 13369 return resultVar0 13370 } 13371 13372 func (a *OpenTracingAppLayer) SendNoCardPaymentFailedEmail() *model.AppError { 13373 origCtx := a.ctx 13374 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNoCardPaymentFailedEmail") 13375 13376 a.ctx = newCtx 13377 a.app.Srv().Store.SetContext(newCtx) 13378 defer func() { 13379 a.app.Srv().Store.SetContext(origCtx) 13380 a.ctx = origCtx 13381 }() 13382 13383 defer span.Finish() 13384 resultVar0 := a.app.SendNoCardPaymentFailedEmail() 13385 13386 if resultVar0 != nil { 13387 span.LogFields(spanlog.Error(resultVar0)) 13388 ext.Error.Set(span, true) 13389 } 13390 13391 return resultVar0 13392 } 13393 13394 func (a *OpenTracingAppLayer) SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error) { 13395 origCtx := a.ctx 13396 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNotifications") 13397 13398 a.ctx = newCtx 13399 a.app.Srv().Store.SetContext(newCtx) 13400 defer func() { 13401 a.app.Srv().Store.SetContext(origCtx) 13402 a.ctx = origCtx 13403 }() 13404 13405 defer span.Finish() 13406 resultVar0, resultVar1 := a.app.SendNotifications(post, team, channel, sender, parentPostList, setOnline) 13407 13408 if resultVar1 != nil { 13409 span.LogFields(spanlog.Error(resultVar1)) 13410 ext.Error.Set(span, true) 13411 } 13412 13413 return resultVar0, resultVar1 13414 } 13415 13416 func (a *OpenTracingAppLayer) SendPasswordReset(email string, siteURL string) (bool, *model.AppError) { 13417 origCtx := a.ctx 13418 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPasswordReset") 13419 13420 a.ctx = newCtx 13421 a.app.Srv().Store.SetContext(newCtx) 13422 defer func() { 13423 a.app.Srv().Store.SetContext(origCtx) 13424 a.ctx = origCtx 13425 }() 13426 13427 defer span.Finish() 13428 resultVar0, resultVar1 := a.app.SendPasswordReset(email, siteURL) 13429 13430 if resultVar1 != nil { 13431 span.LogFields(spanlog.Error(resultVar1)) 13432 ext.Error.Set(span, true) 13433 } 13434 13435 return resultVar0, resultVar1 13436 } 13437 13438 func (a *OpenTracingAppLayer) SendPaymentFailedEmail(failedPayment *model.FailedPayment) *model.AppError { 13439 origCtx := a.ctx 13440 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPaymentFailedEmail") 13441 13442 a.ctx = newCtx 13443 a.app.Srv().Store.SetContext(newCtx) 13444 defer func() { 13445 a.app.Srv().Store.SetContext(origCtx) 13446 a.ctx = origCtx 13447 }() 13448 13449 defer span.Finish() 13450 resultVar0 := a.app.SendPaymentFailedEmail(failedPayment) 13451 13452 if resultVar0 != nil { 13453 span.LogFields(spanlog.Error(resultVar0)) 13454 ext.Error.Set(span, true) 13455 } 13456 13457 return resultVar0 13458 } 13459 13460 func (a *OpenTracingAppLayer) ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, sourcePluginId string, destinationPluginId string) { 13461 origCtx := a.ctx 13462 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServeInterPluginRequest") 13463 13464 a.ctx = newCtx 13465 a.app.Srv().Store.SetContext(newCtx) 13466 defer func() { 13467 a.app.Srv().Store.SetContext(origCtx) 13468 a.ctx = origCtx 13469 }() 13470 13471 defer span.Finish() 13472 a.app.ServeInterPluginRequest(w, r, sourcePluginId, destinationPluginId) 13473 } 13474 13475 func (a *OpenTracingAppLayer) ServePluginPublicRequest(w http.ResponseWriter, r *http.Request) { 13476 origCtx := a.ctx 13477 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServePluginPublicRequest") 13478 13479 a.ctx = newCtx 13480 a.app.Srv().Store.SetContext(newCtx) 13481 defer func() { 13482 a.app.Srv().Store.SetContext(origCtx) 13483 a.ctx = origCtx 13484 }() 13485 13486 defer span.Finish() 13487 a.app.ServePluginPublicRequest(w, r) 13488 } 13489 13490 func (a *OpenTracingAppLayer) ServePluginRequest(w http.ResponseWriter, r *http.Request) { 13491 origCtx := a.ctx 13492 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServePluginRequest") 13493 13494 a.ctx = newCtx 13495 a.app.Srv().Store.SetContext(newCtx) 13496 defer func() { 13497 a.app.Srv().Store.SetContext(origCtx) 13498 a.ctx = origCtx 13499 }() 13500 13501 defer span.Finish() 13502 a.app.ServePluginRequest(w, r) 13503 } 13504 13505 func (a *OpenTracingAppLayer) ServerBusyStateChanged(sbs *model.ServerBusyState) { 13506 origCtx := a.ctx 13507 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServerBusyStateChanged") 13508 13509 a.ctx = newCtx 13510 a.app.Srv().Store.SetContext(newCtx) 13511 defer func() { 13512 a.app.Srv().Store.SetContext(origCtx) 13513 a.ctx = origCtx 13514 }() 13515 13516 defer span.Finish() 13517 a.app.ServerBusyStateChanged(sbs) 13518 } 13519 13520 func (a *OpenTracingAppLayer) SessionCacheLength() int { 13521 origCtx := a.ctx 13522 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionCacheLength") 13523 13524 a.ctx = newCtx 13525 a.app.Srv().Store.SetContext(newCtx) 13526 defer func() { 13527 a.app.Srv().Store.SetContext(origCtx) 13528 a.ctx = origCtx 13529 }() 13530 13531 defer span.Finish() 13532 resultVar0 := a.app.SessionCacheLength() 13533 13534 return resultVar0 13535 } 13536 13537 func (a *OpenTracingAppLayer) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool { 13538 origCtx := a.ctx 13539 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionTo") 13540 13541 a.ctx = newCtx 13542 a.app.Srv().Store.SetContext(newCtx) 13543 defer func() { 13544 a.app.Srv().Store.SetContext(origCtx) 13545 a.ctx = origCtx 13546 }() 13547 13548 defer span.Finish() 13549 resultVar0 := a.app.SessionHasPermissionTo(session, permission) 13550 13551 return resultVar0 13552 } 13553 13554 func (a *OpenTracingAppLayer) SessionHasPermissionToAny(session model.Session, permissions []*model.Permission) bool { 13555 origCtx := a.ctx 13556 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToAny") 13557 13558 a.ctx = newCtx 13559 a.app.Srv().Store.SetContext(newCtx) 13560 defer func() { 13561 a.app.Srv().Store.SetContext(origCtx) 13562 a.ctx = origCtx 13563 }() 13564 13565 defer span.Finish() 13566 resultVar0 := a.app.SessionHasPermissionToAny(session, permissions) 13567 13568 return resultVar0 13569 } 13570 13571 func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Session, userID string, teamID string, categoryId string) bool { 13572 origCtx := a.ctx 13573 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToCategory") 13574 13575 a.ctx = newCtx 13576 a.app.Srv().Store.SetContext(newCtx) 13577 defer func() { 13578 a.app.Srv().Store.SetContext(origCtx) 13579 a.ctx = origCtx 13580 }() 13581 13582 defer span.Finish() 13583 resultVar0 := a.app.SessionHasPermissionToCategory(session, userID, teamID, categoryId) 13584 13585 return resultVar0 13586 } 13587 13588 func (a *OpenTracingAppLayer) SessionHasPermissionToChannel(session model.Session, channelId string, permission *model.Permission) bool { 13589 origCtx := a.ctx 13590 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannel") 13591 13592 a.ctx = newCtx 13593 a.app.Srv().Store.SetContext(newCtx) 13594 defer func() { 13595 a.app.Srv().Store.SetContext(origCtx) 13596 a.ctx = origCtx 13597 }() 13598 13599 defer span.Finish() 13600 resultVar0 := a.app.SessionHasPermissionToChannel(session, channelId, permission) 13601 13602 return resultVar0 13603 } 13604 13605 func (a *OpenTracingAppLayer) SessionHasPermissionToChannelByPost(session model.Session, postId string, permission *model.Permission) bool { 13606 origCtx := a.ctx 13607 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannelByPost") 13608 13609 a.ctx = newCtx 13610 a.app.Srv().Store.SetContext(newCtx) 13611 defer func() { 13612 a.app.Srv().Store.SetContext(origCtx) 13613 a.ctx = origCtx 13614 }() 13615 13616 defer span.Finish() 13617 resultVar0 := a.app.SessionHasPermissionToChannelByPost(session, postId, permission) 13618 13619 return resultVar0 13620 } 13621 13622 func (a *OpenTracingAppLayer) SessionHasPermissionToManageBot(session model.Session, botUserId string) *model.AppError { 13623 origCtx := a.ctx 13624 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToManageBot") 13625 13626 a.ctx = newCtx 13627 a.app.Srv().Store.SetContext(newCtx) 13628 defer func() { 13629 a.app.Srv().Store.SetContext(origCtx) 13630 a.ctx = origCtx 13631 }() 13632 13633 defer span.Finish() 13634 resultVar0 := a.app.SessionHasPermissionToManageBot(session, botUserId) 13635 13636 if resultVar0 != nil { 13637 span.LogFields(spanlog.Error(resultVar0)) 13638 ext.Error.Set(span, true) 13639 } 13640 13641 return resultVar0 13642 } 13643 13644 func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, teamID string, permission *model.Permission) bool { 13645 origCtx := a.ctx 13646 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToTeam") 13647 13648 a.ctx = newCtx 13649 a.app.Srv().Store.SetContext(newCtx) 13650 defer func() { 13651 a.app.Srv().Store.SetContext(origCtx) 13652 a.ctx = origCtx 13653 }() 13654 13655 defer span.Finish() 13656 resultVar0 := a.app.SessionHasPermissionToTeam(session, teamID, permission) 13657 13658 return resultVar0 13659 } 13660 13661 func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userID string) bool { 13662 origCtx := a.ctx 13663 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUser") 13664 13665 a.ctx = newCtx 13666 a.app.Srv().Store.SetContext(newCtx) 13667 defer func() { 13668 a.app.Srv().Store.SetContext(origCtx) 13669 a.ctx = origCtx 13670 }() 13671 13672 defer span.Finish() 13673 resultVar0 := a.app.SessionHasPermissionToUser(session, userID) 13674 13675 return resultVar0 13676 } 13677 13678 func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Session, userID string) bool { 13679 origCtx := a.ctx 13680 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUserOrBot") 13681 13682 a.ctx = newCtx 13683 a.app.Srv().Store.SetContext(newCtx) 13684 defer func() { 13685 a.app.Srv().Store.SetContext(origCtx) 13686 a.ctx = origCtx 13687 }() 13688 13689 defer span.Finish() 13690 resultVar0 := a.app.SessionHasPermissionToUserOrBot(session, userID) 13691 13692 return resultVar0 13693 } 13694 13695 func (a *OpenTracingAppLayer) SessionIsRegistered(session model.Session) bool { 13696 origCtx := a.ctx 13697 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionIsRegistered") 13698 13699 a.ctx = newCtx 13700 a.app.Srv().Store.SetContext(newCtx) 13701 defer func() { 13702 a.app.Srv().Store.SetContext(origCtx) 13703 a.ctx = origCtx 13704 }() 13705 13706 defer span.Finish() 13707 resultVar0 := a.app.SessionIsRegistered(session) 13708 13709 return resultVar0 13710 } 13711 13712 func (a *OpenTracingAppLayer) SetActiveChannel(userID string, channelId string) *model.AppError { 13713 origCtx := a.ctx 13714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetActiveChannel") 13715 13716 a.ctx = newCtx 13717 a.app.Srv().Store.SetContext(newCtx) 13718 defer func() { 13719 a.app.Srv().Store.SetContext(origCtx) 13720 a.ctx = origCtx 13721 }() 13722 13723 defer span.Finish() 13724 resultVar0 := a.app.SetActiveChannel(userID, channelId) 13725 13726 if resultVar0 != nil { 13727 span.LogFields(spanlog.Error(resultVar0)) 13728 ext.Error.Set(span, true) 13729 } 13730 13731 return resultVar0 13732 } 13733 13734 func (a *OpenTracingAppLayer) SetAutoResponderStatus(user *model.User, oldNotifyProps model.StringMap) { 13735 origCtx := a.ctx 13736 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetAutoResponderStatus") 13737 13738 a.ctx = newCtx 13739 a.app.Srv().Store.SetContext(newCtx) 13740 defer func() { 13741 a.app.Srv().Store.SetContext(origCtx) 13742 a.ctx = origCtx 13743 }() 13744 13745 defer span.Finish() 13746 a.app.SetAutoResponderStatus(user, oldNotifyProps) 13747 } 13748 13749 func (a *OpenTracingAppLayer) SetBotIconImage(botUserId string, file io.ReadSeeker) *model.AppError { 13750 origCtx := a.ctx 13751 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImage") 13752 13753 a.ctx = newCtx 13754 a.app.Srv().Store.SetContext(newCtx) 13755 defer func() { 13756 a.app.Srv().Store.SetContext(origCtx) 13757 a.ctx = origCtx 13758 }() 13759 13760 defer span.Finish() 13761 resultVar0 := a.app.SetBotIconImage(botUserId, file) 13762 13763 if resultVar0 != nil { 13764 span.LogFields(spanlog.Error(resultVar0)) 13765 ext.Error.Set(span, true) 13766 } 13767 13768 return resultVar0 13769 } 13770 13771 func (a *OpenTracingAppLayer) SetBotIconImageFromMultiPartFile(botUserId string, imageData *multipart.FileHeader) *model.AppError { 13772 origCtx := a.ctx 13773 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImageFromMultiPartFile") 13774 13775 a.ctx = newCtx 13776 a.app.Srv().Store.SetContext(newCtx) 13777 defer func() { 13778 a.app.Srv().Store.SetContext(origCtx) 13779 a.ctx = origCtx 13780 }() 13781 13782 defer span.Finish() 13783 resultVar0 := a.app.SetBotIconImageFromMultiPartFile(botUserId, imageData) 13784 13785 if resultVar0 != nil { 13786 span.LogFields(spanlog.Error(resultVar0)) 13787 ext.Error.Set(span, true) 13788 } 13789 13790 return resultVar0 13791 } 13792 13793 func (a *OpenTracingAppLayer) SetCustomStatus(userID string, cs *model.CustomStatus) *model.AppError { 13794 origCtx := a.ctx 13795 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetCustomStatus") 13796 13797 a.ctx = newCtx 13798 a.app.Srv().Store.SetContext(newCtx) 13799 defer func() { 13800 a.app.Srv().Store.SetContext(origCtx) 13801 a.ctx = origCtx 13802 }() 13803 13804 defer span.Finish() 13805 resultVar0 := a.app.SetCustomStatus(userID, cs) 13806 13807 if resultVar0 != nil { 13808 span.LogFields(spanlog.Error(resultVar0)) 13809 ext.Error.Set(span, true) 13810 } 13811 13812 return resultVar0 13813 } 13814 13815 func (a *OpenTracingAppLayer) SetDefaultProfileImage(user *model.User) *model.AppError { 13816 origCtx := a.ctx 13817 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDefaultProfileImage") 13818 13819 a.ctx = newCtx 13820 a.app.Srv().Store.SetContext(newCtx) 13821 defer func() { 13822 a.app.Srv().Store.SetContext(origCtx) 13823 a.ctx = origCtx 13824 }() 13825 13826 defer span.Finish() 13827 resultVar0 := a.app.SetDefaultProfileImage(user) 13828 13829 if resultVar0 != nil { 13830 span.LogFields(spanlog.Error(resultVar0)) 13831 ext.Error.Set(span, true) 13832 } 13833 13834 return resultVar0 13835 } 13836 13837 func (a *OpenTracingAppLayer) SetPhase2PermissionsMigrationStatus(isComplete bool) error { 13838 origCtx := a.ctx 13839 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPhase2PermissionsMigrationStatus") 13840 13841 a.ctx = newCtx 13842 a.app.Srv().Store.SetContext(newCtx) 13843 defer func() { 13844 a.app.Srv().Store.SetContext(origCtx) 13845 a.ctx = origCtx 13846 }() 13847 13848 defer span.Finish() 13849 resultVar0 := a.app.SetPhase2PermissionsMigrationStatus(isComplete) 13850 13851 if resultVar0 != nil { 13852 span.LogFields(spanlog.Error(resultVar0)) 13853 ext.Error.Set(span, true) 13854 } 13855 13856 return resultVar0 13857 } 13858 13859 func (a *OpenTracingAppLayer) SetPluginKey(pluginId string, key string, value []byte) *model.AppError { 13860 origCtx := a.ctx 13861 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKey") 13862 13863 a.ctx = newCtx 13864 a.app.Srv().Store.SetContext(newCtx) 13865 defer func() { 13866 a.app.Srv().Store.SetContext(origCtx) 13867 a.ctx = origCtx 13868 }() 13869 13870 defer span.Finish() 13871 resultVar0 := a.app.SetPluginKey(pluginId, key, value) 13872 13873 if resultVar0 != nil { 13874 span.LogFields(spanlog.Error(resultVar0)) 13875 ext.Error.Set(span, true) 13876 } 13877 13878 return resultVar0 13879 } 13880 13881 func (a *OpenTracingAppLayer) SetPluginKeyWithExpiry(pluginId string, key string, value []byte, expireInSeconds int64) *model.AppError { 13882 origCtx := a.ctx 13883 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithExpiry") 13884 13885 a.ctx = newCtx 13886 a.app.Srv().Store.SetContext(newCtx) 13887 defer func() { 13888 a.app.Srv().Store.SetContext(origCtx) 13889 a.ctx = origCtx 13890 }() 13891 13892 defer span.Finish() 13893 resultVar0 := a.app.SetPluginKeyWithExpiry(pluginId, key, value, expireInSeconds) 13894 13895 if resultVar0 != nil { 13896 span.LogFields(spanlog.Error(resultVar0)) 13897 ext.Error.Set(span, true) 13898 } 13899 13900 return resultVar0 13901 } 13902 13903 func (a *OpenTracingAppLayer) SetPluginKeyWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) { 13904 origCtx := a.ctx 13905 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithOptions") 13906 13907 a.ctx = newCtx 13908 a.app.Srv().Store.SetContext(newCtx) 13909 defer func() { 13910 a.app.Srv().Store.SetContext(origCtx) 13911 a.ctx = origCtx 13912 }() 13913 13914 defer span.Finish() 13915 resultVar0, resultVar1 := a.app.SetPluginKeyWithOptions(pluginId, key, value, options) 13916 13917 if resultVar1 != nil { 13918 span.LogFields(spanlog.Error(resultVar1)) 13919 ext.Error.Set(span, true) 13920 } 13921 13922 return resultVar0, resultVar1 13923 } 13924 13925 func (a *OpenTracingAppLayer) SetPluginsEnvironment(pluginsEnvironment *plugin.Environment) { 13926 origCtx := a.ctx 13927 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginsEnvironment") 13928 13929 a.ctx = newCtx 13930 a.app.Srv().Store.SetContext(newCtx) 13931 defer func() { 13932 a.app.Srv().Store.SetContext(origCtx) 13933 a.ctx = origCtx 13934 }() 13935 13936 defer span.Finish() 13937 a.app.SetPluginsEnvironment(pluginsEnvironment) 13938 } 13939 13940 func (a *OpenTracingAppLayer) SetProfileImage(userID string, imageData *multipart.FileHeader) *model.AppError { 13941 origCtx := a.ctx 13942 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImage") 13943 13944 a.ctx = newCtx 13945 a.app.Srv().Store.SetContext(newCtx) 13946 defer func() { 13947 a.app.Srv().Store.SetContext(origCtx) 13948 a.ctx = origCtx 13949 }() 13950 13951 defer span.Finish() 13952 resultVar0 := a.app.SetProfileImage(userID, imageData) 13953 13954 if resultVar0 != nil { 13955 span.LogFields(spanlog.Error(resultVar0)) 13956 ext.Error.Set(span, true) 13957 } 13958 13959 return resultVar0 13960 } 13961 13962 func (a *OpenTracingAppLayer) SetProfileImageFromFile(userID string, file io.Reader) *model.AppError { 13963 origCtx := a.ctx 13964 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromFile") 13965 13966 a.ctx = newCtx 13967 a.app.Srv().Store.SetContext(newCtx) 13968 defer func() { 13969 a.app.Srv().Store.SetContext(origCtx) 13970 a.ctx = origCtx 13971 }() 13972 13973 defer span.Finish() 13974 resultVar0 := a.app.SetProfileImageFromFile(userID, file) 13975 13976 if resultVar0 != nil { 13977 span.LogFields(spanlog.Error(resultVar0)) 13978 ext.Error.Set(span, true) 13979 } 13980 13981 return resultVar0 13982 } 13983 13984 func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userID string, file multipart.File) *model.AppError { 13985 origCtx := a.ctx 13986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromMultiPartFile") 13987 13988 a.ctx = newCtx 13989 a.app.Srv().Store.SetContext(newCtx) 13990 defer func() { 13991 a.app.Srv().Store.SetContext(origCtx) 13992 a.ctx = origCtx 13993 }() 13994 13995 defer span.Finish() 13996 resultVar0 := a.app.SetProfileImageFromMultiPartFile(userID, file) 13997 13998 if resultVar0 != nil { 13999 span.LogFields(spanlog.Error(resultVar0)) 14000 ext.Error.Set(span, true) 14001 } 14002 14003 return resultVar0 14004 } 14005 14006 func (a *OpenTracingAppLayer) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError { 14007 origCtx := a.ctx 14008 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSamlIdpCertificateFromMetadata") 14009 14010 a.ctx = newCtx 14011 a.app.Srv().Store.SetContext(newCtx) 14012 defer func() { 14013 a.app.Srv().Store.SetContext(origCtx) 14014 a.ctx = origCtx 14015 }() 14016 14017 defer span.Finish() 14018 resultVar0 := a.app.SetSamlIdpCertificateFromMetadata(data) 14019 14020 if resultVar0 != nil { 14021 span.LogFields(spanlog.Error(resultVar0)) 14022 ext.Error.Set(span, true) 14023 } 14024 14025 return resultVar0 14026 } 14027 14028 func (a *OpenTracingAppLayer) SetSearchEngine(se *searchengine.Broker) { 14029 origCtx := a.ctx 14030 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSearchEngine") 14031 14032 a.ctx = newCtx 14033 a.app.Srv().Store.SetContext(newCtx) 14034 defer func() { 14035 a.app.Srv().Store.SetContext(origCtx) 14036 a.ctx = origCtx 14037 }() 14038 14039 defer span.Finish() 14040 a.app.SetSearchEngine(se) 14041 } 14042 14043 func (a *OpenTracingAppLayer) SetSessionExpireInDays(session *model.Session, days int) { 14044 origCtx := a.ctx 14045 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSessionExpireInDays") 14046 14047 a.ctx = newCtx 14048 a.app.Srv().Store.SetContext(newCtx) 14049 defer func() { 14050 a.app.Srv().Store.SetContext(origCtx) 14051 a.ctx = origCtx 14052 }() 14053 14054 defer span.Finish() 14055 a.app.SetSessionExpireInDays(session, days) 14056 } 14057 14058 func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userID string, manual bool) { 14059 origCtx := a.ctx 14060 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusAwayIfNeeded") 14061 14062 a.ctx = newCtx 14063 a.app.Srv().Store.SetContext(newCtx) 14064 defer func() { 14065 a.app.Srv().Store.SetContext(origCtx) 14066 a.ctx = origCtx 14067 }() 14068 14069 defer span.Finish() 14070 a.app.SetStatusAwayIfNeeded(userID, manual) 14071 } 14072 14073 func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userID string) { 14074 origCtx := a.ctx 14075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturb") 14076 14077 a.ctx = newCtx 14078 a.app.Srv().Store.SetContext(newCtx) 14079 defer func() { 14080 a.app.Srv().Store.SetContext(origCtx) 14081 a.ctx = origCtx 14082 }() 14083 14084 defer span.Finish() 14085 a.app.SetStatusDoNotDisturb(userID) 14086 } 14087 14088 func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userID string, activityAt int64) { 14089 origCtx := a.ctx 14090 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusLastActivityAt") 14091 14092 a.ctx = newCtx 14093 a.app.Srv().Store.SetContext(newCtx) 14094 defer func() { 14095 a.app.Srv().Store.SetContext(origCtx) 14096 a.ctx = origCtx 14097 }() 14098 14099 defer span.Finish() 14100 a.app.SetStatusLastActivityAt(userID, activityAt) 14101 } 14102 14103 func (a *OpenTracingAppLayer) SetStatusOffline(userID string, manual bool) { 14104 origCtx := a.ctx 14105 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOffline") 14106 14107 a.ctx = newCtx 14108 a.app.Srv().Store.SetContext(newCtx) 14109 defer func() { 14110 a.app.Srv().Store.SetContext(origCtx) 14111 a.ctx = origCtx 14112 }() 14113 14114 defer span.Finish() 14115 a.app.SetStatusOffline(userID, manual) 14116 } 14117 14118 func (a *OpenTracingAppLayer) SetStatusOnline(userID string, manual bool) { 14119 origCtx := a.ctx 14120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOnline") 14121 14122 a.ctx = newCtx 14123 a.app.Srv().Store.SetContext(newCtx) 14124 defer func() { 14125 a.app.Srv().Store.SetContext(origCtx) 14126 a.ctx = origCtx 14127 }() 14128 14129 defer span.Finish() 14130 a.app.SetStatusOnline(userID, manual) 14131 } 14132 14133 func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userID string) { 14134 origCtx := a.ctx 14135 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOutOfOffice") 14136 14137 a.ctx = newCtx 14138 a.app.Srv().Store.SetContext(newCtx) 14139 defer func() { 14140 a.app.Srv().Store.SetContext(origCtx) 14141 a.ctx = origCtx 14142 }() 14143 14144 defer span.Finish() 14145 a.app.SetStatusOutOfOffice(userID) 14146 } 14147 14148 func (a *OpenTracingAppLayer) SetTeamIcon(teamID string, imageData *multipart.FileHeader) *model.AppError { 14149 origCtx := a.ctx 14150 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIcon") 14151 14152 a.ctx = newCtx 14153 a.app.Srv().Store.SetContext(newCtx) 14154 defer func() { 14155 a.app.Srv().Store.SetContext(origCtx) 14156 a.ctx = origCtx 14157 }() 14158 14159 defer span.Finish() 14160 resultVar0 := a.app.SetTeamIcon(teamID, imageData) 14161 14162 if resultVar0 != nil { 14163 span.LogFields(spanlog.Error(resultVar0)) 14164 ext.Error.Set(span, true) 14165 } 14166 14167 return resultVar0 14168 } 14169 14170 func (a *OpenTracingAppLayer) SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError { 14171 origCtx := a.ctx 14172 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromFile") 14173 14174 a.ctx = newCtx 14175 a.app.Srv().Store.SetContext(newCtx) 14176 defer func() { 14177 a.app.Srv().Store.SetContext(origCtx) 14178 a.ctx = origCtx 14179 }() 14180 14181 defer span.Finish() 14182 resultVar0 := a.app.SetTeamIconFromFile(team, file) 14183 14184 if resultVar0 != nil { 14185 span.LogFields(spanlog.Error(resultVar0)) 14186 ext.Error.Set(span, true) 14187 } 14188 14189 return resultVar0 14190 } 14191 14192 func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamID string, file multipart.File) *model.AppError { 14193 origCtx := a.ctx 14194 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromMultiPartFile") 14195 14196 a.ctx = newCtx 14197 a.app.Srv().Store.SetContext(newCtx) 14198 defer func() { 14199 a.app.Srv().Store.SetContext(origCtx) 14200 a.ctx = origCtx 14201 }() 14202 14203 defer span.Finish() 14204 resultVar0 := a.app.SetTeamIconFromMultiPartFile(teamID, file) 14205 14206 if resultVar0 != nil { 14207 span.LogFields(spanlog.Error(resultVar0)) 14208 ext.Error.Set(span, true) 14209 } 14210 14211 return resultVar0 14212 } 14213 14214 func (a *OpenTracingAppLayer) SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) { 14215 origCtx := a.ctx 14216 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackImport") 14217 14218 a.ctx = newCtx 14219 a.app.Srv().Store.SetContext(newCtx) 14220 defer func() { 14221 a.app.Srv().Store.SetContext(origCtx) 14222 a.ctx = origCtx 14223 }() 14224 14225 defer span.Finish() 14226 resultVar0, resultVar1 := a.app.SlackImport(fileData, fileSize, teamID) 14227 14228 if resultVar0 != nil { 14229 span.LogFields(spanlog.Error(resultVar0)) 14230 ext.Error.Set(span, true) 14231 } 14232 14233 return resultVar0, resultVar1 14234 } 14235 14236 func (a *OpenTracingAppLayer) SoftDeleteTeam(teamID string) *model.AppError { 14237 origCtx := a.ctx 14238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SoftDeleteTeam") 14239 14240 a.ctx = newCtx 14241 a.app.Srv().Store.SetContext(newCtx) 14242 defer func() { 14243 a.app.Srv().Store.SetContext(origCtx) 14244 a.ctx = origCtx 14245 }() 14246 14247 defer span.Finish() 14248 resultVar0 := a.app.SoftDeleteTeam(teamID) 14249 14250 if resultVar0 != nil { 14251 span.LogFields(spanlog.Error(resultVar0)) 14252 ext.Error.Set(span, true) 14253 } 14254 14255 return resultVar0 14256 } 14257 14258 func (a *OpenTracingAppLayer) SubmitInteractiveDialog(request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) { 14259 origCtx := a.ctx 14260 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SubmitInteractiveDialog") 14261 14262 a.ctx = newCtx 14263 a.app.Srv().Store.SetContext(newCtx) 14264 defer func() { 14265 a.app.Srv().Store.SetContext(origCtx) 14266 a.ctx = origCtx 14267 }() 14268 14269 defer span.Finish() 14270 resultVar0, resultVar1 := a.app.SubmitInteractiveDialog(request) 14271 14272 if resultVar1 != nil { 14273 span.LogFields(spanlog.Error(resultVar1)) 14274 ext.Error.Set(span, true) 14275 } 14276 14277 return resultVar0, resultVar1 14278 } 14279 14280 func (a *OpenTracingAppLayer) SwitchEmailToLdap(email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) { 14281 origCtx := a.ctx 14282 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToLdap") 14283 14284 a.ctx = newCtx 14285 a.app.Srv().Store.SetContext(newCtx) 14286 defer func() { 14287 a.app.Srv().Store.SetContext(origCtx) 14288 a.ctx = origCtx 14289 }() 14290 14291 defer span.Finish() 14292 resultVar0, resultVar1 := a.app.SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword) 14293 14294 if resultVar1 != nil { 14295 span.LogFields(spanlog.Error(resultVar1)) 14296 ext.Error.Set(span, true) 14297 } 14298 14299 return resultVar0, resultVar1 14300 } 14301 14302 func (a *OpenTracingAppLayer) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) { 14303 origCtx := a.ctx 14304 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToOAuth") 14305 14306 a.ctx = newCtx 14307 a.app.Srv().Store.SetContext(newCtx) 14308 defer func() { 14309 a.app.Srv().Store.SetContext(origCtx) 14310 a.ctx = origCtx 14311 }() 14312 14313 defer span.Finish() 14314 resultVar0, resultVar1 := a.app.SwitchEmailToOAuth(w, r, email, password, code, service) 14315 14316 if resultVar1 != nil { 14317 span.LogFields(spanlog.Error(resultVar1)) 14318 ext.Error.Set(span, true) 14319 } 14320 14321 return resultVar0, resultVar1 14322 } 14323 14324 func (a *OpenTracingAppLayer) SwitchLdapToEmail(ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) { 14325 origCtx := a.ctx 14326 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchLdapToEmail") 14327 14328 a.ctx = newCtx 14329 a.app.Srv().Store.SetContext(newCtx) 14330 defer func() { 14331 a.app.Srv().Store.SetContext(origCtx) 14332 a.ctx = origCtx 14333 }() 14334 14335 defer span.Finish() 14336 resultVar0, resultVar1 := a.app.SwitchLdapToEmail(ldapPassword, code, email, newPassword) 14337 14338 if resultVar1 != nil { 14339 span.LogFields(spanlog.Error(resultVar1)) 14340 ext.Error.Set(span, true) 14341 } 14342 14343 return resultVar0, resultVar1 14344 } 14345 14346 func (a *OpenTracingAppLayer) SwitchOAuthToEmail(email string, password string, requesterId string) (string, *model.AppError) { 14347 origCtx := a.ctx 14348 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchOAuthToEmail") 14349 14350 a.ctx = newCtx 14351 a.app.Srv().Store.SetContext(newCtx) 14352 defer func() { 14353 a.app.Srv().Store.SetContext(origCtx) 14354 a.ctx = origCtx 14355 }() 14356 14357 defer span.Finish() 14358 resultVar0, resultVar1 := a.app.SwitchOAuthToEmail(email, password, requesterId) 14359 14360 if resultVar1 != nil { 14361 span.LogFields(spanlog.Error(resultVar1)) 14362 ext.Error.Set(span, true) 14363 } 14364 14365 return resultVar0, resultVar1 14366 } 14367 14368 func (a *OpenTracingAppLayer) SyncLdap() { 14369 origCtx := a.ctx 14370 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncLdap") 14371 14372 a.ctx = newCtx 14373 a.app.Srv().Store.SetContext(newCtx) 14374 defer func() { 14375 a.app.Srv().Store.SetContext(origCtx) 14376 a.ctx = origCtx 14377 }() 14378 14379 defer span.Finish() 14380 a.app.SyncLdap() 14381 } 14382 14383 func (a *OpenTracingAppLayer) SyncPlugins() *model.AppError { 14384 origCtx := a.ctx 14385 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPlugins") 14386 14387 a.ctx = newCtx 14388 a.app.Srv().Store.SetContext(newCtx) 14389 defer func() { 14390 a.app.Srv().Store.SetContext(origCtx) 14391 a.ctx = origCtx 14392 }() 14393 14394 defer span.Finish() 14395 resultVar0 := a.app.SyncPlugins() 14396 14397 if resultVar0 != nil { 14398 span.LogFields(spanlog.Error(resultVar0)) 14399 ext.Error.Set(span, true) 14400 } 14401 14402 return resultVar0 14403 } 14404 14405 func (a *OpenTracingAppLayer) SyncPluginsActiveState() { 14406 origCtx := a.ctx 14407 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPluginsActiveState") 14408 14409 a.ctx = newCtx 14410 a.app.Srv().Store.SetContext(newCtx) 14411 defer func() { 14412 a.app.Srv().Store.SetContext(origCtx) 14413 a.ctx = origCtx 14414 }() 14415 14416 defer span.Finish() 14417 a.app.SyncPluginsActiveState() 14418 } 14419 14420 func (a *OpenTracingAppLayer) SyncRolesAndMembership(syncableID string, syncableType model.GroupSyncableType) { 14421 origCtx := a.ctx 14422 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncRolesAndMembership") 14423 14424 a.ctx = newCtx 14425 a.app.Srv().Store.SetContext(newCtx) 14426 defer func() { 14427 a.app.Srv().Store.SetContext(origCtx) 14428 a.ctx = origCtx 14429 }() 14430 14431 defer span.Finish() 14432 a.app.SyncRolesAndMembership(syncableID, syncableType) 14433 } 14434 14435 func (a *OpenTracingAppLayer) SyncSyncableRoles(syncableID string, syncableType model.GroupSyncableType) *model.AppError { 14436 origCtx := a.ctx 14437 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncSyncableRoles") 14438 14439 a.ctx = newCtx 14440 a.app.Srv().Store.SetContext(newCtx) 14441 defer func() { 14442 a.app.Srv().Store.SetContext(origCtx) 14443 a.ctx = origCtx 14444 }() 14445 14446 defer span.Finish() 14447 resultVar0 := a.app.SyncSyncableRoles(syncableID, syncableType) 14448 14449 if resultVar0 != nil { 14450 span.LogFields(spanlog.Error(resultVar0)) 14451 ext.Error.Set(span, true) 14452 } 14453 14454 return resultVar0 14455 } 14456 14457 func (a *OpenTracingAppLayer) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 14458 origCtx := a.ctx 14459 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersMinusGroupMembers") 14460 14461 a.ctx = newCtx 14462 a.app.Srv().Store.SetContext(newCtx) 14463 defer func() { 14464 a.app.Srv().Store.SetContext(origCtx) 14465 a.ctx = origCtx 14466 }() 14467 14468 defer span.Finish() 14469 resultVar0, resultVar1, resultVar2 := a.app.TeamMembersMinusGroupMembers(teamID, groupIDs, page, perPage) 14470 14471 if resultVar2 != nil { 14472 span.LogFields(spanlog.Error(resultVar2)) 14473 ext.Error.Set(span, true) 14474 } 14475 14476 return resultVar0, resultVar1, resultVar2 14477 } 14478 14479 func (a *OpenTracingAppLayer) TeamMembersToAdd(since int64, teamID *string) ([]*model.UserTeamIDPair, *model.AppError) { 14480 origCtx := a.ctx 14481 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToAdd") 14482 14483 a.ctx = newCtx 14484 a.app.Srv().Store.SetContext(newCtx) 14485 defer func() { 14486 a.app.Srv().Store.SetContext(origCtx) 14487 a.ctx = origCtx 14488 }() 14489 14490 defer span.Finish() 14491 resultVar0, resultVar1 := a.app.TeamMembersToAdd(since, teamID) 14492 14493 if resultVar1 != nil { 14494 span.LogFields(spanlog.Error(resultVar1)) 14495 ext.Error.Set(span, true) 14496 } 14497 14498 return resultVar0, resultVar1 14499 } 14500 14501 func (a *OpenTracingAppLayer) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError) { 14502 origCtx := a.ctx 14503 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToRemove") 14504 14505 a.ctx = newCtx 14506 a.app.Srv().Store.SetContext(newCtx) 14507 defer func() { 14508 a.app.Srv().Store.SetContext(origCtx) 14509 a.ctx = origCtx 14510 }() 14511 14512 defer span.Finish() 14513 resultVar0, resultVar1 := a.app.TeamMembersToRemove(teamID) 14514 14515 if resultVar1 != nil { 14516 span.LogFields(spanlog.Error(resultVar1)) 14517 ext.Error.Set(span, true) 14518 } 14519 14520 return resultVar0, resultVar1 14521 } 14522 14523 func (a *OpenTracingAppLayer) TelemetryId() string { 14524 origCtx := a.ctx 14525 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TelemetryId") 14526 14527 a.ctx = newCtx 14528 a.app.Srv().Store.SetContext(newCtx) 14529 defer func() { 14530 a.app.Srv().Store.SetContext(origCtx) 14531 a.ctx = origCtx 14532 }() 14533 14534 defer span.Finish() 14535 resultVar0 := a.app.TelemetryId() 14536 14537 return resultVar0 14538 } 14539 14540 func (a *OpenTracingAppLayer) TestElasticsearch(cfg *model.Config) *model.AppError { 14541 origCtx := a.ctx 14542 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestElasticsearch") 14543 14544 a.ctx = newCtx 14545 a.app.Srv().Store.SetContext(newCtx) 14546 defer func() { 14547 a.app.Srv().Store.SetContext(origCtx) 14548 a.ctx = origCtx 14549 }() 14550 14551 defer span.Finish() 14552 resultVar0 := a.app.TestElasticsearch(cfg) 14553 14554 if resultVar0 != nil { 14555 span.LogFields(spanlog.Error(resultVar0)) 14556 ext.Error.Set(span, true) 14557 } 14558 14559 return resultVar0 14560 } 14561 14562 func (a *OpenTracingAppLayer) TestEmail(userID string, cfg *model.Config) *model.AppError { 14563 origCtx := a.ctx 14564 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestEmail") 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.TestEmail(userID, cfg) 14575 14576 if resultVar0 != nil { 14577 span.LogFields(spanlog.Error(resultVar0)) 14578 ext.Error.Set(span, true) 14579 } 14580 14581 return resultVar0 14582 } 14583 14584 func (a *OpenTracingAppLayer) TestFilesStoreConnection() *model.AppError { 14585 origCtx := a.ctx 14586 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFilesStoreConnection") 14587 14588 a.ctx = newCtx 14589 a.app.Srv().Store.SetContext(newCtx) 14590 defer func() { 14591 a.app.Srv().Store.SetContext(origCtx) 14592 a.ctx = origCtx 14593 }() 14594 14595 defer span.Finish() 14596 resultVar0 := a.app.TestFilesStoreConnection() 14597 14598 if resultVar0 != nil { 14599 span.LogFields(spanlog.Error(resultVar0)) 14600 ext.Error.Set(span, true) 14601 } 14602 14603 return resultVar0 14604 } 14605 14606 func (a *OpenTracingAppLayer) TestFilesStoreConnectionWithConfig(cfg *model.FileSettings) *model.AppError { 14607 origCtx := a.ctx 14608 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestFilesStoreConnectionWithConfig") 14609 14610 a.ctx = newCtx 14611 a.app.Srv().Store.SetContext(newCtx) 14612 defer func() { 14613 a.app.Srv().Store.SetContext(origCtx) 14614 a.ctx = origCtx 14615 }() 14616 14617 defer span.Finish() 14618 resultVar0 := a.app.TestFilesStoreConnectionWithConfig(cfg) 14619 14620 if resultVar0 != nil { 14621 span.LogFields(spanlog.Error(resultVar0)) 14622 ext.Error.Set(span, true) 14623 } 14624 14625 return resultVar0 14626 } 14627 14628 func (a *OpenTracingAppLayer) TestLdap() *model.AppError { 14629 origCtx := a.ctx 14630 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestLdap") 14631 14632 a.ctx = newCtx 14633 a.app.Srv().Store.SetContext(newCtx) 14634 defer func() { 14635 a.app.Srv().Store.SetContext(origCtx) 14636 a.ctx = origCtx 14637 }() 14638 14639 defer span.Finish() 14640 resultVar0 := a.app.TestLdap() 14641 14642 if resultVar0 != nil { 14643 span.LogFields(spanlog.Error(resultVar0)) 14644 ext.Error.Set(span, true) 14645 } 14646 14647 return resultVar0 14648 } 14649 14650 func (a *OpenTracingAppLayer) TestSiteURL(siteURL string) *model.AppError { 14651 origCtx := a.ctx 14652 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestSiteURL") 14653 14654 a.ctx = newCtx 14655 a.app.Srv().Store.SetContext(newCtx) 14656 defer func() { 14657 a.app.Srv().Store.SetContext(origCtx) 14658 a.ctx = origCtx 14659 }() 14660 14661 defer span.Finish() 14662 resultVar0 := a.app.TestSiteURL(siteURL) 14663 14664 if resultVar0 != nil { 14665 span.LogFields(spanlog.Error(resultVar0)) 14666 ext.Error.Set(span, true) 14667 } 14668 14669 return resultVar0 14670 } 14671 14672 func (a *OpenTracingAppLayer) ToggleMuteChannel(channelId string, userID string) (*model.ChannelMember, *model.AppError) { 14673 origCtx := a.ctx 14674 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ToggleMuteChannel") 14675 14676 a.ctx = newCtx 14677 a.app.Srv().Store.SetContext(newCtx) 14678 defer func() { 14679 a.app.Srv().Store.SetContext(origCtx) 14680 a.ctx = origCtx 14681 }() 14682 14683 defer span.Finish() 14684 resultVar0, resultVar1 := a.app.ToggleMuteChannel(channelId, userID) 14685 14686 if resultVar1 != nil { 14687 span.LogFields(spanlog.Error(resultVar1)) 14688 ext.Error.Set(span, true) 14689 } 14690 14691 return resultVar0, resultVar1 14692 } 14693 14694 func (a *OpenTracingAppLayer) TotalWebsocketConnections() int { 14695 origCtx := a.ctx 14696 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TotalWebsocketConnections") 14697 14698 a.ctx = newCtx 14699 a.app.Srv().Store.SetContext(newCtx) 14700 defer func() { 14701 a.app.Srv().Store.SetContext(origCtx) 14702 a.ctx = origCtx 14703 }() 14704 14705 defer span.Finish() 14706 resultVar0 := a.app.TotalWebsocketConnections() 14707 14708 return resultVar0 14709 } 14710 14711 func (a *OpenTracingAppLayer) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel) { 14712 origCtx := a.ctx 14713 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TriggerWebhook") 14714 14715 a.ctx = newCtx 14716 a.app.Srv().Store.SetContext(newCtx) 14717 defer func() { 14718 a.app.Srv().Store.SetContext(origCtx) 14719 a.ctx = origCtx 14720 }() 14721 14722 defer span.Finish() 14723 a.app.TriggerWebhook(payload, hook, post, channel) 14724 } 14725 14726 func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginId string, teamID string, trigger string) { 14727 origCtx := a.ctx 14728 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommand") 14729 14730 a.ctx = newCtx 14731 a.app.Srv().Store.SetContext(newCtx) 14732 defer func() { 14733 a.app.Srv().Store.SetContext(origCtx) 14734 a.ctx = origCtx 14735 }() 14736 14737 defer span.Finish() 14738 a.app.UnregisterPluginCommand(pluginId, teamID, trigger) 14739 } 14740 14741 func (a *OpenTracingAppLayer) UnregisterPluginCommands(pluginId string) { 14742 origCtx := a.ctx 14743 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommands") 14744 14745 a.ctx = newCtx 14746 a.app.Srv().Store.SetContext(newCtx) 14747 defer func() { 14748 a.app.Srv().Store.SetContext(origCtx) 14749 a.ctx = origCtx 14750 }() 14751 14752 defer span.Finish() 14753 a.app.UnregisterPluginCommands(pluginId) 14754 } 14755 14756 func (a *OpenTracingAppLayer) UpdateActive(user *model.User, active bool) (*model.User, *model.AppError) { 14757 origCtx := a.ctx 14758 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateActive") 14759 14760 a.ctx = newCtx 14761 a.app.Srv().Store.SetContext(newCtx) 14762 defer func() { 14763 a.app.Srv().Store.SetContext(origCtx) 14764 a.ctx = origCtx 14765 }() 14766 14767 defer span.Finish() 14768 resultVar0, resultVar1 := a.app.UpdateActive(user, active) 14769 14770 if resultVar1 != nil { 14771 span.LogFields(spanlog.Error(resultVar1)) 14772 ext.Error.Set(span, true) 14773 } 14774 14775 return resultVar0, resultVar1 14776 } 14777 14778 func (a *OpenTracingAppLayer) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError) { 14779 origCtx := a.ctx 14780 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotActive") 14781 14782 a.ctx = newCtx 14783 a.app.Srv().Store.SetContext(newCtx) 14784 defer func() { 14785 a.app.Srv().Store.SetContext(origCtx) 14786 a.ctx = origCtx 14787 }() 14788 14789 defer span.Finish() 14790 resultVar0, resultVar1 := a.app.UpdateBotActive(botUserId, active) 14791 14792 if resultVar1 != nil { 14793 span.LogFields(spanlog.Error(resultVar1)) 14794 ext.Error.Set(span, true) 14795 } 14796 14797 return resultVar0, resultVar1 14798 } 14799 14800 func (a *OpenTracingAppLayer) UpdateBotOwner(botUserId string, newOwnerId string) (*model.Bot, *model.AppError) { 14801 origCtx := a.ctx 14802 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotOwner") 14803 14804 a.ctx = newCtx 14805 a.app.Srv().Store.SetContext(newCtx) 14806 defer func() { 14807 a.app.Srv().Store.SetContext(origCtx) 14808 a.ctx = origCtx 14809 }() 14810 14811 defer span.Finish() 14812 resultVar0, resultVar1 := a.app.UpdateBotOwner(botUserId, newOwnerId) 14813 14814 if resultVar1 != nil { 14815 span.LogFields(spanlog.Error(resultVar1)) 14816 ext.Error.Set(span, true) 14817 } 14818 14819 return resultVar0, resultVar1 14820 } 14821 14822 func (a *OpenTracingAppLayer) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { 14823 origCtx := a.ctx 14824 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannel") 14825 14826 a.ctx = newCtx 14827 a.app.Srv().Store.SetContext(newCtx) 14828 defer func() { 14829 a.app.Srv().Store.SetContext(origCtx) 14830 a.ctx = origCtx 14831 }() 14832 14833 defer span.Finish() 14834 resultVar0, resultVar1 := a.app.UpdateChannel(channel) 14835 14836 if resultVar1 != nil { 14837 span.LogFields(spanlog.Error(resultVar1)) 14838 ext.Error.Set(span, true) 14839 } 14840 14841 return resultVar0, resultVar1 14842 } 14843 14844 func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, userID string) *model.AppError { 14845 origCtx := a.ctx 14846 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelLastViewedAt") 14847 14848 a.ctx = newCtx 14849 a.app.Srv().Store.SetContext(newCtx) 14850 defer func() { 14851 a.app.Srv().Store.SetContext(origCtx) 14852 a.ctx = origCtx 14853 }() 14854 14855 defer span.Finish() 14856 resultVar0 := a.app.UpdateChannelLastViewedAt(channelIds, userID) 14857 14858 if resultVar0 != nil { 14859 span.LogFields(spanlog.Error(resultVar0)) 14860 ext.Error.Set(span, true) 14861 } 14862 14863 return resultVar0 14864 } 14865 14866 func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userID string) (*model.ChannelMember, *model.AppError) { 14867 origCtx := a.ctx 14868 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberNotifyProps") 14869 14870 a.ctx = newCtx 14871 a.app.Srv().Store.SetContext(newCtx) 14872 defer func() { 14873 a.app.Srv().Store.SetContext(origCtx) 14874 a.ctx = origCtx 14875 }() 14876 14877 defer span.Finish() 14878 resultVar0, resultVar1 := a.app.UpdateChannelMemberNotifyProps(data, channelId, userID) 14879 14880 if resultVar1 != nil { 14881 span.LogFields(spanlog.Error(resultVar1)) 14882 ext.Error.Set(span, true) 14883 } 14884 14885 return resultVar0, resultVar1 14886 } 14887 14888 func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userID string, newRoles string) (*model.ChannelMember, *model.AppError) { 14889 origCtx := a.ctx 14890 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberRoles") 14891 14892 a.ctx = newCtx 14893 a.app.Srv().Store.SetContext(newCtx) 14894 defer func() { 14895 a.app.Srv().Store.SetContext(origCtx) 14896 a.ctx = origCtx 14897 }() 14898 14899 defer span.Finish() 14900 resultVar0, resultVar1 := a.app.UpdateChannelMemberRoles(channelId, userID, newRoles) 14901 14902 if resultVar1 != nil { 14903 span.LogFields(spanlog.Error(resultVar1)) 14904 ext.Error.Set(span, true) 14905 } 14906 14907 return resultVar0, resultVar1 14908 } 14909 14910 func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelId string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { 14911 origCtx := a.ctx 14912 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberSchemeRoles") 14913 14914 a.ctx = newCtx 14915 a.app.Srv().Store.SetContext(newCtx) 14916 defer func() { 14917 a.app.Srv().Store.SetContext(origCtx) 14918 a.ctx = origCtx 14919 }() 14920 14921 defer span.Finish() 14922 resultVar0, resultVar1 := a.app.UpdateChannelMemberSchemeRoles(channelId, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) 14923 14924 if resultVar1 != nil { 14925 span.LogFields(spanlog.Error(resultVar1)) 14926 ext.Error.Set(span, true) 14927 } 14928 14929 return resultVar0, resultVar1 14930 } 14931 14932 func (a *OpenTracingAppLayer) UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User) (*model.Channel, *model.AppError) { 14933 origCtx := a.ctx 14934 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelPrivacy") 14935 14936 a.ctx = newCtx 14937 a.app.Srv().Store.SetContext(newCtx) 14938 defer func() { 14939 a.app.Srv().Store.SetContext(origCtx) 14940 a.ctx = origCtx 14941 }() 14942 14943 defer span.Finish() 14944 resultVar0, resultVar1 := a.app.UpdateChannelPrivacy(oldChannel, user) 14945 14946 if resultVar1 != nil { 14947 span.LogFields(spanlog.Error(resultVar1)) 14948 ext.Error.Set(span, true) 14949 } 14950 14951 return resultVar0, resultVar1 14952 } 14953 14954 func (a *OpenTracingAppLayer) UpdateChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 14955 origCtx := a.ctx 14956 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelScheme") 14957 14958 a.ctx = newCtx 14959 a.app.Srv().Store.SetContext(newCtx) 14960 defer func() { 14961 a.app.Srv().Store.SetContext(origCtx) 14962 a.ctx = origCtx 14963 }() 14964 14965 defer span.Finish() 14966 resultVar0, resultVar1 := a.app.UpdateChannelScheme(channel) 14967 14968 if resultVar1 != nil { 14969 span.LogFields(spanlog.Error(resultVar1)) 14970 ext.Error.Set(span, true) 14971 } 14972 14973 return resultVar0, resultVar1 14974 } 14975 14976 func (a *OpenTracingAppLayer) UpdateCommand(oldCmd *model.Command, updatedCmd *model.Command) (*model.Command, *model.AppError) { 14977 origCtx := a.ctx 14978 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateCommand") 14979 14980 a.ctx = newCtx 14981 a.app.Srv().Store.SetContext(newCtx) 14982 defer func() { 14983 a.app.Srv().Store.SetContext(origCtx) 14984 a.ctx = origCtx 14985 }() 14986 14987 defer span.Finish() 14988 resultVar0, resultVar1 := a.app.UpdateCommand(oldCmd, updatedCmd) 14989 14990 if resultVar1 != nil { 14991 span.LogFields(spanlog.Error(resultVar1)) 14992 ext.Error.Set(span, true) 14993 } 14994 14995 return resultVar0, resultVar1 14996 } 14997 14998 func (a *OpenTracingAppLayer) UpdateConfig(f func(*model.Config)) { 14999 origCtx := a.ctx 15000 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateConfig") 15001 15002 a.ctx = newCtx 15003 a.app.Srv().Store.SetContext(newCtx) 15004 defer func() { 15005 a.app.Srv().Store.SetContext(origCtx) 15006 a.ctx = origCtx 15007 }() 15008 15009 defer span.Finish() 15010 a.app.UpdateConfig(f) 15011 } 15012 15013 func (a *OpenTracingAppLayer) UpdateEphemeralPost(userID string, post *model.Post) *model.Post { 15014 origCtx := a.ctx 15015 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateEphemeralPost") 15016 15017 a.ctx = newCtx 15018 a.app.Srv().Store.SetContext(newCtx) 15019 defer func() { 15020 a.app.Srv().Store.SetContext(origCtx) 15021 a.ctx = origCtx 15022 }() 15023 15024 defer span.Finish() 15025 resultVar0 := a.app.UpdateEphemeralPost(userID, post) 15026 15027 return resultVar0 15028 } 15029 15030 func (a *OpenTracingAppLayer) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) { 15031 origCtx := a.ctx 15032 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroup") 15033 15034 a.ctx = newCtx 15035 a.app.Srv().Store.SetContext(newCtx) 15036 defer func() { 15037 a.app.Srv().Store.SetContext(origCtx) 15038 a.ctx = origCtx 15039 }() 15040 15041 defer span.Finish() 15042 resultVar0, resultVar1 := a.app.UpdateGroup(group) 15043 15044 if resultVar1 != nil { 15045 span.LogFields(spanlog.Error(resultVar1)) 15046 ext.Error.Set(span, true) 15047 } 15048 15049 return resultVar0, resultVar1 15050 } 15051 15052 func (a *OpenTracingAppLayer) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 15053 origCtx := a.ctx 15054 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroupSyncable") 15055 15056 a.ctx = newCtx 15057 a.app.Srv().Store.SetContext(newCtx) 15058 defer func() { 15059 a.app.Srv().Store.SetContext(origCtx) 15060 a.ctx = origCtx 15061 }() 15062 15063 defer span.Finish() 15064 resultVar0, resultVar1 := a.app.UpdateGroupSyncable(groupSyncable) 15065 15066 if resultVar1 != nil { 15067 span.LogFields(spanlog.Error(resultVar1)) 15068 ext.Error.Set(span, true) 15069 } 15070 15071 return resultVar0, resultVar1 15072 } 15073 15074 func (a *OpenTracingAppLayer) UpdateHashedPassword(user *model.User, newHashedPassword string) *model.AppError { 15075 origCtx := a.ctx 15076 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateHashedPassword") 15077 15078 a.ctx = newCtx 15079 a.app.Srv().Store.SetContext(newCtx) 15080 defer func() { 15081 a.app.Srv().Store.SetContext(origCtx) 15082 a.ctx = origCtx 15083 }() 15084 15085 defer span.Finish() 15086 resultVar0 := a.app.UpdateHashedPassword(user, newHashedPassword) 15087 15088 if resultVar0 != nil { 15089 span.LogFields(spanlog.Error(resultVar0)) 15090 ext.Error.Set(span, true) 15091 } 15092 15093 return resultVar0 15094 } 15095 15096 func (a *OpenTracingAppLayer) UpdateHashedPasswordByUserId(userID string, newHashedPassword string) *model.AppError { 15097 origCtx := a.ctx 15098 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateHashedPasswordByUserId") 15099 15100 a.ctx = newCtx 15101 a.app.Srv().Store.SetContext(newCtx) 15102 defer func() { 15103 a.app.Srv().Store.SetContext(origCtx) 15104 a.ctx = origCtx 15105 }() 15106 15107 defer span.Finish() 15108 resultVar0 := a.app.UpdateHashedPasswordByUserId(userID, newHashedPassword) 15109 15110 if resultVar0 != nil { 15111 span.LogFields(spanlog.Error(resultVar0)) 15112 ext.Error.Set(span, true) 15113 } 15114 15115 return resultVar0 15116 } 15117 15118 func (a *OpenTracingAppLayer) UpdateIncomingWebhook(oldHook *model.IncomingWebhook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 15119 origCtx := a.ctx 15120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateIncomingWebhook") 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 resultVar0, resultVar1 := a.app.UpdateIncomingWebhook(oldHook, updatedHook) 15131 15132 if resultVar1 != nil { 15133 span.LogFields(spanlog.Error(resultVar1)) 15134 ext.Error.Set(span, true) 15135 } 15136 15137 return resultVar0, resultVar1 15138 } 15139 15140 func (a *OpenTracingAppLayer) UpdateLastActivityAtIfNeeded(session model.Session) { 15141 origCtx := a.ctx 15142 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateLastActivityAtIfNeeded") 15143 15144 a.ctx = newCtx 15145 a.app.Srv().Store.SetContext(newCtx) 15146 defer func() { 15147 a.app.Srv().Store.SetContext(origCtx) 15148 a.ctx = origCtx 15149 }() 15150 15151 defer span.Finish() 15152 a.app.UpdateLastActivityAtIfNeeded(session) 15153 } 15154 15155 func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userID string, token string) *model.AppError { 15156 origCtx := a.ctx 15157 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMfa") 15158 15159 a.ctx = newCtx 15160 a.app.Srv().Store.SetContext(newCtx) 15161 defer func() { 15162 a.app.Srv().Store.SetContext(origCtx) 15163 a.ctx = origCtx 15164 }() 15165 15166 defer span.Finish() 15167 resultVar0 := a.app.UpdateMfa(activate, userID, token) 15168 15169 if resultVar0 != nil { 15170 span.LogFields(spanlog.Error(resultVar0)) 15171 ext.Error.Set(span, true) 15172 } 15173 15174 return resultVar0 15175 } 15176 15177 func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userID string) { 15178 origCtx := a.ctx 15179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMobileAppBadge") 15180 15181 a.ctx = newCtx 15182 a.app.Srv().Store.SetContext(newCtx) 15183 defer func() { 15184 a.app.Srv().Store.SetContext(origCtx) 15185 a.ctx = origCtx 15186 }() 15187 15188 defer span.Finish() 15189 a.app.UpdateMobileAppBadge(userID) 15190 } 15191 15192 func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string, tokenUser *model.User) *model.AppError { 15193 origCtx := a.ctx 15194 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOAuthUserAttrs") 15195 15196 a.ctx = newCtx 15197 a.app.Srv().Store.SetContext(newCtx) 15198 defer func() { 15199 a.app.Srv().Store.SetContext(origCtx) 15200 a.ctx = origCtx 15201 }() 15202 15203 defer span.Finish() 15204 resultVar0 := a.app.UpdateOAuthUserAttrs(userData, user, provider, service, tokenUser) 15205 15206 if resultVar0 != nil { 15207 span.LogFields(spanlog.Error(resultVar0)) 15208 ext.Error.Set(span, true) 15209 } 15210 15211 return resultVar0 15212 } 15213 15214 func (a *OpenTracingAppLayer) UpdateOauthApp(oldApp *model.OAuthApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 15215 origCtx := a.ctx 15216 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOauthApp") 15217 15218 a.ctx = newCtx 15219 a.app.Srv().Store.SetContext(newCtx) 15220 defer func() { 15221 a.app.Srv().Store.SetContext(origCtx) 15222 a.ctx = origCtx 15223 }() 15224 15225 defer span.Finish() 15226 resultVar0, resultVar1 := a.app.UpdateOauthApp(oldApp, updatedApp) 15227 15228 if resultVar1 != nil { 15229 span.LogFields(spanlog.Error(resultVar1)) 15230 ext.Error.Set(span, true) 15231 } 15232 15233 return resultVar0, resultVar1 15234 } 15235 15236 func (a *OpenTracingAppLayer) UpdateOutgoingWebhook(oldHook *model.OutgoingWebhook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 15237 origCtx := a.ctx 15238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOutgoingWebhook") 15239 15240 a.ctx = newCtx 15241 a.app.Srv().Store.SetContext(newCtx) 15242 defer func() { 15243 a.app.Srv().Store.SetContext(origCtx) 15244 a.ctx = origCtx 15245 }() 15246 15247 defer span.Finish() 15248 resultVar0, resultVar1 := a.app.UpdateOutgoingWebhook(oldHook, updatedHook) 15249 15250 if resultVar1 != nil { 15251 span.LogFields(spanlog.Error(resultVar1)) 15252 ext.Error.Set(span, true) 15253 } 15254 15255 return resultVar0, resultVar1 15256 } 15257 15258 func (a *OpenTracingAppLayer) UpdatePassword(user *model.User, newPassword string) *model.AppError { 15259 origCtx := a.ctx 15260 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePassword") 15261 15262 a.ctx = newCtx 15263 a.app.Srv().Store.SetContext(newCtx) 15264 defer func() { 15265 a.app.Srv().Store.SetContext(origCtx) 15266 a.ctx = origCtx 15267 }() 15268 15269 defer span.Finish() 15270 resultVar0 := a.app.UpdatePassword(user, newPassword) 15271 15272 if resultVar0 != nil { 15273 span.LogFields(spanlog.Error(resultVar0)) 15274 ext.Error.Set(span, true) 15275 } 15276 15277 return resultVar0 15278 } 15279 15280 func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userID string, currentPassword string, newPassword string) *model.AppError { 15281 origCtx := a.ctx 15282 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordAsUser") 15283 15284 a.ctx = newCtx 15285 a.app.Srv().Store.SetContext(newCtx) 15286 defer func() { 15287 a.app.Srv().Store.SetContext(origCtx) 15288 a.ctx = origCtx 15289 }() 15290 15291 defer span.Finish() 15292 resultVar0 := a.app.UpdatePasswordAsUser(userID, currentPassword, newPassword) 15293 15294 if resultVar0 != nil { 15295 span.LogFields(spanlog.Error(resultVar0)) 15296 ext.Error.Set(span, true) 15297 } 15298 15299 return resultVar0 15300 } 15301 15302 func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userID string, newPassword string, method string) *model.AppError { 15303 origCtx := a.ctx 15304 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordByUserIdSendEmail") 15305 15306 a.ctx = newCtx 15307 a.app.Srv().Store.SetContext(newCtx) 15308 defer func() { 15309 a.app.Srv().Store.SetContext(origCtx) 15310 a.ctx = origCtx 15311 }() 15312 15313 defer span.Finish() 15314 resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userID, newPassword, method) 15315 15316 if resultVar0 != nil { 15317 span.LogFields(spanlog.Error(resultVar0)) 15318 ext.Error.Set(span, true) 15319 } 15320 15321 return resultVar0 15322 } 15323 15324 func (a *OpenTracingAppLayer) UpdatePasswordSendEmail(user *model.User, newPassword string, method string) *model.AppError { 15325 origCtx := a.ctx 15326 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordSendEmail") 15327 15328 a.ctx = newCtx 15329 a.app.Srv().Store.SetContext(newCtx) 15330 defer func() { 15331 a.app.Srv().Store.SetContext(origCtx) 15332 a.ctx = origCtx 15333 }() 15334 15335 defer span.Finish() 15336 resultVar0 := a.app.UpdatePasswordSendEmail(user, newPassword, method) 15337 15338 if resultVar0 != nil { 15339 span.LogFields(spanlog.Error(resultVar0)) 15340 ext.Error.Set(span, true) 15341 } 15342 15343 return resultVar0 15344 } 15345 15346 func (a *OpenTracingAppLayer) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) { 15347 origCtx := a.ctx 15348 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePost") 15349 15350 a.ctx = newCtx 15351 a.app.Srv().Store.SetContext(newCtx) 15352 defer func() { 15353 a.app.Srv().Store.SetContext(origCtx) 15354 a.ctx = origCtx 15355 }() 15356 15357 defer span.Finish() 15358 resultVar0, resultVar1 := a.app.UpdatePost(post, safeUpdate) 15359 15360 if resultVar1 != nil { 15361 span.LogFields(spanlog.Error(resultVar1)) 15362 ext.Error.Set(span, true) 15363 } 15364 15365 return resultVar0, resultVar1 15366 } 15367 15368 func (a *OpenTracingAppLayer) UpdatePreferences(userID string, preferences model.Preferences) *model.AppError { 15369 origCtx := a.ctx 15370 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePreferences") 15371 15372 a.ctx = newCtx 15373 a.app.Srv().Store.SetContext(newCtx) 15374 defer func() { 15375 a.app.Srv().Store.SetContext(origCtx) 15376 a.ctx = origCtx 15377 }() 15378 15379 defer span.Finish() 15380 resultVar0 := a.app.UpdatePreferences(userID, preferences) 15381 15382 if resultVar0 != nil { 15383 span.LogFields(spanlog.Error(resultVar0)) 15384 ext.Error.Set(span, true) 15385 } 15386 15387 return resultVar0 15388 } 15389 15390 func (a *OpenTracingAppLayer) UpdateProductNotices() *model.AppError { 15391 origCtx := a.ctx 15392 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateProductNotices") 15393 15394 a.ctx = newCtx 15395 a.app.Srv().Store.SetContext(newCtx) 15396 defer func() { 15397 a.app.Srv().Store.SetContext(origCtx) 15398 a.ctx = origCtx 15399 }() 15400 15401 defer span.Finish() 15402 resultVar0 := a.app.UpdateProductNotices() 15403 15404 if resultVar0 != nil { 15405 span.LogFields(spanlog.Error(resultVar0)) 15406 ext.Error.Set(span, true) 15407 } 15408 15409 return resultVar0 15410 } 15411 15412 func (a *OpenTracingAppLayer) UpdateRole(role *model.Role) (*model.Role, *model.AppError) { 15413 origCtx := a.ctx 15414 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRole") 15415 15416 a.ctx = newCtx 15417 a.app.Srv().Store.SetContext(newCtx) 15418 defer func() { 15419 a.app.Srv().Store.SetContext(origCtx) 15420 a.ctx = origCtx 15421 }() 15422 15423 defer span.Finish() 15424 resultVar0, resultVar1 := a.app.UpdateRole(role) 15425 15426 if resultVar1 != nil { 15427 span.LogFields(spanlog.Error(resultVar1)) 15428 ext.Error.Set(span, true) 15429 } 15430 15431 return resultVar0, resultVar1 15432 } 15433 15434 func (a *OpenTracingAppLayer) UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 15435 origCtx := a.ctx 15436 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateScheme") 15437 15438 a.ctx = newCtx 15439 a.app.Srv().Store.SetContext(newCtx) 15440 defer func() { 15441 a.app.Srv().Store.SetContext(origCtx) 15442 a.ctx = origCtx 15443 }() 15444 15445 defer span.Finish() 15446 resultVar0, resultVar1 := a.app.UpdateScheme(scheme) 15447 15448 if resultVar1 != nil { 15449 span.LogFields(spanlog.Error(resultVar1)) 15450 ext.Error.Set(span, true) 15451 } 15452 15453 return resultVar0, resultVar1 15454 } 15455 15456 func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userID string, isGuest bool) { 15457 origCtx := a.ctx 15458 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSessionsIsGuest") 15459 15460 a.ctx = newCtx 15461 a.app.Srv().Store.SetContext(newCtx) 15462 defer func() { 15463 a.app.Srv().Store.SetContext(origCtx) 15464 a.ctx = origCtx 15465 }() 15466 15467 defer span.Finish() 15468 a.app.UpdateSessionsIsGuest(userID, isGuest) 15469 } 15470 15471 func (a *OpenTracingAppLayer) UpdateSidebarCategories(userID string, teamID string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { 15472 origCtx := a.ctx 15473 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategories") 15474 15475 a.ctx = newCtx 15476 a.app.Srv().Store.SetContext(newCtx) 15477 defer func() { 15478 a.app.Srv().Store.SetContext(origCtx) 15479 a.ctx = origCtx 15480 }() 15481 15482 defer span.Finish() 15483 resultVar0, resultVar1 := a.app.UpdateSidebarCategories(userID, teamID, categories) 15484 15485 if resultVar1 != nil { 15486 span.LogFields(spanlog.Error(resultVar1)) 15487 ext.Error.Set(span, true) 15488 } 15489 15490 return resultVar0, resultVar1 15491 } 15492 15493 func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userID string, teamID string, categoryOrder []string) *model.AppError { 15494 origCtx := a.ctx 15495 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategoryOrder") 15496 15497 a.ctx = newCtx 15498 a.app.Srv().Store.SetContext(newCtx) 15499 defer func() { 15500 a.app.Srv().Store.SetContext(origCtx) 15501 a.ctx = origCtx 15502 }() 15503 15504 defer span.Finish() 15505 resultVar0 := a.app.UpdateSidebarCategoryOrder(userID, teamID, categoryOrder) 15506 15507 if resultVar0 != nil { 15508 span.LogFields(spanlog.Error(resultVar0)) 15509 ext.Error.Set(span, true) 15510 } 15511 15512 return resultVar0 15513 } 15514 15515 func (a *OpenTracingAppLayer) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { 15516 origCtx := a.ctx 15517 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeam") 15518 15519 a.ctx = newCtx 15520 a.app.Srv().Store.SetContext(newCtx) 15521 defer func() { 15522 a.app.Srv().Store.SetContext(origCtx) 15523 a.ctx = origCtx 15524 }() 15525 15526 defer span.Finish() 15527 resultVar0, resultVar1 := a.app.UpdateTeam(team) 15528 15529 if resultVar1 != nil { 15530 span.LogFields(spanlog.Error(resultVar1)) 15531 ext.Error.Set(span, true) 15532 } 15533 15534 return resultVar0, resultVar1 15535 } 15536 15537 func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamID string, userID string, newRoles string) (*model.TeamMember, *model.AppError) { 15538 origCtx := a.ctx 15539 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberRoles") 15540 15541 a.ctx = newCtx 15542 a.app.Srv().Store.SetContext(newCtx) 15543 defer func() { 15544 a.app.Srv().Store.SetContext(origCtx) 15545 a.ctx = origCtx 15546 }() 15547 15548 defer span.Finish() 15549 resultVar0, resultVar1 := a.app.UpdateTeamMemberRoles(teamID, userID, newRoles) 15550 15551 if resultVar1 != nil { 15552 span.LogFields(spanlog.Error(resultVar1)) 15553 ext.Error.Set(span, true) 15554 } 15555 15556 return resultVar0, resultVar1 15557 } 15558 15559 func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamID string, userID string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { 15560 origCtx := a.ctx 15561 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberSchemeRoles") 15562 15563 a.ctx = newCtx 15564 a.app.Srv().Store.SetContext(newCtx) 15565 defer func() { 15566 a.app.Srv().Store.SetContext(origCtx) 15567 a.ctx = origCtx 15568 }() 15569 15570 defer span.Finish() 15571 resultVar0, resultVar1 := a.app.UpdateTeamMemberSchemeRoles(teamID, userID, isSchemeGuest, isSchemeUser, isSchemeAdmin) 15572 15573 if resultVar1 != nil { 15574 span.LogFields(spanlog.Error(resultVar1)) 15575 ext.Error.Set(span, true) 15576 } 15577 15578 return resultVar0, resultVar1 15579 } 15580 15581 func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamID string, teamType string, allowOpenInvite bool) *model.AppError { 15582 origCtx := a.ctx 15583 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamPrivacy") 15584 15585 a.ctx = newCtx 15586 a.app.Srv().Store.SetContext(newCtx) 15587 defer func() { 15588 a.app.Srv().Store.SetContext(origCtx) 15589 a.ctx = origCtx 15590 }() 15591 15592 defer span.Finish() 15593 resultVar0 := a.app.UpdateTeamPrivacy(teamID, teamType, allowOpenInvite) 15594 15595 if resultVar0 != nil { 15596 span.LogFields(spanlog.Error(resultVar0)) 15597 ext.Error.Set(span, true) 15598 } 15599 15600 return resultVar0 15601 } 15602 15603 func (a *OpenTracingAppLayer) UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError) { 15604 origCtx := a.ctx 15605 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamScheme") 15606 15607 a.ctx = newCtx 15608 a.app.Srv().Store.SetContext(newCtx) 15609 defer func() { 15610 a.app.Srv().Store.SetContext(origCtx) 15611 a.ctx = origCtx 15612 }() 15613 15614 defer span.Finish() 15615 resultVar0, resultVar1 := a.app.UpdateTeamScheme(team) 15616 15617 if resultVar1 != nil { 15618 span.LogFields(spanlog.Error(resultVar1)) 15619 ext.Error.Set(span, true) 15620 } 15621 15622 return resultVar0, resultVar1 15623 } 15624 15625 func (a *OpenTracingAppLayer) UpdateThreadFollowForUser(userID string, threadId string, state bool) *model.AppError { 15626 origCtx := a.ctx 15627 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadFollowForUser") 15628 15629 a.ctx = newCtx 15630 a.app.Srv().Store.SetContext(newCtx) 15631 defer func() { 15632 a.app.Srv().Store.SetContext(origCtx) 15633 a.ctx = origCtx 15634 }() 15635 15636 defer span.Finish() 15637 resultVar0 := a.app.UpdateThreadFollowForUser(userID, threadId, state) 15638 15639 if resultVar0 != nil { 15640 span.LogFields(spanlog.Error(resultVar0)) 15641 ext.Error.Set(span, true) 15642 } 15643 15644 return resultVar0 15645 } 15646 15647 func (a *OpenTracingAppLayer) UpdateThreadReadForUser(userID string, teamID string, threadId string, timestamp int64) *model.AppError { 15648 origCtx := a.ctx 15649 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadReadForUser") 15650 15651 a.ctx = newCtx 15652 a.app.Srv().Store.SetContext(newCtx) 15653 defer func() { 15654 a.app.Srv().Store.SetContext(origCtx) 15655 a.ctx = origCtx 15656 }() 15657 15658 defer span.Finish() 15659 resultVar0 := a.app.UpdateThreadReadForUser(userID, teamID, threadId, timestamp) 15660 15661 if resultVar0 != nil { 15662 span.LogFields(spanlog.Error(resultVar0)) 15663 ext.Error.Set(span, true) 15664 } 15665 15666 return resultVar0 15667 } 15668 15669 func (a *OpenTracingAppLayer) UpdateThreadsReadForUser(userID string, teamID string) *model.AppError { 15670 origCtx := a.ctx 15671 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateThreadsReadForUser") 15672 15673 a.ctx = newCtx 15674 a.app.Srv().Store.SetContext(newCtx) 15675 defer func() { 15676 a.app.Srv().Store.SetContext(origCtx) 15677 a.ctx = origCtx 15678 }() 15679 15680 defer span.Finish() 15681 resultVar0 := a.app.UpdateThreadsReadForUser(userID, teamID) 15682 15683 if resultVar0 != nil { 15684 span.LogFields(spanlog.Error(resultVar0)) 15685 ext.Error.Set(span, true) 15686 } 15687 15688 return resultVar0 15689 } 15690 15691 func (a *OpenTracingAppLayer) UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) { 15692 origCtx := a.ctx 15693 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUser") 15694 15695 a.ctx = newCtx 15696 a.app.Srv().Store.SetContext(newCtx) 15697 defer func() { 15698 a.app.Srv().Store.SetContext(origCtx) 15699 a.ctx = origCtx 15700 }() 15701 15702 defer span.Finish() 15703 resultVar0, resultVar1 := a.app.UpdateUser(user, sendNotifications) 15704 15705 if resultVar1 != nil { 15706 span.LogFields(spanlog.Error(resultVar1)) 15707 ext.Error.Set(span, true) 15708 } 15709 15710 return resultVar0, resultVar1 15711 } 15712 15713 func (a *OpenTracingAppLayer) UpdateUserActive(userID string, active bool) *model.AppError { 15714 origCtx := a.ctx 15715 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive") 15716 15717 a.ctx = newCtx 15718 a.app.Srv().Store.SetContext(newCtx) 15719 defer func() { 15720 a.app.Srv().Store.SetContext(origCtx) 15721 a.ctx = origCtx 15722 }() 15723 15724 defer span.Finish() 15725 resultVar0 := a.app.UpdateUserActive(userID, active) 15726 15727 if resultVar0 != nil { 15728 span.LogFields(spanlog.Error(resultVar0)) 15729 ext.Error.Set(span, true) 15730 } 15731 15732 return resultVar0 15733 } 15734 15735 func (a *OpenTracingAppLayer) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) { 15736 origCtx := a.ctx 15737 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAsUser") 15738 15739 a.ctx = newCtx 15740 a.app.Srv().Store.SetContext(newCtx) 15741 defer func() { 15742 a.app.Srv().Store.SetContext(origCtx) 15743 a.ctx = origCtx 15744 }() 15745 15746 defer span.Finish() 15747 resultVar0, resultVar1 := a.app.UpdateUserAsUser(user, asAdmin) 15748 15749 if resultVar1 != nil { 15750 span.LogFields(spanlog.Error(resultVar1)) 15751 ext.Error.Set(span, true) 15752 } 15753 15754 return resultVar0, resultVar1 15755 } 15756 15757 func (a *OpenTracingAppLayer) UpdateUserAuth(userID string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { 15758 origCtx := a.ctx 15759 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAuth") 15760 15761 a.ctx = newCtx 15762 a.app.Srv().Store.SetContext(newCtx) 15763 defer func() { 15764 a.app.Srv().Store.SetContext(origCtx) 15765 a.ctx = origCtx 15766 }() 15767 15768 defer span.Finish() 15769 resultVar0, resultVar1 := a.app.UpdateUserAuth(userID, userAuth) 15770 15771 if resultVar1 != nil { 15772 span.LogFields(spanlog.Error(resultVar1)) 15773 ext.Error.Set(span, true) 15774 } 15775 15776 return resultVar0, resultVar1 15777 } 15778 15779 func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userID string, props map[string]string, sendNotifications bool) (*model.User, *model.AppError) { 15780 origCtx := a.ctx 15781 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserNotifyProps") 15782 15783 a.ctx = newCtx 15784 a.app.Srv().Store.SetContext(newCtx) 15785 defer func() { 15786 a.app.Srv().Store.SetContext(origCtx) 15787 a.ctx = origCtx 15788 }() 15789 15790 defer span.Finish() 15791 resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userID, props, sendNotifications) 15792 15793 if resultVar1 != nil { 15794 span.LogFields(spanlog.Error(resultVar1)) 15795 ext.Error.Set(span, true) 15796 } 15797 15798 return resultVar0, resultVar1 15799 } 15800 15801 func (a *OpenTracingAppLayer) UpdateUserRoles(userID string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 15802 origCtx := a.ctx 15803 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRoles") 15804 15805 a.ctx = newCtx 15806 a.app.Srv().Store.SetContext(newCtx) 15807 defer func() { 15808 a.app.Srv().Store.SetContext(origCtx) 15809 a.ctx = origCtx 15810 }() 15811 15812 defer span.Finish() 15813 resultVar0, resultVar1 := a.app.UpdateUserRoles(userID, newRoles, sendWebSocketEvent) 15814 15815 if resultVar1 != nil { 15816 span.LogFields(spanlog.Error(resultVar1)) 15817 ext.Error.Set(span, true) 15818 } 15819 15820 return resultVar0, resultVar1 15821 } 15822 15823 func (a *OpenTracingAppLayer) UpdateUserRolesWithUser(user *model.User, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 15824 origCtx := a.ctx 15825 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRolesWithUser") 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.UpdateUserRolesWithUser(user, newRoles, sendWebSocketEvent) 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) UpdateViewedProductNotices(userID string, noticeIds []string) *model.AppError { 15846 origCtx := a.ctx 15847 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNotices") 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 := a.app.UpdateViewedProductNotices(userID, noticeIds) 15858 15859 if resultVar0 != nil { 15860 span.LogFields(spanlog.Error(resultVar0)) 15861 ext.Error.Set(span, true) 15862 } 15863 15864 return resultVar0 15865 } 15866 15867 func (a *OpenTracingAppLayer) UpdateViewedProductNoticesForNewUser(userID string) { 15868 origCtx := a.ctx 15869 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateViewedProductNoticesForNewUser") 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 a.app.UpdateViewedProductNoticesForNewUser(userID) 15880 } 15881 15882 func (a *OpenTracingAppLayer) UpdateWebConnUserActivity(session model.Session, activityAt int64) { 15883 origCtx := a.ctx 15884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateWebConnUserActivity") 15885 15886 a.ctx = newCtx 15887 a.app.Srv().Store.SetContext(newCtx) 15888 defer func() { 15889 a.app.Srv().Store.SetContext(origCtx) 15890 a.ctx = origCtx 15891 }() 15892 15893 defer span.Finish() 15894 a.app.UpdateWebConnUserActivity(session, activityAt) 15895 } 15896 15897 func (a *OpenTracingAppLayer) UploadData(us *model.UploadSession, rd io.Reader) (*model.FileInfo, *model.AppError) { 15898 origCtx := a.ctx 15899 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadData") 15900 15901 a.ctx = newCtx 15902 a.app.Srv().Store.SetContext(newCtx) 15903 defer func() { 15904 a.app.Srv().Store.SetContext(origCtx) 15905 a.ctx = origCtx 15906 }() 15907 15908 defer span.Finish() 15909 resultVar0, resultVar1 := a.app.UploadData(us, rd) 15910 15911 if resultVar1 != nil { 15912 span.LogFields(spanlog.Error(resultVar1)) 15913 ext.Error.Set(span, true) 15914 } 15915 15916 return resultVar0, resultVar1 15917 } 15918 15919 func (a *OpenTracingAppLayer) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError { 15920 origCtx := a.ctx 15921 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadEmojiImage") 15922 15923 a.ctx = newCtx 15924 a.app.Srv().Store.SetContext(newCtx) 15925 defer func() { 15926 a.app.Srv().Store.SetContext(origCtx) 15927 a.ctx = origCtx 15928 }() 15929 15930 defer span.Finish() 15931 resultVar0 := a.app.UploadEmojiImage(id, imageData) 15932 15933 if resultVar0 != nil { 15934 span.LogFields(spanlog.Error(resultVar0)) 15935 ext.Error.Set(span, true) 15936 } 15937 15938 return resultVar0 15939 } 15940 15941 func (a *OpenTracingAppLayer) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) { 15942 origCtx := a.ctx 15943 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFile") 15944 15945 a.ctx = newCtx 15946 a.app.Srv().Store.SetContext(newCtx) 15947 defer func() { 15948 a.app.Srv().Store.SetContext(origCtx) 15949 a.ctx = origCtx 15950 }() 15951 15952 defer span.Finish() 15953 resultVar0, resultVar1 := a.app.UploadFile(data, channelId, filename) 15954 15955 if resultVar1 != nil { 15956 span.LogFields(spanlog.Error(resultVar1)) 15957 ext.Error.Set(span, true) 15958 } 15959 15960 return resultVar0, resultVar1 15961 } 15962 15963 func (a *OpenTracingAppLayer) UploadFileX(channelId string, name string, input io.Reader, opts ...func(*app.UploadFileTask)) (*model.FileInfo, *model.AppError) { 15964 origCtx := a.ctx 15965 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFileX") 15966 15967 a.ctx = newCtx 15968 a.app.Srv().Store.SetContext(newCtx) 15969 defer func() { 15970 a.app.Srv().Store.SetContext(origCtx) 15971 a.ctx = origCtx 15972 }() 15973 15974 defer span.Finish() 15975 resultVar0, resultVar1 := a.app.UploadFileX(channelId, name, input, opts...) 15976 15977 if resultVar1 != nil { 15978 span.LogFields(spanlog.Error(resultVar1)) 15979 ext.Error.Set(span, true) 15980 } 15981 15982 return resultVar0, resultVar1 15983 } 15984 15985 func (a *OpenTracingAppLayer) UploadFiles(teamID string, channelId string, userID string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 15986 origCtx := a.ctx 15987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFiles") 15988 15989 a.ctx = newCtx 15990 a.app.Srv().Store.SetContext(newCtx) 15991 defer func() { 15992 a.app.Srv().Store.SetContext(origCtx) 15993 a.ctx = origCtx 15994 }() 15995 15996 defer span.Finish() 15997 resultVar0, resultVar1 := a.app.UploadFiles(teamID, channelId, userID, files, filenames, clientIds, now) 15998 15999 if resultVar1 != nil { 16000 span.LogFields(spanlog.Error(resultVar1)) 16001 ext.Error.Set(span, true) 16002 } 16003 16004 return resultVar0, resultVar1 16005 } 16006 16007 func (a *OpenTracingAppLayer) UploadMultipartFiles(teamID string, channelId string, userID string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 16008 origCtx := a.ctx 16009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadMultipartFiles") 16010 16011 a.ctx = newCtx 16012 a.app.Srv().Store.SetContext(newCtx) 16013 defer func() { 16014 a.app.Srv().Store.SetContext(origCtx) 16015 a.ctx = origCtx 16016 }() 16017 16018 defer span.Finish() 16019 resultVar0, resultVar1 := a.app.UploadMultipartFiles(teamID, channelId, userID, fileHeaders, clientIds, now) 16020 16021 if resultVar1 != nil { 16022 span.LogFields(spanlog.Error(resultVar1)) 16023 ext.Error.Set(span, true) 16024 } 16025 16026 return resultVar0, resultVar1 16027 } 16028 16029 func (a *OpenTracingAppLayer) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 16030 origCtx := a.ctx 16031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupMember") 16032 16033 a.ctx = newCtx 16034 a.app.Srv().Store.SetContext(newCtx) 16035 defer func() { 16036 a.app.Srv().Store.SetContext(origCtx) 16037 a.ctx = origCtx 16038 }() 16039 16040 defer span.Finish() 16041 resultVar0, resultVar1 := a.app.UpsertGroupMember(groupID, userID) 16042 16043 if resultVar1 != nil { 16044 span.LogFields(spanlog.Error(resultVar1)) 16045 ext.Error.Set(span, true) 16046 } 16047 16048 return resultVar0, resultVar1 16049 } 16050 16051 func (a *OpenTracingAppLayer) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 16052 origCtx := a.ctx 16053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupSyncable") 16054 16055 a.ctx = newCtx 16056 a.app.Srv().Store.SetContext(newCtx) 16057 defer func() { 16058 a.app.Srv().Store.SetContext(origCtx) 16059 a.ctx = origCtx 16060 }() 16061 16062 defer span.Finish() 16063 resultVar0, resultVar1 := a.app.UpsertGroupSyncable(groupSyncable) 16064 16065 if resultVar1 != nil { 16066 span.LogFields(spanlog.Error(resultVar1)) 16067 ext.Error.Set(span, true) 16068 } 16069 16070 return resultVar0, resultVar1 16071 } 16072 16073 func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userID string, otherUserId string) (bool, *model.AppError) { 16074 origCtx := a.ctx 16075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserCanSeeOtherUser") 16076 16077 a.ctx = newCtx 16078 a.app.Srv().Store.SetContext(newCtx) 16079 defer func() { 16080 a.app.Srv().Store.SetContext(origCtx) 16081 a.ctx = origCtx 16082 }() 16083 16084 defer span.Finish() 16085 resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userID, otherUserId) 16086 16087 if resultVar1 != nil { 16088 span.LogFields(spanlog.Error(resultVar1)) 16089 ext.Error.Set(span, true) 16090 } 16091 16092 return resultVar0, resultVar1 16093 } 16094 16095 func (a *OpenTracingAppLayer) UserIsInAdminRoleGroup(userID string, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError) { 16096 origCtx := a.ctx 16097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserIsInAdminRoleGroup") 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, resultVar1 := a.app.UserIsInAdminRoleGroup(userID, syncableID, syncableType) 16108 16109 if resultVar1 != nil { 16110 span.LogFields(spanlog.Error(resultVar1)) 16111 ext.Error.Set(span, true) 16112 } 16113 16114 return resultVar0, resultVar1 16115 } 16116 16117 func (a *OpenTracingAppLayer) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError { 16118 origCtx := a.ctx 16119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyEmailFromToken") 16120 16121 a.ctx = newCtx 16122 a.app.Srv().Store.SetContext(newCtx) 16123 defer func() { 16124 a.app.Srv().Store.SetContext(origCtx) 16125 a.ctx = origCtx 16126 }() 16127 16128 defer span.Finish() 16129 resultVar0 := a.app.VerifyEmailFromToken(userSuppliedTokenString) 16130 16131 if resultVar0 != nil { 16132 span.LogFields(spanlog.Error(resultVar0)) 16133 ext.Error.Set(span, true) 16134 } 16135 16136 return resultVar0 16137 } 16138 16139 func (a *OpenTracingAppLayer) VerifyPlugin(plugin io.ReadSeeker, signature io.ReadSeeker) *model.AppError { 16140 origCtx := a.ctx 16141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyPlugin") 16142 16143 a.ctx = newCtx 16144 a.app.Srv().Store.SetContext(newCtx) 16145 defer func() { 16146 a.app.Srv().Store.SetContext(origCtx) 16147 a.ctx = origCtx 16148 }() 16149 16150 defer span.Finish() 16151 resultVar0 := a.app.VerifyPlugin(plugin, signature) 16152 16153 if resultVar0 != nil { 16154 span.LogFields(spanlog.Error(resultVar0)) 16155 ext.Error.Set(span, true) 16156 } 16157 16158 return resultVar0 16159 } 16160 16161 func (a *OpenTracingAppLayer) VerifyUserEmail(userID string, email string) *model.AppError { 16162 origCtx := a.ctx 16163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyUserEmail") 16164 16165 a.ctx = newCtx 16166 a.app.Srv().Store.SetContext(newCtx) 16167 defer func() { 16168 a.app.Srv().Store.SetContext(origCtx) 16169 a.ctx = origCtx 16170 }() 16171 16172 defer span.Finish() 16173 resultVar0 := a.app.VerifyUserEmail(userID, email) 16174 16175 if resultVar0 != nil { 16176 span.LogFields(spanlog.Error(resultVar0)) 16177 ext.Error.Set(span, true) 16178 } 16179 16180 return resultVar0 16181 } 16182 16183 func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userID string, currentSessionId string) (map[string]int64, *model.AppError) { 16184 origCtx := a.ctx 16185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ViewChannel") 16186 16187 a.ctx = newCtx 16188 a.app.Srv().Store.SetContext(newCtx) 16189 defer func() { 16190 a.app.Srv().Store.SetContext(origCtx) 16191 a.ctx = origCtx 16192 }() 16193 16194 defer span.Finish() 16195 resultVar0, resultVar1 := a.app.ViewChannel(view, userID, currentSessionId) 16196 16197 if resultVar1 != nil { 16198 span.LogFields(spanlog.Error(resultVar1)) 16199 ext.Error.Set(span, true) 16200 } 16201 16202 return resultVar0, resultVar1 16203 } 16204 16205 func (a *OpenTracingAppLayer) WaitForChannelMembership(channelId string, userID string) { 16206 origCtx := a.ctx 16207 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WaitForChannelMembership") 16208 16209 a.ctx = newCtx 16210 a.app.Srv().Store.SetContext(newCtx) 16211 defer func() { 16212 a.app.Srv().Store.SetContext(origCtx) 16213 a.ctx = origCtx 16214 }() 16215 16216 defer span.Finish() 16217 a.app.WaitForChannelMembership(channelId, userID) 16218 } 16219 16220 func (a *OpenTracingAppLayer) WriteFile(fr io.Reader, path string) (int64, *model.AppError) { 16221 origCtx := a.ctx 16222 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WriteFile") 16223 16224 a.ctx = newCtx 16225 a.app.Srv().Store.SetContext(newCtx) 16226 defer func() { 16227 a.app.Srv().Store.SetContext(origCtx) 16228 a.ctx = origCtx 16229 }() 16230 16231 defer span.Finish() 16232 resultVar0, resultVar1 := a.app.WriteFile(fr, path) 16233 16234 if resultVar1 != nil { 16235 span.LogFields(spanlog.Error(resultVar1)) 16236 ext.Error.Set(span, true) 16237 } 16238 16239 return resultVar0, resultVar1 16240 } 16241 16242 func NewOpenTracingAppLayer(childApp app.AppIface, ctx context.Context) *OpenTracingAppLayer { 16243 newApp := OpenTracingAppLayer{ 16244 app: childApp, 16245 ctx: ctx, 16246 } 16247 16248 newApp.srv = childApp.Srv() 16249 newApp.log = childApp.Log() 16250 newApp.notificationsLog = childApp.NotificationsLog() 16251 newApp.t = childApp.GetT() 16252 if childApp.Session() != nil { 16253 newApp.session = *childApp.Session() 16254 } 16255 newApp.requestId = childApp.RequestId() 16256 newApp.ipAddress = childApp.IpAddress() 16257 newApp.path = childApp.Path() 16258 newApp.userAgent = childApp.UserAgent() 16259 newApp.acceptLanguage = childApp.AcceptLanguage() 16260 newApp.accountMigration = childApp.AccountMigration() 16261 newApp.cluster = childApp.Cluster() 16262 newApp.compliance = childApp.Compliance() 16263 newApp.dataRetention = childApp.DataRetention() 16264 newApp.searchEngine = childApp.SearchEngine() 16265 newApp.ldap = childApp.Ldap() 16266 newApp.messageExport = childApp.MessageExport() 16267 newApp.metrics = childApp.Metrics() 16268 newApp.notification = childApp.Notification() 16269 newApp.saml = childApp.Saml() 16270 newApp.httpService = childApp.HTTPService() 16271 newApp.imageProxy = childApp.ImageProxy() 16272 newApp.timezones = childApp.Timezones() 16273 newApp.context = childApp.Context() 16274 16275 return &newApp 16276 } 16277 16278 func (a *OpenTracingAppLayer) Srv() *app.Server { 16279 return a.srv 16280 } 16281 func (a *OpenTracingAppLayer) Log() *mlog.Logger { 16282 return a.log 16283 } 16284 func (a *OpenTracingAppLayer) NotificationsLog() *mlog.Logger { 16285 return a.notificationsLog 16286 } 16287 func (a *OpenTracingAppLayer) T(translationID string, args ...interface{}) string { 16288 return a.t(translationID, args...) 16289 } 16290 func (a *OpenTracingAppLayer) Session() *model.Session { 16291 return &a.session 16292 } 16293 func (a *OpenTracingAppLayer) RequestId() string { 16294 return a.requestId 16295 } 16296 func (a *OpenTracingAppLayer) IpAddress() string { 16297 return a.ipAddress 16298 } 16299 func (a *OpenTracingAppLayer) Path() string { 16300 return a.path 16301 } 16302 func (a *OpenTracingAppLayer) UserAgent() string { 16303 return a.userAgent 16304 } 16305 func (a *OpenTracingAppLayer) AcceptLanguage() string { 16306 return a.acceptLanguage 16307 } 16308 func (a *OpenTracingAppLayer) AccountMigration() einterfaces.AccountMigrationInterface { 16309 return a.accountMigration 16310 } 16311 func (a *OpenTracingAppLayer) Cluster() einterfaces.ClusterInterface { 16312 return a.cluster 16313 } 16314 func (a *OpenTracingAppLayer) Compliance() einterfaces.ComplianceInterface { 16315 return a.compliance 16316 } 16317 func (a *OpenTracingAppLayer) DataRetention() einterfaces.DataRetentionInterface { 16318 return a.dataRetention 16319 } 16320 func (a *OpenTracingAppLayer) Ldap() einterfaces.LdapInterface { 16321 return a.ldap 16322 } 16323 func (a *OpenTracingAppLayer) MessageExport() einterfaces.MessageExportInterface { 16324 return a.messageExport 16325 } 16326 func (a *OpenTracingAppLayer) Metrics() einterfaces.MetricsInterface { 16327 return a.metrics 16328 } 16329 func (a *OpenTracingAppLayer) Notification() einterfaces.NotificationInterface { 16330 return a.notification 16331 } 16332 func (a *OpenTracingAppLayer) Saml() einterfaces.SamlInterface { 16333 return a.saml 16334 } 16335 func (a *OpenTracingAppLayer) HTTPService() httpservice.HTTPService { 16336 return a.httpService 16337 } 16338 func (a *OpenTracingAppLayer) ImageProxy() *imageproxy.ImageProxy { 16339 return a.imageProxy 16340 } 16341 func (a *OpenTracingAppLayer) Timezones() *timezones.Timezones { 16342 return a.timezones 16343 } 16344 func (a *OpenTracingAppLayer) Context() context.Context { 16345 return a.context 16346 } 16347 func (a *OpenTracingAppLayer) SetSession(sess *model.Session) { 16348 a.session = *sess 16349 } 16350 func (a *OpenTracingAppLayer) SetT(t i18n.TranslateFunc) { 16351 a.t = t 16352 } 16353 func (a *OpenTracingAppLayer) SetRequestId(str string) { 16354 a.requestId = str 16355 } 16356 func (a *OpenTracingAppLayer) SetIpAddress(str string) { 16357 a.ipAddress = str 16358 } 16359 func (a *OpenTracingAppLayer) SetUserAgent(str string) { 16360 a.userAgent = str 16361 } 16362 func (a *OpenTracingAppLayer) SetAcceptLanguage(str string) { 16363 a.acceptLanguage = str 16364 } 16365 func (a *OpenTracingAppLayer) SetPath(str string) { 16366 a.path = str 16367 } 16368 func (a *OpenTracingAppLayer) SetContext(c context.Context) { 16369 a.context = c 16370 } 16371 func (a *OpenTracingAppLayer) SetServer(srv *app.Server) { 16372 a.srv = srv 16373 } 16374 func (a *OpenTracingAppLayer) GetT() i18n.TranslateFunc { 16375 return a.t 16376 }