github.com/mattermosttest/mattermost-server/v5@v5.0.0-20200917143240-9dfa12e121f9/app/opentracing/opentracing_layer.go (about) 1 // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. 2 // See LICENSE.txt for license information. 3 4 // Code generated by "make app-layers" 5 // DO NOT EDIT 6 7 package opentracing 8 9 import ( 10 "archive/zip" 11 "bytes" 12 "context" 13 "crypto/ecdsa" 14 "io" 15 "mime/multipart" 16 "net/http" 17 "net/url" 18 "time" 19 20 "github.com/dyatlov/go-opengraph/opengraph" 21 "github.com/gorilla/websocket" 22 "github.com/mattermost/go-i18n/i18n" 23 goi18n "github.com/mattermost/go-i18n/i18n" 24 "github.com/mattermost/mattermost-server/v5/app" 25 "github.com/mattermost/mattermost-server/v5/audit" 26 "github.com/mattermost/mattermost-server/v5/einterfaces" 27 "github.com/mattermost/mattermost-server/v5/mlog" 28 "github.com/mattermost/mattermost-server/v5/model" 29 "github.com/mattermost/mattermost-server/v5/plugin" 30 "github.com/mattermost/mattermost-server/v5/services/filesstore" 31 "github.com/mattermost/mattermost-server/v5/services/httpservice" 32 "github.com/mattermost/mattermost-server/v5/services/imageproxy" 33 "github.com/mattermost/mattermost-server/v5/services/searchengine" 34 "github.com/mattermost/mattermost-server/v5/services/timezones" 35 "github.com/mattermost/mattermost-server/v5/services/tracing" 36 "github.com/mattermost/mattermost-server/v5/store" 37 "github.com/opentracing/opentracing-go/ext" 38 spanlog "github.com/opentracing/opentracing-go/log" 39 ) 40 41 type OpenTracingAppLayer struct { 42 app app.AppIface 43 44 srv *app.Server 45 46 log *mlog.Logger 47 notificationsLog *mlog.Logger 48 49 t i18n.TranslateFunc 50 session model.Session 51 requestId string 52 ipAddress string 53 path string 54 userAgent string 55 acceptLanguage string 56 57 accountMigration einterfaces.AccountMigrationInterface 58 cluster einterfaces.ClusterInterface 59 compliance einterfaces.ComplianceInterface 60 dataRetention einterfaces.DataRetentionInterface 61 searchEngine *searchengine.Broker 62 ldap einterfaces.LdapInterface 63 messageExport einterfaces.MessageExportInterface 64 metrics einterfaces.MetricsInterface 65 notification einterfaces.NotificationInterface 66 saml einterfaces.SamlInterface 67 68 httpService httpservice.HTTPService 69 imageProxy *imageproxy.ImageProxy 70 timezones *timezones.Timezones 71 72 context context.Context 73 ctx context.Context 74 } 75 76 func (a *OpenTracingAppLayer) ActivateMfa(userId string, token string) *model.AppError { 77 origCtx := a.ctx 78 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ActivateMfa") 79 80 a.ctx = newCtx 81 a.app.Srv().Store.SetContext(newCtx) 82 defer func() { 83 a.app.Srv().Store.SetContext(origCtx) 84 a.ctx = origCtx 85 }() 86 87 defer span.Finish() 88 resultVar0 := a.app.ActivateMfa(userId, token) 89 90 if resultVar0 != nil { 91 span.LogFields(spanlog.Error(resultVar0)) 92 ext.Error.Set(span, true) 93 } 94 95 return resultVar0 96 } 97 98 func (a *OpenTracingAppLayer) AddChannelMember(userId string, channel *model.Channel, userRequestorId string, postRootId string) (*model.ChannelMember, *model.AppError) { 99 origCtx := a.ctx 100 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddChannelMember") 101 102 a.ctx = newCtx 103 a.app.Srv().Store.SetContext(newCtx) 104 defer func() { 105 a.app.Srv().Store.SetContext(origCtx) 106 a.ctx = origCtx 107 }() 108 109 defer span.Finish() 110 resultVar0, resultVar1 := a.app.AddChannelMember(userId, channel, userRequestorId, postRootId) 111 112 if resultVar1 != nil { 113 span.LogFields(spanlog.Error(resultVar1)) 114 ext.Error.Set(span, true) 115 } 116 117 return resultVar0, resultVar1 118 } 119 120 func (a *OpenTracingAppLayer) AddConfigListener(listener func(*model.Config, *model.Config)) string { 121 origCtx := a.ctx 122 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddConfigListener") 123 124 a.ctx = newCtx 125 a.app.Srv().Store.SetContext(newCtx) 126 defer func() { 127 a.app.Srv().Store.SetContext(origCtx) 128 a.ctx = origCtx 129 }() 130 131 defer span.Finish() 132 resultVar0 := a.app.AddConfigListener(listener) 133 134 return resultVar0 135 } 136 137 func (a *OpenTracingAppLayer) AddCursorIdsForPostList(originalList *model.PostList, afterPost string, beforePost string, since int64, page int, perPage int) { 138 origCtx := a.ctx 139 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddCursorIdsForPostList") 140 141 a.ctx = newCtx 142 a.app.Srv().Store.SetContext(newCtx) 143 defer func() { 144 a.app.Srv().Store.SetContext(origCtx) 145 a.ctx = origCtx 146 }() 147 148 defer span.Finish() 149 a.app.AddCursorIdsForPostList(originalList, afterPost, beforePost, since, page, perPage) 150 } 151 152 func (a *OpenTracingAppLayer) AddDirectChannels(teamId string, user *model.User) *model.AppError { 153 origCtx := a.ctx 154 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddDirectChannels") 155 156 a.ctx = newCtx 157 a.app.Srv().Store.SetContext(newCtx) 158 defer func() { 159 a.app.Srv().Store.SetContext(origCtx) 160 a.ctx = origCtx 161 }() 162 163 defer span.Finish() 164 resultVar0 := a.app.AddDirectChannels(teamId, user) 165 166 if resultVar0 != nil { 167 span.LogFields(spanlog.Error(resultVar0)) 168 ext.Error.Set(span, true) 169 } 170 171 return resultVar0 172 } 173 174 func (a *OpenTracingAppLayer) AddPublicKey(name string, key io.Reader) *model.AppError { 175 origCtx := a.ctx 176 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddPublicKey") 177 178 a.ctx = newCtx 179 a.app.Srv().Store.SetContext(newCtx) 180 defer func() { 181 a.app.Srv().Store.SetContext(origCtx) 182 a.ctx = origCtx 183 }() 184 185 defer span.Finish() 186 resultVar0 := a.app.AddPublicKey(name, key) 187 188 if resultVar0 != nil { 189 span.LogFields(spanlog.Error(resultVar0)) 190 ext.Error.Set(span, true) 191 } 192 193 return resultVar0 194 } 195 196 func (a *OpenTracingAppLayer) AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError { 197 origCtx := a.ctx 198 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlIdpCertificate") 199 200 a.ctx = newCtx 201 a.app.Srv().Store.SetContext(newCtx) 202 defer func() { 203 a.app.Srv().Store.SetContext(origCtx) 204 a.ctx = origCtx 205 }() 206 207 defer span.Finish() 208 resultVar0 := a.app.AddSamlIdpCertificate(fileData) 209 210 if resultVar0 != nil { 211 span.LogFields(spanlog.Error(resultVar0)) 212 ext.Error.Set(span, true) 213 } 214 215 return resultVar0 216 } 217 218 func (a *OpenTracingAppLayer) AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 219 origCtx := a.ctx 220 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPrivateCertificate") 221 222 a.ctx = newCtx 223 a.app.Srv().Store.SetContext(newCtx) 224 defer func() { 225 a.app.Srv().Store.SetContext(origCtx) 226 a.ctx = origCtx 227 }() 228 229 defer span.Finish() 230 resultVar0 := a.app.AddSamlPrivateCertificate(fileData) 231 232 if resultVar0 != nil { 233 span.LogFields(spanlog.Error(resultVar0)) 234 ext.Error.Set(span, true) 235 } 236 237 return resultVar0 238 } 239 240 func (a *OpenTracingAppLayer) AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 241 origCtx := a.ctx 242 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPublicCertificate") 243 244 a.ctx = newCtx 245 a.app.Srv().Store.SetContext(newCtx) 246 defer func() { 247 a.app.Srv().Store.SetContext(origCtx) 248 a.ctx = origCtx 249 }() 250 251 defer span.Finish() 252 resultVar0 := a.app.AddSamlPublicCertificate(fileData) 253 254 if resultVar0 != nil { 255 span.LogFields(spanlog.Error(resultVar0)) 256 ext.Error.Set(span, true) 257 } 258 259 return resultVar0 260 } 261 262 func (a *OpenTracingAppLayer) AddSessionToCache(session *model.Session) { 263 origCtx := a.ctx 264 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSessionToCache") 265 266 a.ctx = newCtx 267 a.app.Srv().Store.SetContext(newCtx) 268 defer func() { 269 a.app.Srv().Store.SetContext(origCtx) 270 a.ctx = origCtx 271 }() 272 273 defer span.Finish() 274 a.app.AddSessionToCache(session) 275 } 276 277 func (a *OpenTracingAppLayer) AddStatusCache(status *model.Status) { 278 origCtx := a.ctx 279 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCache") 280 281 a.ctx = newCtx 282 a.app.Srv().Store.SetContext(newCtx) 283 defer func() { 284 a.app.Srv().Store.SetContext(origCtx) 285 a.ctx = origCtx 286 }() 287 288 defer span.Finish() 289 a.app.AddStatusCache(status) 290 } 291 292 func (a *OpenTracingAppLayer) AddStatusCacheSkipClusterSend(status *model.Status) { 293 origCtx := a.ctx 294 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCacheSkipClusterSend") 295 296 a.ctx = newCtx 297 a.app.Srv().Store.SetContext(newCtx) 298 defer func() { 299 a.app.Srv().Store.SetContext(origCtx) 300 a.ctx = origCtx 301 }() 302 303 defer span.Finish() 304 a.app.AddStatusCacheSkipClusterSend(status) 305 } 306 307 func (a *OpenTracingAppLayer) AddTeamMember(teamId string, userId string) (*model.TeamMember, *model.AppError) { 308 origCtx := a.ctx 309 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMember") 310 311 a.ctx = newCtx 312 a.app.Srv().Store.SetContext(newCtx) 313 defer func() { 314 a.app.Srv().Store.SetContext(origCtx) 315 a.ctx = origCtx 316 }() 317 318 defer span.Finish() 319 resultVar0, resultVar1 := a.app.AddTeamMember(teamId, userId) 320 321 if resultVar1 != nil { 322 span.LogFields(spanlog.Error(resultVar1)) 323 ext.Error.Set(span, true) 324 } 325 326 return resultVar0, resultVar1 327 } 328 329 func (a *OpenTracingAppLayer) AddTeamMemberByInviteId(inviteId string, userId string) (*model.TeamMember, *model.AppError) { 330 origCtx := a.ctx 331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByInviteId") 332 333 a.ctx = newCtx 334 a.app.Srv().Store.SetContext(newCtx) 335 defer func() { 336 a.app.Srv().Store.SetContext(origCtx) 337 a.ctx = origCtx 338 }() 339 340 defer span.Finish() 341 resultVar0, resultVar1 := a.app.AddTeamMemberByInviteId(inviteId, userId) 342 343 if resultVar1 != nil { 344 span.LogFields(spanlog.Error(resultVar1)) 345 ext.Error.Set(span, true) 346 } 347 348 return resultVar0, resultVar1 349 } 350 351 func (a *OpenTracingAppLayer) AddTeamMemberByToken(userId string, tokenId string) (*model.TeamMember, *model.AppError) { 352 origCtx := a.ctx 353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMemberByToken") 354 355 a.ctx = newCtx 356 a.app.Srv().Store.SetContext(newCtx) 357 defer func() { 358 a.app.Srv().Store.SetContext(origCtx) 359 a.ctx = origCtx 360 }() 361 362 defer span.Finish() 363 resultVar0, resultVar1 := a.app.AddTeamMemberByToken(userId, tokenId) 364 365 if resultVar1 != nil { 366 span.LogFields(spanlog.Error(resultVar1)) 367 ext.Error.Set(span, true) 368 } 369 370 return resultVar0, resultVar1 371 } 372 373 func (a *OpenTracingAppLayer) AddTeamMembers(teamId string, userIds []string, userRequestorId string, graceful bool) ([]*model.TeamMemberWithError, *model.AppError) { 374 origCtx := a.ctx 375 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddTeamMembers") 376 377 a.ctx = newCtx 378 a.app.Srv().Store.SetContext(newCtx) 379 defer func() { 380 a.app.Srv().Store.SetContext(origCtx) 381 a.ctx = origCtx 382 }() 383 384 defer span.Finish() 385 resultVar0, resultVar1 := a.app.AddTeamMembers(teamId, userIds, userRequestorId, graceful) 386 387 if resultVar1 != nil { 388 span.LogFields(spanlog.Error(resultVar1)) 389 ext.Error.Set(span, true) 390 } 391 392 return resultVar0, resultVar1 393 } 394 395 func (a *OpenTracingAppLayer) AddUserToChannel(user *model.User, channel *model.Channel) (*model.ChannelMember, *model.AppError) { 396 origCtx := a.ctx 397 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToChannel") 398 399 a.ctx = newCtx 400 a.app.Srv().Store.SetContext(newCtx) 401 defer func() { 402 a.app.Srv().Store.SetContext(origCtx) 403 a.ctx = origCtx 404 }() 405 406 defer span.Finish() 407 resultVar0, resultVar1 := a.app.AddUserToChannel(user, channel) 408 409 if resultVar1 != nil { 410 span.LogFields(spanlog.Error(resultVar1)) 411 ext.Error.Set(span, true) 412 } 413 414 return resultVar0, resultVar1 415 } 416 417 func (a *OpenTracingAppLayer) AddUserToTeam(teamId string, userId string, userRequestorId string) (*model.Team, *model.AppError) { 418 origCtx := a.ctx 419 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeam") 420 421 a.ctx = newCtx 422 a.app.Srv().Store.SetContext(newCtx) 423 defer func() { 424 a.app.Srv().Store.SetContext(origCtx) 425 a.ctx = origCtx 426 }() 427 428 defer span.Finish() 429 resultVar0, resultVar1 := a.app.AddUserToTeam(teamId, userId, userRequestorId) 430 431 if resultVar1 != nil { 432 span.LogFields(spanlog.Error(resultVar1)) 433 ext.Error.Set(span, true) 434 } 435 436 return resultVar0, resultVar1 437 } 438 439 func (a *OpenTracingAppLayer) AddUserToTeamByInviteId(inviteId string, userId string) (*model.Team, *model.AppError) { 440 origCtx := a.ctx 441 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByInviteId") 442 443 a.ctx = newCtx 444 a.app.Srv().Store.SetContext(newCtx) 445 defer func() { 446 a.app.Srv().Store.SetContext(origCtx) 447 a.ctx = origCtx 448 }() 449 450 defer span.Finish() 451 resultVar0, resultVar1 := a.app.AddUserToTeamByInviteId(inviteId, userId) 452 453 if resultVar1 != nil { 454 span.LogFields(spanlog.Error(resultVar1)) 455 ext.Error.Set(span, true) 456 } 457 458 return resultVar0, resultVar1 459 } 460 461 func (a *OpenTracingAppLayer) AddUserToTeamByTeamId(teamId string, user *model.User) *model.AppError { 462 origCtx := a.ctx 463 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByTeamId") 464 465 a.ctx = newCtx 466 a.app.Srv().Store.SetContext(newCtx) 467 defer func() { 468 a.app.Srv().Store.SetContext(origCtx) 469 a.ctx = origCtx 470 }() 471 472 defer span.Finish() 473 resultVar0 := a.app.AddUserToTeamByTeamId(teamId, user) 474 475 if resultVar0 != nil { 476 span.LogFields(spanlog.Error(resultVar0)) 477 ext.Error.Set(span, true) 478 } 479 480 return resultVar0 481 } 482 483 func (a *OpenTracingAppLayer) AddUserToTeamByToken(userId string, tokenId string) (*model.Team, *model.AppError) { 484 origCtx := a.ctx 485 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToTeamByToken") 486 487 a.ctx = newCtx 488 a.app.Srv().Store.SetContext(newCtx) 489 defer func() { 490 a.app.Srv().Store.SetContext(origCtx) 491 a.ctx = origCtx 492 }() 493 494 defer span.Finish() 495 resultVar0, resultVar1 := a.app.AddUserToTeamByToken(userId, tokenId) 496 497 if resultVar1 != nil { 498 span.LogFields(spanlog.Error(resultVar1)) 499 ext.Error.Set(span, true) 500 } 501 502 return resultVar0, resultVar1 503 } 504 505 func (a *OpenTracingAppLayer) AdjustImage(file io.Reader) (*bytes.Buffer, *model.AppError) { 506 origCtx := a.ctx 507 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AdjustImage") 508 509 a.ctx = newCtx 510 a.app.Srv().Store.SetContext(newCtx) 511 defer func() { 512 a.app.Srv().Store.SetContext(origCtx) 513 a.ctx = origCtx 514 }() 515 516 defer span.Finish() 517 resultVar0, resultVar1 := a.app.AdjustImage(file) 518 519 if resultVar1 != nil { 520 span.LogFields(spanlog.Error(resultVar1)) 521 ext.Error.Set(span, true) 522 } 523 524 return resultVar0, resultVar1 525 } 526 527 func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 528 origCtx := a.ctx 529 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser") 530 531 a.ctx = newCtx 532 a.app.Srv().Store.SetContext(newCtx) 533 defer func() { 534 a.app.Srv().Store.SetContext(origCtx) 535 a.ctx = origCtx 536 }() 537 538 defer span.Finish() 539 resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userId, authRequest) 540 541 if resultVar1 != nil { 542 span.LogFields(spanlog.Error(resultVar1)) 543 ext.Error.Set(span, true) 544 } 545 546 return resultVar0, resultVar1 547 } 548 549 func (a *OpenTracingAppLayer) AsymmetricSigningKey() *ecdsa.PrivateKey { 550 origCtx := a.ctx 551 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AsymmetricSigningKey") 552 553 a.ctx = newCtx 554 a.app.Srv().Store.SetContext(newCtx) 555 defer func() { 556 a.app.Srv().Store.SetContext(origCtx) 557 a.ctx = origCtx 558 }() 559 560 defer span.Finish() 561 resultVar0 := a.app.AsymmetricSigningKey() 562 563 return resultVar0 564 } 565 566 func (a *OpenTracingAppLayer) AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError { 567 origCtx := a.ctx 568 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachDeviceId") 569 570 a.ctx = newCtx 571 a.app.Srv().Store.SetContext(newCtx) 572 defer func() { 573 a.app.Srv().Store.SetContext(origCtx) 574 a.ctx = origCtx 575 }() 576 577 defer span.Finish() 578 resultVar0 := a.app.AttachDeviceId(sessionId, deviceId, expiresAt) 579 580 if resultVar0 != nil { 581 span.LogFields(spanlog.Error(resultVar0)) 582 ext.Error.Set(span, true) 583 } 584 585 return resultVar0 586 } 587 588 func (a *OpenTracingAppLayer) AttachSessionCookies(w http.ResponseWriter, r *http.Request) { 589 origCtx := a.ctx 590 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachSessionCookies") 591 592 a.ctx = newCtx 593 a.app.Srv().Store.SetContext(newCtx) 594 defer func() { 595 a.app.Srv().Store.SetContext(origCtx) 596 a.ctx = origCtx 597 }() 598 599 defer span.Finish() 600 a.app.AttachSessionCookies(w, r) 601 } 602 603 func (a *OpenTracingAppLayer) AuthenticateUserForLogin(id string, loginId string, password string, mfaToken string, ldapOnly bool) (user *model.User, err *model.AppError) { 604 origCtx := a.ctx 605 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthenticateUserForLogin") 606 607 a.ctx = newCtx 608 a.app.Srv().Store.SetContext(newCtx) 609 defer func() { 610 a.app.Srv().Store.SetContext(origCtx) 611 a.ctx = origCtx 612 }() 613 614 defer span.Finish() 615 resultVar0, resultVar1 := a.app.AuthenticateUserForLogin(id, loginId, password, mfaToken, ldapOnly) 616 617 if resultVar1 != nil { 618 span.LogFields(spanlog.Error(resultVar1)) 619 ext.Error.Set(span, true) 620 } 621 622 return resultVar0, resultVar1 623 } 624 625 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.AppError) { 626 origCtx := a.ctx 627 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthorizeOAuthUser") 628 629 a.ctx = newCtx 630 a.app.Srv().Store.SetContext(newCtx) 631 defer func() { 632 a.app.Srv().Store.SetContext(origCtx) 633 a.ctx = origCtx 634 }() 635 636 defer span.Finish() 637 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.AuthorizeOAuthUser(w, r, service, code, state, redirectUri) 638 639 if resultVar3 != nil { 640 span.LogFields(spanlog.Error(resultVar3)) 641 ext.Error.Set(span, true) 642 } 643 644 return resultVar0, resultVar1, resultVar2, resultVar3 645 } 646 647 func (a *OpenTracingAppLayer) AutocompleteChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { 648 origCtx := a.ctx 649 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannels") 650 651 a.ctx = newCtx 652 a.app.Srv().Store.SetContext(newCtx) 653 defer func() { 654 a.app.Srv().Store.SetContext(origCtx) 655 a.ctx = origCtx 656 }() 657 658 defer span.Finish() 659 resultVar0, resultVar1 := a.app.AutocompleteChannels(teamId, term) 660 661 if resultVar1 != nil { 662 span.LogFields(spanlog.Error(resultVar1)) 663 ext.Error.Set(span, true) 664 } 665 666 return resultVar0, resultVar1 667 } 668 669 func (a *OpenTracingAppLayer) AutocompleteChannelsForSearch(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { 670 origCtx := a.ctx 671 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteChannelsForSearch") 672 673 a.ctx = newCtx 674 a.app.Srv().Store.SetContext(newCtx) 675 defer func() { 676 a.app.Srv().Store.SetContext(origCtx) 677 a.ctx = origCtx 678 }() 679 680 defer span.Finish() 681 resultVar0, resultVar1 := a.app.AutocompleteChannelsForSearch(teamId, userId, term) 682 683 if resultVar1 != nil { 684 span.LogFields(spanlog.Error(resultVar1)) 685 ext.Error.Set(span, true) 686 } 687 688 return resultVar0, resultVar1 689 } 690 691 func (a *OpenTracingAppLayer) AutocompleteUsersInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInChannel, *model.AppError) { 692 origCtx := a.ctx 693 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInChannel") 694 695 a.ctx = newCtx 696 a.app.Srv().Store.SetContext(newCtx) 697 defer func() { 698 a.app.Srv().Store.SetContext(origCtx) 699 a.ctx = origCtx 700 }() 701 702 defer span.Finish() 703 resultVar0, resultVar1 := a.app.AutocompleteUsersInChannel(teamId, channelId, term, options) 704 705 if resultVar1 != nil { 706 span.LogFields(spanlog.Error(resultVar1)) 707 ext.Error.Set(span, true) 708 } 709 710 return resultVar0, resultVar1 711 } 712 713 func (a *OpenTracingAppLayer) AutocompleteUsersInTeam(teamId string, term string, options *model.UserSearchOptions) (*model.UserAutocompleteInTeam, *model.AppError) { 714 origCtx := a.ctx 715 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AutocompleteUsersInTeam") 716 717 a.ctx = newCtx 718 a.app.Srv().Store.SetContext(newCtx) 719 defer func() { 720 a.app.Srv().Store.SetContext(origCtx) 721 a.ctx = origCtx 722 }() 723 724 defer span.Finish() 725 resultVar0, resultVar1 := a.app.AutocompleteUsersInTeam(teamId, term, options) 726 727 if resultVar1 != nil { 728 span.LogFields(spanlog.Error(resultVar1)) 729 ext.Error.Set(span, true) 730 } 731 732 return resultVar0, resultVar1 733 } 734 735 func (a *OpenTracingAppLayer) BroadcastStatus(status *model.Status) { 736 origCtx := a.ctx 737 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BroadcastStatus") 738 739 a.ctx = newCtx 740 a.app.Srv().Store.SetContext(newCtx) 741 defer func() { 742 a.app.Srv().Store.SetContext(origCtx) 743 a.ctx = origCtx 744 }() 745 746 defer span.Finish() 747 a.app.BroadcastStatus(status) 748 } 749 750 func (a *OpenTracingAppLayer) BuildPostReactions(postId string) (*[]app.ReactionImportData, *model.AppError) { 751 origCtx := a.ctx 752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPostReactions") 753 754 a.ctx = newCtx 755 a.app.Srv().Store.SetContext(newCtx) 756 defer func() { 757 a.app.Srv().Store.SetContext(origCtx) 758 a.ctx = origCtx 759 }() 760 761 defer span.Finish() 762 resultVar0, resultVar1 := a.app.BuildPostReactions(postId) 763 764 if resultVar1 != nil { 765 span.LogFields(spanlog.Error(resultVar1)) 766 ext.Error.Set(span, true) 767 } 768 769 return resultVar0, resultVar1 770 } 771 772 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) { 773 origCtx := a.ctx 774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPushNotificationMessage") 775 776 a.ctx = newCtx 777 a.app.Srv().Store.SetContext(newCtx) 778 defer func() { 779 a.app.Srv().Store.SetContext(origCtx) 780 a.ctx = origCtx 781 }() 782 783 defer span.Finish() 784 resultVar0, resultVar1 := a.app.BuildPushNotificationMessage(contentsConfig, post, user, channel, channelName, senderName, explicitMention, channelWideMention, replyToThreadType) 785 786 if resultVar1 != nil { 787 span.LogFields(spanlog.Error(resultVar1)) 788 ext.Error.Set(span, true) 789 } 790 791 return resultVar0, resultVar1 792 } 793 794 func (a *OpenTracingAppLayer) BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError) { 795 origCtx := a.ctx 796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildSamlMetadataObject") 797 798 a.ctx = newCtx 799 a.app.Srv().Store.SetContext(newCtx) 800 defer func() { 801 a.app.Srv().Store.SetContext(origCtx) 802 a.ctx = origCtx 803 }() 804 805 defer span.Finish() 806 resultVar0, resultVar1 := a.app.BuildSamlMetadataObject(idpMetadata) 807 808 if resultVar1 != nil { 809 span.LogFields(spanlog.Error(resultVar1)) 810 ext.Error.Set(span, true) 811 } 812 813 return resultVar0, resultVar1 814 } 815 816 func (a *OpenTracingAppLayer) BulkExport(writer io.Writer, file string, pathToEmojiDir string, dirNameToExportEmoji string) *model.AppError { 817 origCtx := a.ctx 818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkExport") 819 820 a.ctx = newCtx 821 a.app.Srv().Store.SetContext(newCtx) 822 defer func() { 823 a.app.Srv().Store.SetContext(origCtx) 824 a.ctx = origCtx 825 }() 826 827 defer span.Finish() 828 resultVar0 := a.app.BulkExport(writer, file, pathToEmojiDir, dirNameToExportEmoji) 829 830 if resultVar0 != nil { 831 span.LogFields(spanlog.Error(resultVar0)) 832 ext.Error.Set(span, true) 833 } 834 835 return resultVar0 836 } 837 838 func (a *OpenTracingAppLayer) BulkImport(fileReader io.Reader, dryRun bool, workers int) (*model.AppError, int) { 839 origCtx := a.ctx 840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkImport") 841 842 a.ctx = newCtx 843 a.app.Srv().Store.SetContext(newCtx) 844 defer func() { 845 a.app.Srv().Store.SetContext(origCtx) 846 a.ctx = origCtx 847 }() 848 849 defer span.Finish() 850 resultVar0, resultVar1 := a.app.BulkImport(fileReader, dryRun, workers) 851 852 if resultVar0 != nil { 853 span.LogFields(spanlog.Error(resultVar0)) 854 ext.Error.Set(span, true) 855 } 856 857 return resultVar0, resultVar1 858 } 859 860 func (a *OpenTracingAppLayer) CancelJob(jobId string) *model.AppError { 861 origCtx := a.ctx 862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CancelJob") 863 864 a.ctx = newCtx 865 a.app.Srv().Store.SetContext(newCtx) 866 defer func() { 867 a.app.Srv().Store.SetContext(origCtx) 868 a.ctx = origCtx 869 }() 870 871 defer span.Finish() 872 resultVar0 := a.app.CancelJob(jobId) 873 874 if resultVar0 != nil { 875 span.LogFields(spanlog.Error(resultVar0)) 876 ext.Error.Set(span, true) 877 } 878 879 return resultVar0 880 } 881 882 func (a *OpenTracingAppLayer) ChannelMembersMinusGroupMembers(channelID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 883 origCtx := a.ctx 884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersMinusGroupMembers") 885 886 a.ctx = newCtx 887 a.app.Srv().Store.SetContext(newCtx) 888 defer func() { 889 a.app.Srv().Store.SetContext(origCtx) 890 a.ctx = origCtx 891 }() 892 893 defer span.Finish() 894 resultVar0, resultVar1, resultVar2 := a.app.ChannelMembersMinusGroupMembers(channelID, groupIDs, page, perPage) 895 896 if resultVar2 != nil { 897 span.LogFields(spanlog.Error(resultVar2)) 898 ext.Error.Set(span, true) 899 } 900 901 return resultVar0, resultVar1, resultVar2 902 } 903 904 func (a *OpenTracingAppLayer) ChannelMembersToAdd(since int64, channelID *string) ([]*model.UserChannelIDPair, *model.AppError) { 905 origCtx := a.ctx 906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToAdd") 907 908 a.ctx = newCtx 909 a.app.Srv().Store.SetContext(newCtx) 910 defer func() { 911 a.app.Srv().Store.SetContext(origCtx) 912 a.ctx = origCtx 913 }() 914 915 defer span.Finish() 916 resultVar0, resultVar1 := a.app.ChannelMembersToAdd(since, channelID) 917 918 if resultVar1 != nil { 919 span.LogFields(spanlog.Error(resultVar1)) 920 ext.Error.Set(span, true) 921 } 922 923 return resultVar0, resultVar1 924 } 925 926 func (a *OpenTracingAppLayer) ChannelMembersToRemove(teamID *string) ([]*model.ChannelMember, *model.AppError) { 927 origCtx := a.ctx 928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ChannelMembersToRemove") 929 930 a.ctx = newCtx 931 a.app.Srv().Store.SetContext(newCtx) 932 defer func() { 933 a.app.Srv().Store.SetContext(origCtx) 934 a.ctx = origCtx 935 }() 936 937 defer span.Finish() 938 resultVar0, resultVar1 := a.app.ChannelMembersToRemove(teamID) 939 940 if resultVar1 != nil { 941 span.LogFields(spanlog.Error(resultVar1)) 942 ext.Error.Set(span, true) 943 } 944 945 return resultVar0, resultVar1 946 } 947 948 func (a *OpenTracingAppLayer) CheckForClientSideCert(r *http.Request) (string, string, string) { 949 origCtx := a.ctx 950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckForClientSideCert") 951 952 a.ctx = newCtx 953 a.app.Srv().Store.SetContext(newCtx) 954 defer func() { 955 a.app.Srv().Store.SetContext(origCtx) 956 a.ctx = origCtx 957 }() 958 959 defer span.Finish() 960 resultVar0, resultVar1, resultVar2 := a.app.CheckForClientSideCert(r) 961 962 return resultVar0, resultVar1, resultVar2 963 } 964 965 func (a *OpenTracingAppLayer) CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError { 966 origCtx := a.ctx 967 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckPasswordAndAllCriteria") 968 969 a.ctx = newCtx 970 a.app.Srv().Store.SetContext(newCtx) 971 defer func() { 972 a.app.Srv().Store.SetContext(origCtx) 973 a.ctx = origCtx 974 }() 975 976 defer span.Finish() 977 resultVar0 := a.app.CheckPasswordAndAllCriteria(user, password, mfaToken) 978 979 if resultVar0 != nil { 980 span.LogFields(spanlog.Error(resultVar0)) 981 ext.Error.Set(span, true) 982 } 983 984 return resultVar0 985 } 986 987 func (a *OpenTracingAppLayer) CheckRolesExist(roleNames []string) *model.AppError { 988 origCtx := a.ctx 989 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckRolesExist") 990 991 a.ctx = newCtx 992 a.app.Srv().Store.SetContext(newCtx) 993 defer func() { 994 a.app.Srv().Store.SetContext(origCtx) 995 a.ctx = origCtx 996 }() 997 998 defer span.Finish() 999 resultVar0 := a.app.CheckRolesExist(roleNames) 1000 1001 if resultVar0 != nil { 1002 span.LogFields(spanlog.Error(resultVar0)) 1003 ext.Error.Set(span, true) 1004 } 1005 1006 return resultVar0 1007 } 1008 1009 func (a *OpenTracingAppLayer) CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1010 origCtx := a.ctx 1011 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserAllAuthenticationCriteria") 1012 1013 a.ctx = newCtx 1014 a.app.Srv().Store.SetContext(newCtx) 1015 defer func() { 1016 a.app.Srv().Store.SetContext(origCtx) 1017 a.ctx = origCtx 1018 }() 1019 1020 defer span.Finish() 1021 resultVar0 := a.app.CheckUserAllAuthenticationCriteria(user, mfaToken) 1022 1023 if resultVar0 != nil { 1024 span.LogFields(spanlog.Error(resultVar0)) 1025 ext.Error.Set(span, true) 1026 } 1027 1028 return resultVar0 1029 } 1030 1031 func (a *OpenTracingAppLayer) CheckUserMfa(user *model.User, token string) *model.AppError { 1032 origCtx := a.ctx 1033 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserMfa") 1034 1035 a.ctx = newCtx 1036 a.app.Srv().Store.SetContext(newCtx) 1037 defer func() { 1038 a.app.Srv().Store.SetContext(origCtx) 1039 a.ctx = origCtx 1040 }() 1041 1042 defer span.Finish() 1043 resultVar0 := a.app.CheckUserMfa(user, token) 1044 1045 if resultVar0 != nil { 1046 span.LogFields(spanlog.Error(resultVar0)) 1047 ext.Error.Set(span, true) 1048 } 1049 1050 return resultVar0 1051 } 1052 1053 func (a *OpenTracingAppLayer) CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError { 1054 origCtx := a.ctx 1055 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPostflightAuthenticationCriteria") 1056 1057 a.ctx = newCtx 1058 a.app.Srv().Store.SetContext(newCtx) 1059 defer func() { 1060 a.app.Srv().Store.SetContext(origCtx) 1061 a.ctx = origCtx 1062 }() 1063 1064 defer span.Finish() 1065 resultVar0 := a.app.CheckUserPostflightAuthenticationCriteria(user) 1066 1067 if resultVar0 != nil { 1068 span.LogFields(spanlog.Error(resultVar0)) 1069 ext.Error.Set(span, true) 1070 } 1071 1072 return resultVar0 1073 } 1074 1075 func (a *OpenTracingAppLayer) CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 1076 origCtx := a.ctx 1077 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPreflightAuthenticationCriteria") 1078 1079 a.ctx = newCtx 1080 a.app.Srv().Store.SetContext(newCtx) 1081 defer func() { 1082 a.app.Srv().Store.SetContext(origCtx) 1083 a.ctx = origCtx 1084 }() 1085 1086 defer span.Finish() 1087 resultVar0 := a.app.CheckUserPreflightAuthenticationCriteria(user, mfaToken) 1088 1089 if resultVar0 != nil { 1090 span.LogFields(spanlog.Error(resultVar0)) 1091 ext.Error.Set(span, true) 1092 } 1093 1094 return resultVar0 1095 } 1096 1097 func (a *OpenTracingAppLayer) CheckValidDomains(team *model.Team) *model.AppError { 1098 origCtx := a.ctx 1099 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckValidDomains") 1100 1101 a.ctx = newCtx 1102 a.app.Srv().Store.SetContext(newCtx) 1103 defer func() { 1104 a.app.Srv().Store.SetContext(origCtx) 1105 a.ctx = origCtx 1106 }() 1107 1108 defer span.Finish() 1109 resultVar0 := a.app.CheckValidDomains(team) 1110 1111 if resultVar0 != nil { 1112 span.LogFields(spanlog.Error(resultVar0)) 1113 ext.Error.Set(span, true) 1114 } 1115 1116 return resultVar0 1117 } 1118 1119 func (a *OpenTracingAppLayer) ClearChannelMembersCache(channelID string) { 1120 origCtx := a.ctx 1121 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearChannelMembersCache") 1122 1123 a.ctx = newCtx 1124 a.app.Srv().Store.SetContext(newCtx) 1125 defer func() { 1126 a.app.Srv().Store.SetContext(origCtx) 1127 a.ctx = origCtx 1128 }() 1129 1130 defer span.Finish() 1131 a.app.ClearChannelMembersCache(channelID) 1132 } 1133 1134 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsers() { 1135 origCtx := a.ctx 1136 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsers") 1137 1138 a.ctx = newCtx 1139 a.app.Srv().Store.SetContext(newCtx) 1140 defer func() { 1141 a.app.Srv().Store.SetContext(origCtx) 1142 a.ctx = origCtx 1143 }() 1144 1145 defer span.Finish() 1146 a.app.ClearSessionCacheForAllUsers() 1147 } 1148 1149 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsersSkipClusterSend() { 1150 origCtx := a.ctx 1151 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsersSkipClusterSend") 1152 1153 a.ctx = newCtx 1154 a.app.Srv().Store.SetContext(newCtx) 1155 defer func() { 1156 a.app.Srv().Store.SetContext(origCtx) 1157 a.ctx = origCtx 1158 }() 1159 1160 defer span.Finish() 1161 a.app.ClearSessionCacheForAllUsersSkipClusterSend() 1162 } 1163 1164 func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userId string) { 1165 origCtx := a.ctx 1166 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUser") 1167 1168 a.ctx = newCtx 1169 a.app.Srv().Store.SetContext(newCtx) 1170 defer func() { 1171 a.app.Srv().Store.SetContext(origCtx) 1172 a.ctx = origCtx 1173 }() 1174 1175 defer span.Finish() 1176 a.app.ClearSessionCacheForUser(userId) 1177 } 1178 1179 func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userId string) { 1180 origCtx := a.ctx 1181 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUserSkipClusterSend") 1182 1183 a.ctx = newCtx 1184 a.app.Srv().Store.SetContext(newCtx) 1185 defer func() { 1186 a.app.Srv().Store.SetContext(origCtx) 1187 a.ctx = origCtx 1188 }() 1189 1190 defer span.Finish() 1191 a.app.ClearSessionCacheForUserSkipClusterSend(userId) 1192 } 1193 1194 func (a *OpenTracingAppLayer) ClearTeamMembersCache(teamID string) { 1195 origCtx := a.ctx 1196 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearTeamMembersCache") 1197 1198 a.ctx = newCtx 1199 a.app.Srv().Store.SetContext(newCtx) 1200 defer func() { 1201 a.app.Srv().Store.SetContext(origCtx) 1202 a.ctx = origCtx 1203 }() 1204 1205 defer span.Finish() 1206 a.app.ClearTeamMembersCache(teamID) 1207 } 1208 1209 func (a *OpenTracingAppLayer) ClientConfig() map[string]string { 1210 origCtx := a.ctx 1211 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfig") 1212 1213 a.ctx = newCtx 1214 a.app.Srv().Store.SetContext(newCtx) 1215 defer func() { 1216 a.app.Srv().Store.SetContext(origCtx) 1217 a.ctx = origCtx 1218 }() 1219 1220 defer span.Finish() 1221 resultVar0 := a.app.ClientConfig() 1222 1223 return resultVar0 1224 } 1225 1226 func (a *OpenTracingAppLayer) ClientConfigHash() string { 1227 origCtx := a.ctx 1228 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigHash") 1229 1230 a.ctx = newCtx 1231 a.app.Srv().Store.SetContext(newCtx) 1232 defer func() { 1233 a.app.Srv().Store.SetContext(origCtx) 1234 a.ctx = origCtx 1235 }() 1236 1237 defer span.Finish() 1238 resultVar0 := a.app.ClientConfigHash() 1239 1240 return resultVar0 1241 } 1242 1243 func (a *OpenTracingAppLayer) ClientConfigWithComputed() map[string]string { 1244 origCtx := a.ctx 1245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigWithComputed") 1246 1247 a.ctx = newCtx 1248 a.app.Srv().Store.SetContext(newCtx) 1249 defer func() { 1250 a.app.Srv().Store.SetContext(origCtx) 1251 a.ctx = origCtx 1252 }() 1253 1254 defer span.Finish() 1255 resultVar0 := a.app.ClientConfigWithComputed() 1256 1257 return resultVar0 1258 } 1259 1260 func (a *OpenTracingAppLayer) CompareAndDeletePluginKey(pluginId string, key string, oldValue []byte) (bool, *model.AppError) { 1261 origCtx := a.ctx 1262 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndDeletePluginKey") 1263 1264 a.ctx = newCtx 1265 a.app.Srv().Store.SetContext(newCtx) 1266 defer func() { 1267 a.app.Srv().Store.SetContext(origCtx) 1268 a.ctx = origCtx 1269 }() 1270 1271 defer span.Finish() 1272 resultVar0, resultVar1 := a.app.CompareAndDeletePluginKey(pluginId, key, oldValue) 1273 1274 if resultVar1 != nil { 1275 span.LogFields(spanlog.Error(resultVar1)) 1276 ext.Error.Set(span, true) 1277 } 1278 1279 return resultVar0, resultVar1 1280 } 1281 1282 func (a *OpenTracingAppLayer) CompareAndSetPluginKey(pluginId string, key string, oldValue []byte, newValue []byte) (bool, *model.AppError) { 1283 origCtx := a.ctx 1284 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompareAndSetPluginKey") 1285 1286 a.ctx = newCtx 1287 a.app.Srv().Store.SetContext(newCtx) 1288 defer func() { 1289 a.app.Srv().Store.SetContext(origCtx) 1290 a.ctx = origCtx 1291 }() 1292 1293 defer span.Finish() 1294 resultVar0, resultVar1 := a.app.CompareAndSetPluginKey(pluginId, key, oldValue, newValue) 1295 1296 if resultVar1 != nil { 1297 span.LogFields(spanlog.Error(resultVar1)) 1298 ext.Error.Set(span, true) 1299 } 1300 1301 return resultVar0, resultVar1 1302 } 1303 1304 func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, teamId string, props map[string]string) (*model.User, *model.AppError) { 1305 origCtx := a.ctx 1306 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth") 1307 1308 a.ctx = newCtx 1309 a.app.Srv().Store.SetContext(newCtx) 1310 defer func() { 1311 a.app.Srv().Store.SetContext(origCtx) 1312 a.ctx = origCtx 1313 }() 1314 1315 defer span.Finish() 1316 resultVar0, resultVar1 := a.app.CompleteOAuth(service, body, teamId, props) 1317 1318 if resultVar1 != nil { 1319 span.LogFields(spanlog.Error(resultVar1)) 1320 ext.Error.Set(span, true) 1321 } 1322 1323 return resultVar0, resultVar1 1324 } 1325 1326 func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(service string, userData io.Reader, email string) (*model.User, *model.AppError) { 1327 origCtx := a.ctx 1328 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteSwitchWithOAuth") 1329 1330 a.ctx = newCtx 1331 a.app.Srv().Store.SetContext(newCtx) 1332 defer func() { 1333 a.app.Srv().Store.SetContext(origCtx) 1334 a.ctx = origCtx 1335 }() 1336 1337 defer span.Finish() 1338 resultVar0, resultVar1 := a.app.CompleteSwitchWithOAuth(service, userData, email) 1339 1340 if resultVar1 != nil { 1341 span.LogFields(spanlog.Error(resultVar1)) 1342 ext.Error.Set(span, true) 1343 } 1344 1345 return resultVar0, resultVar1 1346 } 1347 1348 func (a *OpenTracingAppLayer) Config() *model.Config { 1349 origCtx := a.ctx 1350 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Config") 1351 1352 a.ctx = newCtx 1353 a.app.Srv().Store.SetContext(newCtx) 1354 defer func() { 1355 a.app.Srv().Store.SetContext(origCtx) 1356 a.ctx = origCtx 1357 }() 1358 1359 defer span.Finish() 1360 resultVar0 := a.app.Config() 1361 1362 return resultVar0 1363 } 1364 1365 func (a *OpenTracingAppLayer) ConvertBotToUser(bot *model.Bot, userPatch *model.UserPatch, sysadmin bool) (*model.User, *model.AppError) { 1366 origCtx := a.ctx 1367 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertBotToUser") 1368 1369 a.ctx = newCtx 1370 a.app.Srv().Store.SetContext(newCtx) 1371 defer func() { 1372 a.app.Srv().Store.SetContext(origCtx) 1373 a.ctx = origCtx 1374 }() 1375 1376 defer span.Finish() 1377 resultVar0, resultVar1 := a.app.ConvertBotToUser(bot, userPatch, sysadmin) 1378 1379 if resultVar1 != nil { 1380 span.LogFields(spanlog.Error(resultVar1)) 1381 ext.Error.Set(span, true) 1382 } 1383 1384 return resultVar0, resultVar1 1385 } 1386 1387 func (a *OpenTracingAppLayer) ConvertUserToBot(user *model.User) (*model.Bot, *model.AppError) { 1388 origCtx := a.ctx 1389 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ConvertUserToBot") 1390 1391 a.ctx = newCtx 1392 a.app.Srv().Store.SetContext(newCtx) 1393 defer func() { 1394 a.app.Srv().Store.SetContext(origCtx) 1395 a.ctx = origCtx 1396 }() 1397 1398 defer span.Finish() 1399 resultVar0, resultVar1 := a.app.ConvertUserToBot(user) 1400 1401 if resultVar1 != nil { 1402 span.LogFields(spanlog.Error(resultVar1)) 1403 ext.Error.Set(span, true) 1404 } 1405 1406 return resultVar0, resultVar1 1407 } 1408 1409 func (a *OpenTracingAppLayer) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) { 1410 origCtx := a.ctx 1411 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CopyFileInfos") 1412 1413 a.ctx = newCtx 1414 a.app.Srv().Store.SetContext(newCtx) 1415 defer func() { 1416 a.app.Srv().Store.SetContext(origCtx) 1417 a.ctx = origCtx 1418 }() 1419 1420 defer span.Finish() 1421 resultVar0, resultVar1 := a.app.CopyFileInfos(userId, fileIds) 1422 1423 if resultVar1 != nil { 1424 span.LogFields(spanlog.Error(resultVar1)) 1425 ext.Error.Set(span, true) 1426 } 1427 1428 return resultVar0, resultVar1 1429 } 1430 1431 func (a *OpenTracingAppLayer) CreateBasicUser(client *model.Client4) *model.AppError { 1432 origCtx := a.ctx 1433 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBasicUser") 1434 1435 a.ctx = newCtx 1436 a.app.Srv().Store.SetContext(newCtx) 1437 defer func() { 1438 a.app.Srv().Store.SetContext(origCtx) 1439 a.ctx = origCtx 1440 }() 1441 1442 defer span.Finish() 1443 resultVar0 := a.app.CreateBasicUser(client) 1444 1445 if resultVar0 != nil { 1446 span.LogFields(spanlog.Error(resultVar0)) 1447 ext.Error.Set(span, true) 1448 } 1449 1450 return resultVar0 1451 } 1452 1453 func (a *OpenTracingAppLayer) CreateBot(bot *model.Bot) (*model.Bot, *model.AppError) { 1454 origCtx := a.ctx 1455 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBot") 1456 1457 a.ctx = newCtx 1458 a.app.Srv().Store.SetContext(newCtx) 1459 defer func() { 1460 a.app.Srv().Store.SetContext(origCtx) 1461 a.ctx = origCtx 1462 }() 1463 1464 defer span.Finish() 1465 resultVar0, resultVar1 := a.app.CreateBot(bot) 1466 1467 if resultVar1 != nil { 1468 span.LogFields(spanlog.Error(resultVar1)) 1469 ext.Error.Set(span, true) 1470 } 1471 1472 return resultVar0, resultVar1 1473 } 1474 1475 func (a *OpenTracingAppLayer) CreateChannel(channel *model.Channel, addMember bool) (*model.Channel, *model.AppError) { 1476 origCtx := a.ctx 1477 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannel") 1478 1479 a.ctx = newCtx 1480 a.app.Srv().Store.SetContext(newCtx) 1481 defer func() { 1482 a.app.Srv().Store.SetContext(origCtx) 1483 a.ctx = origCtx 1484 }() 1485 1486 defer span.Finish() 1487 resultVar0, resultVar1 := a.app.CreateChannel(channel, addMember) 1488 1489 if resultVar1 != nil { 1490 span.LogFields(spanlog.Error(resultVar1)) 1491 ext.Error.Set(span, true) 1492 } 1493 1494 return resultVar0, resultVar1 1495 } 1496 1497 func (a *OpenTracingAppLayer) CreateChannelScheme(channel *model.Channel) (*model.Scheme, *model.AppError) { 1498 origCtx := a.ctx 1499 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelScheme") 1500 1501 a.ctx = newCtx 1502 a.app.Srv().Store.SetContext(newCtx) 1503 defer func() { 1504 a.app.Srv().Store.SetContext(origCtx) 1505 a.ctx = origCtx 1506 }() 1507 1508 defer span.Finish() 1509 resultVar0, resultVar1 := a.app.CreateChannelScheme(channel) 1510 1511 if resultVar1 != nil { 1512 span.LogFields(spanlog.Error(resultVar1)) 1513 ext.Error.Set(span, true) 1514 } 1515 1516 return resultVar0, resultVar1 1517 } 1518 1519 func (a *OpenTracingAppLayer) CreateChannelWithUser(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { 1520 origCtx := a.ctx 1521 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateChannelWithUser") 1522 1523 a.ctx = newCtx 1524 a.app.Srv().Store.SetContext(newCtx) 1525 defer func() { 1526 a.app.Srv().Store.SetContext(origCtx) 1527 a.ctx = origCtx 1528 }() 1529 1530 defer span.Finish() 1531 resultVar0, resultVar1 := a.app.CreateChannelWithUser(channel, userId) 1532 1533 if resultVar1 != nil { 1534 span.LogFields(spanlog.Error(resultVar1)) 1535 ext.Error.Set(span, true) 1536 } 1537 1538 return resultVar0, resultVar1 1539 } 1540 1541 func (a *OpenTracingAppLayer) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) { 1542 origCtx := a.ctx 1543 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommand") 1544 1545 a.ctx = newCtx 1546 a.app.Srv().Store.SetContext(newCtx) 1547 defer func() { 1548 a.app.Srv().Store.SetContext(origCtx) 1549 a.ctx = origCtx 1550 }() 1551 1552 defer span.Finish() 1553 resultVar0, resultVar1 := a.app.CreateCommand(cmd) 1554 1555 if resultVar1 != nil { 1556 span.LogFields(spanlog.Error(resultVar1)) 1557 ext.Error.Set(span, true) 1558 } 1559 1560 return resultVar0, resultVar1 1561 } 1562 1563 func (a *OpenTracingAppLayer) CreateCommandPost(post *model.Post, teamId string, response *model.CommandResponse, skipSlackParsing bool) (*model.Post, *model.AppError) { 1564 origCtx := a.ctx 1565 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandPost") 1566 1567 a.ctx = newCtx 1568 a.app.Srv().Store.SetContext(newCtx) 1569 defer func() { 1570 a.app.Srv().Store.SetContext(origCtx) 1571 a.ctx = origCtx 1572 }() 1573 1574 span.SetTag("teamId", teamId) 1575 1576 span.SetTag("skipSlackParsing", skipSlackParsing) 1577 1578 defer span.Finish() 1579 resultVar0, resultVar1 := a.app.CreateCommandPost(post, teamId, response, skipSlackParsing) 1580 1581 if resultVar1 != nil { 1582 span.LogFields(spanlog.Error(resultVar1)) 1583 ext.Error.Set(span, true) 1584 } 1585 1586 return resultVar0, resultVar1 1587 } 1588 1589 func (a *OpenTracingAppLayer) CreateCommandWebhook(commandId string, args *model.CommandArgs) (*model.CommandWebhook, *model.AppError) { 1590 origCtx := a.ctx 1591 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommandWebhook") 1592 1593 a.ctx = newCtx 1594 a.app.Srv().Store.SetContext(newCtx) 1595 defer func() { 1596 a.app.Srv().Store.SetContext(origCtx) 1597 a.ctx = origCtx 1598 }() 1599 1600 defer span.Finish() 1601 resultVar0, resultVar1 := a.app.CreateCommandWebhook(commandId, args) 1602 1603 if resultVar1 != nil { 1604 span.LogFields(spanlog.Error(resultVar1)) 1605 ext.Error.Set(span, true) 1606 } 1607 1608 return resultVar0, resultVar1 1609 } 1610 1611 func (a *OpenTracingAppLayer) CreateDefaultChannels(teamID string) ([]*model.Channel, *model.AppError) { 1612 origCtx := a.ctx 1613 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultChannels") 1614 1615 a.ctx = newCtx 1616 a.app.Srv().Store.SetContext(newCtx) 1617 defer func() { 1618 a.app.Srv().Store.SetContext(origCtx) 1619 a.ctx = origCtx 1620 }() 1621 1622 defer span.Finish() 1623 resultVar0, resultVar1 := a.app.CreateDefaultChannels(teamID) 1624 1625 if resultVar1 != nil { 1626 span.LogFields(spanlog.Error(resultVar1)) 1627 ext.Error.Set(span, true) 1628 } 1629 1630 return resultVar0, resultVar1 1631 } 1632 1633 func (a *OpenTracingAppLayer) CreateDefaultMemberships(since int64) error { 1634 origCtx := a.ctx 1635 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultMemberships") 1636 1637 a.ctx = newCtx 1638 a.app.Srv().Store.SetContext(newCtx) 1639 defer func() { 1640 a.app.Srv().Store.SetContext(origCtx) 1641 a.ctx = origCtx 1642 }() 1643 1644 defer span.Finish() 1645 resultVar0 := a.app.CreateDefaultMemberships(since) 1646 1647 if resultVar0 != nil { 1648 span.LogFields(spanlog.Error(resultVar0)) 1649 ext.Error.Set(span, true) 1650 } 1651 1652 return resultVar0 1653 } 1654 1655 func (a *OpenTracingAppLayer) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) { 1656 origCtx := a.ctx 1657 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateEmoji") 1658 1659 a.ctx = newCtx 1660 a.app.Srv().Store.SetContext(newCtx) 1661 defer func() { 1662 a.app.Srv().Store.SetContext(origCtx) 1663 a.ctx = origCtx 1664 }() 1665 1666 defer span.Finish() 1667 resultVar0, resultVar1 := a.app.CreateEmoji(sessionUserId, emoji, multiPartImageData) 1668 1669 if resultVar1 != nil { 1670 span.LogFields(spanlog.Error(resultVar1)) 1671 ext.Error.Set(span, true) 1672 } 1673 1674 return resultVar0, resultVar1 1675 } 1676 1677 func (a *OpenTracingAppLayer) CreateGroup(group *model.Group) (*model.Group, *model.AppError) { 1678 origCtx := a.ctx 1679 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroup") 1680 1681 a.ctx = newCtx 1682 a.app.Srv().Store.SetContext(newCtx) 1683 defer func() { 1684 a.app.Srv().Store.SetContext(origCtx) 1685 a.ctx = origCtx 1686 }() 1687 1688 defer span.Finish() 1689 resultVar0, resultVar1 := a.app.CreateGroup(group) 1690 1691 if resultVar1 != nil { 1692 span.LogFields(spanlog.Error(resultVar1)) 1693 ext.Error.Set(span, true) 1694 } 1695 1696 return resultVar0, resultVar1 1697 } 1698 1699 func (a *OpenTracingAppLayer) CreateGroupChannel(userIds []string, creatorId string) (*model.Channel, *model.AppError) { 1700 origCtx := a.ctx 1701 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGroupChannel") 1702 1703 a.ctx = newCtx 1704 a.app.Srv().Store.SetContext(newCtx) 1705 defer func() { 1706 a.app.Srv().Store.SetContext(origCtx) 1707 a.ctx = origCtx 1708 }() 1709 1710 defer span.Finish() 1711 resultVar0, resultVar1 := a.app.CreateGroupChannel(userIds, creatorId) 1712 1713 if resultVar1 != nil { 1714 span.LogFields(spanlog.Error(resultVar1)) 1715 ext.Error.Set(span, true) 1716 } 1717 1718 return resultVar0, resultVar1 1719 } 1720 1721 func (a *OpenTracingAppLayer) CreateGuest(user *model.User) (*model.User, *model.AppError) { 1722 origCtx := a.ctx 1723 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGuest") 1724 1725 a.ctx = newCtx 1726 a.app.Srv().Store.SetContext(newCtx) 1727 defer func() { 1728 a.app.Srv().Store.SetContext(origCtx) 1729 a.ctx = origCtx 1730 }() 1731 1732 defer span.Finish() 1733 resultVar0, resultVar1 := a.app.CreateGuest(user) 1734 1735 if resultVar1 != nil { 1736 span.LogFields(spanlog.Error(resultVar1)) 1737 ext.Error.Set(span, true) 1738 } 1739 1740 return resultVar0, resultVar1 1741 } 1742 1743 func (a *OpenTracingAppLayer) CreateIncomingWebhookForChannel(creatorId string, channel *model.Channel, hook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 1744 origCtx := a.ctx 1745 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateIncomingWebhookForChannel") 1746 1747 a.ctx = newCtx 1748 a.app.Srv().Store.SetContext(newCtx) 1749 defer func() { 1750 a.app.Srv().Store.SetContext(origCtx) 1751 a.ctx = origCtx 1752 }() 1753 1754 defer span.Finish() 1755 resultVar0, resultVar1 := a.app.CreateIncomingWebhookForChannel(creatorId, channel, hook) 1756 1757 if resultVar1 != nil { 1758 span.LogFields(spanlog.Error(resultVar1)) 1759 ext.Error.Set(span, true) 1760 } 1761 1762 return resultVar0, resultVar1 1763 } 1764 1765 func (a *OpenTracingAppLayer) CreateJob(job *model.Job) (*model.Job, *model.AppError) { 1766 origCtx := a.ctx 1767 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateJob") 1768 1769 a.ctx = newCtx 1770 a.app.Srv().Store.SetContext(newCtx) 1771 defer func() { 1772 a.app.Srv().Store.SetContext(origCtx) 1773 a.ctx = origCtx 1774 }() 1775 1776 defer span.Finish() 1777 resultVar0, resultVar1 := a.app.CreateJob(job) 1778 1779 if resultVar1 != nil { 1780 span.LogFields(spanlog.Error(resultVar1)) 1781 ext.Error.Set(span, true) 1782 } 1783 1784 return resultVar0, resultVar1 1785 } 1786 1787 func (a *OpenTracingAppLayer) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 1788 origCtx := a.ctx 1789 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthApp") 1790 1791 a.ctx = newCtx 1792 a.app.Srv().Store.SetContext(newCtx) 1793 defer func() { 1794 a.app.Srv().Store.SetContext(origCtx) 1795 a.ctx = origCtx 1796 }() 1797 1798 defer span.Finish() 1799 resultVar0, resultVar1 := a.app.CreateOAuthApp(app) 1800 1801 if resultVar1 != nil { 1802 span.LogFields(spanlog.Error(resultVar1)) 1803 ext.Error.Set(span, true) 1804 } 1805 1806 return resultVar0, resultVar1 1807 } 1808 1809 func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) { 1810 origCtx := a.ctx 1811 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthStateToken") 1812 1813 a.ctx = newCtx 1814 a.app.Srv().Store.SetContext(newCtx) 1815 defer func() { 1816 a.app.Srv().Store.SetContext(origCtx) 1817 a.ctx = origCtx 1818 }() 1819 1820 defer span.Finish() 1821 resultVar0, resultVar1 := a.app.CreateOAuthStateToken(extra) 1822 1823 if resultVar1 != nil { 1824 span.LogFields(spanlog.Error(resultVar1)) 1825 ext.Error.Set(span, true) 1826 } 1827 1828 return resultVar0, resultVar1 1829 } 1830 1831 func (a *OpenTracingAppLayer) CreateOAuthUser(service string, userData io.Reader, teamId string) (*model.User, *model.AppError) { 1832 origCtx := a.ctx 1833 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser") 1834 1835 a.ctx = newCtx 1836 a.app.Srv().Store.SetContext(newCtx) 1837 defer func() { 1838 a.app.Srv().Store.SetContext(origCtx) 1839 a.ctx = origCtx 1840 }() 1841 1842 defer span.Finish() 1843 resultVar0, resultVar1 := a.app.CreateOAuthUser(service, userData, teamId) 1844 1845 if resultVar1 != nil { 1846 span.LogFields(spanlog.Error(resultVar1)) 1847 ext.Error.Set(span, true) 1848 } 1849 1850 return resultVar0, resultVar1 1851 } 1852 1853 func (a *OpenTracingAppLayer) CreateOutgoingWebhook(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 1854 origCtx := a.ctx 1855 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOutgoingWebhook") 1856 1857 a.ctx = newCtx 1858 a.app.Srv().Store.SetContext(newCtx) 1859 defer func() { 1860 a.app.Srv().Store.SetContext(origCtx) 1861 a.ctx = origCtx 1862 }() 1863 1864 defer span.Finish() 1865 resultVar0, resultVar1 := a.app.CreateOutgoingWebhook(hook) 1866 1867 if resultVar1 != nil { 1868 span.LogFields(spanlog.Error(resultVar1)) 1869 ext.Error.Set(span, true) 1870 } 1871 1872 return resultVar0, resultVar1 1873 } 1874 1875 func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userId string, email string) (*model.Token, *model.AppError) { 1876 origCtx := a.ctx 1877 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePasswordRecoveryToken") 1878 1879 a.ctx = newCtx 1880 a.app.Srv().Store.SetContext(newCtx) 1881 defer func() { 1882 a.app.Srv().Store.SetContext(origCtx) 1883 a.ctx = origCtx 1884 }() 1885 1886 defer span.Finish() 1887 resultVar0, resultVar1 := a.app.CreatePasswordRecoveryToken(userId, email) 1888 1889 if resultVar1 != nil { 1890 span.LogFields(spanlog.Error(resultVar1)) 1891 ext.Error.Set(span, true) 1892 } 1893 1894 return resultVar0, resultVar1 1895 } 1896 1897 func (a *OpenTracingAppLayer) CreatePost(post *model.Post, channel *model.Channel, triggerWebhooks bool, setOnline bool) (savedPost *model.Post, err *model.AppError) { 1898 origCtx := a.ctx 1899 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePost") 1900 1901 a.ctx = newCtx 1902 a.app.Srv().Store.SetContext(newCtx) 1903 defer func() { 1904 a.app.Srv().Store.SetContext(origCtx) 1905 a.ctx = origCtx 1906 }() 1907 1908 defer span.Finish() 1909 resultVar0, resultVar1 := a.app.CreatePost(post, channel, triggerWebhooks, setOnline) 1910 1911 if resultVar1 != nil { 1912 span.LogFields(spanlog.Error(resultVar1)) 1913 ext.Error.Set(span, true) 1914 } 1915 1916 return resultVar0, resultVar1 1917 } 1918 1919 func (a *OpenTracingAppLayer) CreatePostAsUser(post *model.Post, currentSessionId string, setOnline bool) (*model.Post, *model.AppError) { 1920 origCtx := a.ctx 1921 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostAsUser") 1922 1923 a.ctx = newCtx 1924 a.app.Srv().Store.SetContext(newCtx) 1925 defer func() { 1926 a.app.Srv().Store.SetContext(origCtx) 1927 a.ctx = origCtx 1928 }() 1929 1930 defer span.Finish() 1931 resultVar0, resultVar1 := a.app.CreatePostAsUser(post, currentSessionId, setOnline) 1932 1933 if resultVar1 != nil { 1934 span.LogFields(spanlog.Error(resultVar1)) 1935 ext.Error.Set(span, true) 1936 } 1937 1938 return resultVar0, resultVar1 1939 } 1940 1941 func (a *OpenTracingAppLayer) CreatePostMissingChannel(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) { 1942 origCtx := a.ctx 1943 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostMissingChannel") 1944 1945 a.ctx = newCtx 1946 a.app.Srv().Store.SetContext(newCtx) 1947 defer func() { 1948 a.app.Srv().Store.SetContext(origCtx) 1949 a.ctx = origCtx 1950 }() 1951 1952 defer span.Finish() 1953 resultVar0, resultVar1 := a.app.CreatePostMissingChannel(post, triggerWebhooks) 1954 1955 if resultVar1 != nil { 1956 span.LogFields(spanlog.Error(resultVar1)) 1957 ext.Error.Set(span, true) 1958 } 1959 1960 return resultVar0, resultVar1 1961 } 1962 1963 func (a *OpenTracingAppLayer) CreateRole(role *model.Role) (*model.Role, *model.AppError) { 1964 origCtx := a.ctx 1965 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateRole") 1966 1967 a.ctx = newCtx 1968 a.app.Srv().Store.SetContext(newCtx) 1969 defer func() { 1970 a.app.Srv().Store.SetContext(origCtx) 1971 a.ctx = origCtx 1972 }() 1973 1974 defer span.Finish() 1975 resultVar0, resultVar1 := a.app.CreateRole(role) 1976 1977 if resultVar1 != nil { 1978 span.LogFields(spanlog.Error(resultVar1)) 1979 ext.Error.Set(span, true) 1980 } 1981 1982 return resultVar0, resultVar1 1983 } 1984 1985 func (a *OpenTracingAppLayer) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 1986 origCtx := a.ctx 1987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateScheme") 1988 1989 a.ctx = newCtx 1990 a.app.Srv().Store.SetContext(newCtx) 1991 defer func() { 1992 a.app.Srv().Store.SetContext(origCtx) 1993 a.ctx = origCtx 1994 }() 1995 1996 defer span.Finish() 1997 resultVar0, resultVar1 := a.app.CreateScheme(scheme) 1998 1999 if resultVar1 != nil { 2000 span.LogFields(spanlog.Error(resultVar1)) 2001 ext.Error.Set(span, true) 2002 } 2003 2004 return resultVar0, resultVar1 2005 } 2006 2007 func (a *OpenTracingAppLayer) CreateSession(session *model.Session) (*model.Session, *model.AppError) { 2008 origCtx := a.ctx 2009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSession") 2010 2011 a.ctx = newCtx 2012 a.app.Srv().Store.SetContext(newCtx) 2013 defer func() { 2014 a.app.Srv().Store.SetContext(origCtx) 2015 a.ctx = origCtx 2016 }() 2017 2018 defer span.Finish() 2019 resultVar0, resultVar1 := a.app.CreateSession(session) 2020 2021 if resultVar1 != nil { 2022 span.LogFields(spanlog.Error(resultVar1)) 2023 ext.Error.Set(span, true) 2024 } 2025 2026 return resultVar0, resultVar1 2027 } 2028 2029 func (a *OpenTracingAppLayer) CreateSidebarCategory(userId string, teamId string, newCategory *model.SidebarCategoryWithChannels) (*model.SidebarCategoryWithChannels, *model.AppError) { 2030 origCtx := a.ctx 2031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSidebarCategory") 2032 2033 a.ctx = newCtx 2034 a.app.Srv().Store.SetContext(newCtx) 2035 defer func() { 2036 a.app.Srv().Store.SetContext(origCtx) 2037 a.ctx = origCtx 2038 }() 2039 2040 defer span.Finish() 2041 resultVar0, resultVar1 := a.app.CreateSidebarCategory(userId, teamId, newCategory) 2042 2043 if resultVar1 != nil { 2044 span.LogFields(spanlog.Error(resultVar1)) 2045 ext.Error.Set(span, true) 2046 } 2047 2048 return resultVar0, resultVar1 2049 } 2050 2051 func (a *OpenTracingAppLayer) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { 2052 origCtx := a.ctx 2053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeam") 2054 2055 a.ctx = newCtx 2056 a.app.Srv().Store.SetContext(newCtx) 2057 defer func() { 2058 a.app.Srv().Store.SetContext(origCtx) 2059 a.ctx = origCtx 2060 }() 2061 2062 defer span.Finish() 2063 resultVar0, resultVar1 := a.app.CreateTeam(team) 2064 2065 if resultVar1 != nil { 2066 span.LogFields(spanlog.Error(resultVar1)) 2067 ext.Error.Set(span, true) 2068 } 2069 2070 return resultVar0, resultVar1 2071 } 2072 2073 func (a *OpenTracingAppLayer) CreateTeamWithUser(team *model.Team, userId string) (*model.Team, *model.AppError) { 2074 origCtx := a.ctx 2075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTeamWithUser") 2076 2077 a.ctx = newCtx 2078 a.app.Srv().Store.SetContext(newCtx) 2079 defer func() { 2080 a.app.Srv().Store.SetContext(origCtx) 2081 a.ctx = origCtx 2082 }() 2083 2084 defer span.Finish() 2085 resultVar0, resultVar1 := a.app.CreateTeamWithUser(team, userId) 2086 2087 if resultVar1 != nil { 2088 span.LogFields(spanlog.Error(resultVar1)) 2089 ext.Error.Set(span, true) 2090 } 2091 2092 return resultVar0, resultVar1 2093 } 2094 2095 func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userId string) (*model.TermsOfService, *model.AppError) { 2096 origCtx := a.ctx 2097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTermsOfService") 2098 2099 a.ctx = newCtx 2100 a.app.Srv().Store.SetContext(newCtx) 2101 defer func() { 2102 a.app.Srv().Store.SetContext(origCtx) 2103 a.ctx = origCtx 2104 }() 2105 2106 defer span.Finish() 2107 resultVar0, resultVar1 := a.app.CreateTermsOfService(text, userId) 2108 2109 if resultVar1 != nil { 2110 span.LogFields(spanlog.Error(resultVar1)) 2111 ext.Error.Set(span, true) 2112 } 2113 2114 return resultVar0, resultVar1 2115 } 2116 2117 func (a *OpenTracingAppLayer) CreateUser(user *model.User) (*model.User, *model.AppError) { 2118 origCtx := a.ctx 2119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUser") 2120 2121 a.ctx = newCtx 2122 a.app.Srv().Store.SetContext(newCtx) 2123 defer func() { 2124 a.app.Srv().Store.SetContext(origCtx) 2125 a.ctx = origCtx 2126 }() 2127 2128 defer span.Finish() 2129 resultVar0, resultVar1 := a.app.CreateUser(user) 2130 2131 if resultVar1 != nil { 2132 span.LogFields(spanlog.Error(resultVar1)) 2133 ext.Error.Set(span, true) 2134 } 2135 2136 return resultVar0, resultVar1 2137 } 2138 2139 func (a *OpenTracingAppLayer) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) { 2140 origCtx := a.ctx 2141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAccessToken") 2142 2143 a.ctx = newCtx 2144 a.app.Srv().Store.SetContext(newCtx) 2145 defer func() { 2146 a.app.Srv().Store.SetContext(origCtx) 2147 a.ctx = origCtx 2148 }() 2149 2150 defer span.Finish() 2151 resultVar0, resultVar1 := a.app.CreateUserAccessToken(token) 2152 2153 if resultVar1 != nil { 2154 span.LogFields(spanlog.Error(resultVar1)) 2155 ext.Error.Set(span, true) 2156 } 2157 2158 return resultVar0, resultVar1 2159 } 2160 2161 func (a *OpenTracingAppLayer) CreateUserAsAdmin(user *model.User, redirect string) (*model.User, *model.AppError) { 2162 origCtx := a.ctx 2163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAsAdmin") 2164 2165 a.ctx = newCtx 2166 a.app.Srv().Store.SetContext(newCtx) 2167 defer func() { 2168 a.app.Srv().Store.SetContext(origCtx) 2169 a.ctx = origCtx 2170 }() 2171 2172 defer span.Finish() 2173 resultVar0, resultVar1 := a.app.CreateUserAsAdmin(user, redirect) 2174 2175 if resultVar1 != nil { 2176 span.LogFields(spanlog.Error(resultVar1)) 2177 ext.Error.Set(span, true) 2178 } 2179 2180 return resultVar0, resultVar1 2181 } 2182 2183 func (a *OpenTracingAppLayer) CreateUserFromSignup(user *model.User, redirect string) (*model.User, *model.AppError) { 2184 origCtx := a.ctx 2185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserFromSignup") 2186 2187 a.ctx = newCtx 2188 a.app.Srv().Store.SetContext(newCtx) 2189 defer func() { 2190 a.app.Srv().Store.SetContext(origCtx) 2191 a.ctx = origCtx 2192 }() 2193 2194 defer span.Finish() 2195 resultVar0, resultVar1 := a.app.CreateUserFromSignup(user, redirect) 2196 2197 if resultVar1 != nil { 2198 span.LogFields(spanlog.Error(resultVar1)) 2199 ext.Error.Set(span, true) 2200 } 2201 2202 return resultVar0, resultVar1 2203 } 2204 2205 func (a *OpenTracingAppLayer) CreateUserWithInviteId(user *model.User, inviteId string, redirect string) (*model.User, *model.AppError) { 2206 origCtx := a.ctx 2207 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithInviteId") 2208 2209 a.ctx = newCtx 2210 a.app.Srv().Store.SetContext(newCtx) 2211 defer func() { 2212 a.app.Srv().Store.SetContext(origCtx) 2213 a.ctx = origCtx 2214 }() 2215 2216 defer span.Finish() 2217 resultVar0, resultVar1 := a.app.CreateUserWithInviteId(user, inviteId, redirect) 2218 2219 if resultVar1 != nil { 2220 span.LogFields(spanlog.Error(resultVar1)) 2221 ext.Error.Set(span, true) 2222 } 2223 2224 return resultVar0, resultVar1 2225 } 2226 2227 func (a *OpenTracingAppLayer) CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError) { 2228 origCtx := a.ctx 2229 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithToken") 2230 2231 a.ctx = newCtx 2232 a.app.Srv().Store.SetContext(newCtx) 2233 defer func() { 2234 a.app.Srv().Store.SetContext(origCtx) 2235 a.ctx = origCtx 2236 }() 2237 2238 defer span.Finish() 2239 resultVar0, resultVar1 := a.app.CreateUserWithToken(user, token) 2240 2241 if resultVar1 != nil { 2242 span.LogFields(spanlog.Error(resultVar1)) 2243 ext.Error.Set(span, true) 2244 } 2245 2246 return resultVar0, resultVar1 2247 } 2248 2249 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) { 2250 origCtx := a.ctx 2251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateWebhookPost") 2252 2253 a.ctx = newCtx 2254 a.app.Srv().Store.SetContext(newCtx) 2255 defer func() { 2256 a.app.Srv().Store.SetContext(origCtx) 2257 a.ctx = origCtx 2258 }() 2259 2260 defer span.Finish() 2261 resultVar0, resultVar1 := a.app.CreateWebhookPost(userId, channel, text, overrideUsername, overrideIconUrl, overrideIconEmoji, props, postType, postRootId) 2262 2263 if resultVar1 != nil { 2264 span.LogFields(spanlog.Error(resultVar1)) 2265 ext.Error.Set(span, true) 2266 } 2267 2268 return resultVar0, resultVar1 2269 } 2270 2271 func (a *OpenTracingAppLayer) DeactivateGuests() *model.AppError { 2272 origCtx := a.ctx 2273 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateGuests") 2274 2275 a.ctx = newCtx 2276 a.app.Srv().Store.SetContext(newCtx) 2277 defer func() { 2278 a.app.Srv().Store.SetContext(origCtx) 2279 a.ctx = origCtx 2280 }() 2281 2282 defer span.Finish() 2283 resultVar0 := a.app.DeactivateGuests() 2284 2285 if resultVar0 != nil { 2286 span.LogFields(spanlog.Error(resultVar0)) 2287 ext.Error.Set(span, true) 2288 } 2289 2290 return resultVar0 2291 } 2292 2293 func (a *OpenTracingAppLayer) DeactivateMfa(userId string) *model.AppError { 2294 origCtx := a.ctx 2295 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateMfa") 2296 2297 a.ctx = newCtx 2298 a.app.Srv().Store.SetContext(newCtx) 2299 defer func() { 2300 a.app.Srv().Store.SetContext(origCtx) 2301 a.ctx = origCtx 2302 }() 2303 2304 defer span.Finish() 2305 resultVar0 := a.app.DeactivateMfa(userId) 2306 2307 if resultVar0 != nil { 2308 span.LogFields(spanlog.Error(resultVar0)) 2309 ext.Error.Set(span, true) 2310 } 2311 2312 return resultVar0 2313 } 2314 2315 func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userId string, appId string) *model.AppError { 2316 origCtx := a.ctx 2317 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser") 2318 2319 a.ctx = newCtx 2320 a.app.Srv().Store.SetContext(newCtx) 2321 defer func() { 2322 a.app.Srv().Store.SetContext(origCtx) 2323 a.ctx = origCtx 2324 }() 2325 2326 defer span.Finish() 2327 resultVar0 := a.app.DeauthorizeOAuthAppForUser(userId, appId) 2328 2329 if resultVar0 != nil { 2330 span.LogFields(spanlog.Error(resultVar0)) 2331 ext.Error.Set(span, true) 2332 } 2333 2334 return resultVar0 2335 } 2336 2337 func (a *OpenTracingAppLayer) DefaultChannelNames() []string { 2338 origCtx := a.ctx 2339 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DefaultChannelNames") 2340 2341 a.ctx = newCtx 2342 a.app.Srv().Store.SetContext(newCtx) 2343 defer func() { 2344 a.app.Srv().Store.SetContext(origCtx) 2345 a.ctx = origCtx 2346 }() 2347 2348 defer span.Finish() 2349 resultVar0 := a.app.DefaultChannelNames() 2350 2351 return resultVar0 2352 } 2353 2354 func (a *OpenTracingAppLayer) DeleteAllExpiredPluginKeys() *model.AppError { 2355 origCtx := a.ctx 2356 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllExpiredPluginKeys") 2357 2358 a.ctx = newCtx 2359 a.app.Srv().Store.SetContext(newCtx) 2360 defer func() { 2361 a.app.Srv().Store.SetContext(origCtx) 2362 a.ctx = origCtx 2363 }() 2364 2365 defer span.Finish() 2366 resultVar0 := a.app.DeleteAllExpiredPluginKeys() 2367 2368 if resultVar0 != nil { 2369 span.LogFields(spanlog.Error(resultVar0)) 2370 ext.Error.Set(span, true) 2371 } 2372 2373 return resultVar0 2374 } 2375 2376 func (a *OpenTracingAppLayer) DeleteAllKeysForPlugin(pluginId string) *model.AppError { 2377 origCtx := a.ctx 2378 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteAllKeysForPlugin") 2379 2380 a.ctx = newCtx 2381 a.app.Srv().Store.SetContext(newCtx) 2382 defer func() { 2383 a.app.Srv().Store.SetContext(origCtx) 2384 a.ctx = origCtx 2385 }() 2386 2387 defer span.Finish() 2388 resultVar0 := a.app.DeleteAllKeysForPlugin(pluginId) 2389 2390 if resultVar0 != nil { 2391 span.LogFields(spanlog.Error(resultVar0)) 2392 ext.Error.Set(span, true) 2393 } 2394 2395 return resultVar0 2396 } 2397 2398 func (a *OpenTracingAppLayer) DeleteBotIconImage(botUserId string) *model.AppError { 2399 origCtx := a.ctx 2400 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBotIconImage") 2401 2402 a.ctx = newCtx 2403 a.app.Srv().Store.SetContext(newCtx) 2404 defer func() { 2405 a.app.Srv().Store.SetContext(origCtx) 2406 a.ctx = origCtx 2407 }() 2408 2409 defer span.Finish() 2410 resultVar0 := a.app.DeleteBotIconImage(botUserId) 2411 2412 if resultVar0 != nil { 2413 span.LogFields(spanlog.Error(resultVar0)) 2414 ext.Error.Set(span, true) 2415 } 2416 2417 return resultVar0 2418 } 2419 2420 func (a *OpenTracingAppLayer) DeleteBrandImage() *model.AppError { 2421 origCtx := a.ctx 2422 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBrandImage") 2423 2424 a.ctx = newCtx 2425 a.app.Srv().Store.SetContext(newCtx) 2426 defer func() { 2427 a.app.Srv().Store.SetContext(origCtx) 2428 a.ctx = origCtx 2429 }() 2430 2431 defer span.Finish() 2432 resultVar0 := a.app.DeleteBrandImage() 2433 2434 if resultVar0 != nil { 2435 span.LogFields(spanlog.Error(resultVar0)) 2436 ext.Error.Set(span, true) 2437 } 2438 2439 return resultVar0 2440 } 2441 2442 func (a *OpenTracingAppLayer) DeleteChannel(channel *model.Channel, userId string) *model.AppError { 2443 origCtx := a.ctx 2444 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannel") 2445 2446 a.ctx = newCtx 2447 a.app.Srv().Store.SetContext(newCtx) 2448 defer func() { 2449 a.app.Srv().Store.SetContext(origCtx) 2450 a.ctx = origCtx 2451 }() 2452 2453 defer span.Finish() 2454 resultVar0 := a.app.DeleteChannel(channel, userId) 2455 2456 if resultVar0 != nil { 2457 span.LogFields(spanlog.Error(resultVar0)) 2458 ext.Error.Set(span, true) 2459 } 2460 2461 return resultVar0 2462 } 2463 2464 func (a *OpenTracingAppLayer) DeleteChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 2465 origCtx := a.ctx 2466 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteChannelScheme") 2467 2468 a.ctx = newCtx 2469 a.app.Srv().Store.SetContext(newCtx) 2470 defer func() { 2471 a.app.Srv().Store.SetContext(origCtx) 2472 a.ctx = origCtx 2473 }() 2474 2475 defer span.Finish() 2476 resultVar0, resultVar1 := a.app.DeleteChannelScheme(channel) 2477 2478 if resultVar1 != nil { 2479 span.LogFields(spanlog.Error(resultVar1)) 2480 ext.Error.Set(span, true) 2481 } 2482 2483 return resultVar0, resultVar1 2484 } 2485 2486 func (a *OpenTracingAppLayer) DeleteCommand(commandId string) *model.AppError { 2487 origCtx := a.ctx 2488 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteCommand") 2489 2490 a.ctx = newCtx 2491 a.app.Srv().Store.SetContext(newCtx) 2492 defer func() { 2493 a.app.Srv().Store.SetContext(origCtx) 2494 a.ctx = origCtx 2495 }() 2496 2497 defer span.Finish() 2498 resultVar0 := a.app.DeleteCommand(commandId) 2499 2500 if resultVar0 != nil { 2501 span.LogFields(spanlog.Error(resultVar0)) 2502 ext.Error.Set(span, true) 2503 } 2504 2505 return resultVar0 2506 } 2507 2508 func (a *OpenTracingAppLayer) DeleteEmoji(emoji *model.Emoji) *model.AppError { 2509 origCtx := a.ctx 2510 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEmoji") 2511 2512 a.ctx = newCtx 2513 a.app.Srv().Store.SetContext(newCtx) 2514 defer func() { 2515 a.app.Srv().Store.SetContext(origCtx) 2516 a.ctx = origCtx 2517 }() 2518 2519 defer span.Finish() 2520 resultVar0 := a.app.DeleteEmoji(emoji) 2521 2522 if resultVar0 != nil { 2523 span.LogFields(spanlog.Error(resultVar0)) 2524 ext.Error.Set(span, true) 2525 } 2526 2527 return resultVar0 2528 } 2529 2530 func (a *OpenTracingAppLayer) DeleteEphemeralPost(userId string, postId string) { 2531 origCtx := a.ctx 2532 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEphemeralPost") 2533 2534 a.ctx = newCtx 2535 a.app.Srv().Store.SetContext(newCtx) 2536 defer func() { 2537 a.app.Srv().Store.SetContext(origCtx) 2538 a.ctx = origCtx 2539 }() 2540 2541 defer span.Finish() 2542 a.app.DeleteEphemeralPost(userId, postId) 2543 } 2544 2545 func (a *OpenTracingAppLayer) DeleteFlaggedPosts(postId string) { 2546 origCtx := a.ctx 2547 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteFlaggedPosts") 2548 2549 a.ctx = newCtx 2550 a.app.Srv().Store.SetContext(newCtx) 2551 defer func() { 2552 a.app.Srv().Store.SetContext(origCtx) 2553 a.ctx = origCtx 2554 }() 2555 2556 defer span.Finish() 2557 a.app.DeleteFlaggedPosts(postId) 2558 } 2559 2560 func (a *OpenTracingAppLayer) DeleteGroup(groupID string) (*model.Group, *model.AppError) { 2561 origCtx := a.ctx 2562 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroup") 2563 2564 a.ctx = newCtx 2565 a.app.Srv().Store.SetContext(newCtx) 2566 defer func() { 2567 a.app.Srv().Store.SetContext(origCtx) 2568 a.ctx = origCtx 2569 }() 2570 2571 defer span.Finish() 2572 resultVar0, resultVar1 := a.app.DeleteGroup(groupID) 2573 2574 if resultVar1 != nil { 2575 span.LogFields(spanlog.Error(resultVar1)) 2576 ext.Error.Set(span, true) 2577 } 2578 2579 return resultVar0, resultVar1 2580 } 2581 2582 func (a *OpenTracingAppLayer) DeleteGroupConstrainedMemberships() error { 2583 origCtx := a.ctx 2584 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupConstrainedMemberships") 2585 2586 a.ctx = newCtx 2587 a.app.Srv().Store.SetContext(newCtx) 2588 defer func() { 2589 a.app.Srv().Store.SetContext(origCtx) 2590 a.ctx = origCtx 2591 }() 2592 2593 defer span.Finish() 2594 resultVar0 := a.app.DeleteGroupConstrainedMemberships() 2595 2596 if resultVar0 != nil { 2597 span.LogFields(spanlog.Error(resultVar0)) 2598 ext.Error.Set(span, true) 2599 } 2600 2601 return resultVar0 2602 } 2603 2604 func (a *OpenTracingAppLayer) DeleteGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 2605 origCtx := a.ctx 2606 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupMember") 2607 2608 a.ctx = newCtx 2609 a.app.Srv().Store.SetContext(newCtx) 2610 defer func() { 2611 a.app.Srv().Store.SetContext(origCtx) 2612 a.ctx = origCtx 2613 }() 2614 2615 defer span.Finish() 2616 resultVar0, resultVar1 := a.app.DeleteGroupMember(groupID, userID) 2617 2618 if resultVar1 != nil { 2619 span.LogFields(spanlog.Error(resultVar1)) 2620 ext.Error.Set(span, true) 2621 } 2622 2623 return resultVar0, resultVar1 2624 } 2625 2626 func (a *OpenTracingAppLayer) DeleteGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 2627 origCtx := a.ctx 2628 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteGroupSyncable") 2629 2630 a.ctx = newCtx 2631 a.app.Srv().Store.SetContext(newCtx) 2632 defer func() { 2633 a.app.Srv().Store.SetContext(origCtx) 2634 a.ctx = origCtx 2635 }() 2636 2637 defer span.Finish() 2638 resultVar0, resultVar1 := a.app.DeleteGroupSyncable(groupID, syncableID, syncableType) 2639 2640 if resultVar1 != nil { 2641 span.LogFields(spanlog.Error(resultVar1)) 2642 ext.Error.Set(span, true) 2643 } 2644 2645 return resultVar0, resultVar1 2646 } 2647 2648 func (a *OpenTracingAppLayer) DeleteIncomingWebhook(hookId string) *model.AppError { 2649 origCtx := a.ctx 2650 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteIncomingWebhook") 2651 2652 a.ctx = newCtx 2653 a.app.Srv().Store.SetContext(newCtx) 2654 defer func() { 2655 a.app.Srv().Store.SetContext(origCtx) 2656 a.ctx = origCtx 2657 }() 2658 2659 defer span.Finish() 2660 resultVar0 := a.app.DeleteIncomingWebhook(hookId) 2661 2662 if resultVar0 != nil { 2663 span.LogFields(spanlog.Error(resultVar0)) 2664 ext.Error.Set(span, true) 2665 } 2666 2667 return resultVar0 2668 } 2669 2670 func (a *OpenTracingAppLayer) DeleteOAuthApp(appId string) *model.AppError { 2671 origCtx := a.ctx 2672 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOAuthApp") 2673 2674 a.ctx = newCtx 2675 a.app.Srv().Store.SetContext(newCtx) 2676 defer func() { 2677 a.app.Srv().Store.SetContext(origCtx) 2678 a.ctx = origCtx 2679 }() 2680 2681 defer span.Finish() 2682 resultVar0 := a.app.DeleteOAuthApp(appId) 2683 2684 if resultVar0 != nil { 2685 span.LogFields(spanlog.Error(resultVar0)) 2686 ext.Error.Set(span, true) 2687 } 2688 2689 return resultVar0 2690 } 2691 2692 func (a *OpenTracingAppLayer) DeleteOutgoingWebhook(hookId string) *model.AppError { 2693 origCtx := a.ctx 2694 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOutgoingWebhook") 2695 2696 a.ctx = newCtx 2697 a.app.Srv().Store.SetContext(newCtx) 2698 defer func() { 2699 a.app.Srv().Store.SetContext(origCtx) 2700 a.ctx = origCtx 2701 }() 2702 2703 defer span.Finish() 2704 resultVar0 := a.app.DeleteOutgoingWebhook(hookId) 2705 2706 if resultVar0 != nil { 2707 span.LogFields(spanlog.Error(resultVar0)) 2708 ext.Error.Set(span, true) 2709 } 2710 2711 return resultVar0 2712 } 2713 2714 func (a *OpenTracingAppLayer) DeletePluginKey(pluginId string, key string) *model.AppError { 2715 origCtx := a.ctx 2716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePluginKey") 2717 2718 a.ctx = newCtx 2719 a.app.Srv().Store.SetContext(newCtx) 2720 defer func() { 2721 a.app.Srv().Store.SetContext(origCtx) 2722 a.ctx = origCtx 2723 }() 2724 2725 defer span.Finish() 2726 resultVar0 := a.app.DeletePluginKey(pluginId, key) 2727 2728 if resultVar0 != nil { 2729 span.LogFields(spanlog.Error(resultVar0)) 2730 ext.Error.Set(span, true) 2731 } 2732 2733 return resultVar0 2734 } 2735 2736 func (a *OpenTracingAppLayer) DeletePost(postId string, deleteByID string) (*model.Post, *model.AppError) { 2737 origCtx := a.ctx 2738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePost") 2739 2740 a.ctx = newCtx 2741 a.app.Srv().Store.SetContext(newCtx) 2742 defer func() { 2743 a.app.Srv().Store.SetContext(origCtx) 2744 a.ctx = origCtx 2745 }() 2746 2747 defer span.Finish() 2748 resultVar0, resultVar1 := a.app.DeletePost(postId, deleteByID) 2749 2750 if resultVar1 != nil { 2751 span.LogFields(spanlog.Error(resultVar1)) 2752 ext.Error.Set(span, true) 2753 } 2754 2755 return resultVar0, resultVar1 2756 } 2757 2758 func (a *OpenTracingAppLayer) DeletePostFiles(post *model.Post) { 2759 origCtx := a.ctx 2760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePostFiles") 2761 2762 a.ctx = newCtx 2763 a.app.Srv().Store.SetContext(newCtx) 2764 defer func() { 2765 a.app.Srv().Store.SetContext(origCtx) 2766 a.ctx = origCtx 2767 }() 2768 2769 defer span.Finish() 2770 a.app.DeletePostFiles(post) 2771 } 2772 2773 func (a *OpenTracingAppLayer) DeletePreferences(userId string, preferences model.Preferences) *model.AppError { 2774 origCtx := a.ctx 2775 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePreferences") 2776 2777 a.ctx = newCtx 2778 a.app.Srv().Store.SetContext(newCtx) 2779 defer func() { 2780 a.app.Srv().Store.SetContext(origCtx) 2781 a.ctx = origCtx 2782 }() 2783 2784 defer span.Finish() 2785 resultVar0 := a.app.DeletePreferences(userId, preferences) 2786 2787 if resultVar0 != nil { 2788 span.LogFields(spanlog.Error(resultVar0)) 2789 ext.Error.Set(span, true) 2790 } 2791 2792 return resultVar0 2793 } 2794 2795 func (a *OpenTracingAppLayer) DeletePublicKey(name string) *model.AppError { 2796 origCtx := a.ctx 2797 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePublicKey") 2798 2799 a.ctx = newCtx 2800 a.app.Srv().Store.SetContext(newCtx) 2801 defer func() { 2802 a.app.Srv().Store.SetContext(origCtx) 2803 a.ctx = origCtx 2804 }() 2805 2806 defer span.Finish() 2807 resultVar0 := a.app.DeletePublicKey(name) 2808 2809 if resultVar0 != nil { 2810 span.LogFields(spanlog.Error(resultVar0)) 2811 ext.Error.Set(span, true) 2812 } 2813 2814 return resultVar0 2815 } 2816 2817 func (a *OpenTracingAppLayer) DeleteReactionForPost(reaction *model.Reaction) *model.AppError { 2818 origCtx := a.ctx 2819 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteReactionForPost") 2820 2821 a.ctx = newCtx 2822 a.app.Srv().Store.SetContext(newCtx) 2823 defer func() { 2824 a.app.Srv().Store.SetContext(origCtx) 2825 a.ctx = origCtx 2826 }() 2827 2828 defer span.Finish() 2829 resultVar0 := a.app.DeleteReactionForPost(reaction) 2830 2831 if resultVar0 != nil { 2832 span.LogFields(spanlog.Error(resultVar0)) 2833 ext.Error.Set(span, true) 2834 } 2835 2836 return resultVar0 2837 } 2838 2839 func (a *OpenTracingAppLayer) DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) { 2840 origCtx := a.ctx 2841 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteScheme") 2842 2843 a.ctx = newCtx 2844 a.app.Srv().Store.SetContext(newCtx) 2845 defer func() { 2846 a.app.Srv().Store.SetContext(origCtx) 2847 a.ctx = origCtx 2848 }() 2849 2850 defer span.Finish() 2851 resultVar0, resultVar1 := a.app.DeleteScheme(schemeId) 2852 2853 if resultVar1 != nil { 2854 span.LogFields(spanlog.Error(resultVar1)) 2855 ext.Error.Set(span, true) 2856 } 2857 2858 return resultVar0, resultVar1 2859 } 2860 2861 func (a *OpenTracingAppLayer) DeleteSidebarCategory(userId string, teamId string, categoryId string) *model.AppError { 2862 origCtx := a.ctx 2863 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteSidebarCategory") 2864 2865 a.ctx = newCtx 2866 a.app.Srv().Store.SetContext(newCtx) 2867 defer func() { 2868 a.app.Srv().Store.SetContext(origCtx) 2869 a.ctx = origCtx 2870 }() 2871 2872 defer span.Finish() 2873 resultVar0 := a.app.DeleteSidebarCategory(userId, teamId, categoryId) 2874 2875 if resultVar0 != nil { 2876 span.LogFields(spanlog.Error(resultVar0)) 2877 ext.Error.Set(span, true) 2878 } 2879 2880 return resultVar0 2881 } 2882 2883 func (a *OpenTracingAppLayer) DeleteToken(token *model.Token) *model.AppError { 2884 origCtx := a.ctx 2885 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteToken") 2886 2887 a.ctx = newCtx 2888 a.app.Srv().Store.SetContext(newCtx) 2889 defer func() { 2890 a.app.Srv().Store.SetContext(origCtx) 2891 a.ctx = origCtx 2892 }() 2893 2894 defer span.Finish() 2895 resultVar0 := a.app.DeleteToken(token) 2896 2897 if resultVar0 != nil { 2898 span.LogFields(spanlog.Error(resultVar0)) 2899 ext.Error.Set(span, true) 2900 } 2901 2902 return resultVar0 2903 } 2904 2905 func (a *OpenTracingAppLayer) DemoteUserToGuest(user *model.User) *model.AppError { 2906 origCtx := a.ctx 2907 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DemoteUserToGuest") 2908 2909 a.ctx = newCtx 2910 a.app.Srv().Store.SetContext(newCtx) 2911 defer func() { 2912 a.app.Srv().Store.SetContext(origCtx) 2913 a.ctx = origCtx 2914 }() 2915 2916 defer span.Finish() 2917 resultVar0 := a.app.DemoteUserToGuest(user) 2918 2919 if resultVar0 != nil { 2920 span.LogFields(spanlog.Error(resultVar0)) 2921 ext.Error.Set(span, true) 2922 } 2923 2924 return resultVar0 2925 } 2926 2927 func (a *OpenTracingAppLayer) DiagnosticId() string { 2928 origCtx := a.ctx 2929 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DiagnosticId") 2930 2931 a.ctx = newCtx 2932 a.app.Srv().Store.SetContext(newCtx) 2933 defer func() { 2934 a.app.Srv().Store.SetContext(origCtx) 2935 a.ctx = origCtx 2936 }() 2937 2938 defer span.Finish() 2939 resultVar0 := a.app.DiagnosticId() 2940 2941 return resultVar0 2942 } 2943 2944 func (a *OpenTracingAppLayer) DisableAutoResponder(userId string, asAdmin bool) *model.AppError { 2945 origCtx := a.ctx 2946 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableAutoResponder") 2947 2948 a.ctx = newCtx 2949 a.app.Srv().Store.SetContext(newCtx) 2950 defer func() { 2951 a.app.Srv().Store.SetContext(origCtx) 2952 a.ctx = origCtx 2953 }() 2954 2955 defer span.Finish() 2956 resultVar0 := a.app.DisableAutoResponder(userId, asAdmin) 2957 2958 if resultVar0 != nil { 2959 span.LogFields(spanlog.Error(resultVar0)) 2960 ext.Error.Set(span, true) 2961 } 2962 2963 return resultVar0 2964 } 2965 2966 func (a *OpenTracingAppLayer) DisablePlugin(id string) *model.AppError { 2967 origCtx := a.ctx 2968 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisablePlugin") 2969 2970 a.ctx = newCtx 2971 a.app.Srv().Store.SetContext(newCtx) 2972 defer func() { 2973 a.app.Srv().Store.SetContext(origCtx) 2974 a.ctx = origCtx 2975 }() 2976 2977 defer span.Finish() 2978 resultVar0 := a.app.DisablePlugin(id) 2979 2980 if resultVar0 != nil { 2981 span.LogFields(spanlog.Error(resultVar0)) 2982 ext.Error.Set(span, true) 2983 } 2984 2985 return resultVar0 2986 } 2987 2988 func (a *OpenTracingAppLayer) DisableUserAccessToken(token *model.UserAccessToken) *model.AppError { 2989 origCtx := a.ctx 2990 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableUserAccessToken") 2991 2992 a.ctx = newCtx 2993 a.app.Srv().Store.SetContext(newCtx) 2994 defer func() { 2995 a.app.Srv().Store.SetContext(origCtx) 2996 a.ctx = origCtx 2997 }() 2998 2999 defer span.Finish() 3000 resultVar0 := a.app.DisableUserAccessToken(token) 3001 3002 if resultVar0 != nil { 3003 span.LogFields(spanlog.Error(resultVar0)) 3004 ext.Error.Set(span, true) 3005 } 3006 3007 return resultVar0 3008 } 3009 3010 func (a *OpenTracingAppLayer) DoActionRequest(rawURL string, body []byte) (*http.Response, *model.AppError) { 3011 origCtx := a.ctx 3012 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoActionRequest") 3013 3014 a.ctx = newCtx 3015 a.app.Srv().Store.SetContext(newCtx) 3016 defer func() { 3017 a.app.Srv().Store.SetContext(origCtx) 3018 a.ctx = origCtx 3019 }() 3020 3021 defer span.Finish() 3022 resultVar0, resultVar1 := a.app.DoActionRequest(rawURL, body) 3023 3024 if resultVar1 != nil { 3025 span.LogFields(spanlog.Error(resultVar1)) 3026 ext.Error.Set(span, true) 3027 } 3028 3029 return resultVar0, resultVar1 3030 } 3031 3032 func (a *OpenTracingAppLayer) DoAdvancedPermissionsMigration() { 3033 origCtx := a.ctx 3034 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAdvancedPermissionsMigration") 3035 3036 a.ctx = newCtx 3037 a.app.Srv().Store.SetContext(newCtx) 3038 defer func() { 3039 a.app.Srv().Store.SetContext(origCtx) 3040 a.ctx = origCtx 3041 }() 3042 3043 defer span.Finish() 3044 a.app.DoAdvancedPermissionsMigration() 3045 } 3046 3047 func (a *OpenTracingAppLayer) DoAppMigrations() { 3048 origCtx := a.ctx 3049 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAppMigrations") 3050 3051 a.ctx = newCtx 3052 a.app.Srv().Store.SetContext(newCtx) 3053 defer func() { 3054 a.app.Srv().Store.SetContext(origCtx) 3055 a.ctx = origCtx 3056 }() 3057 3058 defer span.Finish() 3059 a.app.DoAppMigrations() 3060 } 3061 3062 func (a *OpenTracingAppLayer) DoEmojisPermissionsMigration() { 3063 origCtx := a.ctx 3064 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoEmojisPermissionsMigration") 3065 3066 a.ctx = newCtx 3067 a.app.Srv().Store.SetContext(newCtx) 3068 defer func() { 3069 a.app.Srv().Store.SetContext(origCtx) 3070 a.ctx = origCtx 3071 }() 3072 3073 defer span.Finish() 3074 a.app.DoEmojisPermissionsMigration() 3075 } 3076 3077 func (a *OpenTracingAppLayer) DoGuestRolesCreationMigration() { 3078 origCtx := a.ctx 3079 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoGuestRolesCreationMigration") 3080 3081 a.ctx = newCtx 3082 a.app.Srv().Store.SetContext(newCtx) 3083 defer func() { 3084 a.app.Srv().Store.SetContext(origCtx) 3085 a.ctx = origCtx 3086 }() 3087 3088 defer span.Finish() 3089 a.app.DoGuestRolesCreationMigration() 3090 } 3091 3092 func (a *OpenTracingAppLayer) DoLocalRequest(rawURL string, body []byte) (*http.Response, *model.AppError) { 3093 origCtx := a.ctx 3094 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLocalRequest") 3095 3096 a.ctx = newCtx 3097 a.app.Srv().Store.SetContext(newCtx) 3098 defer func() { 3099 a.app.Srv().Store.SetContext(origCtx) 3100 a.ctx = origCtx 3101 }() 3102 3103 defer span.Finish() 3104 resultVar0, resultVar1 := a.app.DoLocalRequest(rawURL, body) 3105 3106 if resultVar1 != nil { 3107 span.LogFields(spanlog.Error(resultVar1)) 3108 ext.Error.Set(span, true) 3109 } 3110 3111 return resultVar0, resultVar1 3112 } 3113 3114 func (a *OpenTracingAppLayer) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string, isMobile bool, isOAuth bool, isSaml bool) *model.AppError { 3115 origCtx := a.ctx 3116 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLogin") 3117 3118 a.ctx = newCtx 3119 a.app.Srv().Store.SetContext(newCtx) 3120 defer func() { 3121 a.app.Srv().Store.SetContext(origCtx) 3122 a.ctx = origCtx 3123 }() 3124 3125 defer span.Finish() 3126 resultVar0 := a.app.DoLogin(w, r, user, deviceId, isMobile, isOAuth, isSaml) 3127 3128 if resultVar0 != nil { 3129 span.LogFields(spanlog.Error(resultVar0)) 3130 ext.Error.Set(span, true) 3131 } 3132 3133 return resultVar0 3134 } 3135 3136 func (a *OpenTracingAppLayer) DoPermissionsMigrations() error { 3137 origCtx := a.ctx 3138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPermissionsMigrations") 3139 3140 a.ctx = newCtx 3141 a.app.Srv().Store.SetContext(newCtx) 3142 defer func() { 3143 a.app.Srv().Store.SetContext(origCtx) 3144 a.ctx = origCtx 3145 }() 3146 3147 defer span.Finish() 3148 resultVar0 := a.app.DoPermissionsMigrations() 3149 3150 if resultVar0 != nil { 3151 span.LogFields(spanlog.Error(resultVar0)) 3152 ext.Error.Set(span, true) 3153 } 3154 3155 return resultVar0 3156 } 3157 3158 func (a *OpenTracingAppLayer) DoPostAction(postId string, actionId string, userId string, selectedOption string) (string, *model.AppError) { 3159 origCtx := a.ctx 3160 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostAction") 3161 3162 a.ctx = newCtx 3163 a.app.Srv().Store.SetContext(newCtx) 3164 defer func() { 3165 a.app.Srv().Store.SetContext(origCtx) 3166 a.ctx = origCtx 3167 }() 3168 3169 defer span.Finish() 3170 resultVar0, resultVar1 := a.app.DoPostAction(postId, actionId, userId, selectedOption) 3171 3172 if resultVar1 != nil { 3173 span.LogFields(spanlog.Error(resultVar1)) 3174 ext.Error.Set(span, true) 3175 } 3176 3177 return resultVar0, resultVar1 3178 } 3179 3180 func (a *OpenTracingAppLayer) DoPostActionWithCookie(postId string, actionId string, userId string, selectedOption string, cookie *model.PostActionCookie) (string, *model.AppError) { 3181 origCtx := a.ctx 3182 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPostActionWithCookie") 3183 3184 a.ctx = newCtx 3185 a.app.Srv().Store.SetContext(newCtx) 3186 defer func() { 3187 a.app.Srv().Store.SetContext(origCtx) 3188 a.ctx = origCtx 3189 }() 3190 3191 defer span.Finish() 3192 resultVar0, resultVar1 := a.app.DoPostActionWithCookie(postId, actionId, userId, selectedOption, cookie) 3193 3194 if resultVar1 != nil { 3195 span.LogFields(spanlog.Error(resultVar1)) 3196 ext.Error.Set(span, true) 3197 } 3198 3199 return resultVar0, resultVar1 3200 } 3201 3202 func (a *OpenTracingAppLayer) DoUploadFile(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) { 3203 origCtx := a.ctx 3204 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFile") 3205 3206 a.ctx = newCtx 3207 a.app.Srv().Store.SetContext(newCtx) 3208 defer func() { 3209 a.app.Srv().Store.SetContext(origCtx) 3210 a.ctx = origCtx 3211 }() 3212 3213 defer span.Finish() 3214 resultVar0, resultVar1 := a.app.DoUploadFile(now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3215 3216 if resultVar1 != nil { 3217 span.LogFields(spanlog.Error(resultVar1)) 3218 ext.Error.Set(span, true) 3219 } 3220 3221 return resultVar0, resultVar1 3222 } 3223 3224 func (a *OpenTracingAppLayer) DoUploadFileExpectModification(now time.Time, rawTeamId string, rawChannelId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) { 3225 origCtx := a.ctx 3226 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFileExpectModification") 3227 3228 a.ctx = newCtx 3229 a.app.Srv().Store.SetContext(newCtx) 3230 defer func() { 3231 a.app.Srv().Store.SetContext(origCtx) 3232 a.ctx = origCtx 3233 }() 3234 3235 defer span.Finish() 3236 resultVar0, resultVar1, resultVar2 := a.app.DoUploadFileExpectModification(now, rawTeamId, rawChannelId, rawUserId, rawFilename, data) 3237 3238 if resultVar2 != nil { 3239 span.LogFields(spanlog.Error(resultVar2)) 3240 ext.Error.Set(span, true) 3241 } 3242 3243 return resultVar0, resultVar1, resultVar2 3244 } 3245 3246 func (a *OpenTracingAppLayer) DoubleCheckPassword(user *model.User, password string) *model.AppError { 3247 origCtx := a.ctx 3248 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoubleCheckPassword") 3249 3250 a.ctx = newCtx 3251 a.app.Srv().Store.SetContext(newCtx) 3252 defer func() { 3253 a.app.Srv().Store.SetContext(origCtx) 3254 a.ctx = origCtx 3255 }() 3256 3257 defer span.Finish() 3258 resultVar0 := a.app.DoubleCheckPassword(user, password) 3259 3260 if resultVar0 != nil { 3261 span.LogFields(spanlog.Error(resultVar0)) 3262 ext.Error.Set(span, true) 3263 } 3264 3265 return resultVar0 3266 } 3267 3268 func (a *OpenTracingAppLayer) DownloadFromURL(downloadURL string) ([]byte, error) { 3269 origCtx := a.ctx 3270 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DownloadFromURL") 3271 3272 a.ctx = newCtx 3273 a.app.Srv().Store.SetContext(newCtx) 3274 defer func() { 3275 a.app.Srv().Store.SetContext(origCtx) 3276 a.ctx = origCtx 3277 }() 3278 3279 defer span.Finish() 3280 resultVar0, resultVar1 := a.app.DownloadFromURL(downloadURL) 3281 3282 if resultVar1 != nil { 3283 span.LogFields(spanlog.Error(resultVar1)) 3284 ext.Error.Set(span, true) 3285 } 3286 3287 return resultVar0, resultVar1 3288 } 3289 3290 func (a *OpenTracingAppLayer) EnablePlugin(id string) *model.AppError { 3291 origCtx := a.ctx 3292 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnablePlugin") 3293 3294 a.ctx = newCtx 3295 a.app.Srv().Store.SetContext(newCtx) 3296 defer func() { 3297 a.app.Srv().Store.SetContext(origCtx) 3298 a.ctx = origCtx 3299 }() 3300 3301 defer span.Finish() 3302 resultVar0 := a.app.EnablePlugin(id) 3303 3304 if resultVar0 != nil { 3305 span.LogFields(spanlog.Error(resultVar0)) 3306 ext.Error.Set(span, true) 3307 } 3308 3309 return resultVar0 3310 } 3311 3312 func (a *OpenTracingAppLayer) EnableUserAccessToken(token *model.UserAccessToken) *model.AppError { 3313 origCtx := a.ctx 3314 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnableUserAccessToken") 3315 3316 a.ctx = newCtx 3317 a.app.Srv().Store.SetContext(newCtx) 3318 defer func() { 3319 a.app.Srv().Store.SetContext(origCtx) 3320 a.ctx = origCtx 3321 }() 3322 3323 defer span.Finish() 3324 resultVar0 := a.app.EnableUserAccessToken(token) 3325 3326 if resultVar0 != nil { 3327 span.LogFields(spanlog.Error(resultVar0)) 3328 ext.Error.Set(span, true) 3329 } 3330 3331 return resultVar0 3332 } 3333 3334 func (a *OpenTracingAppLayer) EnvironmentConfig() map[string]interface{} { 3335 origCtx := a.ctx 3336 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnvironmentConfig") 3337 3338 a.ctx = newCtx 3339 a.app.Srv().Store.SetContext(newCtx) 3340 defer func() { 3341 a.app.Srv().Store.SetContext(origCtx) 3342 a.ctx = origCtx 3343 }() 3344 3345 defer span.Finish() 3346 resultVar0 := a.app.EnvironmentConfig() 3347 3348 return resultVar0 3349 } 3350 3351 func (a *OpenTracingAppLayer) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { 3352 origCtx := a.ctx 3353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExecuteCommand") 3354 3355 a.ctx = newCtx 3356 a.app.Srv().Store.SetContext(newCtx) 3357 defer func() { 3358 a.app.Srv().Store.SetContext(origCtx) 3359 a.ctx = origCtx 3360 }() 3361 3362 span.SetTag("args", args) 3363 3364 defer span.Finish() 3365 resultVar0, resultVar1 := a.app.ExecuteCommand(args) 3366 3367 if resultVar1 != nil { 3368 span.LogFields(spanlog.Error(resultVar1)) 3369 ext.Error.Set(span, true) 3370 } 3371 3372 return resultVar0, resultVar1 3373 } 3374 3375 func (a *OpenTracingAppLayer) ExportPermissions(w io.Writer) error { 3376 origCtx := a.ctx 3377 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExportPermissions") 3378 3379 a.ctx = newCtx 3380 a.app.Srv().Store.SetContext(newCtx) 3381 defer func() { 3382 a.app.Srv().Store.SetContext(origCtx) 3383 a.ctx = origCtx 3384 }() 3385 3386 defer span.Finish() 3387 resultVar0 := a.app.ExportPermissions(w) 3388 3389 if resultVar0 != nil { 3390 span.LogFields(spanlog.Error(resultVar0)) 3391 ext.Error.Set(span, true) 3392 } 3393 3394 return resultVar0 3395 } 3396 3397 func (a *OpenTracingAppLayer) ExtendSessionExpiryIfNeeded(session *model.Session) bool { 3398 origCtx := a.ctx 3399 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExtendSessionExpiryIfNeeded") 3400 3401 a.ctx = newCtx 3402 a.app.Srv().Store.SetContext(newCtx) 3403 defer func() { 3404 a.app.Srv().Store.SetContext(origCtx) 3405 a.ctx = origCtx 3406 }() 3407 3408 defer span.Finish() 3409 resultVar0 := a.app.ExtendSessionExpiryIfNeeded(session) 3410 3411 return resultVar0 3412 } 3413 3414 func (a *OpenTracingAppLayer) FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) { 3415 origCtx := a.ctx 3416 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FetchSamlMetadataFromIdp") 3417 3418 a.ctx = newCtx 3419 a.app.Srv().Store.SetContext(newCtx) 3420 defer func() { 3421 a.app.Srv().Store.SetContext(origCtx) 3422 a.ctx = origCtx 3423 }() 3424 3425 defer span.Finish() 3426 resultVar0, resultVar1 := a.app.FetchSamlMetadataFromIdp(url) 3427 3428 if resultVar1 != nil { 3429 span.LogFields(spanlog.Error(resultVar1)) 3430 ext.Error.Set(span, true) 3431 } 3432 3433 return resultVar0, resultVar1 3434 } 3435 3436 func (a *OpenTracingAppLayer) FileBackend() (filesstore.FileBackend, *model.AppError) { 3437 origCtx := a.ctx 3438 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileBackend") 3439 3440 a.ctx = newCtx 3441 a.app.Srv().Store.SetContext(newCtx) 3442 defer func() { 3443 a.app.Srv().Store.SetContext(origCtx) 3444 a.ctx = origCtx 3445 }() 3446 3447 defer span.Finish() 3448 resultVar0, resultVar1 := a.app.FileBackend() 3449 3450 if resultVar1 != nil { 3451 span.LogFields(spanlog.Error(resultVar1)) 3452 ext.Error.Set(span, true) 3453 } 3454 3455 return resultVar0, resultVar1 3456 } 3457 3458 func (a *OpenTracingAppLayer) FileExists(path string) (bool, *model.AppError) { 3459 origCtx := a.ctx 3460 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileExists") 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.FileExists(path) 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) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) { 3481 origCtx := a.ctx 3482 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileReader") 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 := a.app.FileReader(path) 3493 3494 if resultVar1 != nil { 3495 span.LogFields(spanlog.Error(resultVar1)) 3496 ext.Error.Set(span, true) 3497 } 3498 3499 return resultVar0, resultVar1 3500 } 3501 3502 func (a *OpenTracingAppLayer) FillInChannelProps(channel *model.Channel) *model.AppError { 3503 origCtx := a.ctx 3504 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelProps") 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.FillInChannelProps(channel) 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) FillInChannelsProps(channelList *model.ChannelList) *model.AppError { 3525 origCtx := a.ctx 3526 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInChannelsProps") 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 := a.app.FillInChannelsProps(channelList) 3537 3538 if resultVar0 != nil { 3539 span.LogFields(spanlog.Error(resultVar0)) 3540 ext.Error.Set(span, true) 3541 } 3542 3543 return resultVar0 3544 } 3545 3546 func (a *OpenTracingAppLayer) FillInPostProps(post *model.Post, channel *model.Channel) *model.AppError { 3547 origCtx := a.ctx 3548 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FillInPostProps") 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.FillInPostProps(post, channel) 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) FilterNonGroupChannelMembers(userIds []string, channel *model.Channel) ([]string, error) { 3569 origCtx := a.ctx 3570 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupChannelMembers") 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, resultVar1 := a.app.FilterNonGroupChannelMembers(userIds, channel) 3581 3582 if resultVar1 != nil { 3583 span.LogFields(spanlog.Error(resultVar1)) 3584 ext.Error.Set(span, true) 3585 } 3586 3587 return resultVar0, resultVar1 3588 } 3589 3590 func (a *OpenTracingAppLayer) FilterNonGroupTeamMembers(userIds []string, team *model.Team) ([]string, error) { 3591 origCtx := a.ctx 3592 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterNonGroupTeamMembers") 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, resultVar1 := a.app.FilterNonGroupTeamMembers(userIds, team) 3603 3604 if resultVar1 != nil { 3605 span.LogFields(spanlog.Error(resultVar1)) 3606 ext.Error.Set(span, true) 3607 } 3608 3609 return resultVar0, resultVar1 3610 } 3611 3612 func (a *OpenTracingAppLayer) FilterUsersByVisible(viewer *model.User, otherUsers []*model.User) ([]*model.User, *model.AppError) { 3613 origCtx := a.ctx 3614 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FilterUsersByVisible") 3615 3616 a.ctx = newCtx 3617 a.app.Srv().Store.SetContext(newCtx) 3618 defer func() { 3619 a.app.Srv().Store.SetContext(origCtx) 3620 a.ctx = origCtx 3621 }() 3622 3623 defer span.Finish() 3624 resultVar0, resultVar1 := a.app.FilterUsersByVisible(viewer, otherUsers) 3625 3626 if resultVar1 != nil { 3627 span.LogFields(spanlog.Error(resultVar1)) 3628 ext.Error.Set(span, true) 3629 } 3630 3631 return resultVar0, resultVar1 3632 } 3633 3634 func (a *OpenTracingAppLayer) FindTeamByName(name string) bool { 3635 origCtx := a.ctx 3636 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FindTeamByName") 3637 3638 a.ctx = newCtx 3639 a.app.Srv().Store.SetContext(newCtx) 3640 defer func() { 3641 a.app.Srv().Store.SetContext(origCtx) 3642 a.ctx = origCtx 3643 }() 3644 3645 defer span.Finish() 3646 resultVar0 := a.app.FindTeamByName(name) 3647 3648 return resultVar0 3649 } 3650 3651 func (a *OpenTracingAppLayer) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) { 3652 origCtx := a.ctx 3653 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateMfaSecret") 3654 3655 a.ctx = newCtx 3656 a.app.Srv().Store.SetContext(newCtx) 3657 defer func() { 3658 a.app.Srv().Store.SetContext(origCtx) 3659 a.ctx = origCtx 3660 }() 3661 3662 defer span.Finish() 3663 resultVar0, resultVar1 := a.app.GenerateMfaSecret(userId) 3664 3665 if resultVar1 != nil { 3666 span.LogFields(spanlog.Error(resultVar1)) 3667 ext.Error.Set(span, true) 3668 } 3669 3670 return resultVar0, resultVar1 3671 } 3672 3673 func (a *OpenTracingAppLayer) GeneratePublicLink(siteURL string, info *model.FileInfo) string { 3674 origCtx := a.ctx 3675 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GeneratePublicLink") 3676 3677 a.ctx = newCtx 3678 a.app.Srv().Store.SetContext(newCtx) 3679 defer func() { 3680 a.app.Srv().Store.SetContext(origCtx) 3681 a.ctx = origCtx 3682 }() 3683 3684 defer span.Finish() 3685 resultVar0 := a.app.GeneratePublicLink(siteURL, info) 3686 3687 return resultVar0 3688 } 3689 3690 func (a *OpenTracingAppLayer) GetActivePluginManifests() ([]*model.Manifest, *model.AppError) { 3691 origCtx := a.ctx 3692 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetActivePluginManifests") 3693 3694 a.ctx = newCtx 3695 a.app.Srv().Store.SetContext(newCtx) 3696 defer func() { 3697 a.app.Srv().Store.SetContext(origCtx) 3698 a.ctx = origCtx 3699 }() 3700 3701 defer span.Finish() 3702 resultVar0, resultVar1 := a.app.GetActivePluginManifests() 3703 3704 if resultVar1 != nil { 3705 span.LogFields(spanlog.Error(resultVar1)) 3706 ext.Error.Set(span, true) 3707 } 3708 3709 return resultVar0, resultVar1 3710 } 3711 3712 func (a *OpenTracingAppLayer) GetAllChannels(page int, perPage int, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, *model.AppError) { 3713 origCtx := a.ctx 3714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannels") 3715 3716 a.ctx = newCtx 3717 a.app.Srv().Store.SetContext(newCtx) 3718 defer func() { 3719 a.app.Srv().Store.SetContext(origCtx) 3720 a.ctx = origCtx 3721 }() 3722 3723 defer span.Finish() 3724 resultVar0, resultVar1 := a.app.GetAllChannels(page, perPage, opts) 3725 3726 if resultVar1 != nil { 3727 span.LogFields(spanlog.Error(resultVar1)) 3728 ext.Error.Set(span, true) 3729 } 3730 3731 return resultVar0, resultVar1 3732 } 3733 3734 func (a *OpenTracingAppLayer) GetAllChannelsCount(opts model.ChannelSearchOpts) (int64, *model.AppError) { 3735 origCtx := a.ctx 3736 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllChannelsCount") 3737 3738 a.ctx = newCtx 3739 a.app.Srv().Store.SetContext(newCtx) 3740 defer func() { 3741 a.app.Srv().Store.SetContext(origCtx) 3742 a.ctx = origCtx 3743 }() 3744 3745 defer span.Finish() 3746 resultVar0, resultVar1 := a.app.GetAllChannelsCount(opts) 3747 3748 if resultVar1 != nil { 3749 span.LogFields(spanlog.Error(resultVar1)) 3750 ext.Error.Set(span, true) 3751 } 3752 3753 return resultVar0, resultVar1 3754 } 3755 3756 func (a *OpenTracingAppLayer) GetAllLdapGroupsPage(page int, perPage int, opts model.LdapGroupSearchOpts) ([]*model.Group, int, *model.AppError) { 3757 origCtx := a.ctx 3758 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllLdapGroupsPage") 3759 3760 a.ctx = newCtx 3761 a.app.Srv().Store.SetContext(newCtx) 3762 defer func() { 3763 a.app.Srv().Store.SetContext(origCtx) 3764 a.ctx = origCtx 3765 }() 3766 3767 defer span.Finish() 3768 resultVar0, resultVar1, resultVar2 := a.app.GetAllLdapGroupsPage(page, perPage, opts) 3769 3770 if resultVar2 != nil { 3771 span.LogFields(spanlog.Error(resultVar2)) 3772 ext.Error.Set(span, true) 3773 } 3774 3775 return resultVar0, resultVar1, resultVar2 3776 } 3777 3778 func (a *OpenTracingAppLayer) GetAllPrivateTeams() ([]*model.Team, *model.AppError) { 3779 origCtx := a.ctx 3780 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeams") 3781 3782 a.ctx = newCtx 3783 a.app.Srv().Store.SetContext(newCtx) 3784 defer func() { 3785 a.app.Srv().Store.SetContext(origCtx) 3786 a.ctx = origCtx 3787 }() 3788 3789 defer span.Finish() 3790 resultVar0, resultVar1 := a.app.GetAllPrivateTeams() 3791 3792 if resultVar1 != nil { 3793 span.LogFields(spanlog.Error(resultVar1)) 3794 ext.Error.Set(span, true) 3795 } 3796 3797 return resultVar0, resultVar1 3798 } 3799 3800 func (a *OpenTracingAppLayer) GetAllPrivateTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 3801 origCtx := a.ctx 3802 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeamsPage") 3803 3804 a.ctx = newCtx 3805 a.app.Srv().Store.SetContext(newCtx) 3806 defer func() { 3807 a.app.Srv().Store.SetContext(origCtx) 3808 a.ctx = origCtx 3809 }() 3810 3811 defer span.Finish() 3812 resultVar0, resultVar1 := a.app.GetAllPrivateTeamsPage(offset, limit) 3813 3814 if resultVar1 != nil { 3815 span.LogFields(spanlog.Error(resultVar1)) 3816 ext.Error.Set(span, true) 3817 } 3818 3819 return resultVar0, resultVar1 3820 } 3821 3822 func (a *OpenTracingAppLayer) GetAllPrivateTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 3823 origCtx := a.ctx 3824 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPrivateTeamsPageWithCount") 3825 3826 a.ctx = newCtx 3827 a.app.Srv().Store.SetContext(newCtx) 3828 defer func() { 3829 a.app.Srv().Store.SetContext(origCtx) 3830 a.ctx = origCtx 3831 }() 3832 3833 defer span.Finish() 3834 resultVar0, resultVar1 := a.app.GetAllPrivateTeamsPageWithCount(offset, limit) 3835 3836 if resultVar1 != nil { 3837 span.LogFields(spanlog.Error(resultVar1)) 3838 ext.Error.Set(span, true) 3839 } 3840 3841 return resultVar0, resultVar1 3842 } 3843 3844 func (a *OpenTracingAppLayer) GetAllPublicTeams() ([]*model.Team, *model.AppError) { 3845 origCtx := a.ctx 3846 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeams") 3847 3848 a.ctx = newCtx 3849 a.app.Srv().Store.SetContext(newCtx) 3850 defer func() { 3851 a.app.Srv().Store.SetContext(origCtx) 3852 a.ctx = origCtx 3853 }() 3854 3855 defer span.Finish() 3856 resultVar0, resultVar1 := a.app.GetAllPublicTeams() 3857 3858 if resultVar1 != nil { 3859 span.LogFields(spanlog.Error(resultVar1)) 3860 ext.Error.Set(span, true) 3861 } 3862 3863 return resultVar0, resultVar1 3864 } 3865 3866 func (a *OpenTracingAppLayer) GetAllPublicTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 3867 origCtx := a.ctx 3868 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeamsPage") 3869 3870 a.ctx = newCtx 3871 a.app.Srv().Store.SetContext(newCtx) 3872 defer func() { 3873 a.app.Srv().Store.SetContext(origCtx) 3874 a.ctx = origCtx 3875 }() 3876 3877 defer span.Finish() 3878 resultVar0, resultVar1 := a.app.GetAllPublicTeamsPage(offset, limit) 3879 3880 if resultVar1 != nil { 3881 span.LogFields(spanlog.Error(resultVar1)) 3882 ext.Error.Set(span, true) 3883 } 3884 3885 return resultVar0, resultVar1 3886 } 3887 3888 func (a *OpenTracingAppLayer) GetAllPublicTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 3889 origCtx := a.ctx 3890 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllPublicTeamsPageWithCount") 3891 3892 a.ctx = newCtx 3893 a.app.Srv().Store.SetContext(newCtx) 3894 defer func() { 3895 a.app.Srv().Store.SetContext(origCtx) 3896 a.ctx = origCtx 3897 }() 3898 3899 defer span.Finish() 3900 resultVar0, resultVar1 := a.app.GetAllPublicTeamsPageWithCount(offset, limit) 3901 3902 if resultVar1 != nil { 3903 span.LogFields(spanlog.Error(resultVar1)) 3904 ext.Error.Set(span, true) 3905 } 3906 3907 return resultVar0, resultVar1 3908 } 3909 3910 func (a *OpenTracingAppLayer) GetAllRoles() ([]*model.Role, *model.AppError) { 3911 origCtx := a.ctx 3912 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllRoles") 3913 3914 a.ctx = newCtx 3915 a.app.Srv().Store.SetContext(newCtx) 3916 defer func() { 3917 a.app.Srv().Store.SetContext(origCtx) 3918 a.ctx = origCtx 3919 }() 3920 3921 defer span.Finish() 3922 resultVar0, resultVar1 := a.app.GetAllRoles() 3923 3924 if resultVar1 != nil { 3925 span.LogFields(spanlog.Error(resultVar1)) 3926 ext.Error.Set(span, true) 3927 } 3928 3929 return resultVar0, resultVar1 3930 } 3931 3932 func (a *OpenTracingAppLayer) GetAllStatuses() map[string]*model.Status { 3933 origCtx := a.ctx 3934 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllStatuses") 3935 3936 a.ctx = newCtx 3937 a.app.Srv().Store.SetContext(newCtx) 3938 defer func() { 3939 a.app.Srv().Store.SetContext(origCtx) 3940 a.ctx = origCtx 3941 }() 3942 3943 defer span.Finish() 3944 resultVar0 := a.app.GetAllStatuses() 3945 3946 return resultVar0 3947 } 3948 3949 func (a *OpenTracingAppLayer) GetAllTeams() ([]*model.Team, *model.AppError) { 3950 origCtx := a.ctx 3951 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeams") 3952 3953 a.ctx = newCtx 3954 a.app.Srv().Store.SetContext(newCtx) 3955 defer func() { 3956 a.app.Srv().Store.SetContext(origCtx) 3957 a.ctx = origCtx 3958 }() 3959 3960 defer span.Finish() 3961 resultVar0, resultVar1 := a.app.GetAllTeams() 3962 3963 if resultVar1 != nil { 3964 span.LogFields(spanlog.Error(resultVar1)) 3965 ext.Error.Set(span, true) 3966 } 3967 3968 return resultVar0, resultVar1 3969 } 3970 3971 func (a *OpenTracingAppLayer) GetAllTeamsPage(offset int, limit int) ([]*model.Team, *model.AppError) { 3972 origCtx := a.ctx 3973 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPage") 3974 3975 a.ctx = newCtx 3976 a.app.Srv().Store.SetContext(newCtx) 3977 defer func() { 3978 a.app.Srv().Store.SetContext(origCtx) 3979 a.ctx = origCtx 3980 }() 3981 3982 defer span.Finish() 3983 resultVar0, resultVar1 := a.app.GetAllTeamsPage(offset, limit) 3984 3985 if resultVar1 != nil { 3986 span.LogFields(spanlog.Error(resultVar1)) 3987 ext.Error.Set(span, true) 3988 } 3989 3990 return resultVar0, resultVar1 3991 } 3992 3993 func (a *OpenTracingAppLayer) GetAllTeamsPageWithCount(offset int, limit int) (*model.TeamsWithCount, *model.AppError) { 3994 origCtx := a.ctx 3995 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllTeamsPageWithCount") 3996 3997 a.ctx = newCtx 3998 a.app.Srv().Store.SetContext(newCtx) 3999 defer func() { 4000 a.app.Srv().Store.SetContext(origCtx) 4001 a.ctx = origCtx 4002 }() 4003 4004 defer span.Finish() 4005 resultVar0, resultVar1 := a.app.GetAllTeamsPageWithCount(offset, limit) 4006 4007 if resultVar1 != nil { 4008 span.LogFields(spanlog.Error(resultVar1)) 4009 ext.Error.Set(span, true) 4010 } 4011 4012 return resultVar0, resultVar1 4013 } 4014 4015 func (a *OpenTracingAppLayer) GetAnalytics(name string, teamId string) (model.AnalyticsRows, *model.AppError) { 4016 origCtx := a.ctx 4017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAnalytics") 4018 4019 a.ctx = newCtx 4020 a.app.Srv().Store.SetContext(newCtx) 4021 defer func() { 4022 a.app.Srv().Store.SetContext(origCtx) 4023 a.ctx = origCtx 4024 }() 4025 4026 defer span.Finish() 4027 resultVar0, resultVar1 := a.app.GetAnalytics(name, teamId) 4028 4029 if resultVar1 != nil { 4030 span.LogFields(spanlog.Error(resultVar1)) 4031 ext.Error.Set(span, true) 4032 } 4033 4034 return resultVar0, resultVar1 4035 } 4036 4037 func (a *OpenTracingAppLayer) GetAudits(userId string, limit int) (model.Audits, *model.AppError) { 4038 origCtx := a.ctx 4039 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAudits") 4040 4041 a.ctx = newCtx 4042 a.app.Srv().Store.SetContext(newCtx) 4043 defer func() { 4044 a.app.Srv().Store.SetContext(origCtx) 4045 a.ctx = origCtx 4046 }() 4047 4048 defer span.Finish() 4049 resultVar0, resultVar1 := a.app.GetAudits(userId, limit) 4050 4051 if resultVar1 != nil { 4052 span.LogFields(spanlog.Error(resultVar1)) 4053 ext.Error.Set(span, true) 4054 } 4055 4056 return resultVar0, resultVar1 4057 } 4058 4059 func (a *OpenTracingAppLayer) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) { 4060 origCtx := a.ctx 4061 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuditsPage") 4062 4063 a.ctx = newCtx 4064 a.app.Srv().Store.SetContext(newCtx) 4065 defer func() { 4066 a.app.Srv().Store.SetContext(origCtx) 4067 a.ctx = origCtx 4068 }() 4069 4070 defer span.Finish() 4071 resultVar0, resultVar1 := a.app.GetAuditsPage(userId, page, perPage) 4072 4073 if resultVar1 != nil { 4074 span.LogFields(spanlog.Error(resultVar1)) 4075 ext.Error.Set(span, true) 4076 } 4077 4078 return resultVar0, resultVar1 4079 } 4080 4081 func (a *OpenTracingAppLayer) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) { 4082 origCtx := a.ctx 4083 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizationCode") 4084 4085 a.ctx = newCtx 4086 a.app.Srv().Store.SetContext(newCtx) 4087 defer func() { 4088 a.app.Srv().Store.SetContext(origCtx) 4089 a.ctx = origCtx 4090 }() 4091 4092 defer span.Finish() 4093 resultVar0, resultVar1 := a.app.GetAuthorizationCode(w, r, service, props, loginHint) 4094 4095 if resultVar1 != nil { 4096 span.LogFields(spanlog.Error(resultVar1)) 4097 ext.Error.Set(span, true) 4098 } 4099 4100 return resultVar0, resultVar1 4101 } 4102 4103 func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 4104 origCtx := a.ctx 4105 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizedAppsForUser") 4106 4107 a.ctx = newCtx 4108 a.app.Srv().Store.SetContext(newCtx) 4109 defer func() { 4110 a.app.Srv().Store.SetContext(origCtx) 4111 a.ctx = origCtx 4112 }() 4113 4114 defer span.Finish() 4115 resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userId, page, perPage) 4116 4117 if resultVar1 != nil { 4118 span.LogFields(spanlog.Error(resultVar1)) 4119 ext.Error.Set(span, true) 4120 } 4121 4122 return resultVar0, resultVar1 4123 } 4124 4125 func (a *OpenTracingAppLayer) GetBot(botUserId string, includeDeleted bool) (*model.Bot, *model.AppError) { 4126 origCtx := a.ctx 4127 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBot") 4128 4129 a.ctx = newCtx 4130 a.app.Srv().Store.SetContext(newCtx) 4131 defer func() { 4132 a.app.Srv().Store.SetContext(origCtx) 4133 a.ctx = origCtx 4134 }() 4135 4136 defer span.Finish() 4137 resultVar0, resultVar1 := a.app.GetBot(botUserId, includeDeleted) 4138 4139 if resultVar1 != nil { 4140 span.LogFields(spanlog.Error(resultVar1)) 4141 ext.Error.Set(span, true) 4142 } 4143 4144 return resultVar0, resultVar1 4145 } 4146 4147 func (a *OpenTracingAppLayer) GetBotIconImage(botUserId string) ([]byte, *model.AppError) { 4148 origCtx := a.ctx 4149 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBotIconImage") 4150 4151 a.ctx = newCtx 4152 a.app.Srv().Store.SetContext(newCtx) 4153 defer func() { 4154 a.app.Srv().Store.SetContext(origCtx) 4155 a.ctx = origCtx 4156 }() 4157 4158 defer span.Finish() 4159 resultVar0, resultVar1 := a.app.GetBotIconImage(botUserId) 4160 4161 if resultVar1 != nil { 4162 span.LogFields(spanlog.Error(resultVar1)) 4163 ext.Error.Set(span, true) 4164 } 4165 4166 return resultVar0, resultVar1 4167 } 4168 4169 func (a *OpenTracingAppLayer) GetBots(options *model.BotGetOptions) (model.BotList, *model.AppError) { 4170 origCtx := a.ctx 4171 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBots") 4172 4173 a.ctx = newCtx 4174 a.app.Srv().Store.SetContext(newCtx) 4175 defer func() { 4176 a.app.Srv().Store.SetContext(origCtx) 4177 a.ctx = origCtx 4178 }() 4179 4180 defer span.Finish() 4181 resultVar0, resultVar1 := a.app.GetBots(options) 4182 4183 if resultVar1 != nil { 4184 span.LogFields(spanlog.Error(resultVar1)) 4185 ext.Error.Set(span, true) 4186 } 4187 4188 return resultVar0, resultVar1 4189 } 4190 4191 func (a *OpenTracingAppLayer) GetBrandImage() ([]byte, *model.AppError) { 4192 origCtx := a.ctx 4193 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBrandImage") 4194 4195 a.ctx = newCtx 4196 a.app.Srv().Store.SetContext(newCtx) 4197 defer func() { 4198 a.app.Srv().Store.SetContext(origCtx) 4199 a.ctx = origCtx 4200 }() 4201 4202 defer span.Finish() 4203 resultVar0, resultVar1 := a.app.GetBrandImage() 4204 4205 if resultVar1 != nil { 4206 span.LogFields(spanlog.Error(resultVar1)) 4207 ext.Error.Set(span, true) 4208 } 4209 4210 return resultVar0, resultVar1 4211 } 4212 4213 func (a *OpenTracingAppLayer) GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError) { 4214 origCtx := a.ctx 4215 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBulkReactionsForPosts") 4216 4217 a.ctx = newCtx 4218 a.app.Srv().Store.SetContext(newCtx) 4219 defer func() { 4220 a.app.Srv().Store.SetContext(origCtx) 4221 a.ctx = origCtx 4222 }() 4223 4224 defer span.Finish() 4225 resultVar0, resultVar1 := a.app.GetBulkReactionsForPosts(postIds) 4226 4227 if resultVar1 != nil { 4228 span.LogFields(spanlog.Error(resultVar1)) 4229 ext.Error.Set(span, true) 4230 } 4231 4232 return resultVar0, resultVar1 4233 } 4234 4235 func (a *OpenTracingAppLayer) GetChannel(channelId string) (*model.Channel, *model.AppError) { 4236 origCtx := a.ctx 4237 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannel") 4238 4239 a.ctx = newCtx 4240 a.app.Srv().Store.SetContext(newCtx) 4241 defer func() { 4242 a.app.Srv().Store.SetContext(origCtx) 4243 a.ctx = origCtx 4244 }() 4245 4246 defer span.Finish() 4247 resultVar0, resultVar1 := a.app.GetChannel(channelId) 4248 4249 if resultVar1 != nil { 4250 span.LogFields(spanlog.Error(resultVar1)) 4251 ext.Error.Set(span, true) 4252 } 4253 4254 return resultVar0, resultVar1 4255 } 4256 4257 func (a *OpenTracingAppLayer) GetChannelByName(channelName string, teamId string, includeDeleted bool) (*model.Channel, *model.AppError) { 4258 origCtx := a.ctx 4259 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByName") 4260 4261 a.ctx = newCtx 4262 a.app.Srv().Store.SetContext(newCtx) 4263 defer func() { 4264 a.app.Srv().Store.SetContext(origCtx) 4265 a.ctx = origCtx 4266 }() 4267 4268 defer span.Finish() 4269 resultVar0, resultVar1 := a.app.GetChannelByName(channelName, teamId, includeDeleted) 4270 4271 if resultVar1 != nil { 4272 span.LogFields(spanlog.Error(resultVar1)) 4273 ext.Error.Set(span, true) 4274 } 4275 4276 return resultVar0, resultVar1 4277 } 4278 4279 func (a *OpenTracingAppLayer) GetChannelByNameForTeamName(channelName string, teamName string, includeDeleted bool) (*model.Channel, *model.AppError) { 4280 origCtx := a.ctx 4281 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelByNameForTeamName") 4282 4283 a.ctx = newCtx 4284 a.app.Srv().Store.SetContext(newCtx) 4285 defer func() { 4286 a.app.Srv().Store.SetContext(origCtx) 4287 a.ctx = origCtx 4288 }() 4289 4290 defer span.Finish() 4291 resultVar0, resultVar1 := a.app.GetChannelByNameForTeamName(channelName, teamName, includeDeleted) 4292 4293 if resultVar1 != nil { 4294 span.LogFields(spanlog.Error(resultVar1)) 4295 ext.Error.Set(span, true) 4296 } 4297 4298 return resultVar0, resultVar1 4299 } 4300 4301 func (a *OpenTracingAppLayer) GetChannelCounts(teamId string, userId string) (*model.ChannelCounts, *model.AppError) { 4302 origCtx := a.ctx 4303 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelCounts") 4304 4305 a.ctx = newCtx 4306 a.app.Srv().Store.SetContext(newCtx) 4307 defer func() { 4308 a.app.Srv().Store.SetContext(origCtx) 4309 a.ctx = origCtx 4310 }() 4311 4312 defer span.Finish() 4313 resultVar0, resultVar1 := a.app.GetChannelCounts(teamId, userId) 4314 4315 if resultVar1 != nil { 4316 span.LogFields(spanlog.Error(resultVar1)) 4317 ext.Error.Set(span, true) 4318 } 4319 4320 return resultVar0, resultVar1 4321 } 4322 4323 func (a *OpenTracingAppLayer) GetChannelGroupUsers(channelID string) ([]*model.User, *model.AppError) { 4324 origCtx := a.ctx 4325 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGroupUsers") 4326 4327 a.ctx = newCtx 4328 a.app.Srv().Store.SetContext(newCtx) 4329 defer func() { 4330 a.app.Srv().Store.SetContext(origCtx) 4331 a.ctx = origCtx 4332 }() 4333 4334 defer span.Finish() 4335 resultVar0, resultVar1 := a.app.GetChannelGroupUsers(channelID) 4336 4337 if resultVar1 != nil { 4338 span.LogFields(spanlog.Error(resultVar1)) 4339 ext.Error.Set(span, true) 4340 } 4341 4342 return resultVar0, resultVar1 4343 } 4344 4345 func (a *OpenTracingAppLayer) GetChannelGuestCount(channelId string) (int64, *model.AppError) { 4346 origCtx := a.ctx 4347 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelGuestCount") 4348 4349 a.ctx = newCtx 4350 a.app.Srv().Store.SetContext(newCtx) 4351 defer func() { 4352 a.app.Srv().Store.SetContext(origCtx) 4353 a.ctx = origCtx 4354 }() 4355 4356 defer span.Finish() 4357 resultVar0, resultVar1 := a.app.GetChannelGuestCount(channelId) 4358 4359 if resultVar1 != nil { 4360 span.LogFields(spanlog.Error(resultVar1)) 4361 ext.Error.Set(span, true) 4362 } 4363 4364 return resultVar0, resultVar1 4365 } 4366 4367 func (a *OpenTracingAppLayer) GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) { 4368 origCtx := a.ctx 4369 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMember") 4370 4371 a.ctx = newCtx 4372 a.app.Srv().Store.SetContext(newCtx) 4373 defer func() { 4374 a.app.Srv().Store.SetContext(origCtx) 4375 a.ctx = origCtx 4376 }() 4377 4378 defer span.Finish() 4379 resultVar0, resultVar1 := a.app.GetChannelMember(channelId, userId) 4380 4381 if resultVar1 != nil { 4382 span.LogFields(spanlog.Error(resultVar1)) 4383 ext.Error.Set(span, true) 4384 } 4385 4386 return resultVar0, resultVar1 4387 } 4388 4389 func (a *OpenTracingAppLayer) GetChannelMemberCount(channelId string) (int64, *model.AppError) { 4390 origCtx := a.ctx 4391 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMemberCount") 4392 4393 a.ctx = newCtx 4394 a.app.Srv().Store.SetContext(newCtx) 4395 defer func() { 4396 a.app.Srv().Store.SetContext(origCtx) 4397 a.ctx = origCtx 4398 }() 4399 4400 defer span.Finish() 4401 resultVar0, resultVar1 := a.app.GetChannelMemberCount(channelId) 4402 4403 if resultVar1 != nil { 4404 span.LogFields(spanlog.Error(resultVar1)) 4405 ext.Error.Set(span, true) 4406 } 4407 4408 return resultVar0, resultVar1 4409 } 4410 4411 func (a *OpenTracingAppLayer) GetChannelMembersByIds(channelId string, userIds []string) (*model.ChannelMembers, *model.AppError) { 4412 origCtx := a.ctx 4413 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersByIds") 4414 4415 a.ctx = newCtx 4416 a.app.Srv().Store.SetContext(newCtx) 4417 defer func() { 4418 a.app.Srv().Store.SetContext(origCtx) 4419 a.ctx = origCtx 4420 }() 4421 4422 defer span.Finish() 4423 resultVar0, resultVar1 := a.app.GetChannelMembersByIds(channelId, userIds) 4424 4425 if resultVar1 != nil { 4426 span.LogFields(spanlog.Error(resultVar1)) 4427 ext.Error.Set(span, true) 4428 } 4429 4430 return resultVar0, resultVar1 4431 } 4432 4433 func (a *OpenTracingAppLayer) GetChannelMembersForUser(teamId string, userId string) (*model.ChannelMembers, *model.AppError) { 4434 origCtx := a.ctx 4435 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUser") 4436 4437 a.ctx = newCtx 4438 a.app.Srv().Store.SetContext(newCtx) 4439 defer func() { 4440 a.app.Srv().Store.SetContext(origCtx) 4441 a.ctx = origCtx 4442 }() 4443 4444 defer span.Finish() 4445 resultVar0, resultVar1 := a.app.GetChannelMembersForUser(teamId, userId) 4446 4447 if resultVar1 != nil { 4448 span.LogFields(spanlog.Error(resultVar1)) 4449 ext.Error.Set(span, true) 4450 } 4451 4452 return resultVar0, resultVar1 4453 } 4454 4455 func (a *OpenTracingAppLayer) GetChannelMembersForUserWithPagination(teamId string, userId string, page int, perPage int) ([]*model.ChannelMember, *model.AppError) { 4456 origCtx := a.ctx 4457 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersForUserWithPagination") 4458 4459 a.ctx = newCtx 4460 a.app.Srv().Store.SetContext(newCtx) 4461 defer func() { 4462 a.app.Srv().Store.SetContext(origCtx) 4463 a.ctx = origCtx 4464 }() 4465 4466 defer span.Finish() 4467 resultVar0, resultVar1 := a.app.GetChannelMembersForUserWithPagination(teamId, userId, page, perPage) 4468 4469 if resultVar1 != nil { 4470 span.LogFields(spanlog.Error(resultVar1)) 4471 ext.Error.Set(span, true) 4472 } 4473 4474 return resultVar0, resultVar1 4475 } 4476 4477 func (a *OpenTracingAppLayer) GetChannelMembersPage(channelId string, page int, perPage int) (*model.ChannelMembers, *model.AppError) { 4478 origCtx := a.ctx 4479 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersPage") 4480 4481 a.ctx = newCtx 4482 a.app.Srv().Store.SetContext(newCtx) 4483 defer func() { 4484 a.app.Srv().Store.SetContext(origCtx) 4485 a.ctx = origCtx 4486 }() 4487 4488 defer span.Finish() 4489 resultVar0, resultVar1 := a.app.GetChannelMembersPage(channelId, page, perPage) 4490 4491 if resultVar1 != nil { 4492 span.LogFields(spanlog.Error(resultVar1)) 4493 ext.Error.Set(span, true) 4494 } 4495 4496 return resultVar0, resultVar1 4497 } 4498 4499 func (a *OpenTracingAppLayer) GetChannelMembersTimezones(channelId string) ([]string, *model.AppError) { 4500 origCtx := a.ctx 4501 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelMembersTimezones") 4502 4503 a.ctx = newCtx 4504 a.app.Srv().Store.SetContext(newCtx) 4505 defer func() { 4506 a.app.Srv().Store.SetContext(origCtx) 4507 a.ctx = origCtx 4508 }() 4509 4510 defer span.Finish() 4511 resultVar0, resultVar1 := a.app.GetChannelMembersTimezones(channelId) 4512 4513 if resultVar1 != nil { 4514 span.LogFields(spanlog.Error(resultVar1)) 4515 ext.Error.Set(span, true) 4516 } 4517 4518 return resultVar0, resultVar1 4519 } 4520 4521 func (a *OpenTracingAppLayer) GetChannelModerationsForChannel(channel *model.Channel) ([]*model.ChannelModeration, *model.AppError) { 4522 origCtx := a.ctx 4523 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelModerationsForChannel") 4524 4525 a.ctx = newCtx 4526 a.app.Srv().Store.SetContext(newCtx) 4527 defer func() { 4528 a.app.Srv().Store.SetContext(origCtx) 4529 a.ctx = origCtx 4530 }() 4531 4532 defer span.Finish() 4533 resultVar0, resultVar1 := a.app.GetChannelModerationsForChannel(channel) 4534 4535 if resultVar1 != nil { 4536 span.LogFields(spanlog.Error(resultVar1)) 4537 ext.Error.Set(span, true) 4538 } 4539 4540 return resultVar0, resultVar1 4541 } 4542 4543 func (a *OpenTracingAppLayer) GetChannelPinnedPostCount(channelId string) (int64, *model.AppError) { 4544 origCtx := a.ctx 4545 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelPinnedPostCount") 4546 4547 a.ctx = newCtx 4548 a.app.Srv().Store.SetContext(newCtx) 4549 defer func() { 4550 a.app.Srv().Store.SetContext(origCtx) 4551 a.ctx = origCtx 4552 }() 4553 4554 defer span.Finish() 4555 resultVar0, resultVar1 := a.app.GetChannelPinnedPostCount(channelId) 4556 4557 if resultVar1 != nil { 4558 span.LogFields(spanlog.Error(resultVar1)) 4559 ext.Error.Set(span, true) 4560 } 4561 4562 return resultVar0, resultVar1 4563 } 4564 4565 func (a *OpenTracingAppLayer) GetChannelUnread(channelId string, userId string) (*model.ChannelUnread, *model.AppError) { 4566 origCtx := a.ctx 4567 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelUnread") 4568 4569 a.ctx = newCtx 4570 a.app.Srv().Store.SetContext(newCtx) 4571 defer func() { 4572 a.app.Srv().Store.SetContext(origCtx) 4573 a.ctx = origCtx 4574 }() 4575 4576 defer span.Finish() 4577 resultVar0, resultVar1 := a.app.GetChannelUnread(channelId, userId) 4578 4579 if resultVar1 != nil { 4580 span.LogFields(spanlog.Error(resultVar1)) 4581 ext.Error.Set(span, true) 4582 } 4583 4584 return resultVar0, resultVar1 4585 } 4586 4587 func (a *OpenTracingAppLayer) GetChannelsByNames(channelNames []string, teamId string) ([]*model.Channel, *model.AppError) { 4588 origCtx := a.ctx 4589 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsByNames") 4590 4591 a.ctx = newCtx 4592 a.app.Srv().Store.SetContext(newCtx) 4593 defer func() { 4594 a.app.Srv().Store.SetContext(origCtx) 4595 a.ctx = origCtx 4596 }() 4597 4598 defer span.Finish() 4599 resultVar0, resultVar1 := a.app.GetChannelsByNames(channelNames, teamId) 4600 4601 if resultVar1 != nil { 4602 span.LogFields(spanlog.Error(resultVar1)) 4603 ext.Error.Set(span, true) 4604 } 4605 4606 return resultVar0, resultVar1 4607 } 4608 4609 func (a *OpenTracingAppLayer) GetChannelsForScheme(scheme *model.Scheme, offset int, limit int) (model.ChannelList, *model.AppError) { 4610 origCtx := a.ctx 4611 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForScheme") 4612 4613 a.ctx = newCtx 4614 a.app.Srv().Store.SetContext(newCtx) 4615 defer func() { 4616 a.app.Srv().Store.SetContext(origCtx) 4617 a.ctx = origCtx 4618 }() 4619 4620 defer span.Finish() 4621 resultVar0, resultVar1 := a.app.GetChannelsForScheme(scheme, offset, limit) 4622 4623 if resultVar1 != nil { 4624 span.LogFields(spanlog.Error(resultVar1)) 4625 ext.Error.Set(span, true) 4626 } 4627 4628 return resultVar0, resultVar1 4629 } 4630 4631 func (a *OpenTracingAppLayer) GetChannelsForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ChannelList, *model.AppError) { 4632 origCtx := a.ctx 4633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForSchemePage") 4634 4635 a.ctx = newCtx 4636 a.app.Srv().Store.SetContext(newCtx) 4637 defer func() { 4638 a.app.Srv().Store.SetContext(origCtx) 4639 a.ctx = origCtx 4640 }() 4641 4642 defer span.Finish() 4643 resultVar0, resultVar1 := a.app.GetChannelsForSchemePage(scheme, page, perPage) 4644 4645 if resultVar1 != nil { 4646 span.LogFields(spanlog.Error(resultVar1)) 4647 ext.Error.Set(span, true) 4648 } 4649 4650 return resultVar0, resultVar1 4651 } 4652 4653 func (a *OpenTracingAppLayer) GetChannelsForUser(teamId string, userId string, includeDeleted bool, lastDeleteAt int) (*model.ChannelList, *model.AppError) { 4654 origCtx := a.ctx 4655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsForUser") 4656 4657 a.ctx = newCtx 4658 a.app.Srv().Store.SetContext(newCtx) 4659 defer func() { 4660 a.app.Srv().Store.SetContext(origCtx) 4661 a.ctx = origCtx 4662 }() 4663 4664 defer span.Finish() 4665 resultVar0, resultVar1 := a.app.GetChannelsForUser(teamId, userId, includeDeleted, lastDeleteAt) 4666 4667 if resultVar1 != nil { 4668 span.LogFields(spanlog.Error(resultVar1)) 4669 ext.Error.Set(span, true) 4670 } 4671 4672 return resultVar0, resultVar1 4673 } 4674 4675 func (a *OpenTracingAppLayer) GetChannelsUserNotIn(teamId string, userId string, offset int, limit int) (*model.ChannelList, *model.AppError) { 4676 origCtx := a.ctx 4677 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetChannelsUserNotIn") 4678 4679 a.ctx = newCtx 4680 a.app.Srv().Store.SetContext(newCtx) 4681 defer func() { 4682 a.app.Srv().Store.SetContext(origCtx) 4683 a.ctx = origCtx 4684 }() 4685 4686 defer span.Finish() 4687 resultVar0, resultVar1 := a.app.GetChannelsUserNotIn(teamId, userId, offset, limit) 4688 4689 if resultVar1 != nil { 4690 span.LogFields(spanlog.Error(resultVar1)) 4691 ext.Error.Set(span, true) 4692 } 4693 4694 return resultVar0, resultVar1 4695 } 4696 4697 func (a *OpenTracingAppLayer) GetClusterId() string { 4698 origCtx := a.ctx 4699 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterId") 4700 4701 a.ctx = newCtx 4702 a.app.Srv().Store.SetContext(newCtx) 4703 defer func() { 4704 a.app.Srv().Store.SetContext(origCtx) 4705 a.ctx = origCtx 4706 }() 4707 4708 defer span.Finish() 4709 resultVar0 := a.app.GetClusterId() 4710 4711 return resultVar0 4712 } 4713 4714 func (a *OpenTracingAppLayer) GetClusterPluginStatuses() (model.PluginStatuses, *model.AppError) { 4715 origCtx := a.ctx 4716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterPluginStatuses") 4717 4718 a.ctx = newCtx 4719 a.app.Srv().Store.SetContext(newCtx) 4720 defer func() { 4721 a.app.Srv().Store.SetContext(origCtx) 4722 a.ctx = origCtx 4723 }() 4724 4725 defer span.Finish() 4726 resultVar0, resultVar1 := a.app.GetClusterPluginStatuses() 4727 4728 if resultVar1 != nil { 4729 span.LogFields(spanlog.Error(resultVar1)) 4730 ext.Error.Set(span, true) 4731 } 4732 4733 return resultVar0, resultVar1 4734 } 4735 4736 func (a *OpenTracingAppLayer) GetClusterStatus() []*model.ClusterInfo { 4737 origCtx := a.ctx 4738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterStatus") 4739 4740 a.ctx = newCtx 4741 a.app.Srv().Store.SetContext(newCtx) 4742 defer func() { 4743 a.app.Srv().Store.SetContext(origCtx) 4744 a.ctx = origCtx 4745 }() 4746 4747 defer span.Finish() 4748 resultVar0 := a.app.GetClusterStatus() 4749 4750 return resultVar0 4751 } 4752 4753 func (a *OpenTracingAppLayer) GetCommand(commandId string) (*model.Command, *model.AppError) { 4754 origCtx := a.ctx 4755 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommand") 4756 4757 a.ctx = newCtx 4758 a.app.Srv().Store.SetContext(newCtx) 4759 defer func() { 4760 a.app.Srv().Store.SetContext(origCtx) 4761 a.ctx = origCtx 4762 }() 4763 4764 defer span.Finish() 4765 resultVar0, resultVar1 := a.app.GetCommand(commandId) 4766 4767 if resultVar1 != nil { 4768 span.LogFields(spanlog.Error(resultVar1)) 4769 ext.Error.Set(span, true) 4770 } 4771 4772 return resultVar0, resultVar1 4773 } 4774 4775 func (a *OpenTracingAppLayer) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) { 4776 origCtx := a.ctx 4777 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceFile") 4778 4779 a.ctx = newCtx 4780 a.app.Srv().Store.SetContext(newCtx) 4781 defer func() { 4782 a.app.Srv().Store.SetContext(origCtx) 4783 a.ctx = origCtx 4784 }() 4785 4786 defer span.Finish() 4787 resultVar0, resultVar1 := a.app.GetComplianceFile(job) 4788 4789 if resultVar1 != nil { 4790 span.LogFields(spanlog.Error(resultVar1)) 4791 ext.Error.Set(span, true) 4792 } 4793 4794 return resultVar0, resultVar1 4795 } 4796 4797 func (a *OpenTracingAppLayer) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) { 4798 origCtx := a.ctx 4799 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReport") 4800 4801 a.ctx = newCtx 4802 a.app.Srv().Store.SetContext(newCtx) 4803 defer func() { 4804 a.app.Srv().Store.SetContext(origCtx) 4805 a.ctx = origCtx 4806 }() 4807 4808 defer span.Finish() 4809 resultVar0, resultVar1 := a.app.GetComplianceReport(reportId) 4810 4811 if resultVar1 != nil { 4812 span.LogFields(spanlog.Error(resultVar1)) 4813 ext.Error.Set(span, true) 4814 } 4815 4816 return resultVar0, resultVar1 4817 } 4818 4819 func (a *OpenTracingAppLayer) GetComplianceReports(page int, perPage int) (model.Compliances, *model.AppError) { 4820 origCtx := a.ctx 4821 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReports") 4822 4823 a.ctx = newCtx 4824 a.app.Srv().Store.SetContext(newCtx) 4825 defer func() { 4826 a.app.Srv().Store.SetContext(origCtx) 4827 a.ctx = origCtx 4828 }() 4829 4830 defer span.Finish() 4831 resultVar0, resultVar1 := a.app.GetComplianceReports(page, perPage) 4832 4833 if resultVar1 != nil { 4834 span.LogFields(spanlog.Error(resultVar1)) 4835 ext.Error.Set(span, true) 4836 } 4837 4838 return resultVar0, resultVar1 4839 } 4840 4841 func (a *OpenTracingAppLayer) GetConfigFile(name string) ([]byte, error) { 4842 origCtx := a.ctx 4843 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetConfigFile") 4844 4845 a.ctx = newCtx 4846 a.app.Srv().Store.SetContext(newCtx) 4847 defer func() { 4848 a.app.Srv().Store.SetContext(origCtx) 4849 a.ctx = origCtx 4850 }() 4851 4852 defer span.Finish() 4853 resultVar0, resultVar1 := a.app.GetConfigFile(name) 4854 4855 if resultVar1 != nil { 4856 span.LogFields(spanlog.Error(resultVar1)) 4857 ext.Error.Set(span, true) 4858 } 4859 4860 return resultVar0, resultVar1 4861 } 4862 4863 func (a *OpenTracingAppLayer) GetCookieDomain() string { 4864 origCtx := a.ctx 4865 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCookieDomain") 4866 4867 a.ctx = newCtx 4868 a.app.Srv().Store.SetContext(newCtx) 4869 defer func() { 4870 a.app.Srv().Store.SetContext(origCtx) 4871 a.ctx = origCtx 4872 }() 4873 4874 defer span.Finish() 4875 resultVar0 := a.app.GetCookieDomain() 4876 4877 return resultVar0 4878 } 4879 4880 func (a *OpenTracingAppLayer) GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError) { 4881 origCtx := a.ctx 4882 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDataRetentionPolicy") 4883 4884 a.ctx = newCtx 4885 a.app.Srv().Store.SetContext(newCtx) 4886 defer func() { 4887 a.app.Srv().Store.SetContext(origCtx) 4888 a.ctx = origCtx 4889 }() 4890 4891 defer span.Finish() 4892 resultVar0, resultVar1 := a.app.GetDataRetentionPolicy() 4893 4894 if resultVar1 != nil { 4895 span.LogFields(spanlog.Error(resultVar1)) 4896 ext.Error.Set(span, true) 4897 } 4898 4899 return resultVar0, resultVar1 4900 } 4901 4902 func (a *OpenTracingAppLayer) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) { 4903 origCtx := a.ctx 4904 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDefaultProfileImage") 4905 4906 a.ctx = newCtx 4907 a.app.Srv().Store.SetContext(newCtx) 4908 defer func() { 4909 a.app.Srv().Store.SetContext(origCtx) 4910 a.ctx = origCtx 4911 }() 4912 4913 defer span.Finish() 4914 resultVar0, resultVar1 := a.app.GetDefaultProfileImage(user) 4915 4916 if resultVar1 != nil { 4917 span.LogFields(spanlog.Error(resultVar1)) 4918 ext.Error.Set(span, true) 4919 } 4920 4921 return resultVar0, resultVar1 4922 } 4923 4924 func (a *OpenTracingAppLayer) GetDeletedChannels(teamId string, offset int, limit int, userId string) (*model.ChannelList, *model.AppError) { 4925 origCtx := a.ctx 4926 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDeletedChannels") 4927 4928 a.ctx = newCtx 4929 a.app.Srv().Store.SetContext(newCtx) 4930 defer func() { 4931 a.app.Srv().Store.SetContext(origCtx) 4932 a.ctx = origCtx 4933 }() 4934 4935 defer span.Finish() 4936 resultVar0, resultVar1 := a.app.GetDeletedChannels(teamId, offset, limit, userId) 4937 4938 if resultVar1 != nil { 4939 span.LogFields(spanlog.Error(resultVar1)) 4940 ext.Error.Set(span, true) 4941 } 4942 4943 return resultVar0, resultVar1 4944 } 4945 4946 func (a *OpenTracingAppLayer) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { 4947 origCtx := a.ctx 4948 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmoji") 4949 4950 a.ctx = newCtx 4951 a.app.Srv().Store.SetContext(newCtx) 4952 defer func() { 4953 a.app.Srv().Store.SetContext(origCtx) 4954 a.ctx = origCtx 4955 }() 4956 4957 defer span.Finish() 4958 resultVar0, resultVar1 := a.app.GetEmoji(emojiId) 4959 4960 if resultVar1 != nil { 4961 span.LogFields(spanlog.Error(resultVar1)) 4962 ext.Error.Set(span, true) 4963 } 4964 4965 return resultVar0, resultVar1 4966 } 4967 4968 func (a *OpenTracingAppLayer) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) { 4969 origCtx := a.ctx 4970 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiByName") 4971 4972 a.ctx = newCtx 4973 a.app.Srv().Store.SetContext(newCtx) 4974 defer func() { 4975 a.app.Srv().Store.SetContext(origCtx) 4976 a.ctx = origCtx 4977 }() 4978 4979 defer span.Finish() 4980 resultVar0, resultVar1 := a.app.GetEmojiByName(emojiName) 4981 4982 if resultVar1 != nil { 4983 span.LogFields(spanlog.Error(resultVar1)) 4984 ext.Error.Set(span, true) 4985 } 4986 4987 return resultVar0, resultVar1 4988 } 4989 4990 func (a *OpenTracingAppLayer) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { 4991 origCtx := a.ctx 4992 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiImage") 4993 4994 a.ctx = newCtx 4995 a.app.Srv().Store.SetContext(newCtx) 4996 defer func() { 4997 a.app.Srv().Store.SetContext(origCtx) 4998 a.ctx = origCtx 4999 }() 5000 5001 defer span.Finish() 5002 resultVar0, resultVar1, resultVar2 := a.app.GetEmojiImage(emojiId) 5003 5004 if resultVar2 != nil { 5005 span.LogFields(spanlog.Error(resultVar2)) 5006 ext.Error.Set(span, true) 5007 } 5008 5009 return resultVar0, resultVar1, resultVar2 5010 } 5011 5012 func (a *OpenTracingAppLayer) GetEmojiList(page int, perPage int, sort string) ([]*model.Emoji, *model.AppError) { 5013 origCtx := a.ctx 5014 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiList") 5015 5016 a.ctx = newCtx 5017 a.app.Srv().Store.SetContext(newCtx) 5018 defer func() { 5019 a.app.Srv().Store.SetContext(origCtx) 5020 a.ctx = origCtx 5021 }() 5022 5023 defer span.Finish() 5024 resultVar0, resultVar1 := a.app.GetEmojiList(page, perPage, sort) 5025 5026 if resultVar1 != nil { 5027 span.LogFields(spanlog.Error(resultVar1)) 5028 ext.Error.Set(span, true) 5029 } 5030 5031 return resultVar0, resultVar1 5032 } 5033 5034 func (a *OpenTracingAppLayer) GetEmojiStaticUrl(emojiName string) (string, *model.AppError) { 5035 origCtx := a.ctx 5036 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiStaticUrl") 5037 5038 a.ctx = newCtx 5039 a.app.Srv().Store.SetContext(newCtx) 5040 defer func() { 5041 a.app.Srv().Store.SetContext(origCtx) 5042 a.ctx = origCtx 5043 }() 5044 5045 defer span.Finish() 5046 resultVar0, resultVar1 := a.app.GetEmojiStaticUrl(emojiName) 5047 5048 if resultVar1 != nil { 5049 span.LogFields(spanlog.Error(resultVar1)) 5050 ext.Error.Set(span, true) 5051 } 5052 5053 return resultVar0, resultVar1 5054 } 5055 5056 func (a *OpenTracingAppLayer) GetEnvironmentConfig() map[string]interface{} { 5057 origCtx := a.ctx 5058 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEnvironmentConfig") 5059 5060 a.ctx = newCtx 5061 a.app.Srv().Store.SetContext(newCtx) 5062 defer func() { 5063 a.app.Srv().Store.SetContext(origCtx) 5064 a.ctx = origCtx 5065 }() 5066 5067 defer span.Finish() 5068 resultVar0 := a.app.GetEnvironmentConfig() 5069 5070 return resultVar0 5071 } 5072 5073 func (a *OpenTracingAppLayer) GetFile(fileId string) ([]byte, *model.AppError) { 5074 origCtx := a.ctx 5075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFile") 5076 5077 a.ctx = newCtx 5078 a.app.Srv().Store.SetContext(newCtx) 5079 defer func() { 5080 a.app.Srv().Store.SetContext(origCtx) 5081 a.ctx = origCtx 5082 }() 5083 5084 defer span.Finish() 5085 resultVar0, resultVar1 := a.app.GetFile(fileId) 5086 5087 if resultVar1 != nil { 5088 span.LogFields(spanlog.Error(resultVar1)) 5089 ext.Error.Set(span, true) 5090 } 5091 5092 return resultVar0, resultVar1 5093 } 5094 5095 func (a *OpenTracingAppLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { 5096 origCtx := a.ctx 5097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfo") 5098 5099 a.ctx = newCtx 5100 a.app.Srv().Store.SetContext(newCtx) 5101 defer func() { 5102 a.app.Srv().Store.SetContext(origCtx) 5103 a.ctx = origCtx 5104 }() 5105 5106 defer span.Finish() 5107 resultVar0, resultVar1 := a.app.GetFileInfo(fileId) 5108 5109 if resultVar1 != nil { 5110 span.LogFields(spanlog.Error(resultVar1)) 5111 ext.Error.Set(span, true) 5112 } 5113 5114 return resultVar0, resultVar1 5115 } 5116 5117 func (a *OpenTracingAppLayer) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) { 5118 origCtx := a.ctx 5119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfos") 5120 5121 a.ctx = newCtx 5122 a.app.Srv().Store.SetContext(newCtx) 5123 defer func() { 5124 a.app.Srv().Store.SetContext(origCtx) 5125 a.ctx = origCtx 5126 }() 5127 5128 defer span.Finish() 5129 resultVar0, resultVar1 := a.app.GetFileInfos(page, perPage, opt) 5130 5131 if resultVar1 != nil { 5132 span.LogFields(spanlog.Error(resultVar1)) 5133 ext.Error.Set(span, true) 5134 } 5135 5136 return resultVar0, resultVar1 5137 } 5138 5139 func (a *OpenTracingAppLayer) GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError) { 5140 origCtx := a.ctx 5141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPost") 5142 5143 a.ctx = newCtx 5144 a.app.Srv().Store.SetContext(newCtx) 5145 defer func() { 5146 a.app.Srv().Store.SetContext(origCtx) 5147 a.ctx = origCtx 5148 }() 5149 5150 defer span.Finish() 5151 resultVar0, resultVar1 := a.app.GetFileInfosForPost(postId, fromMaster) 5152 5153 if resultVar1 != nil { 5154 span.LogFields(spanlog.Error(resultVar1)) 5155 ext.Error.Set(span, true) 5156 } 5157 5158 return resultVar0, resultVar1 5159 } 5160 5161 func (a *OpenTracingAppLayer) GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError) { 5162 origCtx := a.ctx 5163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPostWithMigration") 5164 5165 a.ctx = newCtx 5166 a.app.Srv().Store.SetContext(newCtx) 5167 defer func() { 5168 a.app.Srv().Store.SetContext(origCtx) 5169 a.ctx = origCtx 5170 }() 5171 5172 defer span.Finish() 5173 resultVar0, resultVar1 := a.app.GetFileInfosForPostWithMigration(postId) 5174 5175 if resultVar1 != nil { 5176 span.LogFields(spanlog.Error(resultVar1)) 5177 ext.Error.Set(span, true) 5178 } 5179 5180 return resultVar0, resultVar1 5181 } 5182 5183 func (a *OpenTracingAppLayer) GetFilteredUsersStats(options *model.UserCountOptions) (*model.UsersStats, *model.AppError) { 5184 origCtx := a.ctx 5185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFilteredUsersStats") 5186 5187 a.ctx = newCtx 5188 a.app.Srv().Store.SetContext(newCtx) 5189 defer func() { 5190 a.app.Srv().Store.SetContext(origCtx) 5191 a.ctx = origCtx 5192 }() 5193 5194 defer span.Finish() 5195 resultVar0, resultVar1 := a.app.GetFilteredUsersStats(options) 5196 5197 if resultVar1 != nil { 5198 span.LogFields(spanlog.Error(resultVar1)) 5199 ext.Error.Set(span, true) 5200 } 5201 5202 return resultVar0, resultVar1 5203 } 5204 5205 func (a *OpenTracingAppLayer) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) { 5206 origCtx := a.ctx 5207 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPosts") 5208 5209 a.ctx = newCtx 5210 a.app.Srv().Store.SetContext(newCtx) 5211 defer func() { 5212 a.app.Srv().Store.SetContext(origCtx) 5213 a.ctx = origCtx 5214 }() 5215 5216 defer span.Finish() 5217 resultVar0, resultVar1 := a.app.GetFlaggedPosts(userId, offset, limit) 5218 5219 if resultVar1 != nil { 5220 span.LogFields(spanlog.Error(resultVar1)) 5221 ext.Error.Set(span, true) 5222 } 5223 5224 return resultVar0, resultVar1 5225 } 5226 5227 func (a *OpenTracingAppLayer) GetFlaggedPostsForChannel(userId string, channelId string, offset int, limit int) (*model.PostList, *model.AppError) { 5228 origCtx := a.ctx 5229 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForChannel") 5230 5231 a.ctx = newCtx 5232 a.app.Srv().Store.SetContext(newCtx) 5233 defer func() { 5234 a.app.Srv().Store.SetContext(origCtx) 5235 a.ctx = origCtx 5236 }() 5237 5238 defer span.Finish() 5239 resultVar0, resultVar1 := a.app.GetFlaggedPostsForChannel(userId, channelId, offset, limit) 5240 5241 if resultVar1 != nil { 5242 span.LogFields(spanlog.Error(resultVar1)) 5243 ext.Error.Set(span, true) 5244 } 5245 5246 return resultVar0, resultVar1 5247 } 5248 5249 func (a *OpenTracingAppLayer) GetFlaggedPostsForTeam(userId string, teamId string, offset int, limit int) (*model.PostList, *model.AppError) { 5250 origCtx := a.ctx 5251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForTeam") 5252 5253 a.ctx = newCtx 5254 a.app.Srv().Store.SetContext(newCtx) 5255 defer func() { 5256 a.app.Srv().Store.SetContext(origCtx) 5257 a.ctx = origCtx 5258 }() 5259 5260 defer span.Finish() 5261 resultVar0, resultVar1 := a.app.GetFlaggedPostsForTeam(userId, teamId, offset, limit) 5262 5263 if resultVar1 != nil { 5264 span.LogFields(spanlog.Error(resultVar1)) 5265 ext.Error.Set(span, true) 5266 } 5267 5268 return resultVar0, resultVar1 5269 } 5270 5271 func (a *OpenTracingAppLayer) GetGroup(id string) (*model.Group, *model.AppError) { 5272 origCtx := a.ctx 5273 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroup") 5274 5275 a.ctx = newCtx 5276 a.app.Srv().Store.SetContext(newCtx) 5277 defer func() { 5278 a.app.Srv().Store.SetContext(origCtx) 5279 a.ctx = origCtx 5280 }() 5281 5282 defer span.Finish() 5283 resultVar0, resultVar1 := a.app.GetGroup(id) 5284 5285 if resultVar1 != nil { 5286 span.LogFields(spanlog.Error(resultVar1)) 5287 ext.Error.Set(span, true) 5288 } 5289 5290 return resultVar0, resultVar1 5291 } 5292 5293 func (a *OpenTracingAppLayer) GetGroupByName(name string, opts model.GroupSearchOpts) (*model.Group, *model.AppError) { 5294 origCtx := a.ctx 5295 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByName") 5296 5297 a.ctx = newCtx 5298 a.app.Srv().Store.SetContext(newCtx) 5299 defer func() { 5300 a.app.Srv().Store.SetContext(origCtx) 5301 a.ctx = origCtx 5302 }() 5303 5304 defer span.Finish() 5305 resultVar0, resultVar1 := a.app.GetGroupByName(name, opts) 5306 5307 if resultVar1 != nil { 5308 span.LogFields(spanlog.Error(resultVar1)) 5309 ext.Error.Set(span, true) 5310 } 5311 5312 return resultVar0, resultVar1 5313 } 5314 5315 func (a *OpenTracingAppLayer) GetGroupByRemoteID(remoteID string, groupSource model.GroupSource) (*model.Group, *model.AppError) { 5316 origCtx := a.ctx 5317 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupByRemoteID") 5318 5319 a.ctx = newCtx 5320 a.app.Srv().Store.SetContext(newCtx) 5321 defer func() { 5322 a.app.Srv().Store.SetContext(origCtx) 5323 a.ctx = origCtx 5324 }() 5325 5326 defer span.Finish() 5327 resultVar0, resultVar1 := a.app.GetGroupByRemoteID(remoteID, groupSource) 5328 5329 if resultVar1 != nil { 5330 span.LogFields(spanlog.Error(resultVar1)) 5331 ext.Error.Set(span, true) 5332 } 5333 5334 return resultVar0, resultVar1 5335 } 5336 5337 func (a *OpenTracingAppLayer) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { 5338 origCtx := a.ctx 5339 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupChannel") 5340 5341 a.ctx = newCtx 5342 a.app.Srv().Store.SetContext(newCtx) 5343 defer func() { 5344 a.app.Srv().Store.SetContext(origCtx) 5345 a.ctx = origCtx 5346 }() 5347 5348 defer span.Finish() 5349 resultVar0, resultVar1 := a.app.GetGroupChannel(userIds) 5350 5351 if resultVar1 != nil { 5352 span.LogFields(spanlog.Error(resultVar1)) 5353 ext.Error.Set(span, true) 5354 } 5355 5356 return resultVar0, resultVar1 5357 } 5358 5359 func (a *OpenTracingAppLayer) GetGroupMemberCount(groupID string) (int64, *model.AppError) { 5360 origCtx := a.ctx 5361 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberCount") 5362 5363 a.ctx = newCtx 5364 a.app.Srv().Store.SetContext(newCtx) 5365 defer func() { 5366 a.app.Srv().Store.SetContext(origCtx) 5367 a.ctx = origCtx 5368 }() 5369 5370 defer span.Finish() 5371 resultVar0, resultVar1 := a.app.GetGroupMemberCount(groupID) 5372 5373 if resultVar1 != nil { 5374 span.LogFields(spanlog.Error(resultVar1)) 5375 ext.Error.Set(span, true) 5376 } 5377 5378 return resultVar0, resultVar1 5379 } 5380 5381 func (a *OpenTracingAppLayer) GetGroupMemberUsers(groupID string) ([]*model.User, *model.AppError) { 5382 origCtx := a.ctx 5383 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsers") 5384 5385 a.ctx = newCtx 5386 a.app.Srv().Store.SetContext(newCtx) 5387 defer func() { 5388 a.app.Srv().Store.SetContext(origCtx) 5389 a.ctx = origCtx 5390 }() 5391 5392 defer span.Finish() 5393 resultVar0, resultVar1 := a.app.GetGroupMemberUsers(groupID) 5394 5395 if resultVar1 != nil { 5396 span.LogFields(spanlog.Error(resultVar1)) 5397 ext.Error.Set(span, true) 5398 } 5399 5400 return resultVar0, resultVar1 5401 } 5402 5403 func (a *OpenTracingAppLayer) GetGroupMemberUsersPage(groupID string, page int, perPage int) ([]*model.User, int, *model.AppError) { 5404 origCtx := a.ctx 5405 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupMemberUsersPage") 5406 5407 a.ctx = newCtx 5408 a.app.Srv().Store.SetContext(newCtx) 5409 defer func() { 5410 a.app.Srv().Store.SetContext(origCtx) 5411 a.ctx = origCtx 5412 }() 5413 5414 defer span.Finish() 5415 resultVar0, resultVar1, resultVar2 := a.app.GetGroupMemberUsersPage(groupID, page, perPage) 5416 5417 if resultVar2 != nil { 5418 span.LogFields(spanlog.Error(resultVar2)) 5419 ext.Error.Set(span, true) 5420 } 5421 5422 return resultVar0, resultVar1, resultVar2 5423 } 5424 5425 func (a *OpenTracingAppLayer) GetGroupSyncable(groupID string, syncableID string, syncableType model.GroupSyncableType) (*model.GroupSyncable, *model.AppError) { 5426 origCtx := a.ctx 5427 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncable") 5428 5429 a.ctx = newCtx 5430 a.app.Srv().Store.SetContext(newCtx) 5431 defer func() { 5432 a.app.Srv().Store.SetContext(origCtx) 5433 a.ctx = origCtx 5434 }() 5435 5436 defer span.Finish() 5437 resultVar0, resultVar1 := a.app.GetGroupSyncable(groupID, syncableID, syncableType) 5438 5439 if resultVar1 != nil { 5440 span.LogFields(spanlog.Error(resultVar1)) 5441 ext.Error.Set(span, true) 5442 } 5443 5444 return resultVar0, resultVar1 5445 } 5446 5447 func (a *OpenTracingAppLayer) GetGroupSyncables(groupID string, syncableType model.GroupSyncableType) ([]*model.GroupSyncable, *model.AppError) { 5448 origCtx := a.ctx 5449 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupSyncables") 5450 5451 a.ctx = newCtx 5452 a.app.Srv().Store.SetContext(newCtx) 5453 defer func() { 5454 a.app.Srv().Store.SetContext(origCtx) 5455 a.ctx = origCtx 5456 }() 5457 5458 defer span.Finish() 5459 resultVar0, resultVar1 := a.app.GetGroupSyncables(groupID, syncableType) 5460 5461 if resultVar1 != nil { 5462 span.LogFields(spanlog.Error(resultVar1)) 5463 ext.Error.Set(span, true) 5464 } 5465 5466 return resultVar0, resultVar1 5467 } 5468 5469 func (a *OpenTracingAppLayer) GetGroups(page int, perPage int, opts model.GroupSearchOpts) ([]*model.Group, *model.AppError) { 5470 origCtx := a.ctx 5471 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroups") 5472 5473 a.ctx = newCtx 5474 a.app.Srv().Store.SetContext(newCtx) 5475 defer func() { 5476 a.app.Srv().Store.SetContext(origCtx) 5477 a.ctx = origCtx 5478 }() 5479 5480 defer span.Finish() 5481 resultVar0, resultVar1 := a.app.GetGroups(page, perPage, opts) 5482 5483 if resultVar1 != nil { 5484 span.LogFields(spanlog.Error(resultVar1)) 5485 ext.Error.Set(span, true) 5486 } 5487 5488 return resultVar0, resultVar1 5489 } 5490 5491 func (a *OpenTracingAppLayer) GetGroupsAssociatedToChannelsByTeam(teamId string, opts model.GroupSearchOpts) (map[string][]*model.GroupWithSchemeAdmin, *model.AppError) { 5492 origCtx := a.ctx 5493 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsAssociatedToChannelsByTeam") 5494 5495 a.ctx = newCtx 5496 a.app.Srv().Store.SetContext(newCtx) 5497 defer func() { 5498 a.app.Srv().Store.SetContext(origCtx) 5499 a.ctx = origCtx 5500 }() 5501 5502 defer span.Finish() 5503 resultVar0, resultVar1 := a.app.GetGroupsAssociatedToChannelsByTeam(teamId, opts) 5504 5505 if resultVar1 != nil { 5506 span.LogFields(spanlog.Error(resultVar1)) 5507 ext.Error.Set(span, true) 5508 } 5509 5510 return resultVar0, resultVar1 5511 } 5512 5513 func (a *OpenTracingAppLayer) GetGroupsByChannel(channelId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 5514 origCtx := a.ctx 5515 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByChannel") 5516 5517 a.ctx = newCtx 5518 a.app.Srv().Store.SetContext(newCtx) 5519 defer func() { 5520 a.app.Srv().Store.SetContext(origCtx) 5521 a.ctx = origCtx 5522 }() 5523 5524 defer span.Finish() 5525 resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByChannel(channelId, opts) 5526 5527 if resultVar2 != nil { 5528 span.LogFields(spanlog.Error(resultVar2)) 5529 ext.Error.Set(span, true) 5530 } 5531 5532 return resultVar0, resultVar1, resultVar2 5533 } 5534 5535 func (a *OpenTracingAppLayer) GetGroupsByIDs(groupIDs []string) ([]*model.Group, *model.AppError) { 5536 origCtx := a.ctx 5537 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByIDs") 5538 5539 a.ctx = newCtx 5540 a.app.Srv().Store.SetContext(newCtx) 5541 defer func() { 5542 a.app.Srv().Store.SetContext(origCtx) 5543 a.ctx = origCtx 5544 }() 5545 5546 defer span.Finish() 5547 resultVar0, resultVar1 := a.app.GetGroupsByIDs(groupIDs) 5548 5549 if resultVar1 != nil { 5550 span.LogFields(spanlog.Error(resultVar1)) 5551 ext.Error.Set(span, true) 5552 } 5553 5554 return resultVar0, resultVar1 5555 } 5556 5557 func (a *OpenTracingAppLayer) GetGroupsBySource(groupSource model.GroupSource) ([]*model.Group, *model.AppError) { 5558 origCtx := a.ctx 5559 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsBySource") 5560 5561 a.ctx = newCtx 5562 a.app.Srv().Store.SetContext(newCtx) 5563 defer func() { 5564 a.app.Srv().Store.SetContext(origCtx) 5565 a.ctx = origCtx 5566 }() 5567 5568 defer span.Finish() 5569 resultVar0, resultVar1 := a.app.GetGroupsBySource(groupSource) 5570 5571 if resultVar1 != nil { 5572 span.LogFields(spanlog.Error(resultVar1)) 5573 ext.Error.Set(span, true) 5574 } 5575 5576 return resultVar0, resultVar1 5577 } 5578 5579 func (a *OpenTracingAppLayer) GetGroupsByTeam(teamId string, opts model.GroupSearchOpts) ([]*model.GroupWithSchemeAdmin, int, *model.AppError) { 5580 origCtx := a.ctx 5581 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByTeam") 5582 5583 a.ctx = newCtx 5584 a.app.Srv().Store.SetContext(newCtx) 5585 defer func() { 5586 a.app.Srv().Store.SetContext(origCtx) 5587 a.ctx = origCtx 5588 }() 5589 5590 defer span.Finish() 5591 resultVar0, resultVar1, resultVar2 := a.app.GetGroupsByTeam(teamId, opts) 5592 5593 if resultVar2 != nil { 5594 span.LogFields(spanlog.Error(resultVar2)) 5595 ext.Error.Set(span, true) 5596 } 5597 5598 return resultVar0, resultVar1, resultVar2 5599 } 5600 5601 func (a *OpenTracingAppLayer) GetGroupsByUserId(userId string) ([]*model.Group, *model.AppError) { 5602 origCtx := a.ctx 5603 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetGroupsByUserId") 5604 5605 a.ctx = newCtx 5606 a.app.Srv().Store.SetContext(newCtx) 5607 defer func() { 5608 a.app.Srv().Store.SetContext(origCtx) 5609 a.ctx = origCtx 5610 }() 5611 5612 defer span.Finish() 5613 resultVar0, resultVar1 := a.app.GetGroupsByUserId(userId) 5614 5615 if resultVar1 != nil { 5616 span.LogFields(spanlog.Error(resultVar1)) 5617 ext.Error.Set(span, true) 5618 } 5619 5620 return resultVar0, resultVar1 5621 } 5622 5623 func (a *OpenTracingAppLayer) GetHubForUserId(userId string) *app.Hub { 5624 origCtx := a.ctx 5625 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetHubForUserId") 5626 5627 a.ctx = newCtx 5628 a.app.Srv().Store.SetContext(newCtx) 5629 defer func() { 5630 a.app.Srv().Store.SetContext(origCtx) 5631 a.ctx = origCtx 5632 }() 5633 5634 defer span.Finish() 5635 resultVar0 := a.app.GetHubForUserId(userId) 5636 5637 return resultVar0 5638 } 5639 5640 func (a *OpenTracingAppLayer) GetIncomingWebhook(hookId string) (*model.IncomingWebhook, *model.AppError) { 5641 origCtx := a.ctx 5642 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhook") 5643 5644 a.ctx = newCtx 5645 a.app.Srv().Store.SetContext(newCtx) 5646 defer func() { 5647 a.app.Srv().Store.SetContext(origCtx) 5648 a.ctx = origCtx 5649 }() 5650 5651 defer span.Finish() 5652 resultVar0, resultVar1 := a.app.GetIncomingWebhook(hookId) 5653 5654 if resultVar1 != nil { 5655 span.LogFields(spanlog.Error(resultVar1)) 5656 ext.Error.Set(span, true) 5657 } 5658 5659 return resultVar0, resultVar1 5660 } 5661 5662 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPage(teamId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 5663 origCtx := a.ctx 5664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPage") 5665 5666 a.ctx = newCtx 5667 a.app.Srv().Store.SetContext(newCtx) 5668 defer func() { 5669 a.app.Srv().Store.SetContext(origCtx) 5670 a.ctx = origCtx 5671 }() 5672 5673 defer span.Finish() 5674 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPage(teamId, page, perPage) 5675 5676 if resultVar1 != nil { 5677 span.LogFields(spanlog.Error(resultVar1)) 5678 ext.Error.Set(span, true) 5679 } 5680 5681 return resultVar0, resultVar1 5682 } 5683 5684 func (a *OpenTracingAppLayer) GetIncomingWebhooksForTeamPageByUser(teamId string, userId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 5685 origCtx := a.ctx 5686 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksForTeamPageByUser") 5687 5688 a.ctx = newCtx 5689 a.app.Srv().Store.SetContext(newCtx) 5690 defer func() { 5691 a.app.Srv().Store.SetContext(origCtx) 5692 a.ctx = origCtx 5693 }() 5694 5695 defer span.Finish() 5696 resultVar0, resultVar1 := a.app.GetIncomingWebhooksForTeamPageByUser(teamId, userId, page, perPage) 5697 5698 if resultVar1 != nil { 5699 span.LogFields(spanlog.Error(resultVar1)) 5700 ext.Error.Set(span, true) 5701 } 5702 5703 return resultVar0, resultVar1 5704 } 5705 5706 func (a *OpenTracingAppLayer) GetIncomingWebhooksPage(page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 5707 origCtx := a.ctx 5708 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPage") 5709 5710 a.ctx = newCtx 5711 a.app.Srv().Store.SetContext(newCtx) 5712 defer func() { 5713 a.app.Srv().Store.SetContext(origCtx) 5714 a.ctx = origCtx 5715 }() 5716 5717 defer span.Finish() 5718 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPage(page, perPage) 5719 5720 if resultVar1 != nil { 5721 span.LogFields(spanlog.Error(resultVar1)) 5722 ext.Error.Set(span, true) 5723 } 5724 5725 return resultVar0, resultVar1 5726 } 5727 5728 func (a *OpenTracingAppLayer) GetIncomingWebhooksPageByUser(userId string, page int, perPage int) ([]*model.IncomingWebhook, *model.AppError) { 5729 origCtx := a.ctx 5730 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetIncomingWebhooksPageByUser") 5731 5732 a.ctx = newCtx 5733 a.app.Srv().Store.SetContext(newCtx) 5734 defer func() { 5735 a.app.Srv().Store.SetContext(origCtx) 5736 a.ctx = origCtx 5737 }() 5738 5739 defer span.Finish() 5740 resultVar0, resultVar1 := a.app.GetIncomingWebhooksPageByUser(userId, page, perPage) 5741 5742 if resultVar1 != nil { 5743 span.LogFields(spanlog.Error(resultVar1)) 5744 ext.Error.Set(span, true) 5745 } 5746 5747 return resultVar0, resultVar1 5748 } 5749 5750 func (a *OpenTracingAppLayer) GetJob(id string) (*model.Job, *model.AppError) { 5751 origCtx := a.ctx 5752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJob") 5753 5754 a.ctx = newCtx 5755 a.app.Srv().Store.SetContext(newCtx) 5756 defer func() { 5757 a.app.Srv().Store.SetContext(origCtx) 5758 a.ctx = origCtx 5759 }() 5760 5761 defer span.Finish() 5762 resultVar0, resultVar1 := a.app.GetJob(id) 5763 5764 if resultVar1 != nil { 5765 span.LogFields(spanlog.Error(resultVar1)) 5766 ext.Error.Set(span, true) 5767 } 5768 5769 return resultVar0, resultVar1 5770 } 5771 5772 func (a *OpenTracingAppLayer) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) { 5773 origCtx := a.ctx 5774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobs") 5775 5776 a.ctx = newCtx 5777 a.app.Srv().Store.SetContext(newCtx) 5778 defer func() { 5779 a.app.Srv().Store.SetContext(origCtx) 5780 a.ctx = origCtx 5781 }() 5782 5783 defer span.Finish() 5784 resultVar0, resultVar1 := a.app.GetJobs(offset, limit) 5785 5786 if resultVar1 != nil { 5787 span.LogFields(spanlog.Error(resultVar1)) 5788 ext.Error.Set(span, true) 5789 } 5790 5791 return resultVar0, resultVar1 5792 } 5793 5794 func (a *OpenTracingAppLayer) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 5795 origCtx := a.ctx 5796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByType") 5797 5798 a.ctx = newCtx 5799 a.app.Srv().Store.SetContext(newCtx) 5800 defer func() { 5801 a.app.Srv().Store.SetContext(origCtx) 5802 a.ctx = origCtx 5803 }() 5804 5805 defer span.Finish() 5806 resultVar0, resultVar1 := a.app.GetJobsByType(jobType, offset, limit) 5807 5808 if resultVar1 != nil { 5809 span.LogFields(spanlog.Error(resultVar1)) 5810 ext.Error.Set(span, true) 5811 } 5812 5813 return resultVar0, resultVar1 5814 } 5815 5816 func (a *OpenTracingAppLayer) GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError) { 5817 origCtx := a.ctx 5818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypePage") 5819 5820 a.ctx = newCtx 5821 a.app.Srv().Store.SetContext(newCtx) 5822 defer func() { 5823 a.app.Srv().Store.SetContext(origCtx) 5824 a.ctx = origCtx 5825 }() 5826 5827 defer span.Finish() 5828 resultVar0, resultVar1 := a.app.GetJobsByTypePage(jobType, page, perPage) 5829 5830 if resultVar1 != nil { 5831 span.LogFields(spanlog.Error(resultVar1)) 5832 ext.Error.Set(span, true) 5833 } 5834 5835 return resultVar0, resultVar1 5836 } 5837 5838 func (a *OpenTracingAppLayer) GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError) { 5839 origCtx := a.ctx 5840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsPage") 5841 5842 a.ctx = newCtx 5843 a.app.Srv().Store.SetContext(newCtx) 5844 defer func() { 5845 a.app.Srv().Store.SetContext(origCtx) 5846 a.ctx = origCtx 5847 }() 5848 5849 defer span.Finish() 5850 resultVar0, resultVar1 := a.app.GetJobsPage(page, perPage) 5851 5852 if resultVar1 != nil { 5853 span.LogFields(spanlog.Error(resultVar1)) 5854 ext.Error.Set(span, true) 5855 } 5856 5857 return resultVar0, resultVar1 5858 } 5859 5860 func (a *OpenTracingAppLayer) GetKnownUsers(userID string) ([]string, *model.AppError) { 5861 origCtx := a.ctx 5862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetKnownUsers") 5863 5864 a.ctx = newCtx 5865 a.app.Srv().Store.SetContext(newCtx) 5866 defer func() { 5867 a.app.Srv().Store.SetContext(origCtx) 5868 a.ctx = origCtx 5869 }() 5870 5871 defer span.Finish() 5872 resultVar0, resultVar1 := a.app.GetKnownUsers(userID) 5873 5874 if resultVar1 != nil { 5875 span.LogFields(spanlog.Error(resultVar1)) 5876 ext.Error.Set(span, true) 5877 } 5878 5879 return resultVar0, resultVar1 5880 } 5881 5882 func (a *OpenTracingAppLayer) GetLatestTermsOfService() (*model.TermsOfService, *model.AppError) { 5883 origCtx := a.ctx 5884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLatestTermsOfService") 5885 5886 a.ctx = newCtx 5887 a.app.Srv().Store.SetContext(newCtx) 5888 defer func() { 5889 a.app.Srv().Store.SetContext(origCtx) 5890 a.ctx = origCtx 5891 }() 5892 5893 defer span.Finish() 5894 resultVar0, resultVar1 := a.app.GetLatestTermsOfService() 5895 5896 if resultVar1 != nil { 5897 span.LogFields(spanlog.Error(resultVar1)) 5898 ext.Error.Set(span, true) 5899 } 5900 5901 return resultVar0, resultVar1 5902 } 5903 5904 func (a *OpenTracingAppLayer) GetLdapGroup(ldapGroupID string) (*model.Group, *model.AppError) { 5905 origCtx := a.ctx 5906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLdapGroup") 5907 5908 a.ctx = newCtx 5909 a.app.Srv().Store.SetContext(newCtx) 5910 defer func() { 5911 a.app.Srv().Store.SetContext(origCtx) 5912 a.ctx = origCtx 5913 }() 5914 5915 defer span.Finish() 5916 resultVar0, resultVar1 := a.app.GetLdapGroup(ldapGroupID) 5917 5918 if resultVar1 != nil { 5919 span.LogFields(spanlog.Error(resultVar1)) 5920 ext.Error.Set(span, true) 5921 } 5922 5923 return resultVar0, resultVar1 5924 } 5925 5926 func (a *OpenTracingAppLayer) GetLogs(page int, perPage int) ([]string, *model.AppError) { 5927 origCtx := a.ctx 5928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogs") 5929 5930 a.ctx = newCtx 5931 a.app.Srv().Store.SetContext(newCtx) 5932 defer func() { 5933 a.app.Srv().Store.SetContext(origCtx) 5934 a.ctx = origCtx 5935 }() 5936 5937 defer span.Finish() 5938 resultVar0, resultVar1 := a.app.GetLogs(page, perPage) 5939 5940 if resultVar1 != nil { 5941 span.LogFields(spanlog.Error(resultVar1)) 5942 ext.Error.Set(span, true) 5943 } 5944 5945 return resultVar0, resultVar1 5946 } 5947 5948 func (a *OpenTracingAppLayer) GetLogsSkipSend(page int, perPage int) ([]string, *model.AppError) { 5949 origCtx := a.ctx 5950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogsSkipSend") 5951 5952 a.ctx = newCtx 5953 a.app.Srv().Store.SetContext(newCtx) 5954 defer func() { 5955 a.app.Srv().Store.SetContext(origCtx) 5956 a.ctx = origCtx 5957 }() 5958 5959 defer span.Finish() 5960 resultVar0, resultVar1 := a.app.GetLogsSkipSend(page, perPage) 5961 5962 if resultVar1 != nil { 5963 span.LogFields(spanlog.Error(resultVar1)) 5964 ext.Error.Set(span, true) 5965 } 5966 5967 return resultVar0, resultVar1 5968 } 5969 5970 func (a *OpenTracingAppLayer) GetMarketplacePlugins(filter *model.MarketplacePluginFilter) ([]*model.MarketplacePlugin, *model.AppError) { 5971 origCtx := a.ctx 5972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMarketplacePlugins") 5973 5974 a.ctx = newCtx 5975 a.app.Srv().Store.SetContext(newCtx) 5976 defer func() { 5977 a.app.Srv().Store.SetContext(origCtx) 5978 a.ctx = origCtx 5979 }() 5980 5981 defer span.Finish() 5982 resultVar0, resultVar1 := a.app.GetMarketplacePlugins(filter) 5983 5984 if resultVar1 != nil { 5985 span.LogFields(spanlog.Error(resultVar1)) 5986 ext.Error.Set(span, true) 5987 } 5988 5989 return resultVar0, resultVar1 5990 } 5991 5992 func (a *OpenTracingAppLayer) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string { 5993 origCtx := a.ctx 5994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMessageForNotification") 5995 5996 a.ctx = newCtx 5997 a.app.Srv().Store.SetContext(newCtx) 5998 defer func() { 5999 a.app.Srv().Store.SetContext(origCtx) 6000 a.ctx = origCtx 6001 }() 6002 6003 defer span.Finish() 6004 resultVar0 := a.app.GetMessageForNotification(post, translateFunc) 6005 6006 return resultVar0 6007 } 6008 6009 func (a *OpenTracingAppLayer) GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) { 6010 origCtx := a.ctx 6011 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMultipleEmojiByName") 6012 6013 a.ctx = newCtx 6014 a.app.Srv().Store.SetContext(newCtx) 6015 defer func() { 6016 a.app.Srv().Store.SetContext(origCtx) 6017 a.ctx = origCtx 6018 }() 6019 6020 defer span.Finish() 6021 resultVar0, resultVar1 := a.app.GetMultipleEmojiByName(names) 6022 6023 if resultVar1 != nil { 6024 span.LogFields(spanlog.Error(resultVar1)) 6025 ext.Error.Set(span, true) 6026 } 6027 6028 return resultVar0, resultVar1 6029 } 6030 6031 func (a *OpenTracingAppLayer) GetNewUsersForTeamPage(teamId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 6032 origCtx := a.ctx 6033 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNewUsersForTeamPage") 6034 6035 a.ctx = newCtx 6036 a.app.Srv().Store.SetContext(newCtx) 6037 defer func() { 6038 a.app.Srv().Store.SetContext(origCtx) 6039 a.ctx = origCtx 6040 }() 6041 6042 defer span.Finish() 6043 resultVar0, resultVar1 := a.app.GetNewUsersForTeamPage(teamId, page, perPage, asAdmin, viewRestrictions) 6044 6045 if resultVar1 != nil { 6046 span.LogFields(spanlog.Error(resultVar1)) 6047 ext.Error.Set(span, true) 6048 } 6049 6050 return resultVar0, resultVar1 6051 } 6052 6053 func (a *OpenTracingAppLayer) GetNextPostIdFromPostList(postList *model.PostList) string { 6054 origCtx := a.ctx 6055 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNextPostIdFromPostList") 6056 6057 a.ctx = newCtx 6058 a.app.Srv().Store.SetContext(newCtx) 6059 defer func() { 6060 a.app.Srv().Store.SetContext(origCtx) 6061 a.ctx = origCtx 6062 }() 6063 6064 defer span.Finish() 6065 resultVar0 := a.app.GetNextPostIdFromPostList(postList) 6066 6067 return resultVar0 6068 } 6069 6070 func (a *OpenTracingAppLayer) GetNotificationNameFormat(user *model.User) string { 6071 origCtx := a.ctx 6072 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNotificationNameFormat") 6073 6074 a.ctx = newCtx 6075 a.app.Srv().Store.SetContext(newCtx) 6076 defer func() { 6077 a.app.Srv().Store.SetContext(origCtx) 6078 a.ctx = origCtx 6079 }() 6080 6081 defer span.Finish() 6082 resultVar0 := a.app.GetNotificationNameFormat(user) 6083 6084 return resultVar0 6085 } 6086 6087 func (a *OpenTracingAppLayer) GetNumberOfChannelsOnTeam(teamId string) (int, *model.AppError) { 6088 origCtx := a.ctx 6089 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNumberOfChannelsOnTeam") 6090 6091 a.ctx = newCtx 6092 a.app.Srv().Store.SetContext(newCtx) 6093 defer func() { 6094 a.app.Srv().Store.SetContext(origCtx) 6095 a.ctx = origCtx 6096 }() 6097 6098 defer span.Finish() 6099 resultVar0, resultVar1 := a.app.GetNumberOfChannelsOnTeam(teamId) 6100 6101 if resultVar1 != nil { 6102 span.LogFields(spanlog.Error(resultVar1)) 6103 ext.Error.Set(span, true) 6104 } 6105 6106 return resultVar0, resultVar1 6107 } 6108 6109 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(clientId string, grantType string, redirectUri string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) { 6110 origCtx := a.ctx 6111 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForCodeFlow") 6112 6113 a.ctx = newCtx 6114 a.app.Srv().Store.SetContext(newCtx) 6115 defer func() { 6116 a.app.Srv().Store.SetContext(origCtx) 6117 a.ctx = origCtx 6118 }() 6119 6120 defer span.Finish() 6121 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken) 6122 6123 if resultVar1 != nil { 6124 span.LogFields(spanlog.Error(resultVar1)) 6125 ext.Error.Set(span, true) 6126 } 6127 6128 return resultVar0, resultVar1 6129 } 6130 6131 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { 6132 origCtx := a.ctx 6133 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow") 6134 6135 a.ctx = newCtx 6136 a.app.Srv().Store.SetContext(newCtx) 6137 defer func() { 6138 a.app.Srv().Store.SetContext(origCtx) 6139 a.ctx = origCtx 6140 }() 6141 6142 defer span.Finish() 6143 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userId, authRequest) 6144 6145 if resultVar1 != nil { 6146 span.LogFields(spanlog.Error(resultVar1)) 6147 ext.Error.Set(span, true) 6148 } 6149 6150 return resultVar0, resultVar1 6151 } 6152 6153 func (a *OpenTracingAppLayer) GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError) { 6154 origCtx := a.ctx 6155 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApp") 6156 6157 a.ctx = newCtx 6158 a.app.Srv().Store.SetContext(newCtx) 6159 defer func() { 6160 a.app.Srv().Store.SetContext(origCtx) 6161 a.ctx = origCtx 6162 }() 6163 6164 defer span.Finish() 6165 resultVar0, resultVar1 := a.app.GetOAuthApp(appId) 6166 6167 if resultVar1 != nil { 6168 span.LogFields(spanlog.Error(resultVar1)) 6169 ext.Error.Set(span, true) 6170 } 6171 6172 return resultVar0, resultVar1 6173 } 6174 6175 func (a *OpenTracingAppLayer) GetOAuthApps(page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6176 origCtx := a.ctx 6177 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApps") 6178 6179 a.ctx = newCtx 6180 a.app.Srv().Store.SetContext(newCtx) 6181 defer func() { 6182 a.app.Srv().Store.SetContext(origCtx) 6183 a.ctx = origCtx 6184 }() 6185 6186 defer span.Finish() 6187 resultVar0, resultVar1 := a.app.GetOAuthApps(page, perPage) 6188 6189 if resultVar1 != nil { 6190 span.LogFields(spanlog.Error(resultVar1)) 6191 ext.Error.Set(span, true) 6192 } 6193 6194 return resultVar0, resultVar1 6195 } 6196 6197 func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 6198 origCtx := a.ctx 6199 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAppsByCreator") 6200 6201 a.ctx = newCtx 6202 a.app.Srv().Store.SetContext(newCtx) 6203 defer func() { 6204 a.app.Srv().Store.SetContext(origCtx) 6205 a.ctx = origCtx 6206 }() 6207 6208 defer span.Finish() 6209 resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userId, page, perPage) 6210 6211 if resultVar1 != nil { 6212 span.LogFields(spanlog.Error(resultVar1)) 6213 ext.Error.Set(span, true) 6214 } 6215 6216 return resultVar0, resultVar1 6217 } 6218 6219 func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 6220 origCtx := a.ctx 6221 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthCodeRedirect") 6222 6223 a.ctx = newCtx 6224 a.app.Srv().Store.SetContext(newCtx) 6225 defer func() { 6226 a.app.Srv().Store.SetContext(origCtx) 6227 a.ctx = origCtx 6228 }() 6229 6230 defer span.Finish() 6231 resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userId, authRequest) 6232 6233 if resultVar1 != nil { 6234 span.LogFields(spanlog.Error(resultVar1)) 6235 ext.Error.Set(span, true) 6236 } 6237 6238 return resultVar0, resultVar1 6239 } 6240 6241 func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 6242 origCtx := a.ctx 6243 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect") 6244 6245 a.ctx = newCtx 6246 a.app.Srv().Store.SetContext(newCtx) 6247 defer func() { 6248 a.app.Srv().Store.SetContext(origCtx) 6249 a.ctx = origCtx 6250 }() 6251 6252 defer span.Finish() 6253 resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userId, authRequest) 6254 6255 if resultVar1 != nil { 6256 span.LogFields(spanlog.Error(resultVar1)) 6257 ext.Error.Set(span, true) 6258 } 6259 6260 return resultVar0, resultVar1 6261 } 6262 6263 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) { 6264 origCtx := a.ctx 6265 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint") 6266 6267 a.ctx = newCtx 6268 a.app.Srv().Store.SetContext(newCtx) 6269 defer func() { 6270 a.app.Srv().Store.SetContext(origCtx) 6271 a.ctx = origCtx 6272 }() 6273 6274 defer span.Finish() 6275 resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, teamId, action, redirectTo, loginHint, isMobile) 6276 6277 if resultVar1 != nil { 6278 span.LogFields(spanlog.Error(resultVar1)) 6279 ext.Error.Set(span, true) 6280 } 6281 6282 return resultVar0, resultVar1 6283 } 6284 6285 func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, teamId string) (string, *model.AppError) { 6286 origCtx := a.ctx 6287 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint") 6288 6289 a.ctx = newCtx 6290 a.app.Srv().Store.SetContext(newCtx) 6291 defer func() { 6292 a.app.Srv().Store.SetContext(origCtx) 6293 a.ctx = origCtx 6294 }() 6295 6296 defer span.Finish() 6297 resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, teamId) 6298 6299 if resultVar1 != nil { 6300 span.LogFields(spanlog.Error(resultVar1)) 6301 ext.Error.Set(span, true) 6302 } 6303 6304 return resultVar0, resultVar1 6305 } 6306 6307 func (a *OpenTracingAppLayer) GetOAuthStateToken(token string) (*model.Token, *model.AppError) { 6308 origCtx := a.ctx 6309 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthStateToken") 6310 6311 a.ctx = newCtx 6312 a.app.Srv().Store.SetContext(newCtx) 6313 defer func() { 6314 a.app.Srv().Store.SetContext(origCtx) 6315 a.ctx = origCtx 6316 }() 6317 6318 defer span.Finish() 6319 resultVar0, resultVar1 := a.app.GetOAuthStateToken(token) 6320 6321 if resultVar1 != nil { 6322 span.LogFields(spanlog.Error(resultVar1)) 6323 ext.Error.Set(span, true) 6324 } 6325 6326 return resultVar0, resultVar1 6327 } 6328 6329 func (a *OpenTracingAppLayer) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph { 6330 origCtx := a.ctx 6331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOpenGraphMetadata") 6332 6333 a.ctx = newCtx 6334 a.app.Srv().Store.SetContext(newCtx) 6335 defer func() { 6336 a.app.Srv().Store.SetContext(origCtx) 6337 a.ctx = origCtx 6338 }() 6339 6340 defer span.Finish() 6341 resultVar0 := a.app.GetOpenGraphMetadata(requestURL) 6342 6343 return resultVar0 6344 } 6345 6346 func (a *OpenTracingAppLayer) GetOrCreateDirectChannel(userId string, otherUserId string) (*model.Channel, *model.AppError) { 6347 origCtx := a.ctx 6348 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOrCreateDirectChannel") 6349 6350 a.ctx = newCtx 6351 a.app.Srv().Store.SetContext(newCtx) 6352 defer func() { 6353 a.app.Srv().Store.SetContext(origCtx) 6354 a.ctx = origCtx 6355 }() 6356 6357 defer span.Finish() 6358 resultVar0, resultVar1 := a.app.GetOrCreateDirectChannel(userId, otherUserId) 6359 6360 if resultVar1 != nil { 6361 span.LogFields(spanlog.Error(resultVar1)) 6362 ext.Error.Set(span, true) 6363 } 6364 6365 return resultVar0, resultVar1 6366 } 6367 6368 func (a *OpenTracingAppLayer) GetOutgoingWebhook(hookId string) (*model.OutgoingWebhook, *model.AppError) { 6369 origCtx := a.ctx 6370 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhook") 6371 6372 a.ctx = newCtx 6373 a.app.Srv().Store.SetContext(newCtx) 6374 defer func() { 6375 a.app.Srv().Store.SetContext(origCtx) 6376 a.ctx = origCtx 6377 }() 6378 6379 defer span.Finish() 6380 resultVar0, resultVar1 := a.app.GetOutgoingWebhook(hookId) 6381 6382 if resultVar1 != nil { 6383 span.LogFields(spanlog.Error(resultVar1)) 6384 ext.Error.Set(span, true) 6385 } 6386 6387 return resultVar0, resultVar1 6388 } 6389 6390 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForChannelPageByUser(channelId string, userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6391 origCtx := a.ctx 6392 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForChannelPageByUser") 6393 6394 a.ctx = newCtx 6395 a.app.Srv().Store.SetContext(newCtx) 6396 defer func() { 6397 a.app.Srv().Store.SetContext(origCtx) 6398 a.ctx = origCtx 6399 }() 6400 6401 defer span.Finish() 6402 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForChannelPageByUser(channelId, userId, page, perPage) 6403 6404 if resultVar1 != nil { 6405 span.LogFields(spanlog.Error(resultVar1)) 6406 ext.Error.Set(span, true) 6407 } 6408 6409 return resultVar0, resultVar1 6410 } 6411 6412 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPage(teamId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6413 origCtx := a.ctx 6414 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPage") 6415 6416 a.ctx = newCtx 6417 a.app.Srv().Store.SetContext(newCtx) 6418 defer func() { 6419 a.app.Srv().Store.SetContext(origCtx) 6420 a.ctx = origCtx 6421 }() 6422 6423 defer span.Finish() 6424 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPage(teamId, page, perPage) 6425 6426 if resultVar1 != nil { 6427 span.LogFields(spanlog.Error(resultVar1)) 6428 ext.Error.Set(span, true) 6429 } 6430 6431 return resultVar0, resultVar1 6432 } 6433 6434 func (a *OpenTracingAppLayer) GetOutgoingWebhooksForTeamPageByUser(teamId string, userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6435 origCtx := a.ctx 6436 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksForTeamPageByUser") 6437 6438 a.ctx = newCtx 6439 a.app.Srv().Store.SetContext(newCtx) 6440 defer func() { 6441 a.app.Srv().Store.SetContext(origCtx) 6442 a.ctx = origCtx 6443 }() 6444 6445 defer span.Finish() 6446 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksForTeamPageByUser(teamId, userId, page, perPage) 6447 6448 if resultVar1 != nil { 6449 span.LogFields(spanlog.Error(resultVar1)) 6450 ext.Error.Set(span, true) 6451 } 6452 6453 return resultVar0, resultVar1 6454 } 6455 6456 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPage(page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6457 origCtx := a.ctx 6458 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPage") 6459 6460 a.ctx = newCtx 6461 a.app.Srv().Store.SetContext(newCtx) 6462 defer func() { 6463 a.app.Srv().Store.SetContext(origCtx) 6464 a.ctx = origCtx 6465 }() 6466 6467 defer span.Finish() 6468 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPage(page, perPage) 6469 6470 if resultVar1 != nil { 6471 span.LogFields(spanlog.Error(resultVar1)) 6472 ext.Error.Set(span, true) 6473 } 6474 6475 return resultVar0, resultVar1 6476 } 6477 6478 func (a *OpenTracingAppLayer) GetOutgoingWebhooksPageByUser(userId string, page int, perPage int) ([]*model.OutgoingWebhook, *model.AppError) { 6479 origCtx := a.ctx 6480 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOutgoingWebhooksPageByUser") 6481 6482 a.ctx = newCtx 6483 a.app.Srv().Store.SetContext(newCtx) 6484 defer func() { 6485 a.app.Srv().Store.SetContext(origCtx) 6486 a.ctx = origCtx 6487 }() 6488 6489 defer span.Finish() 6490 resultVar0, resultVar1 := a.app.GetOutgoingWebhooksPageByUser(userId, page, perPage) 6491 6492 if resultVar1 != nil { 6493 span.LogFields(spanlog.Error(resultVar1)) 6494 ext.Error.Set(span, true) 6495 } 6496 6497 return resultVar0, resultVar1 6498 } 6499 6500 func (a *OpenTracingAppLayer) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) { 6501 origCtx := a.ctx 6502 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPasswordRecoveryToken") 6503 6504 a.ctx = newCtx 6505 a.app.Srv().Store.SetContext(newCtx) 6506 defer func() { 6507 a.app.Srv().Store.SetContext(origCtx) 6508 a.ctx = origCtx 6509 }() 6510 6511 defer span.Finish() 6512 resultVar0, resultVar1 := a.app.GetPasswordRecoveryToken(token) 6513 6514 if resultVar1 != nil { 6515 span.LogFields(spanlog.Error(resultVar1)) 6516 ext.Error.Set(span, true) 6517 } 6518 6519 return resultVar0, resultVar1 6520 } 6521 6522 func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) { 6523 origCtx := a.ctx 6524 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPermalinkPost") 6525 6526 a.ctx = newCtx 6527 a.app.Srv().Store.SetContext(newCtx) 6528 defer func() { 6529 a.app.Srv().Store.SetContext(origCtx) 6530 a.ctx = origCtx 6531 }() 6532 6533 defer span.Finish() 6534 resultVar0, resultVar1 := a.app.GetPermalinkPost(postId, userId) 6535 6536 if resultVar1 != nil { 6537 span.LogFields(spanlog.Error(resultVar1)) 6538 ext.Error.Set(span, true) 6539 } 6540 6541 return resultVar0, resultVar1 6542 } 6543 6544 func (a *OpenTracingAppLayer) GetPinnedPosts(channelId string) (*model.PostList, *model.AppError) { 6545 origCtx := a.ctx 6546 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPinnedPosts") 6547 6548 a.ctx = newCtx 6549 a.app.Srv().Store.SetContext(newCtx) 6550 defer func() { 6551 a.app.Srv().Store.SetContext(origCtx) 6552 a.ctx = origCtx 6553 }() 6554 6555 defer span.Finish() 6556 resultVar0, resultVar1 := a.app.GetPinnedPosts(channelId) 6557 6558 if resultVar1 != nil { 6559 span.LogFields(spanlog.Error(resultVar1)) 6560 ext.Error.Set(span, true) 6561 } 6562 6563 return resultVar0, resultVar1 6564 } 6565 6566 func (a *OpenTracingAppLayer) GetPluginKey(pluginId string, key string) ([]byte, *model.AppError) { 6567 origCtx := a.ctx 6568 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginKey") 6569 6570 a.ctx = newCtx 6571 a.app.Srv().Store.SetContext(newCtx) 6572 defer func() { 6573 a.app.Srv().Store.SetContext(origCtx) 6574 a.ctx = origCtx 6575 }() 6576 6577 defer span.Finish() 6578 resultVar0, resultVar1 := a.app.GetPluginKey(pluginId, key) 6579 6580 if resultVar1 != nil { 6581 span.LogFields(spanlog.Error(resultVar1)) 6582 ext.Error.Set(span, true) 6583 } 6584 6585 return resultVar0, resultVar1 6586 } 6587 6588 func (a *OpenTracingAppLayer) GetPluginPublicKeyFiles() ([]string, *model.AppError) { 6589 origCtx := a.ctx 6590 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginPublicKeyFiles") 6591 6592 a.ctx = newCtx 6593 a.app.Srv().Store.SetContext(newCtx) 6594 defer func() { 6595 a.app.Srv().Store.SetContext(origCtx) 6596 a.ctx = origCtx 6597 }() 6598 6599 defer span.Finish() 6600 resultVar0, resultVar1 := a.app.GetPluginPublicKeyFiles() 6601 6602 if resultVar1 != nil { 6603 span.LogFields(spanlog.Error(resultVar1)) 6604 ext.Error.Set(span, true) 6605 } 6606 6607 return resultVar0, resultVar1 6608 } 6609 6610 func (a *OpenTracingAppLayer) GetPluginStatus(id string) (*model.PluginStatus, *model.AppError) { 6611 origCtx := a.ctx 6612 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatus") 6613 6614 a.ctx = newCtx 6615 a.app.Srv().Store.SetContext(newCtx) 6616 defer func() { 6617 a.app.Srv().Store.SetContext(origCtx) 6618 a.ctx = origCtx 6619 }() 6620 6621 defer span.Finish() 6622 resultVar0, resultVar1 := a.app.GetPluginStatus(id) 6623 6624 if resultVar1 != nil { 6625 span.LogFields(spanlog.Error(resultVar1)) 6626 ext.Error.Set(span, true) 6627 } 6628 6629 return resultVar0, resultVar1 6630 } 6631 6632 func (a *OpenTracingAppLayer) GetPluginStatuses() (model.PluginStatuses, *model.AppError) { 6633 origCtx := a.ctx 6634 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginStatuses") 6635 6636 a.ctx = newCtx 6637 a.app.Srv().Store.SetContext(newCtx) 6638 defer func() { 6639 a.app.Srv().Store.SetContext(origCtx) 6640 a.ctx = origCtx 6641 }() 6642 6643 defer span.Finish() 6644 resultVar0, resultVar1 := a.app.GetPluginStatuses() 6645 6646 if resultVar1 != nil { 6647 span.LogFields(spanlog.Error(resultVar1)) 6648 ext.Error.Set(span, true) 6649 } 6650 6651 return resultVar0, resultVar1 6652 } 6653 6654 func (a *OpenTracingAppLayer) GetPlugins() (*model.PluginsResponse, *model.AppError) { 6655 origCtx := a.ctx 6656 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPlugins") 6657 6658 a.ctx = newCtx 6659 a.app.Srv().Store.SetContext(newCtx) 6660 defer func() { 6661 a.app.Srv().Store.SetContext(origCtx) 6662 a.ctx = origCtx 6663 }() 6664 6665 defer span.Finish() 6666 resultVar0, resultVar1 := a.app.GetPlugins() 6667 6668 if resultVar1 != nil { 6669 span.LogFields(spanlog.Error(resultVar1)) 6670 ext.Error.Set(span, true) 6671 } 6672 6673 return resultVar0, resultVar1 6674 } 6675 6676 func (a *OpenTracingAppLayer) GetPluginsEnvironment() *plugin.Environment { 6677 origCtx := a.ctx 6678 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPluginsEnvironment") 6679 6680 a.ctx = newCtx 6681 a.app.Srv().Store.SetContext(newCtx) 6682 defer func() { 6683 a.app.Srv().Store.SetContext(origCtx) 6684 a.ctx = origCtx 6685 }() 6686 6687 defer span.Finish() 6688 resultVar0 := a.app.GetPluginsEnvironment() 6689 6690 return resultVar0 6691 } 6692 6693 func (a *OpenTracingAppLayer) GetPostAfterTime(channelId string, time int64) (*model.Post, *model.AppError) { 6694 origCtx := a.ctx 6695 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostAfterTime") 6696 6697 a.ctx = newCtx 6698 a.app.Srv().Store.SetContext(newCtx) 6699 defer func() { 6700 a.app.Srv().Store.SetContext(origCtx) 6701 a.ctx = origCtx 6702 }() 6703 6704 defer span.Finish() 6705 resultVar0, resultVar1 := a.app.GetPostAfterTime(channelId, time) 6706 6707 if resultVar1 != nil { 6708 span.LogFields(spanlog.Error(resultVar1)) 6709 ext.Error.Set(span, true) 6710 } 6711 6712 return resultVar0, resultVar1 6713 } 6714 6715 func (a *OpenTracingAppLayer) GetPostIdAfterTime(channelId string, time int64) (string, *model.AppError) { 6716 origCtx := a.ctx 6717 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdAfterTime") 6718 6719 a.ctx = newCtx 6720 a.app.Srv().Store.SetContext(newCtx) 6721 defer func() { 6722 a.app.Srv().Store.SetContext(origCtx) 6723 a.ctx = origCtx 6724 }() 6725 6726 defer span.Finish() 6727 resultVar0, resultVar1 := a.app.GetPostIdAfterTime(channelId, time) 6728 6729 if resultVar1 != nil { 6730 span.LogFields(spanlog.Error(resultVar1)) 6731 ext.Error.Set(span, true) 6732 } 6733 6734 return resultVar0, resultVar1 6735 } 6736 6737 func (a *OpenTracingAppLayer) GetPostIdBeforeTime(channelId string, time int64) (string, *model.AppError) { 6738 origCtx := a.ctx 6739 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdBeforeTime") 6740 6741 a.ctx = newCtx 6742 a.app.Srv().Store.SetContext(newCtx) 6743 defer func() { 6744 a.app.Srv().Store.SetContext(origCtx) 6745 a.ctx = origCtx 6746 }() 6747 6748 defer span.Finish() 6749 resultVar0, resultVar1 := a.app.GetPostIdBeforeTime(channelId, time) 6750 6751 if resultVar1 != nil { 6752 span.LogFields(spanlog.Error(resultVar1)) 6753 ext.Error.Set(span, true) 6754 } 6755 6756 return resultVar0, resultVar1 6757 } 6758 6759 func (a *OpenTracingAppLayer) GetPostThread(postId string, skipFetchThreads bool) (*model.PostList, *model.AppError) { 6760 origCtx := a.ctx 6761 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostThread") 6762 6763 a.ctx = newCtx 6764 a.app.Srv().Store.SetContext(newCtx) 6765 defer func() { 6766 a.app.Srv().Store.SetContext(origCtx) 6767 a.ctx = origCtx 6768 }() 6769 6770 defer span.Finish() 6771 resultVar0, resultVar1 := a.app.GetPostThread(postId, skipFetchThreads) 6772 6773 if resultVar1 != nil { 6774 span.LogFields(spanlog.Error(resultVar1)) 6775 ext.Error.Set(span, true) 6776 } 6777 6778 return resultVar0, resultVar1 6779 } 6780 6781 func (a *OpenTracingAppLayer) GetPosts(channelId string, offset int, limit int) (*model.PostList, *model.AppError) { 6782 origCtx := a.ctx 6783 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPosts") 6784 6785 a.ctx = newCtx 6786 a.app.Srv().Store.SetContext(newCtx) 6787 defer func() { 6788 a.app.Srv().Store.SetContext(origCtx) 6789 a.ctx = origCtx 6790 }() 6791 6792 defer span.Finish() 6793 resultVar0, resultVar1 := a.app.GetPosts(channelId, offset, limit) 6794 6795 if resultVar1 != nil { 6796 span.LogFields(spanlog.Error(resultVar1)) 6797 ext.Error.Set(span, true) 6798 } 6799 6800 return resultVar0, resultVar1 6801 } 6802 6803 func (a *OpenTracingAppLayer) GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 6804 origCtx := a.ctx 6805 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAfterPost") 6806 6807 a.ctx = newCtx 6808 a.app.Srv().Store.SetContext(newCtx) 6809 defer func() { 6810 a.app.Srv().Store.SetContext(origCtx) 6811 a.ctx = origCtx 6812 }() 6813 6814 defer span.Finish() 6815 resultVar0, resultVar1 := a.app.GetPostsAfterPost(options) 6816 6817 if resultVar1 != nil { 6818 span.LogFields(spanlog.Error(resultVar1)) 6819 ext.Error.Set(span, true) 6820 } 6821 6822 return resultVar0, resultVar1 6823 } 6824 6825 func (a *OpenTracingAppLayer) GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) { 6826 origCtx := a.ctx 6827 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAroundPost") 6828 6829 a.ctx = newCtx 6830 a.app.Srv().Store.SetContext(newCtx) 6831 defer func() { 6832 a.app.Srv().Store.SetContext(origCtx) 6833 a.ctx = origCtx 6834 }() 6835 6836 defer span.Finish() 6837 resultVar0, resultVar1 := a.app.GetPostsAroundPost(before, options) 6838 6839 if resultVar1 != nil { 6840 span.LogFields(spanlog.Error(resultVar1)) 6841 ext.Error.Set(span, true) 6842 } 6843 6844 return resultVar0, resultVar1 6845 } 6846 6847 func (a *OpenTracingAppLayer) GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 6848 origCtx := a.ctx 6849 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsBeforePost") 6850 6851 a.ctx = newCtx 6852 a.app.Srv().Store.SetContext(newCtx) 6853 defer func() { 6854 a.app.Srv().Store.SetContext(origCtx) 6855 a.ctx = origCtx 6856 }() 6857 6858 defer span.Finish() 6859 resultVar0, resultVar1 := a.app.GetPostsBeforePost(options) 6860 6861 if resultVar1 != nil { 6862 span.LogFields(spanlog.Error(resultVar1)) 6863 ext.Error.Set(span, true) 6864 } 6865 6866 return resultVar0, resultVar1 6867 } 6868 6869 func (a *OpenTracingAppLayer) GetPostsEtag(channelId string) string { 6870 origCtx := a.ctx 6871 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsEtag") 6872 6873 a.ctx = newCtx 6874 a.app.Srv().Store.SetContext(newCtx) 6875 defer func() { 6876 a.app.Srv().Store.SetContext(origCtx) 6877 a.ctx = origCtx 6878 }() 6879 6880 defer span.Finish() 6881 resultVar0 := a.app.GetPostsEtag(channelId) 6882 6883 return resultVar0 6884 } 6885 6886 func (a *OpenTracingAppLayer) GetPostsForChannelAroundLastUnread(channelId string, userId string, limitBefore int, limitAfter int, skipFetchThreads bool) (*model.PostList, *model.AppError) { 6887 origCtx := a.ctx 6888 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsForChannelAroundLastUnread") 6889 6890 a.ctx = newCtx 6891 a.app.Srv().Store.SetContext(newCtx) 6892 defer func() { 6893 a.app.Srv().Store.SetContext(origCtx) 6894 a.ctx = origCtx 6895 }() 6896 6897 defer span.Finish() 6898 resultVar0, resultVar1 := a.app.GetPostsForChannelAroundLastUnread(channelId, userId, limitBefore, limitAfter, skipFetchThreads) 6899 6900 if resultVar1 != nil { 6901 span.LogFields(spanlog.Error(resultVar1)) 6902 ext.Error.Set(span, true) 6903 } 6904 6905 return resultVar0, resultVar1 6906 } 6907 6908 func (a *OpenTracingAppLayer) GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 6909 origCtx := a.ctx 6910 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsPage") 6911 6912 a.ctx = newCtx 6913 a.app.Srv().Store.SetContext(newCtx) 6914 defer func() { 6915 a.app.Srv().Store.SetContext(origCtx) 6916 a.ctx = origCtx 6917 }() 6918 6919 defer span.Finish() 6920 resultVar0, resultVar1 := a.app.GetPostsPage(options) 6921 6922 if resultVar1 != nil { 6923 span.LogFields(spanlog.Error(resultVar1)) 6924 ext.Error.Set(span, true) 6925 } 6926 6927 return resultVar0, resultVar1 6928 } 6929 6930 func (a *OpenTracingAppLayer) GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) { 6931 origCtx := a.ctx 6932 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsSince") 6933 6934 a.ctx = newCtx 6935 a.app.Srv().Store.SetContext(newCtx) 6936 defer func() { 6937 a.app.Srv().Store.SetContext(origCtx) 6938 a.ctx = origCtx 6939 }() 6940 6941 defer span.Finish() 6942 resultVar0, resultVar1 := a.app.GetPostsSince(options) 6943 6944 if resultVar1 != nil { 6945 span.LogFields(spanlog.Error(resultVar1)) 6946 ext.Error.Set(span, true) 6947 } 6948 6949 return resultVar0, resultVar1 6950 } 6951 6952 func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) { 6953 origCtx := a.ctx 6954 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryAndNameForUser") 6955 6956 a.ctx = newCtx 6957 a.app.Srv().Store.SetContext(newCtx) 6958 defer func() { 6959 a.app.Srv().Store.SetContext(origCtx) 6960 a.ctx = origCtx 6961 }() 6962 6963 defer span.Finish() 6964 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userId, category, preferenceName) 6965 6966 if resultVar1 != nil { 6967 span.LogFields(spanlog.Error(resultVar1)) 6968 ext.Error.Set(span, true) 6969 } 6970 6971 return resultVar0, resultVar1 6972 } 6973 6974 func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) { 6975 origCtx := a.ctx 6976 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryForUser") 6977 6978 a.ctx = newCtx 6979 a.app.Srv().Store.SetContext(newCtx) 6980 defer func() { 6981 a.app.Srv().Store.SetContext(origCtx) 6982 a.ctx = origCtx 6983 }() 6984 6985 defer span.Finish() 6986 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userId, category) 6987 6988 if resultVar1 != nil { 6989 span.LogFields(spanlog.Error(resultVar1)) 6990 ext.Error.Set(span, true) 6991 } 6992 6993 return resultVar0, resultVar1 6994 } 6995 6996 func (a *OpenTracingAppLayer) GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) { 6997 origCtx := a.ctx 6998 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferencesForUser") 6999 7000 a.ctx = newCtx 7001 a.app.Srv().Store.SetContext(newCtx) 7002 defer func() { 7003 a.app.Srv().Store.SetContext(origCtx) 7004 a.ctx = origCtx 7005 }() 7006 7007 defer span.Finish() 7008 resultVar0, resultVar1 := a.app.GetPreferencesForUser(userId) 7009 7010 if resultVar1 != nil { 7011 span.LogFields(spanlog.Error(resultVar1)) 7012 ext.Error.Set(span, true) 7013 } 7014 7015 return resultVar0, resultVar1 7016 } 7017 7018 func (a *OpenTracingAppLayer) GetPrevPostIdFromPostList(postList *model.PostList) string { 7019 origCtx := a.ctx 7020 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrevPostIdFromPostList") 7021 7022 a.ctx = newCtx 7023 a.app.Srv().Store.SetContext(newCtx) 7024 defer func() { 7025 a.app.Srv().Store.SetContext(origCtx) 7026 a.ctx = origCtx 7027 }() 7028 7029 defer span.Finish() 7030 resultVar0 := a.app.GetPrevPostIdFromPostList(postList) 7031 7032 return resultVar0 7033 } 7034 7035 func (a *OpenTracingAppLayer) GetPrivateChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7036 origCtx := a.ctx 7037 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrivateChannelsForTeam") 7038 7039 a.ctx = newCtx 7040 a.app.Srv().Store.SetContext(newCtx) 7041 defer func() { 7042 a.app.Srv().Store.SetContext(origCtx) 7043 a.ctx = origCtx 7044 }() 7045 7046 defer span.Finish() 7047 resultVar0, resultVar1 := a.app.GetPrivateChannelsForTeam(teamId, offset, limit) 7048 7049 if resultVar1 != nil { 7050 span.LogFields(spanlog.Error(resultVar1)) 7051 ext.Error.Set(span, true) 7052 } 7053 7054 return resultVar0, resultVar1 7055 } 7056 7057 func (a *OpenTracingAppLayer) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) { 7058 origCtx := a.ctx 7059 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProfileImage") 7060 7061 a.ctx = newCtx 7062 a.app.Srv().Store.SetContext(newCtx) 7063 defer func() { 7064 a.app.Srv().Store.SetContext(origCtx) 7065 a.ctx = origCtx 7066 }() 7067 7068 defer span.Finish() 7069 resultVar0, resultVar1, resultVar2 := a.app.GetProfileImage(user) 7070 7071 if resultVar2 != nil { 7072 span.LogFields(spanlog.Error(resultVar2)) 7073 ext.Error.Set(span, true) 7074 } 7075 7076 return resultVar0, resultVar1, resultVar2 7077 } 7078 7079 func (a *OpenTracingAppLayer) GetPublicChannelsByIdsForTeam(teamId string, channelIds []string) (*model.ChannelList, *model.AppError) { 7080 origCtx := a.ctx 7081 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsByIdsForTeam") 7082 7083 a.ctx = newCtx 7084 a.app.Srv().Store.SetContext(newCtx) 7085 defer func() { 7086 a.app.Srv().Store.SetContext(origCtx) 7087 a.ctx = origCtx 7088 }() 7089 7090 defer span.Finish() 7091 resultVar0, resultVar1 := a.app.GetPublicChannelsByIdsForTeam(teamId, channelIds) 7092 7093 if resultVar1 != nil { 7094 span.LogFields(spanlog.Error(resultVar1)) 7095 ext.Error.Set(span, true) 7096 } 7097 7098 return resultVar0, resultVar1 7099 } 7100 7101 func (a *OpenTracingAppLayer) GetPublicChannelsForTeam(teamId string, offset int, limit int) (*model.ChannelList, *model.AppError) { 7102 origCtx := a.ctx 7103 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicChannelsForTeam") 7104 7105 a.ctx = newCtx 7106 a.app.Srv().Store.SetContext(newCtx) 7107 defer func() { 7108 a.app.Srv().Store.SetContext(origCtx) 7109 a.ctx = origCtx 7110 }() 7111 7112 defer span.Finish() 7113 resultVar0, resultVar1 := a.app.GetPublicChannelsForTeam(teamId, offset, limit) 7114 7115 if resultVar1 != nil { 7116 span.LogFields(spanlog.Error(resultVar1)) 7117 ext.Error.Set(span, true) 7118 } 7119 7120 return resultVar0, resultVar1 7121 } 7122 7123 func (a *OpenTracingAppLayer) GetPublicKey(name string) ([]byte, *model.AppError) { 7124 origCtx := a.ctx 7125 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPublicKey") 7126 7127 a.ctx = newCtx 7128 a.app.Srv().Store.SetContext(newCtx) 7129 defer func() { 7130 a.app.Srv().Store.SetContext(origCtx) 7131 a.ctx = origCtx 7132 }() 7133 7134 defer span.Finish() 7135 resultVar0, resultVar1 := a.app.GetPublicKey(name) 7136 7137 if resultVar1 != nil { 7138 span.LogFields(spanlog.Error(resultVar1)) 7139 ext.Error.Set(span, true) 7140 } 7141 7142 return resultVar0, resultVar1 7143 } 7144 7145 func (a *OpenTracingAppLayer) GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) { 7146 origCtx := a.ctx 7147 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetReactionsForPost") 7148 7149 a.ctx = newCtx 7150 a.app.Srv().Store.SetContext(newCtx) 7151 defer func() { 7152 a.app.Srv().Store.SetContext(origCtx) 7153 a.ctx = origCtx 7154 }() 7155 7156 defer span.Finish() 7157 resultVar0, resultVar1 := a.app.GetReactionsForPost(postId) 7158 7159 if resultVar1 != nil { 7160 span.LogFields(spanlog.Error(resultVar1)) 7161 ext.Error.Set(span, true) 7162 } 7163 7164 return resultVar0, resultVar1 7165 } 7166 7167 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeam(teamId string) (map[string]*model.User, *model.AppError) { 7168 origCtx := a.ctx 7169 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeam") 7170 7171 a.ctx = newCtx 7172 a.app.Srv().Store.SetContext(newCtx) 7173 defer func() { 7174 a.app.Srv().Store.SetContext(origCtx) 7175 a.ctx = origCtx 7176 }() 7177 7178 defer span.Finish() 7179 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeam(teamId) 7180 7181 if resultVar1 != nil { 7182 span.LogFields(spanlog.Error(resultVar1)) 7183 ext.Error.Set(span, true) 7184 } 7185 7186 return resultVar0, resultVar1 7187 } 7188 7189 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForTeamPage(teamId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 7190 origCtx := a.ctx 7191 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForTeamPage") 7192 7193 a.ctx = newCtx 7194 a.app.Srv().Store.SetContext(newCtx) 7195 defer func() { 7196 a.app.Srv().Store.SetContext(origCtx) 7197 a.ctx = origCtx 7198 }() 7199 7200 defer span.Finish() 7201 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForTeamPage(teamId, page, perPage, asAdmin, viewRestrictions) 7202 7203 if resultVar1 != nil { 7204 span.LogFields(spanlog.Error(resultVar1)) 7205 ext.Error.Set(span, true) 7206 } 7207 7208 return resultVar0, resultVar1 7209 } 7210 7211 func (a *OpenTracingAppLayer) GetRole(id string) (*model.Role, *model.AppError) { 7212 origCtx := a.ctx 7213 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRole") 7214 7215 a.ctx = newCtx 7216 a.app.Srv().Store.SetContext(newCtx) 7217 defer func() { 7218 a.app.Srv().Store.SetContext(origCtx) 7219 a.ctx = origCtx 7220 }() 7221 7222 defer span.Finish() 7223 resultVar0, resultVar1 := a.app.GetRole(id) 7224 7225 if resultVar1 != nil { 7226 span.LogFields(spanlog.Error(resultVar1)) 7227 ext.Error.Set(span, true) 7228 } 7229 7230 return resultVar0, resultVar1 7231 } 7232 7233 func (a *OpenTracingAppLayer) GetRoleByName(name string) (*model.Role, *model.AppError) { 7234 origCtx := a.ctx 7235 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRoleByName") 7236 7237 a.ctx = newCtx 7238 a.app.Srv().Store.SetContext(newCtx) 7239 defer func() { 7240 a.app.Srv().Store.SetContext(origCtx) 7241 a.ctx = origCtx 7242 }() 7243 7244 defer span.Finish() 7245 resultVar0, resultVar1 := a.app.GetRoleByName(name) 7246 7247 if resultVar1 != nil { 7248 span.LogFields(spanlog.Error(resultVar1)) 7249 ext.Error.Set(span, true) 7250 } 7251 7252 return resultVar0, resultVar1 7253 } 7254 7255 func (a *OpenTracingAppLayer) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) { 7256 origCtx := a.ctx 7257 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRolesByNames") 7258 7259 a.ctx = newCtx 7260 a.app.Srv().Store.SetContext(newCtx) 7261 defer func() { 7262 a.app.Srv().Store.SetContext(origCtx) 7263 a.ctx = origCtx 7264 }() 7265 7266 defer span.Finish() 7267 resultVar0, resultVar1 := a.app.GetRolesByNames(names) 7268 7269 if resultVar1 != nil { 7270 span.LogFields(spanlog.Error(resultVar1)) 7271 ext.Error.Set(span, true) 7272 } 7273 7274 return resultVar0, resultVar1 7275 } 7276 7277 func (a *OpenTracingAppLayer) GetSamlCertificateStatus() *model.SamlCertificateStatus { 7278 origCtx := a.ctx 7279 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlCertificateStatus") 7280 7281 a.ctx = newCtx 7282 a.app.Srv().Store.SetContext(newCtx) 7283 defer func() { 7284 a.app.Srv().Store.SetContext(origCtx) 7285 a.ctx = origCtx 7286 }() 7287 7288 defer span.Finish() 7289 resultVar0 := a.app.GetSamlCertificateStatus() 7290 7291 return resultVar0 7292 } 7293 7294 func (a *OpenTracingAppLayer) GetSamlMetadata() (string, *model.AppError) { 7295 origCtx := a.ctx 7296 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadata") 7297 7298 a.ctx = newCtx 7299 a.app.Srv().Store.SetContext(newCtx) 7300 defer func() { 7301 a.app.Srv().Store.SetContext(origCtx) 7302 a.ctx = origCtx 7303 }() 7304 7305 defer span.Finish() 7306 resultVar0, resultVar1 := a.app.GetSamlMetadata() 7307 7308 if resultVar1 != nil { 7309 span.LogFields(spanlog.Error(resultVar1)) 7310 ext.Error.Set(span, true) 7311 } 7312 7313 return resultVar0, resultVar1 7314 } 7315 7316 func (a *OpenTracingAppLayer) GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError) { 7317 origCtx := a.ctx 7318 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadataFromIdp") 7319 7320 a.ctx = newCtx 7321 a.app.Srv().Store.SetContext(newCtx) 7322 defer func() { 7323 a.app.Srv().Store.SetContext(origCtx) 7324 a.ctx = origCtx 7325 }() 7326 7327 defer span.Finish() 7328 resultVar0, resultVar1 := a.app.GetSamlMetadataFromIdp(idpMetadataUrl) 7329 7330 if resultVar1 != nil { 7331 span.LogFields(spanlog.Error(resultVar1)) 7332 ext.Error.Set(span, true) 7333 } 7334 7335 return resultVar0, resultVar1 7336 } 7337 7338 func (a *OpenTracingAppLayer) GetSanitizeOptions(asAdmin bool) map[string]bool { 7339 origCtx := a.ctx 7340 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizeOptions") 7341 7342 a.ctx = newCtx 7343 a.app.Srv().Store.SetContext(newCtx) 7344 defer func() { 7345 a.app.Srv().Store.SetContext(origCtx) 7346 a.ctx = origCtx 7347 }() 7348 7349 defer span.Finish() 7350 resultVar0 := a.app.GetSanitizeOptions(asAdmin) 7351 7352 return resultVar0 7353 } 7354 7355 func (a *OpenTracingAppLayer) GetSanitizedConfig() *model.Config { 7356 origCtx := a.ctx 7357 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizedConfig") 7358 7359 a.ctx = newCtx 7360 a.app.Srv().Store.SetContext(newCtx) 7361 defer func() { 7362 a.app.Srv().Store.SetContext(origCtx) 7363 a.ctx = origCtx 7364 }() 7365 7366 defer span.Finish() 7367 resultVar0 := a.app.GetSanitizedConfig() 7368 7369 return resultVar0 7370 } 7371 7372 func (a *OpenTracingAppLayer) GetScheme(id string) (*model.Scheme, *model.AppError) { 7373 origCtx := a.ctx 7374 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetScheme") 7375 7376 a.ctx = newCtx 7377 a.app.Srv().Store.SetContext(newCtx) 7378 defer func() { 7379 a.app.Srv().Store.SetContext(origCtx) 7380 a.ctx = origCtx 7381 }() 7382 7383 defer span.Finish() 7384 resultVar0, resultVar1 := a.app.GetScheme(id) 7385 7386 if resultVar1 != nil { 7387 span.LogFields(spanlog.Error(resultVar1)) 7388 ext.Error.Set(span, true) 7389 } 7390 7391 return resultVar0, resultVar1 7392 } 7393 7394 func (a *OpenTracingAppLayer) GetSchemeByName(name string) (*model.Scheme, *model.AppError) { 7395 origCtx := a.ctx 7396 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeByName") 7397 7398 a.ctx = newCtx 7399 a.app.Srv().Store.SetContext(newCtx) 7400 defer func() { 7401 a.app.Srv().Store.SetContext(origCtx) 7402 a.ctx = origCtx 7403 }() 7404 7405 defer span.Finish() 7406 resultVar0, resultVar1 := a.app.GetSchemeByName(name) 7407 7408 if resultVar1 != nil { 7409 span.LogFields(spanlog.Error(resultVar1)) 7410 ext.Error.Set(span, true) 7411 } 7412 7413 return resultVar0, resultVar1 7414 } 7415 7416 func (a *OpenTracingAppLayer) GetSchemeRolesForChannel(channelId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 7417 origCtx := a.ctx 7418 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForChannel") 7419 7420 a.ctx = newCtx 7421 a.app.Srv().Store.SetContext(newCtx) 7422 defer func() { 7423 a.app.Srv().Store.SetContext(origCtx) 7424 a.ctx = origCtx 7425 }() 7426 7427 defer span.Finish() 7428 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForChannel(channelId) 7429 7430 if resultVar3 != nil { 7431 span.LogFields(spanlog.Error(resultVar3)) 7432 ext.Error.Set(span, true) 7433 } 7434 7435 return resultVar0, resultVar1, resultVar2, resultVar3 7436 } 7437 7438 func (a *OpenTracingAppLayer) GetSchemeRolesForTeam(teamId string) (string, string, string, *model.AppError) { 7439 origCtx := a.ctx 7440 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForTeam") 7441 7442 a.ctx = newCtx 7443 a.app.Srv().Store.SetContext(newCtx) 7444 defer func() { 7445 a.app.Srv().Store.SetContext(origCtx) 7446 a.ctx = origCtx 7447 }() 7448 7449 defer span.Finish() 7450 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetSchemeRolesForTeam(teamId) 7451 7452 if resultVar3 != nil { 7453 span.LogFields(spanlog.Error(resultVar3)) 7454 ext.Error.Set(span, true) 7455 } 7456 7457 return resultVar0, resultVar1, resultVar2, resultVar3 7458 } 7459 7460 func (a *OpenTracingAppLayer) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) { 7461 origCtx := a.ctx 7462 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemes") 7463 7464 a.ctx = newCtx 7465 a.app.Srv().Store.SetContext(newCtx) 7466 defer func() { 7467 a.app.Srv().Store.SetContext(origCtx) 7468 a.ctx = origCtx 7469 }() 7470 7471 defer span.Finish() 7472 resultVar0, resultVar1 := a.app.GetSchemes(scope, offset, limit) 7473 7474 if resultVar1 != nil { 7475 span.LogFields(spanlog.Error(resultVar1)) 7476 ext.Error.Set(span, true) 7477 } 7478 7479 return resultVar0, resultVar1 7480 } 7481 7482 func (a *OpenTracingAppLayer) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) { 7483 origCtx := a.ctx 7484 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemesPage") 7485 7486 a.ctx = newCtx 7487 a.app.Srv().Store.SetContext(newCtx) 7488 defer func() { 7489 a.app.Srv().Store.SetContext(origCtx) 7490 a.ctx = origCtx 7491 }() 7492 7493 defer span.Finish() 7494 resultVar0, resultVar1 := a.app.GetSchemesPage(scope, page, perPage) 7495 7496 if resultVar1 != nil { 7497 span.LogFields(spanlog.Error(resultVar1)) 7498 ext.Error.Set(span, true) 7499 } 7500 7501 return resultVar0, resultVar1 7502 } 7503 7504 func (a *OpenTracingAppLayer) GetSession(token string) (*model.Session, *model.AppError) { 7505 origCtx := a.ctx 7506 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSession") 7507 7508 a.ctx = newCtx 7509 a.app.Srv().Store.SetContext(newCtx) 7510 defer func() { 7511 a.app.Srv().Store.SetContext(origCtx) 7512 a.ctx = origCtx 7513 }() 7514 7515 defer span.Finish() 7516 resultVar0, resultVar1 := a.app.GetSession(token) 7517 7518 if resultVar1 != nil { 7519 span.LogFields(spanlog.Error(resultVar1)) 7520 ext.Error.Set(span, true) 7521 } 7522 7523 return resultVar0, resultVar1 7524 } 7525 7526 func (a *OpenTracingAppLayer) GetSessionById(sessionId string) (*model.Session, *model.AppError) { 7527 origCtx := a.ctx 7528 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionById") 7529 7530 a.ctx = newCtx 7531 a.app.Srv().Store.SetContext(newCtx) 7532 defer func() { 7533 a.app.Srv().Store.SetContext(origCtx) 7534 a.ctx = origCtx 7535 }() 7536 7537 defer span.Finish() 7538 resultVar0, resultVar1 := a.app.GetSessionById(sessionId) 7539 7540 if resultVar1 != nil { 7541 span.LogFields(spanlog.Error(resultVar1)) 7542 ext.Error.Set(span, true) 7543 } 7544 7545 return resultVar0, resultVar1 7546 } 7547 7548 func (a *OpenTracingAppLayer) GetSessionLengthInMillis(session *model.Session) int64 { 7549 origCtx := a.ctx 7550 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionLengthInMillis") 7551 7552 a.ctx = newCtx 7553 a.app.Srv().Store.SetContext(newCtx) 7554 defer func() { 7555 a.app.Srv().Store.SetContext(origCtx) 7556 a.ctx = origCtx 7557 }() 7558 7559 defer span.Finish() 7560 resultVar0 := a.app.GetSessionLengthInMillis(session) 7561 7562 return resultVar0 7563 } 7564 7565 func (a *OpenTracingAppLayer) GetSessions(userId string) ([]*model.Session, *model.AppError) { 7566 origCtx := a.ctx 7567 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions") 7568 7569 a.ctx = newCtx 7570 a.app.Srv().Store.SetContext(newCtx) 7571 defer func() { 7572 a.app.Srv().Store.SetContext(origCtx) 7573 a.ctx = origCtx 7574 }() 7575 7576 defer span.Finish() 7577 resultVar0, resultVar1 := a.app.GetSessions(userId) 7578 7579 if resultVar1 != nil { 7580 span.LogFields(spanlog.Error(resultVar1)) 7581 ext.Error.Set(span, true) 7582 } 7583 7584 return resultVar0, resultVar1 7585 } 7586 7587 func (a *OpenTracingAppLayer) GetSidebarCategories(userId string, teamId string) (*model.OrderedSidebarCategories, *model.AppError) { 7588 origCtx := a.ctx 7589 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategories") 7590 7591 a.ctx = newCtx 7592 a.app.Srv().Store.SetContext(newCtx) 7593 defer func() { 7594 a.app.Srv().Store.SetContext(origCtx) 7595 a.ctx = origCtx 7596 }() 7597 7598 defer span.Finish() 7599 resultVar0, resultVar1 := a.app.GetSidebarCategories(userId, teamId) 7600 7601 if resultVar1 != nil { 7602 span.LogFields(spanlog.Error(resultVar1)) 7603 ext.Error.Set(span, true) 7604 } 7605 7606 return resultVar0, resultVar1 7607 } 7608 7609 func (a *OpenTracingAppLayer) GetSidebarCategory(categoryId string) (*model.SidebarCategoryWithChannels, *model.AppError) { 7610 origCtx := a.ctx 7611 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategory") 7612 7613 a.ctx = newCtx 7614 a.app.Srv().Store.SetContext(newCtx) 7615 defer func() { 7616 a.app.Srv().Store.SetContext(origCtx) 7617 a.ctx = origCtx 7618 }() 7619 7620 defer span.Finish() 7621 resultVar0, resultVar1 := a.app.GetSidebarCategory(categoryId) 7622 7623 if resultVar1 != nil { 7624 span.LogFields(spanlog.Error(resultVar1)) 7625 ext.Error.Set(span, true) 7626 } 7627 7628 return resultVar0, resultVar1 7629 } 7630 7631 func (a *OpenTracingAppLayer) GetSidebarCategoryOrder(userId string, teamId string) ([]string, *model.AppError) { 7632 origCtx := a.ctx 7633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSidebarCategoryOrder") 7634 7635 a.ctx = newCtx 7636 a.app.Srv().Store.SetContext(newCtx) 7637 defer func() { 7638 a.app.Srv().Store.SetContext(origCtx) 7639 a.ctx = origCtx 7640 }() 7641 7642 defer span.Finish() 7643 resultVar0, resultVar1 := a.app.GetSidebarCategoryOrder(userId, teamId) 7644 7645 if resultVar1 != nil { 7646 span.LogFields(spanlog.Error(resultVar1)) 7647 ext.Error.Set(span, true) 7648 } 7649 7650 return resultVar0, resultVar1 7651 } 7652 7653 func (a *OpenTracingAppLayer) GetSinglePost(postId string) (*model.Post, *model.AppError) { 7654 origCtx := a.ctx 7655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSinglePost") 7656 7657 a.ctx = newCtx 7658 a.app.Srv().Store.SetContext(newCtx) 7659 defer func() { 7660 a.app.Srv().Store.SetContext(origCtx) 7661 a.ctx = origCtx 7662 }() 7663 7664 defer span.Finish() 7665 resultVar0, resultVar1 := a.app.GetSinglePost(postId) 7666 7667 if resultVar1 != nil { 7668 span.LogFields(spanlog.Error(resultVar1)) 7669 ext.Error.Set(span, true) 7670 } 7671 7672 return resultVar0, resultVar1 7673 } 7674 7675 func (a *OpenTracingAppLayer) GetSiteURL() string { 7676 origCtx := a.ctx 7677 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSiteURL") 7678 7679 a.ctx = newCtx 7680 a.app.Srv().Store.SetContext(newCtx) 7681 defer func() { 7682 a.app.Srv().Store.SetContext(origCtx) 7683 a.ctx = origCtx 7684 }() 7685 7686 defer span.Finish() 7687 resultVar0 := a.app.GetSiteURL() 7688 7689 return resultVar0 7690 } 7691 7692 func (a *OpenTracingAppLayer) GetStatus(userId string) (*model.Status, *model.AppError) { 7693 origCtx := a.ctx 7694 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatus") 7695 7696 a.ctx = newCtx 7697 a.app.Srv().Store.SetContext(newCtx) 7698 defer func() { 7699 a.app.Srv().Store.SetContext(origCtx) 7700 a.ctx = origCtx 7701 }() 7702 7703 defer span.Finish() 7704 resultVar0, resultVar1 := a.app.GetStatus(userId) 7705 7706 if resultVar1 != nil { 7707 span.LogFields(spanlog.Error(resultVar1)) 7708 ext.Error.Set(span, true) 7709 } 7710 7711 return resultVar0, resultVar1 7712 } 7713 7714 func (a *OpenTracingAppLayer) GetStatusFromCache(userId string) *model.Status { 7715 origCtx := a.ctx 7716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusFromCache") 7717 7718 a.ctx = newCtx 7719 a.app.Srv().Store.SetContext(newCtx) 7720 defer func() { 7721 a.app.Srv().Store.SetContext(origCtx) 7722 a.ctx = origCtx 7723 }() 7724 7725 defer span.Finish() 7726 resultVar0 := a.app.GetStatusFromCache(userId) 7727 7728 return resultVar0 7729 } 7730 7731 func (a *OpenTracingAppLayer) GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) { 7732 origCtx := a.ctx 7733 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusesByIds") 7734 7735 a.ctx = newCtx 7736 a.app.Srv().Store.SetContext(newCtx) 7737 defer func() { 7738 a.app.Srv().Store.SetContext(origCtx) 7739 a.ctx = origCtx 7740 }() 7741 7742 defer span.Finish() 7743 resultVar0, resultVar1 := a.app.GetStatusesByIds(userIds) 7744 7745 if resultVar1 != nil { 7746 span.LogFields(spanlog.Error(resultVar1)) 7747 ext.Error.Set(span, true) 7748 } 7749 7750 return resultVar0, resultVar1 7751 } 7752 7753 func (a *OpenTracingAppLayer) GetSuggestions(commandArgs *model.CommandArgs, commands []*model.Command, roleID string) []model.AutocompleteSuggestion { 7754 origCtx := a.ctx 7755 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSuggestions") 7756 7757 a.ctx = newCtx 7758 a.app.Srv().Store.SetContext(newCtx) 7759 defer func() { 7760 a.app.Srv().Store.SetContext(origCtx) 7761 a.ctx = origCtx 7762 }() 7763 7764 defer span.Finish() 7765 resultVar0 := a.app.GetSuggestions(commandArgs, commands, roleID) 7766 7767 return resultVar0 7768 } 7769 7770 func (a *OpenTracingAppLayer) GetTeam(teamId string) (*model.Team, *model.AppError) { 7771 origCtx := a.ctx 7772 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeam") 7773 7774 a.ctx = newCtx 7775 a.app.Srv().Store.SetContext(newCtx) 7776 defer func() { 7777 a.app.Srv().Store.SetContext(origCtx) 7778 a.ctx = origCtx 7779 }() 7780 7781 defer span.Finish() 7782 resultVar0, resultVar1 := a.app.GetTeam(teamId) 7783 7784 if resultVar1 != nil { 7785 span.LogFields(spanlog.Error(resultVar1)) 7786 ext.Error.Set(span, true) 7787 } 7788 7789 return resultVar0, resultVar1 7790 } 7791 7792 func (a *OpenTracingAppLayer) GetTeamByInviteId(inviteId string) (*model.Team, *model.AppError) { 7793 origCtx := a.ctx 7794 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByInviteId") 7795 7796 a.ctx = newCtx 7797 a.app.Srv().Store.SetContext(newCtx) 7798 defer func() { 7799 a.app.Srv().Store.SetContext(origCtx) 7800 a.ctx = origCtx 7801 }() 7802 7803 defer span.Finish() 7804 resultVar0, resultVar1 := a.app.GetTeamByInviteId(inviteId) 7805 7806 if resultVar1 != nil { 7807 span.LogFields(spanlog.Error(resultVar1)) 7808 ext.Error.Set(span, true) 7809 } 7810 7811 return resultVar0, resultVar1 7812 } 7813 7814 func (a *OpenTracingAppLayer) GetTeamByName(name string) (*model.Team, *model.AppError) { 7815 origCtx := a.ctx 7816 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamByName") 7817 7818 a.ctx = newCtx 7819 a.app.Srv().Store.SetContext(newCtx) 7820 defer func() { 7821 a.app.Srv().Store.SetContext(origCtx) 7822 a.ctx = origCtx 7823 }() 7824 7825 defer span.Finish() 7826 resultVar0, resultVar1 := a.app.GetTeamByName(name) 7827 7828 if resultVar1 != nil { 7829 span.LogFields(spanlog.Error(resultVar1)) 7830 ext.Error.Set(span, true) 7831 } 7832 7833 return resultVar0, resultVar1 7834 } 7835 7836 func (a *OpenTracingAppLayer) GetTeamGroupUsers(teamID string) ([]*model.User, *model.AppError) { 7837 origCtx := a.ctx 7838 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamGroupUsers") 7839 7840 a.ctx = newCtx 7841 a.app.Srv().Store.SetContext(newCtx) 7842 defer func() { 7843 a.app.Srv().Store.SetContext(origCtx) 7844 a.ctx = origCtx 7845 }() 7846 7847 defer span.Finish() 7848 resultVar0, resultVar1 := a.app.GetTeamGroupUsers(teamID) 7849 7850 if resultVar1 != nil { 7851 span.LogFields(spanlog.Error(resultVar1)) 7852 ext.Error.Set(span, true) 7853 } 7854 7855 return resultVar0, resultVar1 7856 } 7857 7858 func (a *OpenTracingAppLayer) GetTeamIcon(team *model.Team) ([]byte, *model.AppError) { 7859 origCtx := a.ctx 7860 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIcon") 7861 7862 a.ctx = newCtx 7863 a.app.Srv().Store.SetContext(newCtx) 7864 defer func() { 7865 a.app.Srv().Store.SetContext(origCtx) 7866 a.ctx = origCtx 7867 }() 7868 7869 defer span.Finish() 7870 resultVar0, resultVar1 := a.app.GetTeamIcon(team) 7871 7872 if resultVar1 != nil { 7873 span.LogFields(spanlog.Error(resultVar1)) 7874 ext.Error.Set(span, true) 7875 } 7876 7877 return resultVar0, resultVar1 7878 } 7879 7880 func (a *OpenTracingAppLayer) GetTeamIdFromQuery(query url.Values) (string, *model.AppError) { 7881 origCtx := a.ctx 7882 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamIdFromQuery") 7883 7884 a.ctx = newCtx 7885 a.app.Srv().Store.SetContext(newCtx) 7886 defer func() { 7887 a.app.Srv().Store.SetContext(origCtx) 7888 a.ctx = origCtx 7889 }() 7890 7891 defer span.Finish() 7892 resultVar0, resultVar1 := a.app.GetTeamIdFromQuery(query) 7893 7894 if resultVar1 != nil { 7895 span.LogFields(spanlog.Error(resultVar1)) 7896 ext.Error.Set(span, true) 7897 } 7898 7899 return resultVar0, resultVar1 7900 } 7901 7902 func (a *OpenTracingAppLayer) GetTeamMember(teamId string, userId string) (*model.TeamMember, *model.AppError) { 7903 origCtx := a.ctx 7904 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMember") 7905 7906 a.ctx = newCtx 7907 a.app.Srv().Store.SetContext(newCtx) 7908 defer func() { 7909 a.app.Srv().Store.SetContext(origCtx) 7910 a.ctx = origCtx 7911 }() 7912 7913 defer span.Finish() 7914 resultVar0, resultVar1 := a.app.GetTeamMember(teamId, userId) 7915 7916 if resultVar1 != nil { 7917 span.LogFields(spanlog.Error(resultVar1)) 7918 ext.Error.Set(span, true) 7919 } 7920 7921 return resultVar0, resultVar1 7922 } 7923 7924 func (a *OpenTracingAppLayer) GetTeamMembers(teamId string, offset int, limit int, teamMembersGetOptions *model.TeamMembersGetOptions) ([]*model.TeamMember, *model.AppError) { 7925 origCtx := a.ctx 7926 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembers") 7927 7928 a.ctx = newCtx 7929 a.app.Srv().Store.SetContext(newCtx) 7930 defer func() { 7931 a.app.Srv().Store.SetContext(origCtx) 7932 a.ctx = origCtx 7933 }() 7934 7935 defer span.Finish() 7936 resultVar0, resultVar1 := a.app.GetTeamMembers(teamId, offset, limit, teamMembersGetOptions) 7937 7938 if resultVar1 != nil { 7939 span.LogFields(spanlog.Error(resultVar1)) 7940 ext.Error.Set(span, true) 7941 } 7942 7943 return resultVar0, resultVar1 7944 } 7945 7946 func (a *OpenTracingAppLayer) GetTeamMembersByIds(teamId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.TeamMember, *model.AppError) { 7947 origCtx := a.ctx 7948 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersByIds") 7949 7950 a.ctx = newCtx 7951 a.app.Srv().Store.SetContext(newCtx) 7952 defer func() { 7953 a.app.Srv().Store.SetContext(origCtx) 7954 a.ctx = origCtx 7955 }() 7956 7957 defer span.Finish() 7958 resultVar0, resultVar1 := a.app.GetTeamMembersByIds(teamId, userIds, restrictions) 7959 7960 if resultVar1 != nil { 7961 span.LogFields(spanlog.Error(resultVar1)) 7962 ext.Error.Set(span, true) 7963 } 7964 7965 return resultVar0, resultVar1 7966 } 7967 7968 func (a *OpenTracingAppLayer) GetTeamMembersForUser(userId string) ([]*model.TeamMember, *model.AppError) { 7969 origCtx := a.ctx 7970 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUser") 7971 7972 a.ctx = newCtx 7973 a.app.Srv().Store.SetContext(newCtx) 7974 defer func() { 7975 a.app.Srv().Store.SetContext(origCtx) 7976 a.ctx = origCtx 7977 }() 7978 7979 defer span.Finish() 7980 resultVar0, resultVar1 := a.app.GetTeamMembersForUser(userId) 7981 7982 if resultVar1 != nil { 7983 span.LogFields(spanlog.Error(resultVar1)) 7984 ext.Error.Set(span, true) 7985 } 7986 7987 return resultVar0, resultVar1 7988 } 7989 7990 func (a *OpenTracingAppLayer) GetTeamMembersForUserWithPagination(userId string, page int, perPage int) ([]*model.TeamMember, *model.AppError) { 7991 origCtx := a.ctx 7992 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamMembersForUserWithPagination") 7993 7994 a.ctx = newCtx 7995 a.app.Srv().Store.SetContext(newCtx) 7996 defer func() { 7997 a.app.Srv().Store.SetContext(origCtx) 7998 a.ctx = origCtx 7999 }() 8000 8001 defer span.Finish() 8002 resultVar0, resultVar1 := a.app.GetTeamMembersForUserWithPagination(userId, page, perPage) 8003 8004 if resultVar1 != nil { 8005 span.LogFields(spanlog.Error(resultVar1)) 8006 ext.Error.Set(span, true) 8007 } 8008 8009 return resultVar0, resultVar1 8010 } 8011 8012 func (a *OpenTracingAppLayer) GetTeamSchemeChannelRoles(teamId string) (guestRoleName string, userRoleName string, adminRoleName string, err *model.AppError) { 8013 origCtx := a.ctx 8014 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamSchemeChannelRoles") 8015 8016 a.ctx = newCtx 8017 a.app.Srv().Store.SetContext(newCtx) 8018 defer func() { 8019 a.app.Srv().Store.SetContext(origCtx) 8020 a.ctx = origCtx 8021 }() 8022 8023 defer span.Finish() 8024 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.GetTeamSchemeChannelRoles(teamId) 8025 8026 if resultVar3 != nil { 8027 span.LogFields(spanlog.Error(resultVar3)) 8028 ext.Error.Set(span, true) 8029 } 8030 8031 return resultVar0, resultVar1, resultVar2, resultVar3 8032 } 8033 8034 func (a *OpenTracingAppLayer) GetTeamStats(teamId string, restrictions *model.ViewUsersRestrictions) (*model.TeamStats, *model.AppError) { 8035 origCtx := a.ctx 8036 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamStats") 8037 8038 a.ctx = newCtx 8039 a.app.Srv().Store.SetContext(newCtx) 8040 defer func() { 8041 a.app.Srv().Store.SetContext(origCtx) 8042 a.ctx = origCtx 8043 }() 8044 8045 defer span.Finish() 8046 resultVar0, resultVar1 := a.app.GetTeamStats(teamId, restrictions) 8047 8048 if resultVar1 != nil { 8049 span.LogFields(spanlog.Error(resultVar1)) 8050 ext.Error.Set(span, true) 8051 } 8052 8053 return resultVar0, resultVar1 8054 } 8055 8056 func (a *OpenTracingAppLayer) GetTeamUnread(teamId string, userId string) (*model.TeamUnread, *model.AppError) { 8057 origCtx := a.ctx 8058 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamUnread") 8059 8060 a.ctx = newCtx 8061 a.app.Srv().Store.SetContext(newCtx) 8062 defer func() { 8063 a.app.Srv().Store.SetContext(origCtx) 8064 a.ctx = origCtx 8065 }() 8066 8067 defer span.Finish() 8068 resultVar0, resultVar1 := a.app.GetTeamUnread(teamId, userId) 8069 8070 if resultVar1 != nil { 8071 span.LogFields(spanlog.Error(resultVar1)) 8072 ext.Error.Set(span, true) 8073 } 8074 8075 return resultVar0, resultVar1 8076 } 8077 8078 func (a *OpenTracingAppLayer) GetTeamsForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Team, *model.AppError) { 8079 origCtx := a.ctx 8080 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForScheme") 8081 8082 a.ctx = newCtx 8083 a.app.Srv().Store.SetContext(newCtx) 8084 defer func() { 8085 a.app.Srv().Store.SetContext(origCtx) 8086 a.ctx = origCtx 8087 }() 8088 8089 defer span.Finish() 8090 resultVar0, resultVar1 := a.app.GetTeamsForScheme(scheme, offset, limit) 8091 8092 if resultVar1 != nil { 8093 span.LogFields(spanlog.Error(resultVar1)) 8094 ext.Error.Set(span, true) 8095 } 8096 8097 return resultVar0, resultVar1 8098 } 8099 8100 func (a *OpenTracingAppLayer) GetTeamsForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Team, *model.AppError) { 8101 origCtx := a.ctx 8102 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForSchemePage") 8103 8104 a.ctx = newCtx 8105 a.app.Srv().Store.SetContext(newCtx) 8106 defer func() { 8107 a.app.Srv().Store.SetContext(origCtx) 8108 a.ctx = origCtx 8109 }() 8110 8111 defer span.Finish() 8112 resultVar0, resultVar1 := a.app.GetTeamsForSchemePage(scheme, page, perPage) 8113 8114 if resultVar1 != nil { 8115 span.LogFields(spanlog.Error(resultVar1)) 8116 ext.Error.Set(span, true) 8117 } 8118 8119 return resultVar0, resultVar1 8120 } 8121 8122 func (a *OpenTracingAppLayer) GetTeamsForUser(userId string) ([]*model.Team, *model.AppError) { 8123 origCtx := a.ctx 8124 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsForUser") 8125 8126 a.ctx = newCtx 8127 a.app.Srv().Store.SetContext(newCtx) 8128 defer func() { 8129 a.app.Srv().Store.SetContext(origCtx) 8130 a.ctx = origCtx 8131 }() 8132 8133 defer span.Finish() 8134 resultVar0, resultVar1 := a.app.GetTeamsForUser(userId) 8135 8136 if resultVar1 != nil { 8137 span.LogFields(spanlog.Error(resultVar1)) 8138 ext.Error.Set(span, true) 8139 } 8140 8141 return resultVar0, resultVar1 8142 } 8143 8144 func (a *OpenTracingAppLayer) GetTeamsUnreadForUser(excludeTeamId string, userId string) ([]*model.TeamUnread, *model.AppError) { 8145 origCtx := a.ctx 8146 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTeamsUnreadForUser") 8147 8148 a.ctx = newCtx 8149 a.app.Srv().Store.SetContext(newCtx) 8150 defer func() { 8151 a.app.Srv().Store.SetContext(origCtx) 8152 a.ctx = origCtx 8153 }() 8154 8155 defer span.Finish() 8156 resultVar0, resultVar1 := a.app.GetTeamsUnreadForUser(excludeTeamId, userId) 8157 8158 if resultVar1 != nil { 8159 span.LogFields(spanlog.Error(resultVar1)) 8160 ext.Error.Set(span, true) 8161 } 8162 8163 return resultVar0, resultVar1 8164 } 8165 8166 func (a *OpenTracingAppLayer) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) { 8167 origCtx := a.ctx 8168 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTermsOfService") 8169 8170 a.ctx = newCtx 8171 a.app.Srv().Store.SetContext(newCtx) 8172 defer func() { 8173 a.app.Srv().Store.SetContext(origCtx) 8174 a.ctx = origCtx 8175 }() 8176 8177 defer span.Finish() 8178 resultVar0, resultVar1 := a.app.GetTermsOfService(id) 8179 8180 if resultVar1 != nil { 8181 span.LogFields(spanlog.Error(resultVar1)) 8182 ext.Error.Set(span, true) 8183 } 8184 8185 return resultVar0, resultVar1 8186 } 8187 8188 func (a *OpenTracingAppLayer) GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) { 8189 origCtx := a.ctx 8190 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTotalUsersStats") 8191 8192 a.ctx = newCtx 8193 a.app.Srv().Store.SetContext(newCtx) 8194 defer func() { 8195 a.app.Srv().Store.SetContext(origCtx) 8196 a.ctx = origCtx 8197 }() 8198 8199 defer span.Finish() 8200 resultVar0, resultVar1 := a.app.GetTotalUsersStats(viewRestrictions) 8201 8202 if resultVar1 != nil { 8203 span.LogFields(spanlog.Error(resultVar1)) 8204 ext.Error.Set(span, true) 8205 } 8206 8207 return resultVar0, resultVar1 8208 } 8209 8210 func (a *OpenTracingAppLayer) GetUser(userId string) (*model.User, *model.AppError) { 8211 origCtx := a.ctx 8212 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUser") 8213 8214 a.ctx = newCtx 8215 a.app.Srv().Store.SetContext(newCtx) 8216 defer func() { 8217 a.app.Srv().Store.SetContext(origCtx) 8218 a.ctx = origCtx 8219 }() 8220 8221 defer span.Finish() 8222 resultVar0, resultVar1 := a.app.GetUser(userId) 8223 8224 if resultVar1 != nil { 8225 span.LogFields(spanlog.Error(resultVar1)) 8226 ext.Error.Set(span, true) 8227 } 8228 8229 return resultVar0, resultVar1 8230 } 8231 8232 func (a *OpenTracingAppLayer) GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) { 8233 origCtx := a.ctx 8234 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessToken") 8235 8236 a.ctx = newCtx 8237 a.app.Srv().Store.SetContext(newCtx) 8238 defer func() { 8239 a.app.Srv().Store.SetContext(origCtx) 8240 a.ctx = origCtx 8241 }() 8242 8243 defer span.Finish() 8244 resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenId, sanitize) 8245 8246 if resultVar1 != nil { 8247 span.LogFields(spanlog.Error(resultVar1)) 8248 ext.Error.Set(span, true) 8249 } 8250 8251 return resultVar0, resultVar1 8252 } 8253 8254 func (a *OpenTracingAppLayer) GetUserAccessTokens(page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 8255 origCtx := a.ctx 8256 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokens") 8257 8258 a.ctx = newCtx 8259 a.app.Srv().Store.SetContext(newCtx) 8260 defer func() { 8261 a.app.Srv().Store.SetContext(origCtx) 8262 a.ctx = origCtx 8263 }() 8264 8265 defer span.Finish() 8266 resultVar0, resultVar1 := a.app.GetUserAccessTokens(page, perPage) 8267 8268 if resultVar1 != nil { 8269 span.LogFields(spanlog.Error(resultVar1)) 8270 ext.Error.Set(span, true) 8271 } 8272 8273 return resultVar0, resultVar1 8274 } 8275 8276 func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userId string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 8277 origCtx := a.ctx 8278 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokensForUser") 8279 8280 a.ctx = newCtx 8281 a.app.Srv().Store.SetContext(newCtx) 8282 defer func() { 8283 a.app.Srv().Store.SetContext(origCtx) 8284 a.ctx = origCtx 8285 }() 8286 8287 defer span.Finish() 8288 resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userId, page, perPage) 8289 8290 if resultVar1 != nil { 8291 span.LogFields(spanlog.Error(resultVar1)) 8292 ext.Error.Set(span, true) 8293 } 8294 8295 return resultVar0, resultVar1 8296 } 8297 8298 func (a *OpenTracingAppLayer) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) { 8299 origCtx := a.ctx 8300 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByAuth") 8301 8302 a.ctx = newCtx 8303 a.app.Srv().Store.SetContext(newCtx) 8304 defer func() { 8305 a.app.Srv().Store.SetContext(origCtx) 8306 a.ctx = origCtx 8307 }() 8308 8309 defer span.Finish() 8310 resultVar0, resultVar1 := a.app.GetUserByAuth(authData, authService) 8311 8312 if resultVar1 != nil { 8313 span.LogFields(spanlog.Error(resultVar1)) 8314 ext.Error.Set(span, true) 8315 } 8316 8317 return resultVar0, resultVar1 8318 } 8319 8320 func (a *OpenTracingAppLayer) GetUserByEmail(email string) (*model.User, *model.AppError) { 8321 origCtx := a.ctx 8322 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByEmail") 8323 8324 a.ctx = newCtx 8325 a.app.Srv().Store.SetContext(newCtx) 8326 defer func() { 8327 a.app.Srv().Store.SetContext(origCtx) 8328 a.ctx = origCtx 8329 }() 8330 8331 defer span.Finish() 8332 resultVar0, resultVar1 := a.app.GetUserByEmail(email) 8333 8334 if resultVar1 != nil { 8335 span.LogFields(spanlog.Error(resultVar1)) 8336 ext.Error.Set(span, true) 8337 } 8338 8339 return resultVar0, resultVar1 8340 } 8341 8342 func (a *OpenTracingAppLayer) GetUserByUsername(username string) (*model.User, *model.AppError) { 8343 origCtx := a.ctx 8344 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByUsername") 8345 8346 a.ctx = newCtx 8347 a.app.Srv().Store.SetContext(newCtx) 8348 defer func() { 8349 a.app.Srv().Store.SetContext(origCtx) 8350 a.ctx = origCtx 8351 }() 8352 8353 defer span.Finish() 8354 resultVar0, resultVar1 := a.app.GetUserByUsername(username) 8355 8356 if resultVar1 != nil { 8357 span.LogFields(spanlog.Error(resultVar1)) 8358 ext.Error.Set(span, true) 8359 } 8360 8361 return resultVar0, resultVar1 8362 } 8363 8364 func (a *OpenTracingAppLayer) GetUserForLogin(id string, loginId string) (*model.User, *model.AppError) { 8365 origCtx := a.ctx 8366 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserForLogin") 8367 8368 a.ctx = newCtx 8369 a.app.Srv().Store.SetContext(newCtx) 8370 defer func() { 8371 a.app.Srv().Store.SetContext(origCtx) 8372 a.ctx = origCtx 8373 }() 8374 8375 defer span.Finish() 8376 resultVar0, resultVar1 := a.app.GetUserForLogin(id, loginId) 8377 8378 if resultVar1 != nil { 8379 span.LogFields(spanlog.Error(resultVar1)) 8380 ext.Error.Set(span, true) 8381 } 8382 8383 return resultVar0, resultVar1 8384 } 8385 8386 func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { 8387 origCtx := a.ctx 8388 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserStatusesByIds") 8389 8390 a.ctx = newCtx 8391 a.app.Srv().Store.SetContext(newCtx) 8392 defer func() { 8393 a.app.Srv().Store.SetContext(origCtx) 8394 a.ctx = origCtx 8395 }() 8396 8397 defer span.Finish() 8398 resultVar0, resultVar1 := a.app.GetUserStatusesByIds(userIds) 8399 8400 if resultVar1 != nil { 8401 span.LogFields(spanlog.Error(resultVar1)) 8402 ext.Error.Set(span, true) 8403 } 8404 8405 return resultVar0, resultVar1 8406 } 8407 8408 func (a *OpenTracingAppLayer) GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) { 8409 origCtx := a.ctx 8410 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserTermsOfService") 8411 8412 a.ctx = newCtx 8413 a.app.Srv().Store.SetContext(newCtx) 8414 defer func() { 8415 a.app.Srv().Store.SetContext(origCtx) 8416 a.ctx = origCtx 8417 }() 8418 8419 defer span.Finish() 8420 resultVar0, resultVar1 := a.app.GetUserTermsOfService(userId) 8421 8422 if resultVar1 != nil { 8423 span.LogFields(spanlog.Error(resultVar1)) 8424 ext.Error.Set(span, true) 8425 } 8426 8427 return resultVar0, resultVar1 8428 } 8429 8430 func (a *OpenTracingAppLayer) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 8431 origCtx := a.ctx 8432 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsers") 8433 8434 a.ctx = newCtx 8435 a.app.Srv().Store.SetContext(newCtx) 8436 defer func() { 8437 a.app.Srv().Store.SetContext(origCtx) 8438 a.ctx = origCtx 8439 }() 8440 8441 defer span.Finish() 8442 resultVar0, resultVar1 := a.app.GetUsers(options) 8443 8444 if resultVar1 != nil { 8445 span.LogFields(spanlog.Error(resultVar1)) 8446 ext.Error.Set(span, true) 8447 } 8448 8449 return resultVar0, resultVar1 8450 } 8451 8452 func (a *OpenTracingAppLayer) GetUsersByGroupChannelIds(channelIds []string, asAdmin bool) (map[string][]*model.User, *model.AppError) { 8453 origCtx := a.ctx 8454 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByGroupChannelIds") 8455 8456 a.ctx = newCtx 8457 a.app.Srv().Store.SetContext(newCtx) 8458 defer func() { 8459 a.app.Srv().Store.SetContext(origCtx) 8460 a.ctx = origCtx 8461 }() 8462 8463 defer span.Finish() 8464 resultVar0, resultVar1 := a.app.GetUsersByGroupChannelIds(channelIds, asAdmin) 8465 8466 if resultVar1 != nil { 8467 span.LogFields(spanlog.Error(resultVar1)) 8468 ext.Error.Set(span, true) 8469 } 8470 8471 return resultVar0, resultVar1 8472 } 8473 8474 func (a *OpenTracingAppLayer) GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { 8475 origCtx := a.ctx 8476 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByIds") 8477 8478 a.ctx = newCtx 8479 a.app.Srv().Store.SetContext(newCtx) 8480 defer func() { 8481 a.app.Srv().Store.SetContext(origCtx) 8482 a.ctx = origCtx 8483 }() 8484 8485 defer span.Finish() 8486 resultVar0, resultVar1 := a.app.GetUsersByIds(userIds, options) 8487 8488 if resultVar1 != nil { 8489 span.LogFields(spanlog.Error(resultVar1)) 8490 ext.Error.Set(span, true) 8491 } 8492 8493 return resultVar0, resultVar1 8494 } 8495 8496 func (a *OpenTracingAppLayer) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 8497 origCtx := a.ctx 8498 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByUsernames") 8499 8500 a.ctx = newCtx 8501 a.app.Srv().Store.SetContext(newCtx) 8502 defer func() { 8503 a.app.Srv().Store.SetContext(origCtx) 8504 a.ctx = origCtx 8505 }() 8506 8507 defer span.Finish() 8508 resultVar0, resultVar1 := a.app.GetUsersByUsernames(usernames, asAdmin, viewRestrictions) 8509 8510 if resultVar1 != nil { 8511 span.LogFields(spanlog.Error(resultVar1)) 8512 ext.Error.Set(span, true) 8513 } 8514 8515 return resultVar0, resultVar1 8516 } 8517 8518 func (a *OpenTracingAppLayer) GetUsersEtag(restrictionsHash string) string { 8519 origCtx := a.ctx 8520 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersEtag") 8521 8522 a.ctx = newCtx 8523 a.app.Srv().Store.SetContext(newCtx) 8524 defer func() { 8525 a.app.Srv().Store.SetContext(origCtx) 8526 a.ctx = origCtx 8527 }() 8528 8529 defer span.Finish() 8530 resultVar0 := a.app.GetUsersEtag(restrictionsHash) 8531 8532 return resultVar0 8533 } 8534 8535 func (a *OpenTracingAppLayer) GetUsersInChannel(channelId string, offset int, limit int) ([]*model.User, *model.AppError) { 8536 origCtx := a.ctx 8537 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannel") 8538 8539 a.ctx = newCtx 8540 a.app.Srv().Store.SetContext(newCtx) 8541 defer func() { 8542 a.app.Srv().Store.SetContext(origCtx) 8543 a.ctx = origCtx 8544 }() 8545 8546 defer span.Finish() 8547 resultVar0, resultVar1 := a.app.GetUsersInChannel(channelId, offset, limit) 8548 8549 if resultVar1 != nil { 8550 span.LogFields(spanlog.Error(resultVar1)) 8551 ext.Error.Set(span, true) 8552 } 8553 8554 return resultVar0, resultVar1 8555 } 8556 8557 func (a *OpenTracingAppLayer) GetUsersInChannelByStatus(channelId string, offset int, limit int) ([]*model.User, *model.AppError) { 8558 origCtx := a.ctx 8559 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelByStatus") 8560 8561 a.ctx = newCtx 8562 a.app.Srv().Store.SetContext(newCtx) 8563 defer func() { 8564 a.app.Srv().Store.SetContext(origCtx) 8565 a.ctx = origCtx 8566 }() 8567 8568 defer span.Finish() 8569 resultVar0, resultVar1 := a.app.GetUsersInChannelByStatus(channelId, offset, limit) 8570 8571 if resultVar1 != nil { 8572 span.LogFields(spanlog.Error(resultVar1)) 8573 ext.Error.Set(span, true) 8574 } 8575 8576 return resultVar0, resultVar1 8577 } 8578 8579 func (a *OpenTracingAppLayer) GetUsersInChannelMap(channelId string, offset int, limit int, asAdmin bool) (map[string]*model.User, *model.AppError) { 8580 origCtx := a.ctx 8581 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelMap") 8582 8583 a.ctx = newCtx 8584 a.app.Srv().Store.SetContext(newCtx) 8585 defer func() { 8586 a.app.Srv().Store.SetContext(origCtx) 8587 a.ctx = origCtx 8588 }() 8589 8590 defer span.Finish() 8591 resultVar0, resultVar1 := a.app.GetUsersInChannelMap(channelId, offset, limit, asAdmin) 8592 8593 if resultVar1 != nil { 8594 span.LogFields(spanlog.Error(resultVar1)) 8595 ext.Error.Set(span, true) 8596 } 8597 8598 return resultVar0, resultVar1 8599 } 8600 8601 func (a *OpenTracingAppLayer) GetUsersInChannelPage(channelId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) { 8602 origCtx := a.ctx 8603 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPage") 8604 8605 a.ctx = newCtx 8606 a.app.Srv().Store.SetContext(newCtx) 8607 defer func() { 8608 a.app.Srv().Store.SetContext(origCtx) 8609 a.ctx = origCtx 8610 }() 8611 8612 defer span.Finish() 8613 resultVar0, resultVar1 := a.app.GetUsersInChannelPage(channelId, page, perPage, asAdmin) 8614 8615 if resultVar1 != nil { 8616 span.LogFields(spanlog.Error(resultVar1)) 8617 ext.Error.Set(span, true) 8618 } 8619 8620 return resultVar0, resultVar1 8621 } 8622 8623 func (a *OpenTracingAppLayer) GetUsersInChannelPageByStatus(channelId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) { 8624 origCtx := a.ctx 8625 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInChannelPageByStatus") 8626 8627 a.ctx = newCtx 8628 a.app.Srv().Store.SetContext(newCtx) 8629 defer func() { 8630 a.app.Srv().Store.SetContext(origCtx) 8631 a.ctx = origCtx 8632 }() 8633 8634 defer span.Finish() 8635 resultVar0, resultVar1 := a.app.GetUsersInChannelPageByStatus(channelId, page, perPage, asAdmin) 8636 8637 if resultVar1 != nil { 8638 span.LogFields(spanlog.Error(resultVar1)) 8639 ext.Error.Set(span, true) 8640 } 8641 8642 return resultVar0, resultVar1 8643 } 8644 8645 func (a *OpenTracingAppLayer) GetUsersInTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 8646 origCtx := a.ctx 8647 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeam") 8648 8649 a.ctx = newCtx 8650 a.app.Srv().Store.SetContext(newCtx) 8651 defer func() { 8652 a.app.Srv().Store.SetContext(origCtx) 8653 a.ctx = origCtx 8654 }() 8655 8656 defer span.Finish() 8657 resultVar0, resultVar1 := a.app.GetUsersInTeam(options) 8658 8659 if resultVar1 != nil { 8660 span.LogFields(spanlog.Error(resultVar1)) 8661 ext.Error.Set(span, true) 8662 } 8663 8664 return resultVar0, resultVar1 8665 } 8666 8667 func (a *OpenTracingAppLayer) GetUsersInTeamEtag(teamId string, restrictionsHash string) string { 8668 origCtx := a.ctx 8669 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamEtag") 8670 8671 a.ctx = newCtx 8672 a.app.Srv().Store.SetContext(newCtx) 8673 defer func() { 8674 a.app.Srv().Store.SetContext(origCtx) 8675 a.ctx = origCtx 8676 }() 8677 8678 defer span.Finish() 8679 resultVar0 := a.app.GetUsersInTeamEtag(teamId, restrictionsHash) 8680 8681 return resultVar0 8682 } 8683 8684 func (a *OpenTracingAppLayer) GetUsersInTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 8685 origCtx := a.ctx 8686 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInTeamPage") 8687 8688 a.ctx = newCtx 8689 a.app.Srv().Store.SetContext(newCtx) 8690 defer func() { 8691 a.app.Srv().Store.SetContext(origCtx) 8692 a.ctx = origCtx 8693 }() 8694 8695 defer span.Finish() 8696 resultVar0, resultVar1 := a.app.GetUsersInTeamPage(options, asAdmin) 8697 8698 if resultVar1 != nil { 8699 span.LogFields(spanlog.Error(resultVar1)) 8700 ext.Error.Set(span, true) 8701 } 8702 8703 return resultVar0, resultVar1 8704 } 8705 8706 func (a *OpenTracingAppLayer) GetUsersNotInChannel(teamId string, channelId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 8707 origCtx := a.ctx 8708 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannel") 8709 8710 a.ctx = newCtx 8711 a.app.Srv().Store.SetContext(newCtx) 8712 defer func() { 8713 a.app.Srv().Store.SetContext(origCtx) 8714 a.ctx = origCtx 8715 }() 8716 8717 defer span.Finish() 8718 resultVar0, resultVar1 := a.app.GetUsersNotInChannel(teamId, channelId, groupConstrained, offset, limit, viewRestrictions) 8719 8720 if resultVar1 != nil { 8721 span.LogFields(spanlog.Error(resultVar1)) 8722 ext.Error.Set(span, true) 8723 } 8724 8725 return resultVar0, resultVar1 8726 } 8727 8728 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) { 8729 origCtx := a.ctx 8730 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelMap") 8731 8732 a.ctx = newCtx 8733 a.app.Srv().Store.SetContext(newCtx) 8734 defer func() { 8735 a.app.Srv().Store.SetContext(origCtx) 8736 a.ctx = origCtx 8737 }() 8738 8739 defer span.Finish() 8740 resultVar0, resultVar1 := a.app.GetUsersNotInChannelMap(teamId, channelId, groupConstrained, offset, limit, asAdmin, viewRestrictions) 8741 8742 if resultVar1 != nil { 8743 span.LogFields(spanlog.Error(resultVar1)) 8744 ext.Error.Set(span, true) 8745 } 8746 8747 return resultVar0, resultVar1 8748 } 8749 8750 func (a *OpenTracingAppLayer) GetUsersNotInChannelPage(teamId string, channelId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 8751 origCtx := a.ctx 8752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInChannelPage") 8753 8754 a.ctx = newCtx 8755 a.app.Srv().Store.SetContext(newCtx) 8756 defer func() { 8757 a.app.Srv().Store.SetContext(origCtx) 8758 a.ctx = origCtx 8759 }() 8760 8761 defer span.Finish() 8762 resultVar0, resultVar1 := a.app.GetUsersNotInChannelPage(teamId, channelId, groupConstrained, page, perPage, asAdmin, viewRestrictions) 8763 8764 if resultVar1 != nil { 8765 span.LogFields(spanlog.Error(resultVar1)) 8766 ext.Error.Set(span, true) 8767 } 8768 8769 return resultVar0, resultVar1 8770 } 8771 8772 func (a *OpenTracingAppLayer) GetUsersNotInTeam(teamId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 8773 origCtx := a.ctx 8774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeam") 8775 8776 a.ctx = newCtx 8777 a.app.Srv().Store.SetContext(newCtx) 8778 defer func() { 8779 a.app.Srv().Store.SetContext(origCtx) 8780 a.ctx = origCtx 8781 }() 8782 8783 defer span.Finish() 8784 resultVar0, resultVar1 := a.app.GetUsersNotInTeam(teamId, groupConstrained, offset, limit, viewRestrictions) 8785 8786 if resultVar1 != nil { 8787 span.LogFields(spanlog.Error(resultVar1)) 8788 ext.Error.Set(span, true) 8789 } 8790 8791 return resultVar0, resultVar1 8792 } 8793 8794 func (a *OpenTracingAppLayer) GetUsersNotInTeamEtag(teamId string, restrictionsHash string) string { 8795 origCtx := a.ctx 8796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamEtag") 8797 8798 a.ctx = newCtx 8799 a.app.Srv().Store.SetContext(newCtx) 8800 defer func() { 8801 a.app.Srv().Store.SetContext(origCtx) 8802 a.ctx = origCtx 8803 }() 8804 8805 defer span.Finish() 8806 resultVar0 := a.app.GetUsersNotInTeamEtag(teamId, restrictionsHash) 8807 8808 return resultVar0 8809 } 8810 8811 func (a *OpenTracingAppLayer) GetUsersNotInTeamPage(teamId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 8812 origCtx := a.ctx 8813 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInTeamPage") 8814 8815 a.ctx = newCtx 8816 a.app.Srv().Store.SetContext(newCtx) 8817 defer func() { 8818 a.app.Srv().Store.SetContext(origCtx) 8819 a.ctx = origCtx 8820 }() 8821 8822 defer span.Finish() 8823 resultVar0, resultVar1 := a.app.GetUsersNotInTeamPage(teamId, groupConstrained, page, perPage, asAdmin, viewRestrictions) 8824 8825 if resultVar1 != nil { 8826 span.LogFields(spanlog.Error(resultVar1)) 8827 ext.Error.Set(span, true) 8828 } 8829 8830 return resultVar0, resultVar1 8831 } 8832 8833 func (a *OpenTracingAppLayer) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 8834 origCtx := a.ctx 8835 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersPage") 8836 8837 a.ctx = newCtx 8838 a.app.Srv().Store.SetContext(newCtx) 8839 defer func() { 8840 a.app.Srv().Store.SetContext(origCtx) 8841 a.ctx = origCtx 8842 }() 8843 8844 defer span.Finish() 8845 resultVar0, resultVar1 := a.app.GetUsersPage(options, asAdmin) 8846 8847 if resultVar1 != nil { 8848 span.LogFields(spanlog.Error(resultVar1)) 8849 ext.Error.Set(span, true) 8850 } 8851 8852 return resultVar0, resultVar1 8853 } 8854 8855 func (a *OpenTracingAppLayer) GetUsersWithoutTeam(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 8856 origCtx := a.ctx 8857 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeam") 8858 8859 a.ctx = newCtx 8860 a.app.Srv().Store.SetContext(newCtx) 8861 defer func() { 8862 a.app.Srv().Store.SetContext(origCtx) 8863 a.ctx = origCtx 8864 }() 8865 8866 defer span.Finish() 8867 resultVar0, resultVar1 := a.app.GetUsersWithoutTeam(options) 8868 8869 if resultVar1 != nil { 8870 span.LogFields(spanlog.Error(resultVar1)) 8871 ext.Error.Set(span, true) 8872 } 8873 8874 return resultVar0, resultVar1 8875 } 8876 8877 func (a *OpenTracingAppLayer) GetUsersWithoutTeamPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 8878 origCtx := a.ctx 8879 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutTeamPage") 8880 8881 a.ctx = newCtx 8882 a.app.Srv().Store.SetContext(newCtx) 8883 defer func() { 8884 a.app.Srv().Store.SetContext(origCtx) 8885 a.ctx = origCtx 8886 }() 8887 8888 defer span.Finish() 8889 resultVar0, resultVar1 := a.app.GetUsersWithoutTeamPage(options, asAdmin) 8890 8891 if resultVar1 != nil { 8892 span.LogFields(spanlog.Error(resultVar1)) 8893 ext.Error.Set(span, true) 8894 } 8895 8896 return resultVar0, resultVar1 8897 } 8898 8899 func (a *OpenTracingAppLayer) GetVerifyEmailToken(token string) (*model.Token, *model.AppError) { 8900 origCtx := a.ctx 8901 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetVerifyEmailToken") 8902 8903 a.ctx = newCtx 8904 a.app.Srv().Store.SetContext(newCtx) 8905 defer func() { 8906 a.app.Srv().Store.SetContext(origCtx) 8907 a.ctx = origCtx 8908 }() 8909 8910 defer span.Finish() 8911 resultVar0, resultVar1 := a.app.GetVerifyEmailToken(token) 8912 8913 if resultVar1 != nil { 8914 span.LogFields(spanlog.Error(resultVar1)) 8915 ext.Error.Set(span, true) 8916 } 8917 8918 return resultVar0, resultVar1 8919 } 8920 8921 func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) { 8922 origCtx := a.ctx 8923 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetViewUsersRestrictions") 8924 8925 a.ctx = newCtx 8926 a.app.Srv().Store.SetContext(newCtx) 8927 defer func() { 8928 a.app.Srv().Store.SetContext(origCtx) 8929 a.ctx = origCtx 8930 }() 8931 8932 defer span.Finish() 8933 resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userId) 8934 8935 if resultVar1 != nil { 8936 span.LogFields(spanlog.Error(resultVar1)) 8937 ext.Error.Set(span, true) 8938 } 8939 8940 return resultVar0, resultVar1 8941 } 8942 8943 func (a *OpenTracingAppLayer) GetWarnMetricsStatus() (map[string]*model.WarnMetricStatus, *model.AppError) { 8944 origCtx := a.ctx 8945 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetWarnMetricsStatus") 8946 8947 a.ctx = newCtx 8948 a.app.Srv().Store.SetContext(newCtx) 8949 defer func() { 8950 a.app.Srv().Store.SetContext(origCtx) 8951 a.ctx = origCtx 8952 }() 8953 8954 defer span.Finish() 8955 resultVar0, resultVar1 := a.app.GetWarnMetricsStatus() 8956 8957 if resultVar1 != nil { 8958 span.LogFields(spanlog.Error(resultVar1)) 8959 ext.Error.Set(span, true) 8960 } 8961 8962 return resultVar0, resultVar1 8963 } 8964 8965 func (a *OpenTracingAppLayer) Handle404(w http.ResponseWriter, r *http.Request) { 8966 origCtx := a.ctx 8967 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Handle404") 8968 8969 a.ctx = newCtx 8970 a.app.Srv().Store.SetContext(newCtx) 8971 defer func() { 8972 a.app.Srv().Store.SetContext(origCtx) 8973 a.ctx = origCtx 8974 }() 8975 8976 defer span.Finish() 8977 a.app.Handle404(w, r) 8978 } 8979 8980 func (a *OpenTracingAppLayer) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) { 8981 origCtx := a.ctx 8982 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponse") 8983 8984 a.ctx = newCtx 8985 a.app.Srv().Store.SetContext(newCtx) 8986 defer func() { 8987 a.app.Srv().Store.SetContext(origCtx) 8988 a.ctx = origCtx 8989 }() 8990 8991 defer span.Finish() 8992 resultVar0, resultVar1 := a.app.HandleCommandResponse(command, args, response, builtIn) 8993 8994 if resultVar1 != nil { 8995 span.LogFields(spanlog.Error(resultVar1)) 8996 ext.Error.Set(span, true) 8997 } 8998 8999 return resultVar0, resultVar1 9000 } 9001 9002 func (a *OpenTracingAppLayer) HandleCommandResponsePost(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.Post, *model.AppError) { 9003 origCtx := a.ctx 9004 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponsePost") 9005 9006 a.ctx = newCtx 9007 a.app.Srv().Store.SetContext(newCtx) 9008 defer func() { 9009 a.app.Srv().Store.SetContext(origCtx) 9010 a.ctx = origCtx 9011 }() 9012 9013 defer span.Finish() 9014 resultVar0, resultVar1 := a.app.HandleCommandResponsePost(command, args, response, builtIn) 9015 9016 if resultVar1 != nil { 9017 span.LogFields(spanlog.Error(resultVar1)) 9018 ext.Error.Set(span, true) 9019 } 9020 9021 return resultVar0, resultVar1 9022 } 9023 9024 func (a *OpenTracingAppLayer) HandleCommandWebhook(hookId string, response *model.CommandResponse) *model.AppError { 9025 origCtx := a.ctx 9026 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandWebhook") 9027 9028 a.ctx = newCtx 9029 a.app.Srv().Store.SetContext(newCtx) 9030 defer func() { 9031 a.app.Srv().Store.SetContext(origCtx) 9032 a.ctx = origCtx 9033 }() 9034 9035 defer span.Finish() 9036 resultVar0 := a.app.HandleCommandWebhook(hookId, response) 9037 9038 if resultVar0 != nil { 9039 span.LogFields(spanlog.Error(resultVar0)) 9040 ext.Error.Set(span, true) 9041 } 9042 9043 return resultVar0 9044 } 9045 9046 func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) { 9047 origCtx := a.ctx 9048 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleImages") 9049 9050 a.ctx = newCtx 9051 a.app.Srv().Store.SetContext(newCtx) 9052 defer func() { 9053 a.app.Srv().Store.SetContext(origCtx) 9054 a.ctx = origCtx 9055 }() 9056 9057 defer span.Finish() 9058 a.app.HandleImages(previewPathList, thumbnailPathList, fileData) 9059 } 9060 9061 func (a *OpenTracingAppLayer) HandleIncomingWebhook(hookId string, req *model.IncomingWebhookRequest) *model.AppError { 9062 origCtx := a.ctx 9063 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleIncomingWebhook") 9064 9065 a.ctx = newCtx 9066 a.app.Srv().Store.SetContext(newCtx) 9067 defer func() { 9068 a.app.Srv().Store.SetContext(origCtx) 9069 a.ctx = origCtx 9070 }() 9071 9072 defer span.Finish() 9073 resultVar0 := a.app.HandleIncomingWebhook(hookId, req) 9074 9075 if resultVar0 != nil { 9076 span.LogFields(spanlog.Error(resultVar0)) 9077 ext.Error.Set(span, true) 9078 } 9079 9080 return resultVar0 9081 } 9082 9083 func (a *OpenTracingAppLayer) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) { 9084 origCtx := a.ctx 9085 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleMessageExportConfig") 9086 9087 a.ctx = newCtx 9088 a.app.Srv().Store.SetContext(newCtx) 9089 defer func() { 9090 a.app.Srv().Store.SetContext(origCtx) 9091 a.ctx = origCtx 9092 }() 9093 9094 defer span.Finish() 9095 a.app.HandleMessageExportConfig(cfg, appCfg) 9096 } 9097 9098 func (a *OpenTracingAppLayer) HasPermissionTo(askingUserId string, permission *model.Permission) bool { 9099 origCtx := a.ctx 9100 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionTo") 9101 9102 a.ctx = newCtx 9103 a.app.Srv().Store.SetContext(newCtx) 9104 defer func() { 9105 a.app.Srv().Store.SetContext(origCtx) 9106 a.ctx = origCtx 9107 }() 9108 9109 defer span.Finish() 9110 resultVar0 := a.app.HasPermissionTo(askingUserId, permission) 9111 9112 return resultVar0 9113 } 9114 9115 func (a *OpenTracingAppLayer) HasPermissionToChannel(askingUserId string, channelId string, permission *model.Permission) bool { 9116 origCtx := a.ctx 9117 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannel") 9118 9119 a.ctx = newCtx 9120 a.app.Srv().Store.SetContext(newCtx) 9121 defer func() { 9122 a.app.Srv().Store.SetContext(origCtx) 9123 a.ctx = origCtx 9124 }() 9125 9126 defer span.Finish() 9127 resultVar0 := a.app.HasPermissionToChannel(askingUserId, channelId, permission) 9128 9129 return resultVar0 9130 } 9131 9132 func (a *OpenTracingAppLayer) HasPermissionToChannelByPost(askingUserId string, postId string, permission *model.Permission) bool { 9133 origCtx := a.ctx 9134 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToChannelByPost") 9135 9136 a.ctx = newCtx 9137 a.app.Srv().Store.SetContext(newCtx) 9138 defer func() { 9139 a.app.Srv().Store.SetContext(origCtx) 9140 a.ctx = origCtx 9141 }() 9142 9143 defer span.Finish() 9144 resultVar0 := a.app.HasPermissionToChannelByPost(askingUserId, postId, permission) 9145 9146 return resultVar0 9147 } 9148 9149 func (a *OpenTracingAppLayer) HasPermissionToTeam(askingUserId string, teamId string, permission *model.Permission) bool { 9150 origCtx := a.ctx 9151 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToTeam") 9152 9153 a.ctx = newCtx 9154 a.app.Srv().Store.SetContext(newCtx) 9155 defer func() { 9156 a.app.Srv().Store.SetContext(origCtx) 9157 a.ctx = origCtx 9158 }() 9159 9160 defer span.Finish() 9161 resultVar0 := a.app.HasPermissionToTeam(askingUserId, teamId, permission) 9162 9163 return resultVar0 9164 } 9165 9166 func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userId string) bool { 9167 origCtx := a.ctx 9168 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToUser") 9169 9170 a.ctx = newCtx 9171 a.app.Srv().Store.SetContext(newCtx) 9172 defer func() { 9173 a.app.Srv().Store.SetContext(origCtx) 9174 a.ctx = origCtx 9175 }() 9176 9177 defer span.Finish() 9178 resultVar0 := a.app.HasPermissionToUser(askingUserId, userId) 9179 9180 return resultVar0 9181 } 9182 9183 func (a *OpenTracingAppLayer) HubRegister(webConn *app.WebConn) { 9184 origCtx := a.ctx 9185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubRegister") 9186 9187 a.ctx = newCtx 9188 a.app.Srv().Store.SetContext(newCtx) 9189 defer func() { 9190 a.app.Srv().Store.SetContext(origCtx) 9191 a.ctx = origCtx 9192 }() 9193 9194 defer span.Finish() 9195 a.app.HubRegister(webConn) 9196 } 9197 9198 func (a *OpenTracingAppLayer) HubStart() { 9199 origCtx := a.ctx 9200 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStart") 9201 9202 a.ctx = newCtx 9203 a.app.Srv().Store.SetContext(newCtx) 9204 defer func() { 9205 a.app.Srv().Store.SetContext(origCtx) 9206 a.ctx = origCtx 9207 }() 9208 9209 defer span.Finish() 9210 a.app.HubStart() 9211 } 9212 9213 func (a *OpenTracingAppLayer) HubStop() { 9214 origCtx := a.ctx 9215 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStop") 9216 9217 a.ctx = newCtx 9218 a.app.Srv().Store.SetContext(newCtx) 9219 defer func() { 9220 a.app.Srv().Store.SetContext(origCtx) 9221 a.ctx = origCtx 9222 }() 9223 9224 defer span.Finish() 9225 a.app.HubStop() 9226 } 9227 9228 func (a *OpenTracingAppLayer) HubUnregister(webConn *app.WebConn) { 9229 origCtx := a.ctx 9230 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubUnregister") 9231 9232 a.ctx = newCtx 9233 a.app.Srv().Store.SetContext(newCtx) 9234 defer func() { 9235 a.app.Srv().Store.SetContext(origCtx) 9236 a.ctx = origCtx 9237 }() 9238 9239 defer span.Finish() 9240 a.app.HubUnregister(webConn) 9241 } 9242 9243 func (a *OpenTracingAppLayer) ImageProxyAdder() func(string) string { 9244 origCtx := a.ctx 9245 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyAdder") 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 := a.app.ImageProxyAdder() 9256 9257 return resultVar0 9258 } 9259 9260 func (a *OpenTracingAppLayer) ImageProxyRemover() (f func(string) string) { 9261 origCtx := a.ctx 9262 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyRemover") 9263 9264 a.ctx = newCtx 9265 a.app.Srv().Store.SetContext(newCtx) 9266 defer func() { 9267 a.app.Srv().Store.SetContext(origCtx) 9268 a.ctx = origCtx 9269 }() 9270 9271 defer span.Finish() 9272 resultVar0 := a.app.ImageProxyRemover() 9273 9274 return resultVar0 9275 } 9276 9277 func (a *OpenTracingAppLayer) ImportPermissions(jsonl io.Reader) error { 9278 origCtx := a.ctx 9279 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImportPermissions") 9280 9281 a.ctx = newCtx 9282 a.app.Srv().Store.SetContext(newCtx) 9283 defer func() { 9284 a.app.Srv().Store.SetContext(origCtx) 9285 a.ctx = origCtx 9286 }() 9287 9288 defer span.Finish() 9289 resultVar0 := a.app.ImportPermissions(jsonl) 9290 9291 if resultVar0 != nil { 9292 span.LogFields(spanlog.Error(resultVar0)) 9293 ext.Error.Set(span, true) 9294 } 9295 9296 return resultVar0 9297 } 9298 9299 func (a *OpenTracingAppLayer) InitPlugins(pluginDir string, webappPluginDir string) { 9300 origCtx := a.ctx 9301 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPlugins") 9302 9303 a.ctx = newCtx 9304 a.app.Srv().Store.SetContext(newCtx) 9305 defer func() { 9306 a.app.Srv().Store.SetContext(origCtx) 9307 a.ctx = origCtx 9308 }() 9309 9310 defer span.Finish() 9311 a.app.InitPlugins(pluginDir, webappPluginDir) 9312 } 9313 9314 func (a *OpenTracingAppLayer) InitPostMetadata() { 9315 origCtx := a.ctx 9316 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPostMetadata") 9317 9318 a.ctx = newCtx 9319 a.app.Srv().Store.SetContext(newCtx) 9320 defer func() { 9321 a.app.Srv().Store.SetContext(origCtx) 9322 a.ctx = origCtx 9323 }() 9324 9325 defer span.Finish() 9326 a.app.InitPostMetadata() 9327 } 9328 9329 func (a *OpenTracingAppLayer) InitServer() { 9330 origCtx := a.ctx 9331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitServer") 9332 9333 a.ctx = newCtx 9334 a.app.Srv().Store.SetContext(newCtx) 9335 defer func() { 9336 a.app.Srv().Store.SetContext(origCtx) 9337 a.ctx = origCtx 9338 }() 9339 9340 defer span.Finish() 9341 a.app.InitServer() 9342 } 9343 9344 func (a *OpenTracingAppLayer) InstallMarketplacePlugin(request *model.InstallMarketplacePluginRequest) (*model.Manifest, *model.AppError) { 9345 origCtx := a.ctx 9346 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallMarketplacePlugin") 9347 9348 a.ctx = newCtx 9349 a.app.Srv().Store.SetContext(newCtx) 9350 defer func() { 9351 a.app.Srv().Store.SetContext(origCtx) 9352 a.ctx = origCtx 9353 }() 9354 9355 defer span.Finish() 9356 resultVar0, resultVar1 := a.app.InstallMarketplacePlugin(request) 9357 9358 if resultVar1 != nil { 9359 span.LogFields(spanlog.Error(resultVar1)) 9360 ext.Error.Set(span, true) 9361 } 9362 9363 return resultVar0, resultVar1 9364 } 9365 9366 func (a *OpenTracingAppLayer) InstallPlugin(pluginFile io.ReadSeeker, replace bool) (*model.Manifest, *model.AppError) { 9367 origCtx := a.ctx 9368 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPlugin") 9369 9370 a.ctx = newCtx 9371 a.app.Srv().Store.SetContext(newCtx) 9372 defer func() { 9373 a.app.Srv().Store.SetContext(origCtx) 9374 a.ctx = origCtx 9375 }() 9376 9377 defer span.Finish() 9378 resultVar0, resultVar1 := a.app.InstallPlugin(pluginFile, replace) 9379 9380 if resultVar1 != nil { 9381 span.LogFields(spanlog.Error(resultVar1)) 9382 ext.Error.Set(span, true) 9383 } 9384 9385 return resultVar0, resultVar1 9386 } 9387 9388 func (a *OpenTracingAppLayer) InstallPluginFromData(data model.PluginEventData) { 9389 origCtx := a.ctx 9390 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginFromData") 9391 9392 a.ctx = newCtx 9393 a.app.Srv().Store.SetContext(newCtx) 9394 defer func() { 9395 a.app.Srv().Store.SetContext(origCtx) 9396 a.ctx = origCtx 9397 }() 9398 9399 defer span.Finish() 9400 a.app.InstallPluginFromData(data) 9401 } 9402 9403 func (a *OpenTracingAppLayer) InstallPluginWithSignature(pluginFile io.ReadSeeker, signature io.ReadSeeker) (*model.Manifest, *model.AppError) { 9404 origCtx := a.ctx 9405 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InstallPluginWithSignature") 9406 9407 a.ctx = newCtx 9408 a.app.Srv().Store.SetContext(newCtx) 9409 defer func() { 9410 a.app.Srv().Store.SetContext(origCtx) 9411 a.ctx = origCtx 9412 }() 9413 9414 defer span.Finish() 9415 resultVar0, resultVar1 := a.app.InstallPluginWithSignature(pluginFile, signature) 9416 9417 if resultVar1 != nil { 9418 span.LogFields(spanlog.Error(resultVar1)) 9419 ext.Error.Set(span, true) 9420 } 9421 9422 return resultVar0, resultVar1 9423 } 9424 9425 func (a *OpenTracingAppLayer) InvalidateAllEmailInvites() *model.AppError { 9426 origCtx := a.ctx 9427 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllEmailInvites") 9428 9429 a.ctx = newCtx 9430 a.app.Srv().Store.SetContext(newCtx) 9431 defer func() { 9432 a.app.Srv().Store.SetContext(origCtx) 9433 a.ctx = origCtx 9434 }() 9435 9436 defer span.Finish() 9437 resultVar0 := a.app.InvalidateAllEmailInvites() 9438 9439 if resultVar0 != nil { 9440 span.LogFields(spanlog.Error(resultVar0)) 9441 ext.Error.Set(span, true) 9442 } 9443 9444 return resultVar0 9445 } 9446 9447 func (a *OpenTracingAppLayer) InvalidateCacheForUser(userId string) { 9448 origCtx := a.ctx 9449 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateCacheForUser") 9450 9451 a.ctx = newCtx 9452 a.app.Srv().Store.SetContext(newCtx) 9453 defer func() { 9454 a.app.Srv().Store.SetContext(origCtx) 9455 a.ctx = origCtx 9456 }() 9457 9458 defer span.Finish() 9459 a.app.InvalidateCacheForUser(userId) 9460 } 9461 9462 func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userId string) { 9463 origCtx := a.ctx 9464 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateWebConnSessionCacheForUser") 9465 9466 a.ctx = newCtx 9467 a.app.Srv().Store.SetContext(newCtx) 9468 defer func() { 9469 a.app.Srv().Store.SetContext(origCtx) 9470 a.ctx = origCtx 9471 }() 9472 9473 defer span.Finish() 9474 a.app.InvalidateWebConnSessionCacheForUser(userId) 9475 } 9476 9477 func (a *OpenTracingAppLayer) InviteGuestsToChannels(teamId string, guestsInvite *model.GuestsInvite, senderId string) *model.AppError { 9478 origCtx := a.ctx 9479 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannels") 9480 9481 a.ctx = newCtx 9482 a.app.Srv().Store.SetContext(newCtx) 9483 defer func() { 9484 a.app.Srv().Store.SetContext(origCtx) 9485 a.ctx = origCtx 9486 }() 9487 9488 defer span.Finish() 9489 resultVar0 := a.app.InviteGuestsToChannels(teamId, guestsInvite, senderId) 9490 9491 if resultVar0 != nil { 9492 span.LogFields(spanlog.Error(resultVar0)) 9493 ext.Error.Set(span, true) 9494 } 9495 9496 return resultVar0 9497 } 9498 9499 func (a *OpenTracingAppLayer) InviteGuestsToChannelsGracefully(teamId string, guestsInvite *model.GuestsInvite, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 9500 origCtx := a.ctx 9501 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteGuestsToChannelsGracefully") 9502 9503 a.ctx = newCtx 9504 a.app.Srv().Store.SetContext(newCtx) 9505 defer func() { 9506 a.app.Srv().Store.SetContext(origCtx) 9507 a.ctx = origCtx 9508 }() 9509 9510 defer span.Finish() 9511 resultVar0, resultVar1 := a.app.InviteGuestsToChannelsGracefully(teamId, guestsInvite, senderId) 9512 9513 if resultVar1 != nil { 9514 span.LogFields(spanlog.Error(resultVar1)) 9515 ext.Error.Set(span, true) 9516 } 9517 9518 return resultVar0, resultVar1 9519 } 9520 9521 func (a *OpenTracingAppLayer) InviteNewUsersToTeam(emailList []string, teamId string, senderId string) *model.AppError { 9522 origCtx := a.ctx 9523 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeam") 9524 9525 a.ctx = newCtx 9526 a.app.Srv().Store.SetContext(newCtx) 9527 defer func() { 9528 a.app.Srv().Store.SetContext(origCtx) 9529 a.ctx = origCtx 9530 }() 9531 9532 defer span.Finish() 9533 resultVar0 := a.app.InviteNewUsersToTeam(emailList, teamId, senderId) 9534 9535 if resultVar0 != nil { 9536 span.LogFields(spanlog.Error(resultVar0)) 9537 ext.Error.Set(span, true) 9538 } 9539 9540 return resultVar0 9541 } 9542 9543 func (a *OpenTracingAppLayer) InviteNewUsersToTeamGracefully(emailList []string, teamId string, senderId string) ([]*model.EmailInviteWithError, *model.AppError) { 9544 origCtx := a.ctx 9545 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InviteNewUsersToTeamGracefully") 9546 9547 a.ctx = newCtx 9548 a.app.Srv().Store.SetContext(newCtx) 9549 defer func() { 9550 a.app.Srv().Store.SetContext(origCtx) 9551 a.ctx = origCtx 9552 }() 9553 9554 defer span.Finish() 9555 resultVar0, resultVar1 := a.app.InviteNewUsersToTeamGracefully(emailList, teamId, senderId) 9556 9557 if resultVar1 != nil { 9558 span.LogFields(spanlog.Error(resultVar1)) 9559 ext.Error.Set(span, true) 9560 } 9561 9562 return resultVar0, resultVar1 9563 } 9564 9565 func (a *OpenTracingAppLayer) IsFirstUserAccount() bool { 9566 origCtx := a.ctx 9567 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsFirstUserAccount") 9568 9569 a.ctx = newCtx 9570 a.app.Srv().Store.SetContext(newCtx) 9571 defer func() { 9572 a.app.Srv().Store.SetContext(origCtx) 9573 a.ctx = origCtx 9574 }() 9575 9576 defer span.Finish() 9577 resultVar0 := a.app.IsFirstUserAccount() 9578 9579 return resultVar0 9580 } 9581 9582 func (a *OpenTracingAppLayer) IsLeader() bool { 9583 origCtx := a.ctx 9584 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsLeader") 9585 9586 a.ctx = newCtx 9587 a.app.Srv().Store.SetContext(newCtx) 9588 defer func() { 9589 a.app.Srv().Store.SetContext(origCtx) 9590 a.ctx = origCtx 9591 }() 9592 9593 defer span.Finish() 9594 resultVar0 := a.app.IsLeader() 9595 9596 return resultVar0 9597 } 9598 9599 func (a *OpenTracingAppLayer) IsPasswordValid(password string) *model.AppError { 9600 origCtx := a.ctx 9601 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPasswordValid") 9602 9603 a.ctx = newCtx 9604 a.app.Srv().Store.SetContext(newCtx) 9605 defer func() { 9606 a.app.Srv().Store.SetContext(origCtx) 9607 a.ctx = origCtx 9608 }() 9609 9610 defer span.Finish() 9611 resultVar0 := a.app.IsPasswordValid(password) 9612 9613 if resultVar0 != nil { 9614 span.LogFields(spanlog.Error(resultVar0)) 9615 ext.Error.Set(span, true) 9616 } 9617 9618 return resultVar0 9619 } 9620 9621 func (a *OpenTracingAppLayer) IsPhase2MigrationCompleted() *model.AppError { 9622 origCtx := a.ctx 9623 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPhase2MigrationCompleted") 9624 9625 a.ctx = newCtx 9626 a.app.Srv().Store.SetContext(newCtx) 9627 defer func() { 9628 a.app.Srv().Store.SetContext(origCtx) 9629 a.ctx = origCtx 9630 }() 9631 9632 defer span.Finish() 9633 resultVar0 := a.app.IsPhase2MigrationCompleted() 9634 9635 if resultVar0 != nil { 9636 span.LogFields(spanlog.Error(resultVar0)) 9637 ext.Error.Set(span, true) 9638 } 9639 9640 return resultVar0 9641 } 9642 9643 func (a *OpenTracingAppLayer) IsUserAway(lastActivityAt int64) bool { 9644 origCtx := a.ctx 9645 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserAway") 9646 9647 a.ctx = newCtx 9648 a.app.Srv().Store.SetContext(newCtx) 9649 defer func() { 9650 a.app.Srv().Store.SetContext(origCtx) 9651 a.ctx = origCtx 9652 }() 9653 9654 defer span.Finish() 9655 resultVar0 := a.app.IsUserAway(lastActivityAt) 9656 9657 return resultVar0 9658 } 9659 9660 func (a *OpenTracingAppLayer) IsUserSignUpAllowed() *model.AppError { 9661 origCtx := a.ctx 9662 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserSignUpAllowed") 9663 9664 a.ctx = newCtx 9665 a.app.Srv().Store.SetContext(newCtx) 9666 defer func() { 9667 a.app.Srv().Store.SetContext(origCtx) 9668 a.ctx = origCtx 9669 }() 9670 9671 defer span.Finish() 9672 resultVar0 := a.app.IsUserSignUpAllowed() 9673 9674 if resultVar0 != nil { 9675 span.LogFields(spanlog.Error(resultVar0)) 9676 ext.Error.Set(span, true) 9677 } 9678 9679 return resultVar0 9680 } 9681 9682 func (a *OpenTracingAppLayer) IsUsernameTaken(name string) bool { 9683 origCtx := a.ctx 9684 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUsernameTaken") 9685 9686 a.ctx = newCtx 9687 a.app.Srv().Store.SetContext(newCtx) 9688 defer func() { 9689 a.app.Srv().Store.SetContext(origCtx) 9690 a.ctx = origCtx 9691 }() 9692 9693 defer span.Finish() 9694 resultVar0 := a.app.IsUsernameTaken(name) 9695 9696 return resultVar0 9697 } 9698 9699 func (a *OpenTracingAppLayer) JoinChannel(channel *model.Channel, userId string) *model.AppError { 9700 origCtx := a.ctx 9701 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinChannel") 9702 9703 a.ctx = newCtx 9704 a.app.Srv().Store.SetContext(newCtx) 9705 defer func() { 9706 a.app.Srv().Store.SetContext(origCtx) 9707 a.ctx = origCtx 9708 }() 9709 9710 defer span.Finish() 9711 resultVar0 := a.app.JoinChannel(channel, userId) 9712 9713 if resultVar0 != nil { 9714 span.LogFields(spanlog.Error(resultVar0)) 9715 ext.Error.Set(span, true) 9716 } 9717 9718 return resultVar0 9719 } 9720 9721 func (a *OpenTracingAppLayer) JoinDefaultChannels(teamId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { 9722 origCtx := a.ctx 9723 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinDefaultChannels") 9724 9725 a.ctx = newCtx 9726 a.app.Srv().Store.SetContext(newCtx) 9727 defer func() { 9728 a.app.Srv().Store.SetContext(origCtx) 9729 a.ctx = origCtx 9730 }() 9731 9732 defer span.Finish() 9733 resultVar0 := a.app.JoinDefaultChannels(teamId, user, shouldBeAdmin, userRequestorId) 9734 9735 if resultVar0 != nil { 9736 span.LogFields(spanlog.Error(resultVar0)) 9737 ext.Error.Set(span, true) 9738 } 9739 9740 return resultVar0 9741 } 9742 9743 func (a *OpenTracingAppLayer) JoinUserToTeam(team *model.Team, user *model.User, userRequestorId string) *model.AppError { 9744 origCtx := a.ctx 9745 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinUserToTeam") 9746 9747 a.ctx = newCtx 9748 a.app.Srv().Store.SetContext(newCtx) 9749 defer func() { 9750 a.app.Srv().Store.SetContext(origCtx) 9751 a.ctx = origCtx 9752 }() 9753 9754 defer span.Finish() 9755 resultVar0 := a.app.JoinUserToTeam(team, user, userRequestorId) 9756 9757 if resultVar0 != nil { 9758 span.LogFields(spanlog.Error(resultVar0)) 9759 ext.Error.Set(span, true) 9760 } 9761 9762 return resultVar0 9763 } 9764 9765 func (a *OpenTracingAppLayer) LeaveChannel(channelId string, userId string) *model.AppError { 9766 origCtx := a.ctx 9767 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveChannel") 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 resultVar0 := a.app.LeaveChannel(channelId, userId) 9778 9779 if resultVar0 != nil { 9780 span.LogFields(spanlog.Error(resultVar0)) 9781 ext.Error.Set(span, true) 9782 } 9783 9784 return resultVar0 9785 } 9786 9787 func (a *OpenTracingAppLayer) LeaveTeam(team *model.Team, user *model.User, requestorId string) *model.AppError { 9788 origCtx := a.ctx 9789 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveTeam") 9790 9791 a.ctx = newCtx 9792 a.app.Srv().Store.SetContext(newCtx) 9793 defer func() { 9794 a.app.Srv().Store.SetContext(origCtx) 9795 a.ctx = origCtx 9796 }() 9797 9798 defer span.Finish() 9799 resultVar0 := a.app.LeaveTeam(team, user, requestorId) 9800 9801 if resultVar0 != nil { 9802 span.LogFields(spanlog.Error(resultVar0)) 9803 ext.Error.Set(span, true) 9804 } 9805 9806 return resultVar0 9807 } 9808 9809 func (a *OpenTracingAppLayer) LimitedClientConfig() map[string]string { 9810 origCtx := a.ctx 9811 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfig") 9812 9813 a.ctx = newCtx 9814 a.app.Srv().Store.SetContext(newCtx) 9815 defer func() { 9816 a.app.Srv().Store.SetContext(origCtx) 9817 a.ctx = origCtx 9818 }() 9819 9820 defer span.Finish() 9821 resultVar0 := a.app.LimitedClientConfig() 9822 9823 return resultVar0 9824 } 9825 9826 func (a *OpenTracingAppLayer) LimitedClientConfigWithComputed() map[string]string { 9827 origCtx := a.ctx 9828 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfigWithComputed") 9829 9830 a.ctx = newCtx 9831 a.app.Srv().Store.SetContext(newCtx) 9832 defer func() { 9833 a.app.Srv().Store.SetContext(origCtx) 9834 a.ctx = origCtx 9835 }() 9836 9837 defer span.Finish() 9838 resultVar0 := a.app.LimitedClientConfigWithComputed() 9839 9840 return resultVar0 9841 } 9842 9843 func (a *OpenTracingAppLayer) ListAllCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 9844 origCtx := a.ctx 9845 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAllCommands") 9846 9847 a.ctx = newCtx 9848 a.app.Srv().Store.SetContext(newCtx) 9849 defer func() { 9850 a.app.Srv().Store.SetContext(origCtx) 9851 a.ctx = origCtx 9852 }() 9853 9854 defer span.Finish() 9855 resultVar0, resultVar1 := a.app.ListAllCommands(teamId, T) 9856 9857 if resultVar1 != nil { 9858 span.LogFields(spanlog.Error(resultVar1)) 9859 ext.Error.Set(span, true) 9860 } 9861 9862 return resultVar0, resultVar1 9863 } 9864 9865 func (a *OpenTracingAppLayer) ListAutocompleteCommands(teamId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 9866 origCtx := a.ctx 9867 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAutocompleteCommands") 9868 9869 a.ctx = newCtx 9870 a.app.Srv().Store.SetContext(newCtx) 9871 defer func() { 9872 a.app.Srv().Store.SetContext(origCtx) 9873 a.ctx = origCtx 9874 }() 9875 9876 span.SetTag("teamId", teamId) 9877 9878 defer span.Finish() 9879 resultVar0, resultVar1 := a.app.ListAutocompleteCommands(teamId, T) 9880 9881 if resultVar1 != nil { 9882 span.LogFields(spanlog.Error(resultVar1)) 9883 ext.Error.Set(span, true) 9884 } 9885 9886 return resultVar0, resultVar1 9887 } 9888 9889 func (a *OpenTracingAppLayer) ListDirectory(path string) ([]string, *model.AppError) { 9890 origCtx := a.ctx 9891 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListDirectory") 9892 9893 a.ctx = newCtx 9894 a.app.Srv().Store.SetContext(newCtx) 9895 defer func() { 9896 a.app.Srv().Store.SetContext(origCtx) 9897 a.ctx = origCtx 9898 }() 9899 9900 defer span.Finish() 9901 resultVar0, resultVar1 := a.app.ListDirectory(path) 9902 9903 if resultVar1 != nil { 9904 span.LogFields(spanlog.Error(resultVar1)) 9905 ext.Error.Set(span, true) 9906 } 9907 9908 return resultVar0, resultVar1 9909 } 9910 9911 func (a *OpenTracingAppLayer) ListPluginKeys(pluginId string, page int, perPage int) ([]string, *model.AppError) { 9912 origCtx := a.ctx 9913 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListPluginKeys") 9914 9915 a.ctx = newCtx 9916 a.app.Srv().Store.SetContext(newCtx) 9917 defer func() { 9918 a.app.Srv().Store.SetContext(origCtx) 9919 a.ctx = origCtx 9920 }() 9921 9922 defer span.Finish() 9923 resultVar0, resultVar1 := a.app.ListPluginKeys(pluginId, page, perPage) 9924 9925 if resultVar1 != nil { 9926 span.LogFields(spanlog.Error(resultVar1)) 9927 ext.Error.Set(span, true) 9928 } 9929 9930 return resultVar0, resultVar1 9931 } 9932 9933 func (a *OpenTracingAppLayer) ListTeamCommands(teamId string) ([]*model.Command, *model.AppError) { 9934 origCtx := a.ctx 9935 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListTeamCommands") 9936 9937 a.ctx = newCtx 9938 a.app.Srv().Store.SetContext(newCtx) 9939 defer func() { 9940 a.app.Srv().Store.SetContext(origCtx) 9941 a.ctx = origCtx 9942 }() 9943 9944 defer span.Finish() 9945 resultVar0, resultVar1 := a.app.ListTeamCommands(teamId) 9946 9947 if resultVar1 != nil { 9948 span.LogFields(spanlog.Error(resultVar1)) 9949 ext.Error.Set(span, true) 9950 } 9951 9952 return resultVar0, resultVar1 9953 } 9954 9955 func (a *OpenTracingAppLayer) LogAuditRec(rec *audit.Record, err error) { 9956 origCtx := a.ctx 9957 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRec") 9958 9959 a.ctx = newCtx 9960 a.app.Srv().Store.SetContext(newCtx) 9961 defer func() { 9962 a.app.Srv().Store.SetContext(origCtx) 9963 a.ctx = origCtx 9964 }() 9965 9966 defer span.Finish() 9967 a.app.LogAuditRec(rec, err) 9968 } 9969 9970 func (a *OpenTracingAppLayer) LogAuditRecWithLevel(rec *audit.Record, level mlog.LogLevel, err error) { 9971 origCtx := a.ctx 9972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LogAuditRecWithLevel") 9973 9974 a.ctx = newCtx 9975 a.app.Srv().Store.SetContext(newCtx) 9976 defer func() { 9977 a.app.Srv().Store.SetContext(origCtx) 9978 a.ctx = origCtx 9979 }() 9980 9981 defer span.Finish() 9982 a.app.LogAuditRecWithLevel(rec, level, err) 9983 } 9984 9985 func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, teamId string) (*model.User, *model.AppError) { 9986 origCtx := a.ctx 9987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth") 9988 9989 a.ctx = newCtx 9990 a.app.Srv().Store.SetContext(newCtx) 9991 defer func() { 9992 a.app.Srv().Store.SetContext(origCtx) 9993 a.ctx = origCtx 9994 }() 9995 9996 defer span.Finish() 9997 resultVar0, resultVar1 := a.app.LoginByOAuth(service, userData, teamId) 9998 9999 if resultVar1 != nil { 10000 span.LogFields(spanlog.Error(resultVar1)) 10001 ext.Error.Set(span, true) 10002 } 10003 10004 return resultVar0, resultVar1 10005 } 10006 10007 func (a *OpenTracingAppLayer) MakeAuditRecord(event string, initialStatus string) *audit.Record { 10008 origCtx := a.ctx 10009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakeAuditRecord") 10010 10011 a.ctx = newCtx 10012 a.app.Srv().Store.SetContext(newCtx) 10013 defer func() { 10014 a.app.Srv().Store.SetContext(origCtx) 10015 a.ctx = origCtx 10016 }() 10017 10018 defer span.Finish() 10019 resultVar0 := a.app.MakeAuditRecord(event, initialStatus) 10020 10021 return resultVar0 10022 } 10023 10024 func (a *OpenTracingAppLayer) MakePermissionError(permission *model.Permission) *model.AppError { 10025 origCtx := a.ctx 10026 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakePermissionError") 10027 10028 a.ctx = newCtx 10029 a.app.Srv().Store.SetContext(newCtx) 10030 defer func() { 10031 a.app.Srv().Store.SetContext(origCtx) 10032 a.ctx = origCtx 10033 }() 10034 10035 defer span.Finish() 10036 resultVar0 := a.app.MakePermissionError(permission) 10037 10038 if resultVar0 != nil { 10039 span.LogFields(spanlog.Error(resultVar0)) 10040 ext.Error.Set(span, true) 10041 } 10042 10043 return resultVar0 10044 } 10045 10046 func (a *OpenTracingAppLayer) MarkChannelAsUnreadFromPost(postID string, userID string) (*model.ChannelUnreadAt, *model.AppError) { 10047 origCtx := a.ctx 10048 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelAsUnreadFromPost") 10049 10050 a.ctx = newCtx 10051 a.app.Srv().Store.SetContext(newCtx) 10052 defer func() { 10053 a.app.Srv().Store.SetContext(origCtx) 10054 a.ctx = origCtx 10055 }() 10056 10057 defer span.Finish() 10058 resultVar0, resultVar1 := a.app.MarkChannelAsUnreadFromPost(postID, userID) 10059 10060 if resultVar1 != nil { 10061 span.LogFields(spanlog.Error(resultVar1)) 10062 ext.Error.Set(span, true) 10063 } 10064 10065 return resultVar0, resultVar1 10066 } 10067 10068 func (a *OpenTracingAppLayer) MarkChannelsAsViewed(channelIds []string, userId string, currentSessionId string) (map[string]int64, *model.AppError) { 10069 origCtx := a.ctx 10070 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MarkChannelsAsViewed") 10071 10072 a.ctx = newCtx 10073 a.app.Srv().Store.SetContext(newCtx) 10074 defer func() { 10075 a.app.Srv().Store.SetContext(origCtx) 10076 a.ctx = origCtx 10077 }() 10078 10079 defer span.Finish() 10080 resultVar0, resultVar1 := a.app.MarkChannelsAsViewed(channelIds, userId, currentSessionId) 10081 10082 if resultVar1 != nil { 10083 span.LogFields(spanlog.Error(resultVar1)) 10084 ext.Error.Set(span, true) 10085 } 10086 10087 return resultVar0, resultVar1 10088 } 10089 10090 func (a *OpenTracingAppLayer) MaxPostSize() int { 10091 origCtx := a.ctx 10092 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MaxPostSize") 10093 10094 a.ctx = newCtx 10095 a.app.Srv().Store.SetContext(newCtx) 10096 defer func() { 10097 a.app.Srv().Store.SetContext(origCtx) 10098 a.ctx = origCtx 10099 }() 10100 10101 defer span.Finish() 10102 resultVar0 := a.app.MaxPostSize() 10103 10104 return resultVar0 10105 } 10106 10107 func (a *OpenTracingAppLayer) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { 10108 origCtx := a.ctx 10109 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateFilenamesToFileInfos") 10110 10111 a.ctx = newCtx 10112 a.app.Srv().Store.SetContext(newCtx) 10113 defer func() { 10114 a.app.Srv().Store.SetContext(origCtx) 10115 a.ctx = origCtx 10116 }() 10117 10118 defer span.Finish() 10119 resultVar0 := a.app.MigrateFilenamesToFileInfos(post) 10120 10121 return resultVar0 10122 } 10123 10124 func (a *OpenTracingAppLayer) MigrateIdLDAP(toAttribute string) *model.AppError { 10125 origCtx := a.ctx 10126 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateIdLDAP") 10127 10128 a.ctx = newCtx 10129 a.app.Srv().Store.SetContext(newCtx) 10130 defer func() { 10131 a.app.Srv().Store.SetContext(origCtx) 10132 a.ctx = origCtx 10133 }() 10134 10135 defer span.Finish() 10136 resultVar0 := a.app.MigrateIdLDAP(toAttribute) 10137 10138 if resultVar0 != nil { 10139 span.LogFields(spanlog.Error(resultVar0)) 10140 ext.Error.Set(span, true) 10141 } 10142 10143 return resultVar0 10144 } 10145 10146 func (a *OpenTracingAppLayer) MoveChannel(team *model.Team, channel *model.Channel, user *model.User) *model.AppError { 10147 origCtx := a.ctx 10148 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveChannel") 10149 10150 a.ctx = newCtx 10151 a.app.Srv().Store.SetContext(newCtx) 10152 defer func() { 10153 a.app.Srv().Store.SetContext(origCtx) 10154 a.ctx = origCtx 10155 }() 10156 10157 defer span.Finish() 10158 resultVar0 := a.app.MoveChannel(team, channel, user) 10159 10160 if resultVar0 != nil { 10161 span.LogFields(spanlog.Error(resultVar0)) 10162 ext.Error.Set(span, true) 10163 } 10164 10165 return resultVar0 10166 } 10167 10168 func (a *OpenTracingAppLayer) MoveCommand(team *model.Team, command *model.Command) *model.AppError { 10169 origCtx := a.ctx 10170 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveCommand") 10171 10172 a.ctx = newCtx 10173 a.app.Srv().Store.SetContext(newCtx) 10174 defer func() { 10175 a.app.Srv().Store.SetContext(origCtx) 10176 a.ctx = origCtx 10177 }() 10178 10179 defer span.Finish() 10180 resultVar0 := a.app.MoveCommand(team, command) 10181 10182 if resultVar0 != nil { 10183 span.LogFields(spanlog.Error(resultVar0)) 10184 ext.Error.Set(span, true) 10185 } 10186 10187 return resultVar0 10188 } 10189 10190 func (a *OpenTracingAppLayer) MoveFile(oldPath string, newPath string) *model.AppError { 10191 origCtx := a.ctx 10192 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveFile") 10193 10194 a.ctx = newCtx 10195 a.app.Srv().Store.SetContext(newCtx) 10196 defer func() { 10197 a.app.Srv().Store.SetContext(origCtx) 10198 a.ctx = origCtx 10199 }() 10200 10201 defer span.Finish() 10202 resultVar0 := a.app.MoveFile(oldPath, newPath) 10203 10204 if resultVar0 != nil { 10205 span.LogFields(spanlog.Error(resultVar0)) 10206 ext.Error.Set(span, true) 10207 } 10208 10209 return resultVar0 10210 } 10211 10212 func (a *OpenTracingAppLayer) NewClusterDiscoveryService() *app.ClusterDiscoveryService { 10213 origCtx := a.ctx 10214 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewClusterDiscoveryService") 10215 10216 a.ctx = newCtx 10217 a.app.Srv().Store.SetContext(newCtx) 10218 defer func() { 10219 a.app.Srv().Store.SetContext(origCtx) 10220 a.ctx = origCtx 10221 }() 10222 10223 defer span.Finish() 10224 resultVar0 := a.app.NewClusterDiscoveryService() 10225 10226 return resultVar0 10227 } 10228 10229 func (a *OpenTracingAppLayer) NewPluginAPI(manifest *model.Manifest) plugin.API { 10230 origCtx := a.ctx 10231 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewPluginAPI") 10232 10233 a.ctx = newCtx 10234 a.app.Srv().Store.SetContext(newCtx) 10235 defer func() { 10236 a.app.Srv().Store.SetContext(origCtx) 10237 a.ctx = origCtx 10238 }() 10239 10240 defer span.Finish() 10241 resultVar0 := a.app.NewPluginAPI(manifest) 10242 10243 return resultVar0 10244 } 10245 10246 func (a *OpenTracingAppLayer) NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *app.WebConn { 10247 origCtx := a.ctx 10248 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebConn") 10249 10250 a.ctx = newCtx 10251 a.app.Srv().Store.SetContext(newCtx) 10252 defer func() { 10253 a.app.Srv().Store.SetContext(origCtx) 10254 a.ctx = origCtx 10255 }() 10256 10257 defer span.Finish() 10258 resultVar0 := a.app.NewWebConn(ws, session, t, locale) 10259 10260 return resultVar0 10261 } 10262 10263 func (a *OpenTracingAppLayer) NewWebHub() *app.Hub { 10264 origCtx := a.ctx 10265 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebHub") 10266 10267 a.ctx = newCtx 10268 a.app.Srv().Store.SetContext(newCtx) 10269 defer func() { 10270 a.app.Srv().Store.SetContext(origCtx) 10271 a.ctx = origCtx 10272 }() 10273 10274 defer span.Finish() 10275 resultVar0 := a.app.NewWebHub() 10276 10277 return resultVar0 10278 } 10279 10280 func (a *OpenTracingAppLayer) NotifyAndSetWarnMetricAck(warnMetricId string, sender *model.User, forceAck bool, isBot bool) *model.AppError { 10281 origCtx := a.ctx 10282 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifyAndSetWarnMetricAck") 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.NotifyAndSetWarnMetricAck(warnMetricId, sender, forceAck, isBot) 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) NotifySessionsExpired() *model.AppError { 10303 origCtx := a.ctx 10304 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NotifySessionsExpired") 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.NotifySessionsExpired() 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) OpenInteractiveDialog(request model.OpenDialogRequest) *model.AppError { 10325 origCtx := a.ctx 10326 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OpenInteractiveDialog") 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.OpenInteractiveDialog(request) 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) OriginChecker() func(*http.Request) bool { 10347 origCtx := a.ctx 10348 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OriginChecker") 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.OriginChecker() 10359 10360 return resultVar0 10361 } 10362 10363 func (a *OpenTracingAppLayer) OverrideIconURLIfEmoji(post *model.Post) { 10364 origCtx := a.ctx 10365 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OverrideIconURLIfEmoji") 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 a.app.OverrideIconURLIfEmoji(post) 10376 } 10377 10378 func (a *OpenTracingAppLayer) PatchBot(botUserId string, botPatch *model.BotPatch) (*model.Bot, *model.AppError) { 10379 origCtx := a.ctx 10380 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchBot") 10381 10382 a.ctx = newCtx 10383 a.app.Srv().Store.SetContext(newCtx) 10384 defer func() { 10385 a.app.Srv().Store.SetContext(origCtx) 10386 a.ctx = origCtx 10387 }() 10388 10389 defer span.Finish() 10390 resultVar0, resultVar1 := a.app.PatchBot(botUserId, botPatch) 10391 10392 if resultVar1 != nil { 10393 span.LogFields(spanlog.Error(resultVar1)) 10394 ext.Error.Set(span, true) 10395 } 10396 10397 return resultVar0, resultVar1 10398 } 10399 10400 func (a *OpenTracingAppLayer) PatchChannel(channel *model.Channel, patch *model.ChannelPatch, userId string) (*model.Channel, *model.AppError) { 10401 origCtx := a.ctx 10402 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannel") 10403 10404 a.ctx = newCtx 10405 a.app.Srv().Store.SetContext(newCtx) 10406 defer func() { 10407 a.app.Srv().Store.SetContext(origCtx) 10408 a.ctx = origCtx 10409 }() 10410 10411 defer span.Finish() 10412 resultVar0, resultVar1 := a.app.PatchChannel(channel, patch, userId) 10413 10414 if resultVar1 != nil { 10415 span.LogFields(spanlog.Error(resultVar1)) 10416 ext.Error.Set(span, true) 10417 } 10418 10419 return resultVar0, resultVar1 10420 } 10421 10422 func (a *OpenTracingAppLayer) PatchChannelModerationsForChannel(channel *model.Channel, channelModerationsPatch []*model.ChannelModerationPatch) ([]*model.ChannelModeration, *model.AppError) { 10423 origCtx := a.ctx 10424 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchChannelModerationsForChannel") 10425 10426 a.ctx = newCtx 10427 a.app.Srv().Store.SetContext(newCtx) 10428 defer func() { 10429 a.app.Srv().Store.SetContext(origCtx) 10430 a.ctx = origCtx 10431 }() 10432 10433 defer span.Finish() 10434 resultVar0, resultVar1 := a.app.PatchChannelModerationsForChannel(channel, channelModerationsPatch) 10435 10436 if resultVar1 != nil { 10437 span.LogFields(spanlog.Error(resultVar1)) 10438 ext.Error.Set(span, true) 10439 } 10440 10441 return resultVar0, resultVar1 10442 } 10443 10444 func (a *OpenTracingAppLayer) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError) { 10445 origCtx := a.ctx 10446 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchPost") 10447 10448 a.ctx = newCtx 10449 a.app.Srv().Store.SetContext(newCtx) 10450 defer func() { 10451 a.app.Srv().Store.SetContext(origCtx) 10452 a.ctx = origCtx 10453 }() 10454 10455 defer span.Finish() 10456 resultVar0, resultVar1 := a.app.PatchPost(postId, patch) 10457 10458 if resultVar1 != nil { 10459 span.LogFields(spanlog.Error(resultVar1)) 10460 ext.Error.Set(span, true) 10461 } 10462 10463 return resultVar0, resultVar1 10464 } 10465 10466 func (a *OpenTracingAppLayer) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) { 10467 origCtx := a.ctx 10468 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchRole") 10469 10470 a.ctx = newCtx 10471 a.app.Srv().Store.SetContext(newCtx) 10472 defer func() { 10473 a.app.Srv().Store.SetContext(origCtx) 10474 a.ctx = origCtx 10475 }() 10476 10477 defer span.Finish() 10478 resultVar0, resultVar1 := a.app.PatchRole(role, patch) 10479 10480 if resultVar1 != nil { 10481 span.LogFields(spanlog.Error(resultVar1)) 10482 ext.Error.Set(span, true) 10483 } 10484 10485 return resultVar0, resultVar1 10486 } 10487 10488 func (a *OpenTracingAppLayer) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) { 10489 origCtx := a.ctx 10490 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchScheme") 10491 10492 a.ctx = newCtx 10493 a.app.Srv().Store.SetContext(newCtx) 10494 defer func() { 10495 a.app.Srv().Store.SetContext(origCtx) 10496 a.ctx = origCtx 10497 }() 10498 10499 defer span.Finish() 10500 resultVar0, resultVar1 := a.app.PatchScheme(scheme, patch) 10501 10502 if resultVar1 != nil { 10503 span.LogFields(spanlog.Error(resultVar1)) 10504 ext.Error.Set(span, true) 10505 } 10506 10507 return resultVar0, resultVar1 10508 } 10509 10510 func (a *OpenTracingAppLayer) PatchTeam(teamId string, patch *model.TeamPatch) (*model.Team, *model.AppError) { 10511 origCtx := a.ctx 10512 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchTeam") 10513 10514 a.ctx = newCtx 10515 a.app.Srv().Store.SetContext(newCtx) 10516 defer func() { 10517 a.app.Srv().Store.SetContext(origCtx) 10518 a.ctx = origCtx 10519 }() 10520 10521 defer span.Finish() 10522 resultVar0, resultVar1 := a.app.PatchTeam(teamId, patch) 10523 10524 if resultVar1 != nil { 10525 span.LogFields(spanlog.Error(resultVar1)) 10526 ext.Error.Set(span, true) 10527 } 10528 10529 return resultVar0, resultVar1 10530 } 10531 10532 func (a *OpenTracingAppLayer) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { 10533 origCtx := a.ctx 10534 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchUser") 10535 10536 a.ctx = newCtx 10537 a.app.Srv().Store.SetContext(newCtx) 10538 defer func() { 10539 a.app.Srv().Store.SetContext(origCtx) 10540 a.ctx = origCtx 10541 }() 10542 10543 defer span.Finish() 10544 resultVar0, resultVar1 := a.app.PatchUser(userId, patch, asAdmin) 10545 10546 if resultVar1 != nil { 10547 span.LogFields(spanlog.Error(resultVar1)) 10548 ext.Error.Set(span, true) 10549 } 10550 10551 return resultVar0, resultVar1 10552 } 10553 10554 func (a *OpenTracingAppLayer) PermanentDeleteAllUsers() *model.AppError { 10555 origCtx := a.ctx 10556 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteAllUsers") 10557 10558 a.ctx = newCtx 10559 a.app.Srv().Store.SetContext(newCtx) 10560 defer func() { 10561 a.app.Srv().Store.SetContext(origCtx) 10562 a.ctx = origCtx 10563 }() 10564 10565 defer span.Finish() 10566 resultVar0 := a.app.PermanentDeleteAllUsers() 10567 10568 if resultVar0 != nil { 10569 span.LogFields(spanlog.Error(resultVar0)) 10570 ext.Error.Set(span, true) 10571 } 10572 10573 return resultVar0 10574 } 10575 10576 func (a *OpenTracingAppLayer) PermanentDeleteBot(botUserId string) *model.AppError { 10577 origCtx := a.ctx 10578 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteBot") 10579 10580 a.ctx = newCtx 10581 a.app.Srv().Store.SetContext(newCtx) 10582 defer func() { 10583 a.app.Srv().Store.SetContext(origCtx) 10584 a.ctx = origCtx 10585 }() 10586 10587 defer span.Finish() 10588 resultVar0 := a.app.PermanentDeleteBot(botUserId) 10589 10590 if resultVar0 != nil { 10591 span.LogFields(spanlog.Error(resultVar0)) 10592 ext.Error.Set(span, true) 10593 } 10594 10595 return resultVar0 10596 } 10597 10598 func (a *OpenTracingAppLayer) PermanentDeleteChannel(channel *model.Channel) *model.AppError { 10599 origCtx := a.ctx 10600 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteChannel") 10601 10602 a.ctx = newCtx 10603 a.app.Srv().Store.SetContext(newCtx) 10604 defer func() { 10605 a.app.Srv().Store.SetContext(origCtx) 10606 a.ctx = origCtx 10607 }() 10608 10609 defer span.Finish() 10610 resultVar0 := a.app.PermanentDeleteChannel(channel) 10611 10612 if resultVar0 != nil { 10613 span.LogFields(spanlog.Error(resultVar0)) 10614 ext.Error.Set(span, true) 10615 } 10616 10617 return resultVar0 10618 } 10619 10620 func (a *OpenTracingAppLayer) PermanentDeleteTeam(team *model.Team) *model.AppError { 10621 origCtx := a.ctx 10622 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeam") 10623 10624 a.ctx = newCtx 10625 a.app.Srv().Store.SetContext(newCtx) 10626 defer func() { 10627 a.app.Srv().Store.SetContext(origCtx) 10628 a.ctx = origCtx 10629 }() 10630 10631 defer span.Finish() 10632 resultVar0 := a.app.PermanentDeleteTeam(team) 10633 10634 if resultVar0 != nil { 10635 span.LogFields(spanlog.Error(resultVar0)) 10636 ext.Error.Set(span, true) 10637 } 10638 10639 return resultVar0 10640 } 10641 10642 func (a *OpenTracingAppLayer) PermanentDeleteTeamId(teamId string) *model.AppError { 10643 origCtx := a.ctx 10644 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteTeamId") 10645 10646 a.ctx = newCtx 10647 a.app.Srv().Store.SetContext(newCtx) 10648 defer func() { 10649 a.app.Srv().Store.SetContext(origCtx) 10650 a.ctx = origCtx 10651 }() 10652 10653 defer span.Finish() 10654 resultVar0 := a.app.PermanentDeleteTeamId(teamId) 10655 10656 if resultVar0 != nil { 10657 span.LogFields(spanlog.Error(resultVar0)) 10658 ext.Error.Set(span, true) 10659 } 10660 10661 return resultVar0 10662 } 10663 10664 func (a *OpenTracingAppLayer) PermanentDeleteUser(user *model.User) *model.AppError { 10665 origCtx := a.ctx 10666 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteUser") 10667 10668 a.ctx = newCtx 10669 a.app.Srv().Store.SetContext(newCtx) 10670 defer func() { 10671 a.app.Srv().Store.SetContext(origCtx) 10672 a.ctx = origCtx 10673 }() 10674 10675 defer span.Finish() 10676 resultVar0 := a.app.PermanentDeleteUser(user) 10677 10678 if resultVar0 != nil { 10679 span.LogFields(spanlog.Error(resultVar0)) 10680 ext.Error.Set(span, true) 10681 } 10682 10683 return resultVar0 10684 } 10685 10686 func (a *OpenTracingAppLayer) PluginCommandsForTeam(teamId string) []*model.Command { 10687 origCtx := a.ctx 10688 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginCommandsForTeam") 10689 10690 a.ctx = newCtx 10691 a.app.Srv().Store.SetContext(newCtx) 10692 defer func() { 10693 a.app.Srv().Store.SetContext(origCtx) 10694 a.ctx = origCtx 10695 }() 10696 10697 defer span.Finish() 10698 resultVar0 := a.app.PluginCommandsForTeam(teamId) 10699 10700 return resultVar0 10701 } 10702 10703 func (a *OpenTracingAppLayer) PluginContext() *plugin.Context { 10704 origCtx := a.ctx 10705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PluginContext") 10706 10707 a.ctx = newCtx 10708 a.app.Srv().Store.SetContext(newCtx) 10709 defer func() { 10710 a.app.Srv().Store.SetContext(origCtx) 10711 a.ctx = origCtx 10712 }() 10713 10714 defer span.Finish() 10715 resultVar0 := a.app.PluginContext() 10716 10717 return resultVar0 10718 } 10719 10720 func (a *OpenTracingAppLayer) PostActionCookieSecret() []byte { 10721 origCtx := a.ctx 10722 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostActionCookieSecret") 10723 10724 a.ctx = newCtx 10725 a.app.Srv().Store.SetContext(newCtx) 10726 defer func() { 10727 a.app.Srv().Store.SetContext(origCtx) 10728 a.ctx = origCtx 10729 }() 10730 10731 defer span.Finish() 10732 resultVar0 := a.app.PostActionCookieSecret() 10733 10734 return resultVar0 10735 } 10736 10737 func (a *OpenTracingAppLayer) PostAddToChannelMessage(user *model.User, addedUser *model.User, channel *model.Channel, postRootId string) *model.AppError { 10738 origCtx := a.ctx 10739 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostAddToChannelMessage") 10740 10741 a.ctx = newCtx 10742 a.app.Srv().Store.SetContext(newCtx) 10743 defer func() { 10744 a.app.Srv().Store.SetContext(origCtx) 10745 a.ctx = origCtx 10746 }() 10747 10748 defer span.Finish() 10749 resultVar0 := a.app.PostAddToChannelMessage(user, addedUser, channel, postRootId) 10750 10751 if resultVar0 != nil { 10752 span.LogFields(spanlog.Error(resultVar0)) 10753 ext.Error.Set(span, true) 10754 } 10755 10756 return resultVar0 10757 } 10758 10759 func (a *OpenTracingAppLayer) PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch { 10760 origCtx := a.ctx 10761 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostPatchWithProxyRemovedFromImageURLs") 10762 10763 a.ctx = newCtx 10764 a.app.Srv().Store.SetContext(newCtx) 10765 defer func() { 10766 a.app.Srv().Store.SetContext(origCtx) 10767 a.ctx = origCtx 10768 }() 10769 10770 defer span.Finish() 10771 resultVar0 := a.app.PostPatchWithProxyRemovedFromImageURLs(patch) 10772 10773 return resultVar0 10774 } 10775 10776 func (a *OpenTracingAppLayer) PostUpdateChannelDisplayNameMessage(userId string, channel *model.Channel, oldChannelDisplayName string, newChannelDisplayName string) *model.AppError { 10777 origCtx := a.ctx 10778 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelDisplayNameMessage") 10779 10780 a.ctx = newCtx 10781 a.app.Srv().Store.SetContext(newCtx) 10782 defer func() { 10783 a.app.Srv().Store.SetContext(origCtx) 10784 a.ctx = origCtx 10785 }() 10786 10787 defer span.Finish() 10788 resultVar0 := a.app.PostUpdateChannelDisplayNameMessage(userId, channel, oldChannelDisplayName, newChannelDisplayName) 10789 10790 if resultVar0 != nil { 10791 span.LogFields(spanlog.Error(resultVar0)) 10792 ext.Error.Set(span, true) 10793 } 10794 10795 return resultVar0 10796 } 10797 10798 func (a *OpenTracingAppLayer) PostUpdateChannelHeaderMessage(userId string, channel *model.Channel, oldChannelHeader string, newChannelHeader string) *model.AppError { 10799 origCtx := a.ctx 10800 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelHeaderMessage") 10801 10802 a.ctx = newCtx 10803 a.app.Srv().Store.SetContext(newCtx) 10804 defer func() { 10805 a.app.Srv().Store.SetContext(origCtx) 10806 a.ctx = origCtx 10807 }() 10808 10809 defer span.Finish() 10810 resultVar0 := a.app.PostUpdateChannelHeaderMessage(userId, channel, oldChannelHeader, newChannelHeader) 10811 10812 if resultVar0 != nil { 10813 span.LogFields(spanlog.Error(resultVar0)) 10814 ext.Error.Set(span, true) 10815 } 10816 10817 return resultVar0 10818 } 10819 10820 func (a *OpenTracingAppLayer) PostUpdateChannelPurposeMessage(userId string, channel *model.Channel, oldChannelPurpose string, newChannelPurpose string) *model.AppError { 10821 origCtx := a.ctx 10822 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostUpdateChannelPurposeMessage") 10823 10824 a.ctx = newCtx 10825 a.app.Srv().Store.SetContext(newCtx) 10826 defer func() { 10827 a.app.Srv().Store.SetContext(origCtx) 10828 a.ctx = origCtx 10829 }() 10830 10831 defer span.Finish() 10832 resultVar0 := a.app.PostUpdateChannelPurposeMessage(userId, channel, oldChannelPurpose, newChannelPurpose) 10833 10834 if resultVar0 != nil { 10835 span.LogFields(spanlog.Error(resultVar0)) 10836 ext.Error.Set(span, true) 10837 } 10838 10839 return resultVar0 10840 } 10841 10842 func (a *OpenTracingAppLayer) PostWithProxyAddedToImageURLs(post *model.Post) *model.Post { 10843 origCtx := a.ctx 10844 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyAddedToImageURLs") 10845 10846 a.ctx = newCtx 10847 a.app.Srv().Store.SetContext(newCtx) 10848 defer func() { 10849 a.app.Srv().Store.SetContext(origCtx) 10850 a.ctx = origCtx 10851 }() 10852 10853 defer span.Finish() 10854 resultVar0 := a.app.PostWithProxyAddedToImageURLs(post) 10855 10856 return resultVar0 10857 } 10858 10859 func (a *OpenTracingAppLayer) PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post { 10860 origCtx := a.ctx 10861 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyRemovedFromImageURLs") 10862 10863 a.ctx = newCtx 10864 a.app.Srv().Store.SetContext(newCtx) 10865 defer func() { 10866 a.app.Srv().Store.SetContext(origCtx) 10867 a.ctx = origCtx 10868 }() 10869 10870 defer span.Finish() 10871 resultVar0 := a.app.PostWithProxyRemovedFromImageURLs(post) 10872 10873 return resultVar0 10874 } 10875 10876 func (a *OpenTracingAppLayer) PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post { 10877 origCtx := a.ctx 10878 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostForClient") 10879 10880 a.ctx = newCtx 10881 a.app.Srv().Store.SetContext(newCtx) 10882 defer func() { 10883 a.app.Srv().Store.SetContext(origCtx) 10884 a.ctx = origCtx 10885 }() 10886 10887 defer span.Finish() 10888 resultVar0 := a.app.PreparePostForClient(originalPost, isNewPost, isEditPost) 10889 10890 return resultVar0 10891 } 10892 10893 func (a *OpenTracingAppLayer) PreparePostListForClient(originalList *model.PostList) *model.PostList { 10894 origCtx := a.ctx 10895 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostListForClient") 10896 10897 a.ctx = newCtx 10898 a.app.Srv().Store.SetContext(newCtx) 10899 defer func() { 10900 a.app.Srv().Store.SetContext(origCtx) 10901 a.ctx = origCtx 10902 }() 10903 10904 defer span.Finish() 10905 resultVar0 := a.app.PreparePostListForClient(originalList) 10906 10907 return resultVar0 10908 } 10909 10910 func (a *OpenTracingAppLayer) ProcessSlackAttachments(attachments []*model.SlackAttachment) []*model.SlackAttachment { 10911 origCtx := a.ctx 10912 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackAttachments") 10913 10914 a.ctx = newCtx 10915 a.app.Srv().Store.SetContext(newCtx) 10916 defer func() { 10917 a.app.Srv().Store.SetContext(origCtx) 10918 a.ctx = origCtx 10919 }() 10920 10921 defer span.Finish() 10922 resultVar0 := a.app.ProcessSlackAttachments(attachments) 10923 10924 return resultVar0 10925 } 10926 10927 func (a *OpenTracingAppLayer) ProcessSlackText(text string) string { 10928 origCtx := a.ctx 10929 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ProcessSlackText") 10930 10931 a.ctx = newCtx 10932 a.app.Srv().Store.SetContext(newCtx) 10933 defer func() { 10934 a.app.Srv().Store.SetContext(origCtx) 10935 a.ctx = origCtx 10936 }() 10937 10938 defer span.Finish() 10939 resultVar0 := a.app.ProcessSlackText(text) 10940 10941 return resultVar0 10942 } 10943 10944 func (a *OpenTracingAppLayer) PromoteGuestToUser(user *model.User, requestorId string) *model.AppError { 10945 origCtx := a.ctx 10946 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PromoteGuestToUser") 10947 10948 a.ctx = newCtx 10949 a.app.Srv().Store.SetContext(newCtx) 10950 defer func() { 10951 a.app.Srv().Store.SetContext(origCtx) 10952 a.ctx = origCtx 10953 }() 10954 10955 defer span.Finish() 10956 resultVar0 := a.app.PromoteGuestToUser(user, requestorId) 10957 10958 if resultVar0 != nil { 10959 span.LogFields(spanlog.Error(resultVar0)) 10960 ext.Error.Set(span, true) 10961 } 10962 10963 return resultVar0 10964 } 10965 10966 func (a *OpenTracingAppLayer) Publish(message *model.WebSocketEvent) { 10967 origCtx := a.ctx 10968 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Publish") 10969 10970 a.ctx = newCtx 10971 a.app.Srv().Store.SetContext(newCtx) 10972 defer func() { 10973 a.app.Srv().Store.SetContext(origCtx) 10974 a.ctx = origCtx 10975 }() 10976 10977 defer span.Finish() 10978 a.app.Publish(message) 10979 } 10980 10981 func (a *OpenTracingAppLayer) PublishSkipClusterSend(message *model.WebSocketEvent) { 10982 origCtx := a.ctx 10983 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishSkipClusterSend") 10984 10985 a.ctx = newCtx 10986 a.app.Srv().Store.SetContext(newCtx) 10987 defer func() { 10988 a.app.Srv().Store.SetContext(origCtx) 10989 a.ctx = origCtx 10990 }() 10991 10992 defer span.Finish() 10993 a.app.PublishSkipClusterSend(message) 10994 } 10995 10996 func (a *OpenTracingAppLayer) PublishUserTyping(userId string, channelId string, parentId string) *model.AppError { 10997 origCtx := a.ctx 10998 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishUserTyping") 10999 11000 a.ctx = newCtx 11001 a.app.Srv().Store.SetContext(newCtx) 11002 defer func() { 11003 a.app.Srv().Store.SetContext(origCtx) 11004 a.ctx = origCtx 11005 }() 11006 11007 defer span.Finish() 11008 resultVar0 := a.app.PublishUserTyping(userId, channelId, parentId) 11009 11010 if resultVar0 != nil { 11011 span.LogFields(spanlog.Error(resultVar0)) 11012 ext.Error.Set(span, true) 11013 } 11014 11015 return resultVar0 11016 } 11017 11018 func (a *OpenTracingAppLayer) PurgeBleveIndexes() *model.AppError { 11019 origCtx := a.ctx 11020 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeBleveIndexes") 11021 11022 a.ctx = newCtx 11023 a.app.Srv().Store.SetContext(newCtx) 11024 defer func() { 11025 a.app.Srv().Store.SetContext(origCtx) 11026 a.ctx = origCtx 11027 }() 11028 11029 defer span.Finish() 11030 resultVar0 := a.app.PurgeBleveIndexes() 11031 11032 if resultVar0 != nil { 11033 span.LogFields(spanlog.Error(resultVar0)) 11034 ext.Error.Set(span, true) 11035 } 11036 11037 return resultVar0 11038 } 11039 11040 func (a *OpenTracingAppLayer) PurgeElasticsearchIndexes() *model.AppError { 11041 origCtx := a.ctx 11042 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeElasticsearchIndexes") 11043 11044 a.ctx = newCtx 11045 a.app.Srv().Store.SetContext(newCtx) 11046 defer func() { 11047 a.app.Srv().Store.SetContext(origCtx) 11048 a.ctx = origCtx 11049 }() 11050 11051 defer span.Finish() 11052 resultVar0 := a.app.PurgeElasticsearchIndexes() 11053 11054 if resultVar0 != nil { 11055 span.LogFields(spanlog.Error(resultVar0)) 11056 ext.Error.Set(span, true) 11057 } 11058 11059 return resultVar0 11060 } 11061 11062 func (a *OpenTracingAppLayer) ReadFile(path string) ([]byte, *model.AppError) { 11063 origCtx := a.ctx 11064 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReadFile") 11065 11066 a.ctx = newCtx 11067 a.app.Srv().Store.SetContext(newCtx) 11068 defer func() { 11069 a.app.Srv().Store.SetContext(origCtx) 11070 a.ctx = origCtx 11071 }() 11072 11073 defer span.Finish() 11074 resultVar0, resultVar1 := a.app.ReadFile(path) 11075 11076 if resultVar1 != nil { 11077 span.LogFields(spanlog.Error(resultVar1)) 11078 ext.Error.Set(span, true) 11079 } 11080 11081 return resultVar0, resultVar1 11082 } 11083 11084 func (a *OpenTracingAppLayer) RecycleDatabaseConnection() { 11085 origCtx := a.ctx 11086 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RecycleDatabaseConnection") 11087 11088 a.ctx = newCtx 11089 a.app.Srv().Store.SetContext(newCtx) 11090 defer func() { 11091 a.app.Srv().Store.SetContext(origCtx) 11092 a.ctx = origCtx 11093 }() 11094 11095 defer span.Finish() 11096 a.app.RecycleDatabaseConnection() 11097 } 11098 11099 func (a *OpenTracingAppLayer) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) { 11100 origCtx := a.ctx 11101 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenCommandToken") 11102 11103 a.ctx = newCtx 11104 a.app.Srv().Store.SetContext(newCtx) 11105 defer func() { 11106 a.app.Srv().Store.SetContext(origCtx) 11107 a.ctx = origCtx 11108 }() 11109 11110 defer span.Finish() 11111 resultVar0, resultVar1 := a.app.RegenCommandToken(cmd) 11112 11113 if resultVar1 != nil { 11114 span.LogFields(spanlog.Error(resultVar1)) 11115 ext.Error.Set(span, true) 11116 } 11117 11118 return resultVar0, resultVar1 11119 } 11120 11121 func (a *OpenTracingAppLayer) RegenOutgoingWebhookToken(hook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 11122 origCtx := a.ctx 11123 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenOutgoingWebhookToken") 11124 11125 a.ctx = newCtx 11126 a.app.Srv().Store.SetContext(newCtx) 11127 defer func() { 11128 a.app.Srv().Store.SetContext(origCtx) 11129 a.ctx = origCtx 11130 }() 11131 11132 defer span.Finish() 11133 resultVar0, resultVar1 := a.app.RegenOutgoingWebhookToken(hook) 11134 11135 if resultVar1 != nil { 11136 span.LogFields(spanlog.Error(resultVar1)) 11137 ext.Error.Set(span, true) 11138 } 11139 11140 return resultVar0, resultVar1 11141 } 11142 11143 func (a *OpenTracingAppLayer) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 11144 origCtx := a.ctx 11145 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateOAuthAppSecret") 11146 11147 a.ctx = newCtx 11148 a.app.Srv().Store.SetContext(newCtx) 11149 defer func() { 11150 a.app.Srv().Store.SetContext(origCtx) 11151 a.ctx = origCtx 11152 }() 11153 11154 defer span.Finish() 11155 resultVar0, resultVar1 := a.app.RegenerateOAuthAppSecret(app) 11156 11157 if resultVar1 != nil { 11158 span.LogFields(spanlog.Error(resultVar1)) 11159 ext.Error.Set(span, true) 11160 } 11161 11162 return resultVar0, resultVar1 11163 } 11164 11165 func (a *OpenTracingAppLayer) RegenerateTeamInviteId(teamId string) (*model.Team, *model.AppError) { 11166 origCtx := a.ctx 11167 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateTeamInviteId") 11168 11169 a.ctx = newCtx 11170 a.app.Srv().Store.SetContext(newCtx) 11171 defer func() { 11172 a.app.Srv().Store.SetContext(origCtx) 11173 a.ctx = origCtx 11174 }() 11175 11176 defer span.Finish() 11177 resultVar0, resultVar1 := a.app.RegenerateTeamInviteId(teamId) 11178 11179 if resultVar1 != nil { 11180 span.LogFields(spanlog.Error(resultVar1)) 11181 ext.Error.Set(span, true) 11182 } 11183 11184 return resultVar0, resultVar1 11185 } 11186 11187 func (a *OpenTracingAppLayer) RegisterPluginCommand(pluginId string, command *model.Command) error { 11188 origCtx := a.ctx 11189 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegisterPluginCommand") 11190 11191 a.ctx = newCtx 11192 a.app.Srv().Store.SetContext(newCtx) 11193 defer func() { 11194 a.app.Srv().Store.SetContext(origCtx) 11195 a.ctx = origCtx 11196 }() 11197 11198 defer span.Finish() 11199 resultVar0 := a.app.RegisterPluginCommand(pluginId, command) 11200 11201 if resultVar0 != nil { 11202 span.LogFields(spanlog.Error(resultVar0)) 11203 ext.Error.Set(span, true) 11204 } 11205 11206 return resultVar0 11207 } 11208 11209 func (a *OpenTracingAppLayer) ReloadConfig() error { 11210 origCtx := a.ctx 11211 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReloadConfig") 11212 11213 a.ctx = newCtx 11214 a.app.Srv().Store.SetContext(newCtx) 11215 defer func() { 11216 a.app.Srv().Store.SetContext(origCtx) 11217 a.ctx = origCtx 11218 }() 11219 11220 defer span.Finish() 11221 resultVar0 := a.app.ReloadConfig() 11222 11223 if resultVar0 != nil { 11224 span.LogFields(spanlog.Error(resultVar0)) 11225 ext.Error.Set(span, true) 11226 } 11227 11228 return resultVar0 11229 } 11230 11231 func (a *OpenTracingAppLayer) RemoveAllDeactivatedMembersFromChannel(channel *model.Channel) *model.AppError { 11232 origCtx := a.ctx 11233 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveAllDeactivatedMembersFromChannel") 11234 11235 a.ctx = newCtx 11236 a.app.Srv().Store.SetContext(newCtx) 11237 defer func() { 11238 a.app.Srv().Store.SetContext(origCtx) 11239 a.ctx = origCtx 11240 }() 11241 11242 defer span.Finish() 11243 resultVar0 := a.app.RemoveAllDeactivatedMembersFromChannel(channel) 11244 11245 if resultVar0 != nil { 11246 span.LogFields(spanlog.Error(resultVar0)) 11247 ext.Error.Set(span, true) 11248 } 11249 11250 return resultVar0 11251 } 11252 11253 func (a *OpenTracingAppLayer) RemoveConfigListener(id string) { 11254 origCtx := a.ctx 11255 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveConfigListener") 11256 11257 a.ctx = newCtx 11258 a.app.Srv().Store.SetContext(newCtx) 11259 defer func() { 11260 a.app.Srv().Store.SetContext(origCtx) 11261 a.ctx = origCtx 11262 }() 11263 11264 defer span.Finish() 11265 a.app.RemoveConfigListener(id) 11266 } 11267 11268 func (a *OpenTracingAppLayer) RemoveFile(path string) *model.AppError { 11269 origCtx := a.ctx 11270 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveFile") 11271 11272 a.ctx = newCtx 11273 a.app.Srv().Store.SetContext(newCtx) 11274 defer func() { 11275 a.app.Srv().Store.SetContext(origCtx) 11276 a.ctx = origCtx 11277 }() 11278 11279 defer span.Finish() 11280 resultVar0 := a.app.RemoveFile(path) 11281 11282 if resultVar0 != nil { 11283 span.LogFields(spanlog.Error(resultVar0)) 11284 ext.Error.Set(span, true) 11285 } 11286 11287 return resultVar0 11288 } 11289 11290 func (a *OpenTracingAppLayer) RemovePlugin(id string) *model.AppError { 11291 origCtx := a.ctx 11292 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePlugin") 11293 11294 a.ctx = newCtx 11295 a.app.Srv().Store.SetContext(newCtx) 11296 defer func() { 11297 a.app.Srv().Store.SetContext(origCtx) 11298 a.ctx = origCtx 11299 }() 11300 11301 defer span.Finish() 11302 resultVar0 := a.app.RemovePlugin(id) 11303 11304 if resultVar0 != nil { 11305 span.LogFields(spanlog.Error(resultVar0)) 11306 ext.Error.Set(span, true) 11307 } 11308 11309 return resultVar0 11310 } 11311 11312 func (a *OpenTracingAppLayer) RemovePluginFromData(data model.PluginEventData) { 11313 origCtx := a.ctx 11314 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemovePluginFromData") 11315 11316 a.ctx = newCtx 11317 a.app.Srv().Store.SetContext(newCtx) 11318 defer func() { 11319 a.app.Srv().Store.SetContext(origCtx) 11320 a.ctx = origCtx 11321 }() 11322 11323 defer span.Finish() 11324 a.app.RemovePluginFromData(data) 11325 } 11326 11327 func (a *OpenTracingAppLayer) RemoveSamlIdpCertificate() *model.AppError { 11328 origCtx := a.ctx 11329 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlIdpCertificate") 11330 11331 a.ctx = newCtx 11332 a.app.Srv().Store.SetContext(newCtx) 11333 defer func() { 11334 a.app.Srv().Store.SetContext(origCtx) 11335 a.ctx = origCtx 11336 }() 11337 11338 defer span.Finish() 11339 resultVar0 := a.app.RemoveSamlIdpCertificate() 11340 11341 if resultVar0 != nil { 11342 span.LogFields(spanlog.Error(resultVar0)) 11343 ext.Error.Set(span, true) 11344 } 11345 11346 return resultVar0 11347 } 11348 11349 func (a *OpenTracingAppLayer) RemoveSamlPrivateCertificate() *model.AppError { 11350 origCtx := a.ctx 11351 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPrivateCertificate") 11352 11353 a.ctx = newCtx 11354 a.app.Srv().Store.SetContext(newCtx) 11355 defer func() { 11356 a.app.Srv().Store.SetContext(origCtx) 11357 a.ctx = origCtx 11358 }() 11359 11360 defer span.Finish() 11361 resultVar0 := a.app.RemoveSamlPrivateCertificate() 11362 11363 if resultVar0 != nil { 11364 span.LogFields(spanlog.Error(resultVar0)) 11365 ext.Error.Set(span, true) 11366 } 11367 11368 return resultVar0 11369 } 11370 11371 func (a *OpenTracingAppLayer) RemoveSamlPublicCertificate() *model.AppError { 11372 origCtx := a.ctx 11373 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPublicCertificate") 11374 11375 a.ctx = newCtx 11376 a.app.Srv().Store.SetContext(newCtx) 11377 defer func() { 11378 a.app.Srv().Store.SetContext(origCtx) 11379 a.ctx = origCtx 11380 }() 11381 11382 defer span.Finish() 11383 resultVar0 := a.app.RemoveSamlPublicCertificate() 11384 11385 if resultVar0 != nil { 11386 span.LogFields(spanlog.Error(resultVar0)) 11387 ext.Error.Set(span, true) 11388 } 11389 11390 return resultVar0 11391 } 11392 11393 func (a *OpenTracingAppLayer) RemoveTeamIcon(teamId string) *model.AppError { 11394 origCtx := a.ctx 11395 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamIcon") 11396 11397 a.ctx = newCtx 11398 a.app.Srv().Store.SetContext(newCtx) 11399 defer func() { 11400 a.app.Srv().Store.SetContext(origCtx) 11401 a.ctx = origCtx 11402 }() 11403 11404 defer span.Finish() 11405 resultVar0 := a.app.RemoveTeamIcon(teamId) 11406 11407 if resultVar0 != nil { 11408 span.LogFields(spanlog.Error(resultVar0)) 11409 ext.Error.Set(span, true) 11410 } 11411 11412 return resultVar0 11413 } 11414 11415 func (a *OpenTracingAppLayer) RemoveTeamMemberFromTeam(teamMember *model.TeamMember, requestorId string) *model.AppError { 11416 origCtx := a.ctx 11417 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveTeamMemberFromTeam") 11418 11419 a.ctx = newCtx 11420 a.app.Srv().Store.SetContext(newCtx) 11421 defer func() { 11422 a.app.Srv().Store.SetContext(origCtx) 11423 a.ctx = origCtx 11424 }() 11425 11426 defer span.Finish() 11427 resultVar0 := a.app.RemoveTeamMemberFromTeam(teamMember, requestorId) 11428 11429 if resultVar0 != nil { 11430 span.LogFields(spanlog.Error(resultVar0)) 11431 ext.Error.Set(span, true) 11432 } 11433 11434 return resultVar0 11435 } 11436 11437 func (a *OpenTracingAppLayer) RemoveUserFromChannel(userIdToRemove string, removerUserId string, channel *model.Channel) *model.AppError { 11438 origCtx := a.ctx 11439 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromChannel") 11440 11441 a.ctx = newCtx 11442 a.app.Srv().Store.SetContext(newCtx) 11443 defer func() { 11444 a.app.Srv().Store.SetContext(origCtx) 11445 a.ctx = origCtx 11446 }() 11447 11448 defer span.Finish() 11449 resultVar0 := a.app.RemoveUserFromChannel(userIdToRemove, removerUserId, channel) 11450 11451 if resultVar0 != nil { 11452 span.LogFields(spanlog.Error(resultVar0)) 11453 ext.Error.Set(span, true) 11454 } 11455 11456 return resultVar0 11457 } 11458 11459 func (a *OpenTracingAppLayer) RemoveUserFromTeam(teamId string, userId string, requestorId string) *model.AppError { 11460 origCtx := a.ctx 11461 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromTeam") 11462 11463 a.ctx = newCtx 11464 a.app.Srv().Store.SetContext(newCtx) 11465 defer func() { 11466 a.app.Srv().Store.SetContext(origCtx) 11467 a.ctx = origCtx 11468 }() 11469 11470 defer span.Finish() 11471 resultVar0 := a.app.RemoveUserFromTeam(teamId, userId, requestorId) 11472 11473 if resultVar0 != nil { 11474 span.LogFields(spanlog.Error(resultVar0)) 11475 ext.Error.Set(span, true) 11476 } 11477 11478 return resultVar0 11479 } 11480 11481 func (a *OpenTracingAppLayer) RemoveUsersFromChannelNotMemberOfTeam(remover *model.User, channel *model.Channel, team *model.Team) *model.AppError { 11482 origCtx := a.ctx 11483 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUsersFromChannelNotMemberOfTeam") 11484 11485 a.ctx = newCtx 11486 a.app.Srv().Store.SetContext(newCtx) 11487 defer func() { 11488 a.app.Srv().Store.SetContext(origCtx) 11489 a.ctx = origCtx 11490 }() 11491 11492 defer span.Finish() 11493 resultVar0 := a.app.RemoveUsersFromChannelNotMemberOfTeam(remover, channel, team) 11494 11495 if resultVar0 != nil { 11496 span.LogFields(spanlog.Error(resultVar0)) 11497 ext.Error.Set(span, true) 11498 } 11499 11500 return resultVar0 11501 } 11502 11503 func (a *OpenTracingAppLayer) RenameChannel(channel *model.Channel, newChannelName string, newDisplayName string) (*model.Channel, *model.AppError) { 11504 origCtx := a.ctx 11505 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameChannel") 11506 11507 a.ctx = newCtx 11508 a.app.Srv().Store.SetContext(newCtx) 11509 defer func() { 11510 a.app.Srv().Store.SetContext(origCtx) 11511 a.ctx = origCtx 11512 }() 11513 11514 defer span.Finish() 11515 resultVar0, resultVar1 := a.app.RenameChannel(channel, newChannelName, newDisplayName) 11516 11517 if resultVar1 != nil { 11518 span.LogFields(spanlog.Error(resultVar1)) 11519 ext.Error.Set(span, true) 11520 } 11521 11522 return resultVar0, resultVar1 11523 } 11524 11525 func (a *OpenTracingAppLayer) RenameTeam(team *model.Team, newTeamName string, newDisplayName string) (*model.Team, *model.AppError) { 11526 origCtx := a.ctx 11527 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameTeam") 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, resultVar1 := a.app.RenameTeam(team, newTeamName, newDisplayName) 11538 11539 if resultVar1 != nil { 11540 span.LogFields(spanlog.Error(resultVar1)) 11541 ext.Error.Set(span, true) 11542 } 11543 11544 return resultVar0, resultVar1 11545 } 11546 11547 func (a *OpenTracingAppLayer) ResetPasswordFromToken(userSuppliedTokenString string, newPassword string) *model.AppError { 11548 origCtx := a.ctx 11549 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPasswordFromToken") 11550 11551 a.ctx = newCtx 11552 a.app.Srv().Store.SetContext(newCtx) 11553 defer func() { 11554 a.app.Srv().Store.SetContext(origCtx) 11555 a.ctx = origCtx 11556 }() 11557 11558 defer span.Finish() 11559 resultVar0 := a.app.ResetPasswordFromToken(userSuppliedTokenString, newPassword) 11560 11561 if resultVar0 != nil { 11562 span.LogFields(spanlog.Error(resultVar0)) 11563 ext.Error.Set(span, true) 11564 } 11565 11566 return resultVar0 11567 } 11568 11569 func (a *OpenTracingAppLayer) ResetPermissionsSystem() *model.AppError { 11570 origCtx := a.ctx 11571 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPermissionsSystem") 11572 11573 a.ctx = newCtx 11574 a.app.Srv().Store.SetContext(newCtx) 11575 defer func() { 11576 a.app.Srv().Store.SetContext(origCtx) 11577 a.ctx = origCtx 11578 }() 11579 11580 defer span.Finish() 11581 resultVar0 := a.app.ResetPermissionsSystem() 11582 11583 if resultVar0 != nil { 11584 span.LogFields(spanlog.Error(resultVar0)) 11585 ext.Error.Set(span, true) 11586 } 11587 11588 return resultVar0 11589 } 11590 11591 func (a *OpenTracingAppLayer) RestoreChannel(channel *model.Channel, userId string) (*model.Channel, *model.AppError) { 11592 origCtx := a.ctx 11593 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreChannel") 11594 11595 a.ctx = newCtx 11596 a.app.Srv().Store.SetContext(newCtx) 11597 defer func() { 11598 a.app.Srv().Store.SetContext(origCtx) 11599 a.ctx = origCtx 11600 }() 11601 11602 defer span.Finish() 11603 resultVar0, resultVar1 := a.app.RestoreChannel(channel, userId) 11604 11605 if resultVar1 != nil { 11606 span.LogFields(spanlog.Error(resultVar1)) 11607 ext.Error.Set(span, true) 11608 } 11609 11610 return resultVar0, resultVar1 11611 } 11612 11613 func (a *OpenTracingAppLayer) RestoreTeam(teamId string) *model.AppError { 11614 origCtx := a.ctx 11615 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreTeam") 11616 11617 a.ctx = newCtx 11618 a.app.Srv().Store.SetContext(newCtx) 11619 defer func() { 11620 a.app.Srv().Store.SetContext(origCtx) 11621 a.ctx = origCtx 11622 }() 11623 11624 defer span.Finish() 11625 resultVar0 := a.app.RestoreTeam(teamId) 11626 11627 if resultVar0 != nil { 11628 span.LogFields(spanlog.Error(resultVar0)) 11629 ext.Error.Set(span, true) 11630 } 11631 11632 return resultVar0 11633 } 11634 11635 func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { 11636 origCtx := a.ctx 11637 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersGetByPermissions") 11638 11639 a.ctx = newCtx 11640 a.app.Srv().Store.SetContext(newCtx) 11641 defer func() { 11642 a.app.Srv().Store.SetContext(origCtx) 11643 a.ctx = origCtx 11644 }() 11645 11646 defer span.Finish() 11647 resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userId, options) 11648 11649 if resultVar1 != nil { 11650 span.LogFields(spanlog.Error(resultVar1)) 11651 ext.Error.Set(span, true) 11652 } 11653 11654 return resultVar0, resultVar1 11655 } 11656 11657 func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { 11658 origCtx := a.ctx 11659 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersSearchByPermissions") 11660 11661 a.ctx = newCtx 11662 a.app.Srv().Store.SetContext(newCtx) 11663 defer func() { 11664 a.app.Srv().Store.SetContext(origCtx) 11665 a.ctx = origCtx 11666 }() 11667 11668 defer span.Finish() 11669 resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userId, options) 11670 11671 if resultVar1 != nil { 11672 span.LogFields(spanlog.Error(resultVar1)) 11673 ext.Error.Set(span, true) 11674 } 11675 11676 return resultVar0, resultVar1 11677 } 11678 11679 func (a *OpenTracingAppLayer) RevokeAccessToken(token string) *model.AppError { 11680 origCtx := a.ctx 11681 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAccessToken") 11682 11683 a.ctx = newCtx 11684 a.app.Srv().Store.SetContext(newCtx) 11685 defer func() { 11686 a.app.Srv().Store.SetContext(origCtx) 11687 a.ctx = origCtx 11688 }() 11689 11690 defer span.Finish() 11691 resultVar0 := a.app.RevokeAccessToken(token) 11692 11693 if resultVar0 != nil { 11694 span.LogFields(spanlog.Error(resultVar0)) 11695 ext.Error.Set(span, true) 11696 } 11697 11698 return resultVar0 11699 } 11700 11701 func (a *OpenTracingAppLayer) RevokeAllSessions(userId string) *model.AppError { 11702 origCtx := a.ctx 11703 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions") 11704 11705 a.ctx = newCtx 11706 a.app.Srv().Store.SetContext(newCtx) 11707 defer func() { 11708 a.app.Srv().Store.SetContext(origCtx) 11709 a.ctx = origCtx 11710 }() 11711 11712 defer span.Finish() 11713 resultVar0 := a.app.RevokeAllSessions(userId) 11714 11715 if resultVar0 != nil { 11716 span.LogFields(spanlog.Error(resultVar0)) 11717 ext.Error.Set(span, true) 11718 } 11719 11720 return resultVar0 11721 } 11722 11723 func (a *OpenTracingAppLayer) RevokeSession(session *model.Session) *model.AppError { 11724 origCtx := a.ctx 11725 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSession") 11726 11727 a.ctx = newCtx 11728 a.app.Srv().Store.SetContext(newCtx) 11729 defer func() { 11730 a.app.Srv().Store.SetContext(origCtx) 11731 a.ctx = origCtx 11732 }() 11733 11734 defer span.Finish() 11735 resultVar0 := a.app.RevokeSession(session) 11736 11737 if resultVar0 != nil { 11738 span.LogFields(spanlog.Error(resultVar0)) 11739 ext.Error.Set(span, true) 11740 } 11741 11742 return resultVar0 11743 } 11744 11745 func (a *OpenTracingAppLayer) RevokeSessionById(sessionId string) *model.AppError { 11746 origCtx := a.ctx 11747 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionById") 11748 11749 a.ctx = newCtx 11750 a.app.Srv().Store.SetContext(newCtx) 11751 defer func() { 11752 a.app.Srv().Store.SetContext(origCtx) 11753 a.ctx = origCtx 11754 }() 11755 11756 defer span.Finish() 11757 resultVar0 := a.app.RevokeSessionById(sessionId) 11758 11759 if resultVar0 != nil { 11760 span.LogFields(spanlog.Error(resultVar0)) 11761 ext.Error.Set(span, true) 11762 } 11763 11764 return resultVar0 11765 } 11766 11767 func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError { 11768 origCtx := a.ctx 11769 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId") 11770 11771 a.ctx = newCtx 11772 a.app.Srv().Store.SetContext(newCtx) 11773 defer func() { 11774 a.app.Srv().Store.SetContext(origCtx) 11775 a.ctx = origCtx 11776 }() 11777 11778 defer span.Finish() 11779 resultVar0 := a.app.RevokeSessionsForDeviceId(userId, deviceId, currentSessionId) 11780 11781 if resultVar0 != nil { 11782 span.LogFields(spanlog.Error(resultVar0)) 11783 ext.Error.Set(span, true) 11784 } 11785 11786 return resultVar0 11787 } 11788 11789 func (a *OpenTracingAppLayer) RevokeSessionsFromAllUsers() *model.AppError { 11790 origCtx := a.ctx 11791 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsFromAllUsers") 11792 11793 a.ctx = newCtx 11794 a.app.Srv().Store.SetContext(newCtx) 11795 defer func() { 11796 a.app.Srv().Store.SetContext(origCtx) 11797 a.ctx = origCtx 11798 }() 11799 11800 defer span.Finish() 11801 resultVar0 := a.app.RevokeSessionsFromAllUsers() 11802 11803 if resultVar0 != nil { 11804 span.LogFields(spanlog.Error(resultVar0)) 11805 ext.Error.Set(span, true) 11806 } 11807 11808 return resultVar0 11809 } 11810 11811 func (a *OpenTracingAppLayer) RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError { 11812 origCtx := a.ctx 11813 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeUserAccessToken") 11814 11815 a.ctx = newCtx 11816 a.app.Srv().Store.SetContext(newCtx) 11817 defer func() { 11818 a.app.Srv().Store.SetContext(origCtx) 11819 a.ctx = origCtx 11820 }() 11821 11822 defer span.Finish() 11823 resultVar0 := a.app.RevokeUserAccessToken(token) 11824 11825 if resultVar0 != nil { 11826 span.LogFields(spanlog.Error(resultVar0)) 11827 ext.Error.Set(span, true) 11828 } 11829 11830 return resultVar0 11831 } 11832 11833 func (a *OpenTracingAppLayer) RolesGrantPermission(roleNames []string, permissionId string) bool { 11834 origCtx := a.ctx 11835 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RolesGrantPermission") 11836 11837 a.ctx = newCtx 11838 a.app.Srv().Store.SetContext(newCtx) 11839 defer func() { 11840 a.app.Srv().Store.SetContext(origCtx) 11841 a.ctx = origCtx 11842 }() 11843 11844 defer span.Finish() 11845 resultVar0 := a.app.RolesGrantPermission(roleNames, permissionId) 11846 11847 return resultVar0 11848 } 11849 11850 func (a *OpenTracingAppLayer) SanitizeProfile(user *model.User, asAdmin bool) { 11851 origCtx := a.ctx 11852 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeProfile") 11853 11854 a.ctx = newCtx 11855 a.app.Srv().Store.SetContext(newCtx) 11856 defer func() { 11857 a.app.Srv().Store.SetContext(origCtx) 11858 a.ctx = origCtx 11859 }() 11860 11861 defer span.Finish() 11862 a.app.SanitizeProfile(user, asAdmin) 11863 } 11864 11865 func (a *OpenTracingAppLayer) SanitizeTeam(session model.Session, team *model.Team) *model.Team { 11866 origCtx := a.ctx 11867 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeam") 11868 11869 a.ctx = newCtx 11870 a.app.Srv().Store.SetContext(newCtx) 11871 defer func() { 11872 a.app.Srv().Store.SetContext(origCtx) 11873 a.ctx = origCtx 11874 }() 11875 11876 defer span.Finish() 11877 resultVar0 := a.app.SanitizeTeam(session, team) 11878 11879 return resultVar0 11880 } 11881 11882 func (a *OpenTracingAppLayer) SanitizeTeams(session model.Session, teams []*model.Team) []*model.Team { 11883 origCtx := a.ctx 11884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeTeams") 11885 11886 a.ctx = newCtx 11887 a.app.Srv().Store.SetContext(newCtx) 11888 defer func() { 11889 a.app.Srv().Store.SetContext(origCtx) 11890 a.ctx = origCtx 11891 }() 11892 11893 defer span.Finish() 11894 resultVar0 := a.app.SanitizeTeams(session, teams) 11895 11896 return resultVar0 11897 } 11898 11899 func (a *OpenTracingAppLayer) SaveAndBroadcastStatus(status *model.Status) { 11900 origCtx := a.ctx 11901 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveAndBroadcastStatus") 11902 11903 a.ctx = newCtx 11904 a.app.Srv().Store.SetContext(newCtx) 11905 defer func() { 11906 a.app.Srv().Store.SetContext(origCtx) 11907 a.ctx = origCtx 11908 }() 11909 11910 defer span.Finish() 11911 a.app.SaveAndBroadcastStatus(status) 11912 } 11913 11914 func (a *OpenTracingAppLayer) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError { 11915 origCtx := a.ctx 11916 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveBrandImage") 11917 11918 a.ctx = newCtx 11919 a.app.Srv().Store.SetContext(newCtx) 11920 defer func() { 11921 a.app.Srv().Store.SetContext(origCtx) 11922 a.ctx = origCtx 11923 }() 11924 11925 defer span.Finish() 11926 resultVar0 := a.app.SaveBrandImage(imageData) 11927 11928 if resultVar0 != nil { 11929 span.LogFields(spanlog.Error(resultVar0)) 11930 ext.Error.Set(span, true) 11931 } 11932 11933 return resultVar0 11934 } 11935 11936 func (a *OpenTracingAppLayer) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) { 11937 origCtx := a.ctx 11938 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveComplianceReport") 11939 11940 a.ctx = newCtx 11941 a.app.Srv().Store.SetContext(newCtx) 11942 defer func() { 11943 a.app.Srv().Store.SetContext(origCtx) 11944 a.ctx = origCtx 11945 }() 11946 11947 defer span.Finish() 11948 resultVar0, resultVar1 := a.app.SaveComplianceReport(job) 11949 11950 if resultVar1 != nil { 11951 span.LogFields(spanlog.Error(resultVar1)) 11952 ext.Error.Set(span, true) 11953 } 11954 11955 return resultVar0, resultVar1 11956 } 11957 11958 func (a *OpenTracingAppLayer) SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError { 11959 origCtx := a.ctx 11960 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveConfig") 11961 11962 a.ctx = newCtx 11963 a.app.Srv().Store.SetContext(newCtx) 11964 defer func() { 11965 a.app.Srv().Store.SetContext(origCtx) 11966 a.ctx = origCtx 11967 }() 11968 11969 defer span.Finish() 11970 resultVar0 := a.app.SaveConfig(newCfg, sendConfigChangeClusterMessage) 11971 11972 if resultVar0 != nil { 11973 span.LogFields(spanlog.Error(resultVar0)) 11974 ext.Error.Set(span, true) 11975 } 11976 11977 return resultVar0 11978 } 11979 11980 func (a *OpenTracingAppLayer) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) { 11981 origCtx := a.ctx 11982 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveReactionForPost") 11983 11984 a.ctx = newCtx 11985 a.app.Srv().Store.SetContext(newCtx) 11986 defer func() { 11987 a.app.Srv().Store.SetContext(origCtx) 11988 a.ctx = origCtx 11989 }() 11990 11991 defer span.Finish() 11992 resultVar0, resultVar1 := a.app.SaveReactionForPost(reaction) 11993 11994 if resultVar1 != nil { 11995 span.LogFields(spanlog.Error(resultVar1)) 11996 ext.Error.Set(span, true) 11997 } 11998 11999 return resultVar0, resultVar1 12000 } 12001 12002 func (a *OpenTracingAppLayer) SaveUserTermsOfService(userId string, termsOfServiceId string, accepted bool) *model.AppError { 12003 origCtx := a.ctx 12004 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveUserTermsOfService") 12005 12006 a.ctx = newCtx 12007 a.app.Srv().Store.SetContext(newCtx) 12008 defer func() { 12009 a.app.Srv().Store.SetContext(origCtx) 12010 a.ctx = origCtx 12011 }() 12012 12013 defer span.Finish() 12014 resultVar0 := a.app.SaveUserTermsOfService(userId, termsOfServiceId, accepted) 12015 12016 if resultVar0 != nil { 12017 span.LogFields(spanlog.Error(resultVar0)) 12018 ext.Error.Set(span, true) 12019 } 12020 12021 return resultVar0 12022 } 12023 12024 func (a *OpenTracingAppLayer) SchemesIterator(scope string, batchSize int) func() []*model.Scheme { 12025 origCtx := a.ctx 12026 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SchemesIterator") 12027 12028 a.ctx = newCtx 12029 a.app.Srv().Store.SetContext(newCtx) 12030 defer func() { 12031 a.app.Srv().Store.SetContext(origCtx) 12032 a.ctx = origCtx 12033 }() 12034 12035 defer span.Finish() 12036 resultVar0 := a.app.SchemesIterator(scope, batchSize) 12037 12038 return resultVar0 12039 } 12040 12041 func (a *OpenTracingAppLayer) SearchAllChannels(term string, opts model.ChannelSearchOpts) (*model.ChannelListWithTeamData, int64, *model.AppError) { 12042 origCtx := a.ctx 12043 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllChannels") 12044 12045 a.ctx = newCtx 12046 a.app.Srv().Store.SetContext(newCtx) 12047 defer func() { 12048 a.app.Srv().Store.SetContext(origCtx) 12049 a.ctx = origCtx 12050 }() 12051 12052 defer span.Finish() 12053 resultVar0, resultVar1, resultVar2 := a.app.SearchAllChannels(term, opts) 12054 12055 if resultVar2 != nil { 12056 span.LogFields(spanlog.Error(resultVar2)) 12057 ext.Error.Set(span, true) 12058 } 12059 12060 return resultVar0, resultVar1, resultVar2 12061 } 12062 12063 func (a *OpenTracingAppLayer) SearchAllTeams(searchOpts *model.TeamSearch) ([]*model.Team, int64, *model.AppError) { 12064 origCtx := a.ctx 12065 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchAllTeams") 12066 12067 a.ctx = newCtx 12068 a.app.Srv().Store.SetContext(newCtx) 12069 defer func() { 12070 a.app.Srv().Store.SetContext(origCtx) 12071 a.ctx = origCtx 12072 }() 12073 12074 defer span.Finish() 12075 resultVar0, resultVar1, resultVar2 := a.app.SearchAllTeams(searchOpts) 12076 12077 if resultVar2 != nil { 12078 span.LogFields(spanlog.Error(resultVar2)) 12079 ext.Error.Set(span, true) 12080 } 12081 12082 return resultVar0, resultVar1, resultVar2 12083 } 12084 12085 func (a *OpenTracingAppLayer) SearchArchivedChannels(teamId string, term string, userId string) (*model.ChannelList, *model.AppError) { 12086 origCtx := a.ctx 12087 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchArchivedChannels") 12088 12089 a.ctx = newCtx 12090 a.app.Srv().Store.SetContext(newCtx) 12091 defer func() { 12092 a.app.Srv().Store.SetContext(origCtx) 12093 a.ctx = origCtx 12094 }() 12095 12096 defer span.Finish() 12097 resultVar0, resultVar1 := a.app.SearchArchivedChannels(teamId, term, userId) 12098 12099 if resultVar1 != nil { 12100 span.LogFields(spanlog.Error(resultVar1)) 12101 ext.Error.Set(span, true) 12102 } 12103 12104 return resultVar0, resultVar1 12105 } 12106 12107 func (a *OpenTracingAppLayer) SearchChannels(teamId string, term string) (*model.ChannelList, *model.AppError) { 12108 origCtx := a.ctx 12109 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannels") 12110 12111 a.ctx = newCtx 12112 a.app.Srv().Store.SetContext(newCtx) 12113 defer func() { 12114 a.app.Srv().Store.SetContext(origCtx) 12115 a.ctx = origCtx 12116 }() 12117 12118 defer span.Finish() 12119 resultVar0, resultVar1 := a.app.SearchChannels(teamId, term) 12120 12121 if resultVar1 != nil { 12122 span.LogFields(spanlog.Error(resultVar1)) 12123 ext.Error.Set(span, true) 12124 } 12125 12126 return resultVar0, resultVar1 12127 } 12128 12129 func (a *OpenTracingAppLayer) SearchChannelsForUser(userId string, teamId string, term string) (*model.ChannelList, *model.AppError) { 12130 origCtx := a.ctx 12131 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsForUser") 12132 12133 a.ctx = newCtx 12134 a.app.Srv().Store.SetContext(newCtx) 12135 defer func() { 12136 a.app.Srv().Store.SetContext(origCtx) 12137 a.ctx = origCtx 12138 }() 12139 12140 defer span.Finish() 12141 resultVar0, resultVar1 := a.app.SearchChannelsForUser(userId, teamId, term) 12142 12143 if resultVar1 != nil { 12144 span.LogFields(spanlog.Error(resultVar1)) 12145 ext.Error.Set(span, true) 12146 } 12147 12148 return resultVar0, resultVar1 12149 } 12150 12151 func (a *OpenTracingAppLayer) SearchChannelsUserNotIn(teamId string, userId string, term string) (*model.ChannelList, *model.AppError) { 12152 origCtx := a.ctx 12153 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchChannelsUserNotIn") 12154 12155 a.ctx = newCtx 12156 a.app.Srv().Store.SetContext(newCtx) 12157 defer func() { 12158 a.app.Srv().Store.SetContext(origCtx) 12159 a.ctx = origCtx 12160 }() 12161 12162 defer span.Finish() 12163 resultVar0, resultVar1 := a.app.SearchChannelsUserNotIn(teamId, userId, term) 12164 12165 if resultVar1 != nil { 12166 span.LogFields(spanlog.Error(resultVar1)) 12167 ext.Error.Set(span, true) 12168 } 12169 12170 return resultVar0, resultVar1 12171 } 12172 12173 func (a *OpenTracingAppLayer) SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) { 12174 origCtx := a.ctx 12175 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEmoji") 12176 12177 a.ctx = newCtx 12178 a.app.Srv().Store.SetContext(newCtx) 12179 defer func() { 12180 a.app.Srv().Store.SetContext(origCtx) 12181 a.ctx = origCtx 12182 }() 12183 12184 defer span.Finish() 12185 resultVar0, resultVar1 := a.app.SearchEmoji(name, prefixOnly, limit) 12186 12187 if resultVar1 != nil { 12188 span.LogFields(spanlog.Error(resultVar1)) 12189 ext.Error.Set(span, true) 12190 } 12191 12192 return resultVar0, resultVar1 12193 } 12194 12195 func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker { 12196 origCtx := a.ctx 12197 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEngine") 12198 12199 a.ctx = newCtx 12200 a.app.Srv().Store.SetContext(newCtx) 12201 defer func() { 12202 a.app.Srv().Store.SetContext(origCtx) 12203 a.ctx = origCtx 12204 }() 12205 12206 defer span.Finish() 12207 resultVar0 := a.app.SearchEngine() 12208 12209 return resultVar0 12210 } 12211 12212 func (a *OpenTracingAppLayer) SearchGroupChannels(userId string, term string) (*model.ChannelList, *model.AppError) { 12213 origCtx := a.ctx 12214 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchGroupChannels") 12215 12216 a.ctx = newCtx 12217 a.app.Srv().Store.SetContext(newCtx) 12218 defer func() { 12219 a.app.Srv().Store.SetContext(origCtx) 12220 a.ctx = origCtx 12221 }() 12222 12223 defer span.Finish() 12224 resultVar0, resultVar1 := a.app.SearchGroupChannels(userId, term) 12225 12226 if resultVar1 != nil { 12227 span.LogFields(spanlog.Error(resultVar1)) 12228 ext.Error.Set(span, true) 12229 } 12230 12231 return resultVar0, resultVar1 12232 } 12233 12234 func (a *OpenTracingAppLayer) SearchPostsInTeam(teamId string, paramsList []*model.SearchParams) (*model.PostList, *model.AppError) { 12235 origCtx := a.ctx 12236 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeam") 12237 12238 a.ctx = newCtx 12239 a.app.Srv().Store.SetContext(newCtx) 12240 defer func() { 12241 a.app.Srv().Store.SetContext(origCtx) 12242 a.ctx = origCtx 12243 }() 12244 12245 defer span.Finish() 12246 resultVar0, resultVar1 := a.app.SearchPostsInTeam(teamId, paramsList) 12247 12248 if resultVar1 != nil { 12249 span.LogFields(spanlog.Error(resultVar1)) 12250 ext.Error.Set(span, true) 12251 } 12252 12253 return resultVar0, resultVar1 12254 } 12255 12256 func (a *OpenTracingAppLayer) SearchPostsInTeamForUser(terms string, userId string, teamId string, isOrSearch bool, includeDeletedChannels bool, timeZoneOffset int, page int, perPage int) (*model.PostSearchResults, *model.AppError) { 12257 origCtx := a.ctx 12258 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPostsInTeamForUser") 12259 12260 a.ctx = newCtx 12261 a.app.Srv().Store.SetContext(newCtx) 12262 defer func() { 12263 a.app.Srv().Store.SetContext(origCtx) 12264 a.ctx = origCtx 12265 }() 12266 12267 defer span.Finish() 12268 resultVar0, resultVar1 := a.app.SearchPostsInTeamForUser(terms, userId, teamId, isOrSearch, includeDeletedChannels, timeZoneOffset, page, perPage) 12269 12270 if resultVar1 != nil { 12271 span.LogFields(spanlog.Error(resultVar1)) 12272 ext.Error.Set(span, true) 12273 } 12274 12275 return resultVar0, resultVar1 12276 } 12277 12278 func (a *OpenTracingAppLayer) SearchPrivateTeams(term string) ([]*model.Team, *model.AppError) { 12279 origCtx := a.ctx 12280 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPrivateTeams") 12281 12282 a.ctx = newCtx 12283 a.app.Srv().Store.SetContext(newCtx) 12284 defer func() { 12285 a.app.Srv().Store.SetContext(origCtx) 12286 a.ctx = origCtx 12287 }() 12288 12289 defer span.Finish() 12290 resultVar0, resultVar1 := a.app.SearchPrivateTeams(term) 12291 12292 if resultVar1 != nil { 12293 span.LogFields(spanlog.Error(resultVar1)) 12294 ext.Error.Set(span, true) 12295 } 12296 12297 return resultVar0, resultVar1 12298 } 12299 12300 func (a *OpenTracingAppLayer) SearchPublicTeams(term string) ([]*model.Team, *model.AppError) { 12301 origCtx := a.ctx 12302 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchPublicTeams") 12303 12304 a.ctx = newCtx 12305 a.app.Srv().Store.SetContext(newCtx) 12306 defer func() { 12307 a.app.Srv().Store.SetContext(origCtx) 12308 a.ctx = origCtx 12309 }() 12310 12311 defer span.Finish() 12312 resultVar0, resultVar1 := a.app.SearchPublicTeams(term) 12313 12314 if resultVar1 != nil { 12315 span.LogFields(spanlog.Error(resultVar1)) 12316 ext.Error.Set(span, true) 12317 } 12318 12319 return resultVar0, resultVar1 12320 } 12321 12322 func (a *OpenTracingAppLayer) SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) { 12323 origCtx := a.ctx 12324 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUserAccessTokens") 12325 12326 a.ctx = newCtx 12327 a.app.Srv().Store.SetContext(newCtx) 12328 defer func() { 12329 a.app.Srv().Store.SetContext(origCtx) 12330 a.ctx = origCtx 12331 }() 12332 12333 defer span.Finish() 12334 resultVar0, resultVar1 := a.app.SearchUserAccessTokens(term) 12335 12336 if resultVar1 != nil { 12337 span.LogFields(spanlog.Error(resultVar1)) 12338 ext.Error.Set(span, true) 12339 } 12340 12341 return resultVar0, resultVar1 12342 } 12343 12344 func (a *OpenTracingAppLayer) SearchUsers(props *model.UserSearch, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12345 origCtx := a.ctx 12346 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsers") 12347 12348 a.ctx = newCtx 12349 a.app.Srv().Store.SetContext(newCtx) 12350 defer func() { 12351 a.app.Srv().Store.SetContext(origCtx) 12352 a.ctx = origCtx 12353 }() 12354 12355 defer span.Finish() 12356 resultVar0, resultVar1 := a.app.SearchUsers(props, options) 12357 12358 if resultVar1 != nil { 12359 span.LogFields(spanlog.Error(resultVar1)) 12360 ext.Error.Set(span, true) 12361 } 12362 12363 return resultVar0, resultVar1 12364 } 12365 12366 func (a *OpenTracingAppLayer) SearchUsersInChannel(channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12367 origCtx := a.ctx 12368 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInChannel") 12369 12370 a.ctx = newCtx 12371 a.app.Srv().Store.SetContext(newCtx) 12372 defer func() { 12373 a.app.Srv().Store.SetContext(origCtx) 12374 a.ctx = origCtx 12375 }() 12376 12377 defer span.Finish() 12378 resultVar0, resultVar1 := a.app.SearchUsersInChannel(channelId, term, options) 12379 12380 if resultVar1 != nil { 12381 span.LogFields(spanlog.Error(resultVar1)) 12382 ext.Error.Set(span, true) 12383 } 12384 12385 return resultVar0, resultVar1 12386 } 12387 12388 func (a *OpenTracingAppLayer) SearchUsersInGroup(groupID string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12389 origCtx := a.ctx 12390 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInGroup") 12391 12392 a.ctx = newCtx 12393 a.app.Srv().Store.SetContext(newCtx) 12394 defer func() { 12395 a.app.Srv().Store.SetContext(origCtx) 12396 a.ctx = origCtx 12397 }() 12398 12399 defer span.Finish() 12400 resultVar0, resultVar1 := a.app.SearchUsersInGroup(groupID, term, options) 12401 12402 if resultVar1 != nil { 12403 span.LogFields(spanlog.Error(resultVar1)) 12404 ext.Error.Set(span, true) 12405 } 12406 12407 return resultVar0, resultVar1 12408 } 12409 12410 func (a *OpenTracingAppLayer) SearchUsersInTeam(teamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12411 origCtx := a.ctx 12412 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersInTeam") 12413 12414 a.ctx = newCtx 12415 a.app.Srv().Store.SetContext(newCtx) 12416 defer func() { 12417 a.app.Srv().Store.SetContext(origCtx) 12418 a.ctx = origCtx 12419 }() 12420 12421 defer span.Finish() 12422 resultVar0, resultVar1 := a.app.SearchUsersInTeam(teamId, term, options) 12423 12424 if resultVar1 != nil { 12425 span.LogFields(spanlog.Error(resultVar1)) 12426 ext.Error.Set(span, true) 12427 } 12428 12429 return resultVar0, resultVar1 12430 } 12431 12432 func (a *OpenTracingAppLayer) SearchUsersNotInChannel(teamId string, channelId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12433 origCtx := a.ctx 12434 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInChannel") 12435 12436 a.ctx = newCtx 12437 a.app.Srv().Store.SetContext(newCtx) 12438 defer func() { 12439 a.app.Srv().Store.SetContext(origCtx) 12440 a.ctx = origCtx 12441 }() 12442 12443 defer span.Finish() 12444 resultVar0, resultVar1 := a.app.SearchUsersNotInChannel(teamId, channelId, term, options) 12445 12446 if resultVar1 != nil { 12447 span.LogFields(spanlog.Error(resultVar1)) 12448 ext.Error.Set(span, true) 12449 } 12450 12451 return resultVar0, resultVar1 12452 } 12453 12454 func (a *OpenTracingAppLayer) SearchUsersNotInTeam(notInTeamId string, term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12455 origCtx := a.ctx 12456 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersNotInTeam") 12457 12458 a.ctx = newCtx 12459 a.app.Srv().Store.SetContext(newCtx) 12460 defer func() { 12461 a.app.Srv().Store.SetContext(origCtx) 12462 a.ctx = origCtx 12463 }() 12464 12465 defer span.Finish() 12466 resultVar0, resultVar1 := a.app.SearchUsersNotInTeam(notInTeamId, term, options) 12467 12468 if resultVar1 != nil { 12469 span.LogFields(spanlog.Error(resultVar1)) 12470 ext.Error.Set(span, true) 12471 } 12472 12473 return resultVar0, resultVar1 12474 } 12475 12476 func (a *OpenTracingAppLayer) SearchUsersWithoutTeam(term string, options *model.UserSearchOptions) ([]*model.User, *model.AppError) { 12477 origCtx := a.ctx 12478 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUsersWithoutTeam") 12479 12480 a.ctx = newCtx 12481 a.app.Srv().Store.SetContext(newCtx) 12482 defer func() { 12483 a.app.Srv().Store.SetContext(origCtx) 12484 a.ctx = origCtx 12485 }() 12486 12487 defer span.Finish() 12488 resultVar0, resultVar1 := a.app.SearchUsersWithoutTeam(term, options) 12489 12490 if resultVar1 != nil { 12491 span.LogFields(spanlog.Error(resultVar1)) 12492 ext.Error.Set(span, true) 12493 } 12494 12495 return resultVar0, resultVar1 12496 } 12497 12498 func (a *OpenTracingAppLayer) SendAckToPushProxy(ack *model.PushNotificationAck) error { 12499 origCtx := a.ctx 12500 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAckToPushProxy") 12501 12502 a.ctx = newCtx 12503 a.app.Srv().Store.SetContext(newCtx) 12504 defer func() { 12505 a.app.Srv().Store.SetContext(origCtx) 12506 a.ctx = origCtx 12507 }() 12508 12509 defer span.Finish() 12510 resultVar0 := a.app.SendAckToPushProxy(ack) 12511 12512 if resultVar0 != nil { 12513 span.LogFields(spanlog.Error(resultVar0)) 12514 ext.Error.Set(span, true) 12515 } 12516 12517 return resultVar0 12518 } 12519 12520 func (a *OpenTracingAppLayer) SendAutoResponse(channel *model.Channel, receiver *model.User) (bool, *model.AppError) { 12521 origCtx := a.ctx 12522 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponse") 12523 12524 a.ctx = newCtx 12525 a.app.Srv().Store.SetContext(newCtx) 12526 defer func() { 12527 a.app.Srv().Store.SetContext(origCtx) 12528 a.ctx = origCtx 12529 }() 12530 12531 defer span.Finish() 12532 resultVar0, resultVar1 := a.app.SendAutoResponse(channel, receiver) 12533 12534 if resultVar1 != nil { 12535 span.LogFields(spanlog.Error(resultVar1)) 12536 ext.Error.Set(span, true) 12537 } 12538 12539 return resultVar0, resultVar1 12540 } 12541 12542 func (a *OpenTracingAppLayer) SendAutoResponseIfNecessary(channel *model.Channel, sender *model.User) (bool, *model.AppError) { 12543 origCtx := a.ctx 12544 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAutoResponseIfNecessary") 12545 12546 a.ctx = newCtx 12547 a.app.Srv().Store.SetContext(newCtx) 12548 defer func() { 12549 a.app.Srv().Store.SetContext(origCtx) 12550 a.ctx = origCtx 12551 }() 12552 12553 defer span.Finish() 12554 resultVar0, resultVar1 := a.app.SendAutoResponseIfNecessary(channel, sender) 12555 12556 if resultVar1 != nil { 12557 span.LogFields(spanlog.Error(resultVar1)) 12558 ext.Error.Set(span, true) 12559 } 12560 12561 return resultVar0, resultVar1 12562 } 12563 12564 func (a *OpenTracingAppLayer) SendEmailVerification(user *model.User, newEmail string, redirect string) *model.AppError { 12565 origCtx := a.ctx 12566 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEmailVerification") 12567 12568 a.ctx = newCtx 12569 a.app.Srv().Store.SetContext(newCtx) 12570 defer func() { 12571 a.app.Srv().Store.SetContext(origCtx) 12572 a.ctx = origCtx 12573 }() 12574 12575 defer span.Finish() 12576 resultVar0 := a.app.SendEmailVerification(user, newEmail, redirect) 12577 12578 if resultVar0 != nil { 12579 span.LogFields(spanlog.Error(resultVar0)) 12580 ext.Error.Set(span, true) 12581 } 12582 12583 return resultVar0 12584 } 12585 12586 func (a *OpenTracingAppLayer) SendEphemeralPost(userId string, post *model.Post) *model.Post { 12587 origCtx := a.ctx 12588 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEphemeralPost") 12589 12590 a.ctx = newCtx 12591 a.app.Srv().Store.SetContext(newCtx) 12592 defer func() { 12593 a.app.Srv().Store.SetContext(origCtx) 12594 a.ctx = origCtx 12595 }() 12596 12597 defer span.Finish() 12598 resultVar0 := a.app.SendEphemeralPost(userId, post) 12599 12600 return resultVar0 12601 } 12602 12603 func (a *OpenTracingAppLayer) SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error) { 12604 origCtx := a.ctx 12605 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNotifications") 12606 12607 a.ctx = newCtx 12608 a.app.Srv().Store.SetContext(newCtx) 12609 defer func() { 12610 a.app.Srv().Store.SetContext(origCtx) 12611 a.ctx = origCtx 12612 }() 12613 12614 defer span.Finish() 12615 resultVar0, resultVar1 := a.app.SendNotifications(post, team, channel, sender, parentPostList, setOnline) 12616 12617 if resultVar1 != nil { 12618 span.LogFields(spanlog.Error(resultVar1)) 12619 ext.Error.Set(span, true) 12620 } 12621 12622 return resultVar0, resultVar1 12623 } 12624 12625 func (a *OpenTracingAppLayer) SendPasswordReset(email string, siteURL string) (bool, *model.AppError) { 12626 origCtx := a.ctx 12627 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPasswordReset") 12628 12629 a.ctx = newCtx 12630 a.app.Srv().Store.SetContext(newCtx) 12631 defer func() { 12632 a.app.Srv().Store.SetContext(origCtx) 12633 a.ctx = origCtx 12634 }() 12635 12636 defer span.Finish() 12637 resultVar0, resultVar1 := a.app.SendPasswordReset(email, siteURL) 12638 12639 if resultVar1 != nil { 12640 span.LogFields(spanlog.Error(resultVar1)) 12641 ext.Error.Set(span, true) 12642 } 12643 12644 return resultVar0, resultVar1 12645 } 12646 12647 func (a *OpenTracingAppLayer) ServeInterPluginRequest(w http.ResponseWriter, r *http.Request, sourcePluginId string, destinationPluginId string) { 12648 origCtx := a.ctx 12649 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServeInterPluginRequest") 12650 12651 a.ctx = newCtx 12652 a.app.Srv().Store.SetContext(newCtx) 12653 defer func() { 12654 a.app.Srv().Store.SetContext(origCtx) 12655 a.ctx = origCtx 12656 }() 12657 12658 defer span.Finish() 12659 a.app.ServeInterPluginRequest(w, r, sourcePluginId, destinationPluginId) 12660 } 12661 12662 func (a *OpenTracingAppLayer) ServePluginPublicRequest(w http.ResponseWriter, r *http.Request) { 12663 origCtx := a.ctx 12664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServePluginPublicRequest") 12665 12666 a.ctx = newCtx 12667 a.app.Srv().Store.SetContext(newCtx) 12668 defer func() { 12669 a.app.Srv().Store.SetContext(origCtx) 12670 a.ctx = origCtx 12671 }() 12672 12673 defer span.Finish() 12674 a.app.ServePluginPublicRequest(w, r) 12675 } 12676 12677 func (a *OpenTracingAppLayer) ServePluginRequest(w http.ResponseWriter, r *http.Request) { 12678 origCtx := a.ctx 12679 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServePluginRequest") 12680 12681 a.ctx = newCtx 12682 a.app.Srv().Store.SetContext(newCtx) 12683 defer func() { 12684 a.app.Srv().Store.SetContext(origCtx) 12685 a.ctx = origCtx 12686 }() 12687 12688 defer span.Finish() 12689 a.app.ServePluginRequest(w, r) 12690 } 12691 12692 func (a *OpenTracingAppLayer) ServerBusyStateChanged(sbs *model.ServerBusyState) { 12693 origCtx := a.ctx 12694 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServerBusyStateChanged") 12695 12696 a.ctx = newCtx 12697 a.app.Srv().Store.SetContext(newCtx) 12698 defer func() { 12699 a.app.Srv().Store.SetContext(origCtx) 12700 a.ctx = origCtx 12701 }() 12702 12703 defer span.Finish() 12704 a.app.ServerBusyStateChanged(sbs) 12705 } 12706 12707 func (a *OpenTracingAppLayer) SessionCacheLength() int { 12708 origCtx := a.ctx 12709 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionCacheLength") 12710 12711 a.ctx = newCtx 12712 a.app.Srv().Store.SetContext(newCtx) 12713 defer func() { 12714 a.app.Srv().Store.SetContext(origCtx) 12715 a.ctx = origCtx 12716 }() 12717 12718 defer span.Finish() 12719 resultVar0 := a.app.SessionCacheLength() 12720 12721 return resultVar0 12722 } 12723 12724 func (a *OpenTracingAppLayer) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool { 12725 origCtx := a.ctx 12726 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionTo") 12727 12728 a.ctx = newCtx 12729 a.app.Srv().Store.SetContext(newCtx) 12730 defer func() { 12731 a.app.Srv().Store.SetContext(origCtx) 12732 a.ctx = origCtx 12733 }() 12734 12735 defer span.Finish() 12736 resultVar0 := a.app.SessionHasPermissionTo(session, permission) 12737 12738 return resultVar0 12739 } 12740 12741 func (a *OpenTracingAppLayer) SessionHasPermissionToCategory(session model.Session, userId string, teamId string, categoryId string) bool { 12742 origCtx := a.ctx 12743 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToCategory") 12744 12745 a.ctx = newCtx 12746 a.app.Srv().Store.SetContext(newCtx) 12747 defer func() { 12748 a.app.Srv().Store.SetContext(origCtx) 12749 a.ctx = origCtx 12750 }() 12751 12752 defer span.Finish() 12753 resultVar0 := a.app.SessionHasPermissionToCategory(session, userId, teamId, categoryId) 12754 12755 return resultVar0 12756 } 12757 12758 func (a *OpenTracingAppLayer) SessionHasPermissionToChannel(session model.Session, channelId string, permission *model.Permission) bool { 12759 origCtx := a.ctx 12760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannel") 12761 12762 a.ctx = newCtx 12763 a.app.Srv().Store.SetContext(newCtx) 12764 defer func() { 12765 a.app.Srv().Store.SetContext(origCtx) 12766 a.ctx = origCtx 12767 }() 12768 12769 defer span.Finish() 12770 resultVar0 := a.app.SessionHasPermissionToChannel(session, channelId, permission) 12771 12772 return resultVar0 12773 } 12774 12775 func (a *OpenTracingAppLayer) SessionHasPermissionToChannelByPost(session model.Session, postId string, permission *model.Permission) bool { 12776 origCtx := a.ctx 12777 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToChannelByPost") 12778 12779 a.ctx = newCtx 12780 a.app.Srv().Store.SetContext(newCtx) 12781 defer func() { 12782 a.app.Srv().Store.SetContext(origCtx) 12783 a.ctx = origCtx 12784 }() 12785 12786 defer span.Finish() 12787 resultVar0 := a.app.SessionHasPermissionToChannelByPost(session, postId, permission) 12788 12789 return resultVar0 12790 } 12791 12792 func (a *OpenTracingAppLayer) SessionHasPermissionToManageBot(session model.Session, botUserId string) *model.AppError { 12793 origCtx := a.ctx 12794 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToManageBot") 12795 12796 a.ctx = newCtx 12797 a.app.Srv().Store.SetContext(newCtx) 12798 defer func() { 12799 a.app.Srv().Store.SetContext(origCtx) 12800 a.ctx = origCtx 12801 }() 12802 12803 defer span.Finish() 12804 resultVar0 := a.app.SessionHasPermissionToManageBot(session, botUserId) 12805 12806 if resultVar0 != nil { 12807 span.LogFields(spanlog.Error(resultVar0)) 12808 ext.Error.Set(span, true) 12809 } 12810 12811 return resultVar0 12812 } 12813 12814 func (a *OpenTracingAppLayer) SessionHasPermissionToTeam(session model.Session, teamId string, permission *model.Permission) bool { 12815 origCtx := a.ctx 12816 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToTeam") 12817 12818 a.ctx = newCtx 12819 a.app.Srv().Store.SetContext(newCtx) 12820 defer func() { 12821 a.app.Srv().Store.SetContext(origCtx) 12822 a.ctx = origCtx 12823 }() 12824 12825 defer span.Finish() 12826 resultVar0 := a.app.SessionHasPermissionToTeam(session, teamId, permission) 12827 12828 return resultVar0 12829 } 12830 12831 func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userId string) bool { 12832 origCtx := a.ctx 12833 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUser") 12834 12835 a.ctx = newCtx 12836 a.app.Srv().Store.SetContext(newCtx) 12837 defer func() { 12838 a.app.Srv().Store.SetContext(origCtx) 12839 a.ctx = origCtx 12840 }() 12841 12842 defer span.Finish() 12843 resultVar0 := a.app.SessionHasPermissionToUser(session, userId) 12844 12845 return resultVar0 12846 } 12847 12848 func (a *OpenTracingAppLayer) SessionHasPermissionToUserOrBot(session model.Session, userId string) bool { 12849 origCtx := a.ctx 12850 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUserOrBot") 12851 12852 a.ctx = newCtx 12853 a.app.Srv().Store.SetContext(newCtx) 12854 defer func() { 12855 a.app.Srv().Store.SetContext(origCtx) 12856 a.ctx = origCtx 12857 }() 12858 12859 defer span.Finish() 12860 resultVar0 := a.app.SessionHasPermissionToUserOrBot(session, userId) 12861 12862 return resultVar0 12863 } 12864 12865 func (a *OpenTracingAppLayer) SessionIsRegistered(session model.Session) bool { 12866 origCtx := a.ctx 12867 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionIsRegistered") 12868 12869 a.ctx = newCtx 12870 a.app.Srv().Store.SetContext(newCtx) 12871 defer func() { 12872 a.app.Srv().Store.SetContext(origCtx) 12873 a.ctx = origCtx 12874 }() 12875 12876 defer span.Finish() 12877 resultVar0 := a.app.SessionIsRegistered(session) 12878 12879 return resultVar0 12880 } 12881 12882 func (a *OpenTracingAppLayer) SetActiveChannel(userId string, channelId string) *model.AppError { 12883 origCtx := a.ctx 12884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetActiveChannel") 12885 12886 a.ctx = newCtx 12887 a.app.Srv().Store.SetContext(newCtx) 12888 defer func() { 12889 a.app.Srv().Store.SetContext(origCtx) 12890 a.ctx = origCtx 12891 }() 12892 12893 defer span.Finish() 12894 resultVar0 := a.app.SetActiveChannel(userId, channelId) 12895 12896 if resultVar0 != nil { 12897 span.LogFields(spanlog.Error(resultVar0)) 12898 ext.Error.Set(span, true) 12899 } 12900 12901 return resultVar0 12902 } 12903 12904 func (a *OpenTracingAppLayer) SetAutoResponderStatus(user *model.User, oldNotifyProps model.StringMap) { 12905 origCtx := a.ctx 12906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetAutoResponderStatus") 12907 12908 a.ctx = newCtx 12909 a.app.Srv().Store.SetContext(newCtx) 12910 defer func() { 12911 a.app.Srv().Store.SetContext(origCtx) 12912 a.ctx = origCtx 12913 }() 12914 12915 defer span.Finish() 12916 a.app.SetAutoResponderStatus(user, oldNotifyProps) 12917 } 12918 12919 func (a *OpenTracingAppLayer) SetBotIconImage(botUserId string, file io.ReadSeeker) *model.AppError { 12920 origCtx := a.ctx 12921 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImage") 12922 12923 a.ctx = newCtx 12924 a.app.Srv().Store.SetContext(newCtx) 12925 defer func() { 12926 a.app.Srv().Store.SetContext(origCtx) 12927 a.ctx = origCtx 12928 }() 12929 12930 defer span.Finish() 12931 resultVar0 := a.app.SetBotIconImage(botUserId, file) 12932 12933 if resultVar0 != nil { 12934 span.LogFields(spanlog.Error(resultVar0)) 12935 ext.Error.Set(span, true) 12936 } 12937 12938 return resultVar0 12939 } 12940 12941 func (a *OpenTracingAppLayer) SetBotIconImageFromMultiPartFile(botUserId string, imageData *multipart.FileHeader) *model.AppError { 12942 origCtx := a.ctx 12943 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBotIconImageFromMultiPartFile") 12944 12945 a.ctx = newCtx 12946 a.app.Srv().Store.SetContext(newCtx) 12947 defer func() { 12948 a.app.Srv().Store.SetContext(origCtx) 12949 a.ctx = origCtx 12950 }() 12951 12952 defer span.Finish() 12953 resultVar0 := a.app.SetBotIconImageFromMultiPartFile(botUserId, imageData) 12954 12955 if resultVar0 != nil { 12956 span.LogFields(spanlog.Error(resultVar0)) 12957 ext.Error.Set(span, true) 12958 } 12959 12960 return resultVar0 12961 } 12962 12963 func (a *OpenTracingAppLayer) SetDefaultProfileImage(user *model.User) *model.AppError { 12964 origCtx := a.ctx 12965 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDefaultProfileImage") 12966 12967 a.ctx = newCtx 12968 a.app.Srv().Store.SetContext(newCtx) 12969 defer func() { 12970 a.app.Srv().Store.SetContext(origCtx) 12971 a.ctx = origCtx 12972 }() 12973 12974 defer span.Finish() 12975 resultVar0 := a.app.SetDefaultProfileImage(user) 12976 12977 if resultVar0 != nil { 12978 span.LogFields(spanlog.Error(resultVar0)) 12979 ext.Error.Set(span, true) 12980 } 12981 12982 return resultVar0 12983 } 12984 12985 func (a *OpenTracingAppLayer) SetDiagnosticId(id string) { 12986 origCtx := a.ctx 12987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDiagnosticId") 12988 12989 a.ctx = newCtx 12990 a.app.Srv().Store.SetContext(newCtx) 12991 defer func() { 12992 a.app.Srv().Store.SetContext(origCtx) 12993 a.ctx = origCtx 12994 }() 12995 12996 defer span.Finish() 12997 a.app.SetDiagnosticId(id) 12998 } 12999 13000 func (a *OpenTracingAppLayer) SetLog(l *mlog.Logger) { 13001 origCtx := a.ctx 13002 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetLog") 13003 13004 a.ctx = newCtx 13005 a.app.Srv().Store.SetContext(newCtx) 13006 defer func() { 13007 a.app.Srv().Store.SetContext(origCtx) 13008 a.ctx = origCtx 13009 }() 13010 13011 defer span.Finish() 13012 a.app.SetLog(l) 13013 } 13014 13015 func (a *OpenTracingAppLayer) SetPhase2PermissionsMigrationStatus(isComplete bool) error { 13016 origCtx := a.ctx 13017 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPhase2PermissionsMigrationStatus") 13018 13019 a.ctx = newCtx 13020 a.app.Srv().Store.SetContext(newCtx) 13021 defer func() { 13022 a.app.Srv().Store.SetContext(origCtx) 13023 a.ctx = origCtx 13024 }() 13025 13026 defer span.Finish() 13027 resultVar0 := a.app.SetPhase2PermissionsMigrationStatus(isComplete) 13028 13029 if resultVar0 != nil { 13030 span.LogFields(spanlog.Error(resultVar0)) 13031 ext.Error.Set(span, true) 13032 } 13033 13034 return resultVar0 13035 } 13036 13037 func (a *OpenTracingAppLayer) SetPluginKey(pluginId string, key string, value []byte) *model.AppError { 13038 origCtx := a.ctx 13039 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKey") 13040 13041 a.ctx = newCtx 13042 a.app.Srv().Store.SetContext(newCtx) 13043 defer func() { 13044 a.app.Srv().Store.SetContext(origCtx) 13045 a.ctx = origCtx 13046 }() 13047 13048 defer span.Finish() 13049 resultVar0 := a.app.SetPluginKey(pluginId, key, value) 13050 13051 if resultVar0 != nil { 13052 span.LogFields(spanlog.Error(resultVar0)) 13053 ext.Error.Set(span, true) 13054 } 13055 13056 return resultVar0 13057 } 13058 13059 func (a *OpenTracingAppLayer) SetPluginKeyWithExpiry(pluginId string, key string, value []byte, expireInSeconds int64) *model.AppError { 13060 origCtx := a.ctx 13061 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithExpiry") 13062 13063 a.ctx = newCtx 13064 a.app.Srv().Store.SetContext(newCtx) 13065 defer func() { 13066 a.app.Srv().Store.SetContext(origCtx) 13067 a.ctx = origCtx 13068 }() 13069 13070 defer span.Finish() 13071 resultVar0 := a.app.SetPluginKeyWithExpiry(pluginId, key, value, expireInSeconds) 13072 13073 if resultVar0 != nil { 13074 span.LogFields(spanlog.Error(resultVar0)) 13075 ext.Error.Set(span, true) 13076 } 13077 13078 return resultVar0 13079 } 13080 13081 func (a *OpenTracingAppLayer) SetPluginKeyWithOptions(pluginId string, key string, value []byte, options model.PluginKVSetOptions) (bool, *model.AppError) { 13082 origCtx := a.ctx 13083 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginKeyWithOptions") 13084 13085 a.ctx = newCtx 13086 a.app.Srv().Store.SetContext(newCtx) 13087 defer func() { 13088 a.app.Srv().Store.SetContext(origCtx) 13089 a.ctx = origCtx 13090 }() 13091 13092 defer span.Finish() 13093 resultVar0, resultVar1 := a.app.SetPluginKeyWithOptions(pluginId, key, value, options) 13094 13095 if resultVar1 != nil { 13096 span.LogFields(spanlog.Error(resultVar1)) 13097 ext.Error.Set(span, true) 13098 } 13099 13100 return resultVar0, resultVar1 13101 } 13102 13103 func (a *OpenTracingAppLayer) SetPluginsEnvironment(pluginsEnvironment *plugin.Environment) { 13104 origCtx := a.ctx 13105 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPluginsEnvironment") 13106 13107 a.ctx = newCtx 13108 a.app.Srv().Store.SetContext(newCtx) 13109 defer func() { 13110 a.app.Srv().Store.SetContext(origCtx) 13111 a.ctx = origCtx 13112 }() 13113 13114 defer span.Finish() 13115 a.app.SetPluginsEnvironment(pluginsEnvironment) 13116 } 13117 13118 func (a *OpenTracingAppLayer) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError { 13119 origCtx := a.ctx 13120 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImage") 13121 13122 a.ctx = newCtx 13123 a.app.Srv().Store.SetContext(newCtx) 13124 defer func() { 13125 a.app.Srv().Store.SetContext(origCtx) 13126 a.ctx = origCtx 13127 }() 13128 13129 defer span.Finish() 13130 resultVar0 := a.app.SetProfileImage(userId, imageData) 13131 13132 if resultVar0 != nil { 13133 span.LogFields(spanlog.Error(resultVar0)) 13134 ext.Error.Set(span, true) 13135 } 13136 13137 return resultVar0 13138 } 13139 13140 func (a *OpenTracingAppLayer) SetProfileImageFromFile(userId string, file io.Reader) *model.AppError { 13141 origCtx := a.ctx 13142 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromFile") 13143 13144 a.ctx = newCtx 13145 a.app.Srv().Store.SetContext(newCtx) 13146 defer func() { 13147 a.app.Srv().Store.SetContext(origCtx) 13148 a.ctx = origCtx 13149 }() 13150 13151 defer span.Finish() 13152 resultVar0 := a.app.SetProfileImageFromFile(userId, file) 13153 13154 if resultVar0 != nil { 13155 span.LogFields(spanlog.Error(resultVar0)) 13156 ext.Error.Set(span, true) 13157 } 13158 13159 return resultVar0 13160 } 13161 13162 func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError { 13163 origCtx := a.ctx 13164 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromMultiPartFile") 13165 13166 a.ctx = newCtx 13167 a.app.Srv().Store.SetContext(newCtx) 13168 defer func() { 13169 a.app.Srv().Store.SetContext(origCtx) 13170 a.ctx = origCtx 13171 }() 13172 13173 defer span.Finish() 13174 resultVar0 := a.app.SetProfileImageFromMultiPartFile(userId, file) 13175 13176 if resultVar0 != nil { 13177 span.LogFields(spanlog.Error(resultVar0)) 13178 ext.Error.Set(span, true) 13179 } 13180 13181 return resultVar0 13182 } 13183 13184 func (a *OpenTracingAppLayer) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError { 13185 origCtx := a.ctx 13186 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSamlIdpCertificateFromMetadata") 13187 13188 a.ctx = newCtx 13189 a.app.Srv().Store.SetContext(newCtx) 13190 defer func() { 13191 a.app.Srv().Store.SetContext(origCtx) 13192 a.ctx = origCtx 13193 }() 13194 13195 defer span.Finish() 13196 resultVar0 := a.app.SetSamlIdpCertificateFromMetadata(data) 13197 13198 if resultVar0 != nil { 13199 span.LogFields(spanlog.Error(resultVar0)) 13200 ext.Error.Set(span, true) 13201 } 13202 13203 return resultVar0 13204 } 13205 13206 func (a *OpenTracingAppLayer) SetSearchEngine(se *searchengine.Broker) { 13207 origCtx := a.ctx 13208 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSearchEngine") 13209 13210 a.ctx = newCtx 13211 a.app.Srv().Store.SetContext(newCtx) 13212 defer func() { 13213 a.app.Srv().Store.SetContext(origCtx) 13214 a.ctx = origCtx 13215 }() 13216 13217 defer span.Finish() 13218 a.app.SetSearchEngine(se) 13219 } 13220 13221 func (a *OpenTracingAppLayer) SetSessionExpireInDays(session *model.Session, days int) { 13222 origCtx := a.ctx 13223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSessionExpireInDays") 13224 13225 a.ctx = newCtx 13226 a.app.Srv().Store.SetContext(newCtx) 13227 defer func() { 13228 a.app.Srv().Store.SetContext(origCtx) 13229 a.ctx = origCtx 13230 }() 13231 13232 defer span.Finish() 13233 a.app.SetSessionExpireInDays(session, days) 13234 } 13235 13236 func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userId string, manual bool) { 13237 origCtx := a.ctx 13238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusAwayIfNeeded") 13239 13240 a.ctx = newCtx 13241 a.app.Srv().Store.SetContext(newCtx) 13242 defer func() { 13243 a.app.Srv().Store.SetContext(origCtx) 13244 a.ctx = origCtx 13245 }() 13246 13247 defer span.Finish() 13248 a.app.SetStatusAwayIfNeeded(userId, manual) 13249 } 13250 13251 func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userId string) { 13252 origCtx := a.ctx 13253 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturb") 13254 13255 a.ctx = newCtx 13256 a.app.Srv().Store.SetContext(newCtx) 13257 defer func() { 13258 a.app.Srv().Store.SetContext(origCtx) 13259 a.ctx = origCtx 13260 }() 13261 13262 defer span.Finish() 13263 a.app.SetStatusDoNotDisturb(userId) 13264 } 13265 13266 func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userId string, activityAt int64) { 13267 origCtx := a.ctx 13268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusLastActivityAt") 13269 13270 a.ctx = newCtx 13271 a.app.Srv().Store.SetContext(newCtx) 13272 defer func() { 13273 a.app.Srv().Store.SetContext(origCtx) 13274 a.ctx = origCtx 13275 }() 13276 13277 defer span.Finish() 13278 a.app.SetStatusLastActivityAt(userId, activityAt) 13279 } 13280 13281 func (a *OpenTracingAppLayer) SetStatusOffline(userId string, manual bool) { 13282 origCtx := a.ctx 13283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOffline") 13284 13285 a.ctx = newCtx 13286 a.app.Srv().Store.SetContext(newCtx) 13287 defer func() { 13288 a.app.Srv().Store.SetContext(origCtx) 13289 a.ctx = origCtx 13290 }() 13291 13292 defer span.Finish() 13293 a.app.SetStatusOffline(userId, manual) 13294 } 13295 13296 func (a *OpenTracingAppLayer) SetStatusOnline(userId string, manual bool) { 13297 origCtx := a.ctx 13298 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOnline") 13299 13300 a.ctx = newCtx 13301 a.app.Srv().Store.SetContext(newCtx) 13302 defer func() { 13303 a.app.Srv().Store.SetContext(origCtx) 13304 a.ctx = origCtx 13305 }() 13306 13307 defer span.Finish() 13308 a.app.SetStatusOnline(userId, manual) 13309 } 13310 13311 func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userId string) { 13312 origCtx := a.ctx 13313 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOutOfOffice") 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 a.app.SetStatusOutOfOffice(userId) 13324 } 13325 13326 func (a *OpenTracingAppLayer) SetTeamIcon(teamId string, imageData *multipart.FileHeader) *model.AppError { 13327 origCtx := a.ctx 13328 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIcon") 13329 13330 a.ctx = newCtx 13331 a.app.Srv().Store.SetContext(newCtx) 13332 defer func() { 13333 a.app.Srv().Store.SetContext(origCtx) 13334 a.ctx = origCtx 13335 }() 13336 13337 defer span.Finish() 13338 resultVar0 := a.app.SetTeamIcon(teamId, imageData) 13339 13340 if resultVar0 != nil { 13341 span.LogFields(spanlog.Error(resultVar0)) 13342 ext.Error.Set(span, true) 13343 } 13344 13345 return resultVar0 13346 } 13347 13348 func (a *OpenTracingAppLayer) SetTeamIconFromFile(team *model.Team, file io.Reader) *model.AppError { 13349 origCtx := a.ctx 13350 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromFile") 13351 13352 a.ctx = newCtx 13353 a.app.Srv().Store.SetContext(newCtx) 13354 defer func() { 13355 a.app.Srv().Store.SetContext(origCtx) 13356 a.ctx = origCtx 13357 }() 13358 13359 defer span.Finish() 13360 resultVar0 := a.app.SetTeamIconFromFile(team, file) 13361 13362 if resultVar0 != nil { 13363 span.LogFields(spanlog.Error(resultVar0)) 13364 ext.Error.Set(span, true) 13365 } 13366 13367 return resultVar0 13368 } 13369 13370 func (a *OpenTracingAppLayer) SetTeamIconFromMultiPartFile(teamId string, file multipart.File) *model.AppError { 13371 origCtx := a.ctx 13372 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetTeamIconFromMultiPartFile") 13373 13374 a.ctx = newCtx 13375 a.app.Srv().Store.SetContext(newCtx) 13376 defer func() { 13377 a.app.Srv().Store.SetContext(origCtx) 13378 a.ctx = origCtx 13379 }() 13380 13381 defer span.Finish() 13382 resultVar0 := a.app.SetTeamIconFromMultiPartFile(teamId, file) 13383 13384 if resultVar0 != nil { 13385 span.LogFields(spanlog.Error(resultVar0)) 13386 ext.Error.Set(span, true) 13387 } 13388 13389 return resultVar0 13390 } 13391 13392 func (a *OpenTracingAppLayer) SlackAddBotUser(teamId string, log *bytes.Buffer) *model.User { 13393 origCtx := a.ctx 13394 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackAddBotUser") 13395 13396 a.ctx = newCtx 13397 a.app.Srv().Store.SetContext(newCtx) 13398 defer func() { 13399 a.app.Srv().Store.SetContext(origCtx) 13400 a.ctx = origCtx 13401 }() 13402 13403 defer span.Finish() 13404 resultVar0 := a.app.SlackAddBotUser(teamId, log) 13405 13406 return resultVar0 13407 } 13408 13409 func (a *OpenTracingAppLayer) SlackAddChannels(teamId string, slackchannels []app.SlackChannel, posts map[string][]app.SlackPost, users map[string]*model.User, uploads map[string]*zip.File, botUser *model.User, importerLog *bytes.Buffer) map[string]*model.Channel { 13410 origCtx := a.ctx 13411 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackAddChannels") 13412 13413 a.ctx = newCtx 13414 a.app.Srv().Store.SetContext(newCtx) 13415 defer func() { 13416 a.app.Srv().Store.SetContext(origCtx) 13417 a.ctx = origCtx 13418 }() 13419 13420 defer span.Finish() 13421 resultVar0 := a.app.SlackAddChannels(teamId, slackchannels, posts, users, uploads, botUser, importerLog) 13422 13423 return resultVar0 13424 } 13425 13426 func (a *OpenTracingAppLayer) SlackAddPosts(teamId string, channel *model.Channel, posts []app.SlackPost, users map[string]*model.User, uploads map[string]*zip.File, botUser *model.User) { 13427 origCtx := a.ctx 13428 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackAddPosts") 13429 13430 a.ctx = newCtx 13431 a.app.Srv().Store.SetContext(newCtx) 13432 defer func() { 13433 a.app.Srv().Store.SetContext(origCtx) 13434 a.ctx = origCtx 13435 }() 13436 13437 defer span.Finish() 13438 a.app.SlackAddPosts(teamId, channel, posts, users, uploads, botUser) 13439 } 13440 13441 func (a *OpenTracingAppLayer) SlackAddUsers(teamId string, slackusers []app.SlackUser, importerLog *bytes.Buffer) map[string]*model.User { 13442 origCtx := a.ctx 13443 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackAddUsers") 13444 13445 a.ctx = newCtx 13446 a.app.Srv().Store.SetContext(newCtx) 13447 defer func() { 13448 a.app.Srv().Store.SetContext(origCtx) 13449 a.ctx = origCtx 13450 }() 13451 13452 defer span.Finish() 13453 resultVar0 := a.app.SlackAddUsers(teamId, slackusers, importerLog) 13454 13455 return resultVar0 13456 } 13457 13458 func (a *OpenTracingAppLayer) SlackImport(fileData multipart.File, fileSize int64, teamID string) (*model.AppError, *bytes.Buffer) { 13459 origCtx := a.ctx 13460 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackImport") 13461 13462 a.ctx = newCtx 13463 a.app.Srv().Store.SetContext(newCtx) 13464 defer func() { 13465 a.app.Srv().Store.SetContext(origCtx) 13466 a.ctx = origCtx 13467 }() 13468 13469 defer span.Finish() 13470 resultVar0, resultVar1 := a.app.SlackImport(fileData, fileSize, teamID) 13471 13472 if resultVar0 != nil { 13473 span.LogFields(spanlog.Error(resultVar0)) 13474 ext.Error.Set(span, true) 13475 } 13476 13477 return resultVar0, resultVar1 13478 } 13479 13480 func (a *OpenTracingAppLayer) SlackUploadFile(slackPostFile *app.SlackFile, uploads map[string]*zip.File, teamId string, channelId string, userId string, slackTimestamp string) (*model.FileInfo, bool) { 13481 origCtx := a.ctx 13482 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SlackUploadFile") 13483 13484 a.ctx = newCtx 13485 a.app.Srv().Store.SetContext(newCtx) 13486 defer func() { 13487 a.app.Srv().Store.SetContext(origCtx) 13488 a.ctx = origCtx 13489 }() 13490 13491 defer span.Finish() 13492 resultVar0, resultVar1 := a.app.SlackUploadFile(slackPostFile, uploads, teamId, channelId, userId, slackTimestamp) 13493 13494 return resultVar0, resultVar1 13495 } 13496 13497 func (a *OpenTracingAppLayer) SoftDeleteTeam(teamId string) *model.AppError { 13498 origCtx := a.ctx 13499 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SoftDeleteTeam") 13500 13501 a.ctx = newCtx 13502 a.app.Srv().Store.SetContext(newCtx) 13503 defer func() { 13504 a.app.Srv().Store.SetContext(origCtx) 13505 a.ctx = origCtx 13506 }() 13507 13508 defer span.Finish() 13509 resultVar0 := a.app.SoftDeleteTeam(teamId) 13510 13511 if resultVar0 != nil { 13512 span.LogFields(spanlog.Error(resultVar0)) 13513 ext.Error.Set(span, true) 13514 } 13515 13516 return resultVar0 13517 } 13518 13519 func (a *OpenTracingAppLayer) SubmitInteractiveDialog(request model.SubmitDialogRequest) (*model.SubmitDialogResponse, *model.AppError) { 13520 origCtx := a.ctx 13521 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SubmitInteractiveDialog") 13522 13523 a.ctx = newCtx 13524 a.app.Srv().Store.SetContext(newCtx) 13525 defer func() { 13526 a.app.Srv().Store.SetContext(origCtx) 13527 a.ctx = origCtx 13528 }() 13529 13530 defer span.Finish() 13531 resultVar0, resultVar1 := a.app.SubmitInteractiveDialog(request) 13532 13533 if resultVar1 != nil { 13534 span.LogFields(spanlog.Error(resultVar1)) 13535 ext.Error.Set(span, true) 13536 } 13537 13538 return resultVar0, resultVar1 13539 } 13540 13541 func (a *OpenTracingAppLayer) SwitchEmailToLdap(email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) { 13542 origCtx := a.ctx 13543 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToLdap") 13544 13545 a.ctx = newCtx 13546 a.app.Srv().Store.SetContext(newCtx) 13547 defer func() { 13548 a.app.Srv().Store.SetContext(origCtx) 13549 a.ctx = origCtx 13550 }() 13551 13552 defer span.Finish() 13553 resultVar0, resultVar1 := a.app.SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword) 13554 13555 if resultVar1 != nil { 13556 span.LogFields(spanlog.Error(resultVar1)) 13557 ext.Error.Set(span, true) 13558 } 13559 13560 return resultVar0, resultVar1 13561 } 13562 13563 func (a *OpenTracingAppLayer) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) { 13564 origCtx := a.ctx 13565 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToOAuth") 13566 13567 a.ctx = newCtx 13568 a.app.Srv().Store.SetContext(newCtx) 13569 defer func() { 13570 a.app.Srv().Store.SetContext(origCtx) 13571 a.ctx = origCtx 13572 }() 13573 13574 defer span.Finish() 13575 resultVar0, resultVar1 := a.app.SwitchEmailToOAuth(w, r, email, password, code, service) 13576 13577 if resultVar1 != nil { 13578 span.LogFields(spanlog.Error(resultVar1)) 13579 ext.Error.Set(span, true) 13580 } 13581 13582 return resultVar0, resultVar1 13583 } 13584 13585 func (a *OpenTracingAppLayer) SwitchLdapToEmail(ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) { 13586 origCtx := a.ctx 13587 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchLdapToEmail") 13588 13589 a.ctx = newCtx 13590 a.app.Srv().Store.SetContext(newCtx) 13591 defer func() { 13592 a.app.Srv().Store.SetContext(origCtx) 13593 a.ctx = origCtx 13594 }() 13595 13596 defer span.Finish() 13597 resultVar0, resultVar1 := a.app.SwitchLdapToEmail(ldapPassword, code, email, newPassword) 13598 13599 if resultVar1 != nil { 13600 span.LogFields(spanlog.Error(resultVar1)) 13601 ext.Error.Set(span, true) 13602 } 13603 13604 return resultVar0, resultVar1 13605 } 13606 13607 func (a *OpenTracingAppLayer) SwitchOAuthToEmail(email string, password string, requesterId string) (string, *model.AppError) { 13608 origCtx := a.ctx 13609 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchOAuthToEmail") 13610 13611 a.ctx = newCtx 13612 a.app.Srv().Store.SetContext(newCtx) 13613 defer func() { 13614 a.app.Srv().Store.SetContext(origCtx) 13615 a.ctx = origCtx 13616 }() 13617 13618 defer span.Finish() 13619 resultVar0, resultVar1 := a.app.SwitchOAuthToEmail(email, password, requesterId) 13620 13621 if resultVar1 != nil { 13622 span.LogFields(spanlog.Error(resultVar1)) 13623 ext.Error.Set(span, true) 13624 } 13625 13626 return resultVar0, resultVar1 13627 } 13628 13629 func (a *OpenTracingAppLayer) SyncLdap() { 13630 origCtx := a.ctx 13631 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncLdap") 13632 13633 a.ctx = newCtx 13634 a.app.Srv().Store.SetContext(newCtx) 13635 defer func() { 13636 a.app.Srv().Store.SetContext(origCtx) 13637 a.ctx = origCtx 13638 }() 13639 13640 defer span.Finish() 13641 a.app.SyncLdap() 13642 } 13643 13644 func (a *OpenTracingAppLayer) SyncPlugins() *model.AppError { 13645 origCtx := a.ctx 13646 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPlugins") 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.SyncPlugins() 13657 13658 if resultVar0 != nil { 13659 span.LogFields(spanlog.Error(resultVar0)) 13660 ext.Error.Set(span, true) 13661 } 13662 13663 return resultVar0 13664 } 13665 13666 func (a *OpenTracingAppLayer) SyncPluginsActiveState() { 13667 origCtx := a.ctx 13668 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncPluginsActiveState") 13669 13670 a.ctx = newCtx 13671 a.app.Srv().Store.SetContext(newCtx) 13672 defer func() { 13673 a.app.Srv().Store.SetContext(origCtx) 13674 a.ctx = origCtx 13675 }() 13676 13677 defer span.Finish() 13678 a.app.SyncPluginsActiveState() 13679 } 13680 13681 func (a *OpenTracingAppLayer) SyncRolesAndMembership(syncableID string, syncableType model.GroupSyncableType) { 13682 origCtx := a.ctx 13683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncRolesAndMembership") 13684 13685 a.ctx = newCtx 13686 a.app.Srv().Store.SetContext(newCtx) 13687 defer func() { 13688 a.app.Srv().Store.SetContext(origCtx) 13689 a.ctx = origCtx 13690 }() 13691 13692 defer span.Finish() 13693 a.app.SyncRolesAndMembership(syncableID, syncableType) 13694 } 13695 13696 func (a *OpenTracingAppLayer) SyncSyncableRoles(syncableID string, syncableType model.GroupSyncableType) *model.AppError { 13697 origCtx := a.ctx 13698 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncSyncableRoles") 13699 13700 a.ctx = newCtx 13701 a.app.Srv().Store.SetContext(newCtx) 13702 defer func() { 13703 a.app.Srv().Store.SetContext(origCtx) 13704 a.ctx = origCtx 13705 }() 13706 13707 defer span.Finish() 13708 resultVar0 := a.app.SyncSyncableRoles(syncableID, syncableType) 13709 13710 if resultVar0 != nil { 13711 span.LogFields(spanlog.Error(resultVar0)) 13712 ext.Error.Set(span, true) 13713 } 13714 13715 return resultVar0 13716 } 13717 13718 func (a *OpenTracingAppLayer) TeamMembersMinusGroupMembers(teamID string, groupIDs []string, page int, perPage int) ([]*model.UserWithGroups, int64, *model.AppError) { 13719 origCtx := a.ctx 13720 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersMinusGroupMembers") 13721 13722 a.ctx = newCtx 13723 a.app.Srv().Store.SetContext(newCtx) 13724 defer func() { 13725 a.app.Srv().Store.SetContext(origCtx) 13726 a.ctx = origCtx 13727 }() 13728 13729 defer span.Finish() 13730 resultVar0, resultVar1, resultVar2 := a.app.TeamMembersMinusGroupMembers(teamID, groupIDs, page, perPage) 13731 13732 if resultVar2 != nil { 13733 span.LogFields(spanlog.Error(resultVar2)) 13734 ext.Error.Set(span, true) 13735 } 13736 13737 return resultVar0, resultVar1, resultVar2 13738 } 13739 13740 func (a *OpenTracingAppLayer) TeamMembersToAdd(since int64, teamID *string) ([]*model.UserTeamIDPair, *model.AppError) { 13741 origCtx := a.ctx 13742 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToAdd") 13743 13744 a.ctx = newCtx 13745 a.app.Srv().Store.SetContext(newCtx) 13746 defer func() { 13747 a.app.Srv().Store.SetContext(origCtx) 13748 a.ctx = origCtx 13749 }() 13750 13751 defer span.Finish() 13752 resultVar0, resultVar1 := a.app.TeamMembersToAdd(since, teamID) 13753 13754 if resultVar1 != nil { 13755 span.LogFields(spanlog.Error(resultVar1)) 13756 ext.Error.Set(span, true) 13757 } 13758 13759 return resultVar0, resultVar1 13760 } 13761 13762 func (a *OpenTracingAppLayer) TeamMembersToRemove(teamID *string) ([]*model.TeamMember, *model.AppError) { 13763 origCtx := a.ctx 13764 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TeamMembersToRemove") 13765 13766 a.ctx = newCtx 13767 a.app.Srv().Store.SetContext(newCtx) 13768 defer func() { 13769 a.app.Srv().Store.SetContext(origCtx) 13770 a.ctx = origCtx 13771 }() 13772 13773 defer span.Finish() 13774 resultVar0, resultVar1 := a.app.TeamMembersToRemove(teamID) 13775 13776 if resultVar1 != nil { 13777 span.LogFields(spanlog.Error(resultVar1)) 13778 ext.Error.Set(span, true) 13779 } 13780 13781 return resultVar0, resultVar1 13782 } 13783 13784 func (a *OpenTracingAppLayer) TestElasticsearch(cfg *model.Config) *model.AppError { 13785 origCtx := a.ctx 13786 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestElasticsearch") 13787 13788 a.ctx = newCtx 13789 a.app.Srv().Store.SetContext(newCtx) 13790 defer func() { 13791 a.app.Srv().Store.SetContext(origCtx) 13792 a.ctx = origCtx 13793 }() 13794 13795 defer span.Finish() 13796 resultVar0 := a.app.TestElasticsearch(cfg) 13797 13798 if resultVar0 != nil { 13799 span.LogFields(spanlog.Error(resultVar0)) 13800 ext.Error.Set(span, true) 13801 } 13802 13803 return resultVar0 13804 } 13805 13806 func (a *OpenTracingAppLayer) TestEmail(userId string, cfg *model.Config) *model.AppError { 13807 origCtx := a.ctx 13808 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestEmail") 13809 13810 a.ctx = newCtx 13811 a.app.Srv().Store.SetContext(newCtx) 13812 defer func() { 13813 a.app.Srv().Store.SetContext(origCtx) 13814 a.ctx = origCtx 13815 }() 13816 13817 defer span.Finish() 13818 resultVar0 := a.app.TestEmail(userId, cfg) 13819 13820 if resultVar0 != nil { 13821 span.LogFields(spanlog.Error(resultVar0)) 13822 ext.Error.Set(span, true) 13823 } 13824 13825 return resultVar0 13826 } 13827 13828 func (a *OpenTracingAppLayer) TestLdap() *model.AppError { 13829 origCtx := a.ctx 13830 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestLdap") 13831 13832 a.ctx = newCtx 13833 a.app.Srv().Store.SetContext(newCtx) 13834 defer func() { 13835 a.app.Srv().Store.SetContext(origCtx) 13836 a.ctx = origCtx 13837 }() 13838 13839 defer span.Finish() 13840 resultVar0 := a.app.TestLdap() 13841 13842 if resultVar0 != nil { 13843 span.LogFields(spanlog.Error(resultVar0)) 13844 ext.Error.Set(span, true) 13845 } 13846 13847 return resultVar0 13848 } 13849 13850 func (a *OpenTracingAppLayer) TestSiteURL(siteURL string) *model.AppError { 13851 origCtx := a.ctx 13852 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestSiteURL") 13853 13854 a.ctx = newCtx 13855 a.app.Srv().Store.SetContext(newCtx) 13856 defer func() { 13857 a.app.Srv().Store.SetContext(origCtx) 13858 a.ctx = origCtx 13859 }() 13860 13861 defer span.Finish() 13862 resultVar0 := a.app.TestSiteURL(siteURL) 13863 13864 if resultVar0 != nil { 13865 span.LogFields(spanlog.Error(resultVar0)) 13866 ext.Error.Set(span, true) 13867 } 13868 13869 return resultVar0 13870 } 13871 13872 func (a *OpenTracingAppLayer) ToggleMuteChannel(channelId string, userId string) *model.ChannelMember { 13873 origCtx := a.ctx 13874 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ToggleMuteChannel") 13875 13876 a.ctx = newCtx 13877 a.app.Srv().Store.SetContext(newCtx) 13878 defer func() { 13879 a.app.Srv().Store.SetContext(origCtx) 13880 a.ctx = origCtx 13881 }() 13882 13883 defer span.Finish() 13884 resultVar0 := a.app.ToggleMuteChannel(channelId, userId) 13885 13886 return resultVar0 13887 } 13888 13889 func (a *OpenTracingAppLayer) TotalWebsocketConnections() int { 13890 origCtx := a.ctx 13891 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TotalWebsocketConnections") 13892 13893 a.ctx = newCtx 13894 a.app.Srv().Store.SetContext(newCtx) 13895 defer func() { 13896 a.app.Srv().Store.SetContext(origCtx) 13897 a.ctx = origCtx 13898 }() 13899 13900 defer span.Finish() 13901 resultVar0 := a.app.TotalWebsocketConnections() 13902 13903 return resultVar0 13904 } 13905 13906 func (a *OpenTracingAppLayer) TriggerWebhook(payload *model.OutgoingWebhookPayload, hook *model.OutgoingWebhook, post *model.Post, channel *model.Channel) { 13907 origCtx := a.ctx 13908 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TriggerWebhook") 13909 13910 a.ctx = newCtx 13911 a.app.Srv().Store.SetContext(newCtx) 13912 defer func() { 13913 a.app.Srv().Store.SetContext(origCtx) 13914 a.ctx = origCtx 13915 }() 13916 13917 defer span.Finish() 13918 a.app.TriggerWebhook(payload, hook, post, channel) 13919 } 13920 13921 func (a *OpenTracingAppLayer) UnregisterPluginCommand(pluginId string, teamId string, trigger string) { 13922 origCtx := a.ctx 13923 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommand") 13924 13925 a.ctx = newCtx 13926 a.app.Srv().Store.SetContext(newCtx) 13927 defer func() { 13928 a.app.Srv().Store.SetContext(origCtx) 13929 a.ctx = origCtx 13930 }() 13931 13932 defer span.Finish() 13933 a.app.UnregisterPluginCommand(pluginId, teamId, trigger) 13934 } 13935 13936 func (a *OpenTracingAppLayer) UnregisterPluginCommands(pluginId string) { 13937 origCtx := a.ctx 13938 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UnregisterPluginCommands") 13939 13940 a.ctx = newCtx 13941 a.app.Srv().Store.SetContext(newCtx) 13942 defer func() { 13943 a.app.Srv().Store.SetContext(origCtx) 13944 a.ctx = origCtx 13945 }() 13946 13947 defer span.Finish() 13948 a.app.UnregisterPluginCommands(pluginId) 13949 } 13950 13951 func (a *OpenTracingAppLayer) UpdateActive(user *model.User, active bool) (*model.User, *model.AppError) { 13952 origCtx := a.ctx 13953 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateActive") 13954 13955 a.ctx = newCtx 13956 a.app.Srv().Store.SetContext(newCtx) 13957 defer func() { 13958 a.app.Srv().Store.SetContext(origCtx) 13959 a.ctx = origCtx 13960 }() 13961 13962 defer span.Finish() 13963 resultVar0, resultVar1 := a.app.UpdateActive(user, active) 13964 13965 if resultVar1 != nil { 13966 span.LogFields(spanlog.Error(resultVar1)) 13967 ext.Error.Set(span, true) 13968 } 13969 13970 return resultVar0, resultVar1 13971 } 13972 13973 func (a *OpenTracingAppLayer) UpdateBotActive(botUserId string, active bool) (*model.Bot, *model.AppError) { 13974 origCtx := a.ctx 13975 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotActive") 13976 13977 a.ctx = newCtx 13978 a.app.Srv().Store.SetContext(newCtx) 13979 defer func() { 13980 a.app.Srv().Store.SetContext(origCtx) 13981 a.ctx = origCtx 13982 }() 13983 13984 defer span.Finish() 13985 resultVar0, resultVar1 := a.app.UpdateBotActive(botUserId, active) 13986 13987 if resultVar1 != nil { 13988 span.LogFields(spanlog.Error(resultVar1)) 13989 ext.Error.Set(span, true) 13990 } 13991 13992 return resultVar0, resultVar1 13993 } 13994 13995 func (a *OpenTracingAppLayer) UpdateBotOwner(botUserId string, newOwnerId string) (*model.Bot, *model.AppError) { 13996 origCtx := a.ctx 13997 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBotOwner") 13998 13999 a.ctx = newCtx 14000 a.app.Srv().Store.SetContext(newCtx) 14001 defer func() { 14002 a.app.Srv().Store.SetContext(origCtx) 14003 a.ctx = origCtx 14004 }() 14005 14006 defer span.Finish() 14007 resultVar0, resultVar1 := a.app.UpdateBotOwner(botUserId, newOwnerId) 14008 14009 if resultVar1 != nil { 14010 span.LogFields(spanlog.Error(resultVar1)) 14011 ext.Error.Set(span, true) 14012 } 14013 14014 return resultVar0, resultVar1 14015 } 14016 14017 func (a *OpenTracingAppLayer) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { 14018 origCtx := a.ctx 14019 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannel") 14020 14021 a.ctx = newCtx 14022 a.app.Srv().Store.SetContext(newCtx) 14023 defer func() { 14024 a.app.Srv().Store.SetContext(origCtx) 14025 a.ctx = origCtx 14026 }() 14027 14028 defer span.Finish() 14029 resultVar0, resultVar1 := a.app.UpdateChannel(channel) 14030 14031 if resultVar1 != nil { 14032 span.LogFields(spanlog.Error(resultVar1)) 14033 ext.Error.Set(span, true) 14034 } 14035 14036 return resultVar0, resultVar1 14037 } 14038 14039 func (a *OpenTracingAppLayer) UpdateChannelLastViewedAt(channelIds []string, userId string) *model.AppError { 14040 origCtx := a.ctx 14041 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelLastViewedAt") 14042 14043 a.ctx = newCtx 14044 a.app.Srv().Store.SetContext(newCtx) 14045 defer func() { 14046 a.app.Srv().Store.SetContext(origCtx) 14047 a.ctx = origCtx 14048 }() 14049 14050 defer span.Finish() 14051 resultVar0 := a.app.UpdateChannelLastViewedAt(channelIds, userId) 14052 14053 if resultVar0 != nil { 14054 span.LogFields(spanlog.Error(resultVar0)) 14055 ext.Error.Set(span, true) 14056 } 14057 14058 return resultVar0 14059 } 14060 14061 func (a *OpenTracingAppLayer) UpdateChannelMemberNotifyProps(data map[string]string, channelId string, userId string) (*model.ChannelMember, *model.AppError) { 14062 origCtx := a.ctx 14063 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberNotifyProps") 14064 14065 a.ctx = newCtx 14066 a.app.Srv().Store.SetContext(newCtx) 14067 defer func() { 14068 a.app.Srv().Store.SetContext(origCtx) 14069 a.ctx = origCtx 14070 }() 14071 14072 defer span.Finish() 14073 resultVar0, resultVar1 := a.app.UpdateChannelMemberNotifyProps(data, channelId, userId) 14074 14075 if resultVar1 != nil { 14076 span.LogFields(spanlog.Error(resultVar1)) 14077 ext.Error.Set(span, true) 14078 } 14079 14080 return resultVar0, resultVar1 14081 } 14082 14083 func (a *OpenTracingAppLayer) UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError) { 14084 origCtx := a.ctx 14085 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberRoles") 14086 14087 a.ctx = newCtx 14088 a.app.Srv().Store.SetContext(newCtx) 14089 defer func() { 14090 a.app.Srv().Store.SetContext(origCtx) 14091 a.ctx = origCtx 14092 }() 14093 14094 defer span.Finish() 14095 resultVar0, resultVar1 := a.app.UpdateChannelMemberRoles(channelId, userId, newRoles) 14096 14097 if resultVar1 != nil { 14098 span.LogFields(spanlog.Error(resultVar1)) 14099 ext.Error.Set(span, true) 14100 } 14101 14102 return resultVar0, resultVar1 14103 } 14104 14105 func (a *OpenTracingAppLayer) UpdateChannelMemberSchemeRoles(channelId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.ChannelMember, *model.AppError) { 14106 origCtx := a.ctx 14107 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelMemberSchemeRoles") 14108 14109 a.ctx = newCtx 14110 a.app.Srv().Store.SetContext(newCtx) 14111 defer func() { 14112 a.app.Srv().Store.SetContext(origCtx) 14113 a.ctx = origCtx 14114 }() 14115 14116 defer span.Finish() 14117 resultVar0, resultVar1 := a.app.UpdateChannelMemberSchemeRoles(channelId, userId, isSchemeGuest, isSchemeUser, isSchemeAdmin) 14118 14119 if resultVar1 != nil { 14120 span.LogFields(spanlog.Error(resultVar1)) 14121 ext.Error.Set(span, true) 14122 } 14123 14124 return resultVar0, resultVar1 14125 } 14126 14127 func (a *OpenTracingAppLayer) UpdateChannelPrivacy(oldChannel *model.Channel, user *model.User) (*model.Channel, *model.AppError) { 14128 origCtx := a.ctx 14129 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelPrivacy") 14130 14131 a.ctx = newCtx 14132 a.app.Srv().Store.SetContext(newCtx) 14133 defer func() { 14134 a.app.Srv().Store.SetContext(origCtx) 14135 a.ctx = origCtx 14136 }() 14137 14138 defer span.Finish() 14139 resultVar0, resultVar1 := a.app.UpdateChannelPrivacy(oldChannel, user) 14140 14141 if resultVar1 != nil { 14142 span.LogFields(spanlog.Error(resultVar1)) 14143 ext.Error.Set(span, true) 14144 } 14145 14146 return resultVar0, resultVar1 14147 } 14148 14149 func (a *OpenTracingAppLayer) UpdateChannelScheme(channel *model.Channel) (*model.Channel, *model.AppError) { 14150 origCtx := a.ctx 14151 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateChannelScheme") 14152 14153 a.ctx = newCtx 14154 a.app.Srv().Store.SetContext(newCtx) 14155 defer func() { 14156 a.app.Srv().Store.SetContext(origCtx) 14157 a.ctx = origCtx 14158 }() 14159 14160 defer span.Finish() 14161 resultVar0, resultVar1 := a.app.UpdateChannelScheme(channel) 14162 14163 if resultVar1 != nil { 14164 span.LogFields(spanlog.Error(resultVar1)) 14165 ext.Error.Set(span, true) 14166 } 14167 14168 return resultVar0, resultVar1 14169 } 14170 14171 func (a *OpenTracingAppLayer) UpdateCommand(oldCmd *model.Command, updatedCmd *model.Command) (*model.Command, *model.AppError) { 14172 origCtx := a.ctx 14173 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateCommand") 14174 14175 a.ctx = newCtx 14176 a.app.Srv().Store.SetContext(newCtx) 14177 defer func() { 14178 a.app.Srv().Store.SetContext(origCtx) 14179 a.ctx = origCtx 14180 }() 14181 14182 defer span.Finish() 14183 resultVar0, resultVar1 := a.app.UpdateCommand(oldCmd, updatedCmd) 14184 14185 if resultVar1 != nil { 14186 span.LogFields(spanlog.Error(resultVar1)) 14187 ext.Error.Set(span, true) 14188 } 14189 14190 return resultVar0, resultVar1 14191 } 14192 14193 func (a *OpenTracingAppLayer) UpdateConfig(f func(*model.Config)) { 14194 origCtx := a.ctx 14195 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateConfig") 14196 14197 a.ctx = newCtx 14198 a.app.Srv().Store.SetContext(newCtx) 14199 defer func() { 14200 a.app.Srv().Store.SetContext(origCtx) 14201 a.ctx = origCtx 14202 }() 14203 14204 defer span.Finish() 14205 a.app.UpdateConfig(f) 14206 } 14207 14208 func (a *OpenTracingAppLayer) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { 14209 origCtx := a.ctx 14210 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateEphemeralPost") 14211 14212 a.ctx = newCtx 14213 a.app.Srv().Store.SetContext(newCtx) 14214 defer func() { 14215 a.app.Srv().Store.SetContext(origCtx) 14216 a.ctx = origCtx 14217 }() 14218 14219 defer span.Finish() 14220 resultVar0 := a.app.UpdateEphemeralPost(userId, post) 14221 14222 return resultVar0 14223 } 14224 14225 func (a *OpenTracingAppLayer) UpdateGroup(group *model.Group) (*model.Group, *model.AppError) { 14226 origCtx := a.ctx 14227 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroup") 14228 14229 a.ctx = newCtx 14230 a.app.Srv().Store.SetContext(newCtx) 14231 defer func() { 14232 a.app.Srv().Store.SetContext(origCtx) 14233 a.ctx = origCtx 14234 }() 14235 14236 defer span.Finish() 14237 resultVar0, resultVar1 := a.app.UpdateGroup(group) 14238 14239 if resultVar1 != nil { 14240 span.LogFields(spanlog.Error(resultVar1)) 14241 ext.Error.Set(span, true) 14242 } 14243 14244 return resultVar0, resultVar1 14245 } 14246 14247 func (a *OpenTracingAppLayer) UpdateGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 14248 origCtx := a.ctx 14249 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateGroupSyncable") 14250 14251 a.ctx = newCtx 14252 a.app.Srv().Store.SetContext(newCtx) 14253 defer func() { 14254 a.app.Srv().Store.SetContext(origCtx) 14255 a.ctx = origCtx 14256 }() 14257 14258 defer span.Finish() 14259 resultVar0, resultVar1 := a.app.UpdateGroupSyncable(groupSyncable) 14260 14261 if resultVar1 != nil { 14262 span.LogFields(spanlog.Error(resultVar1)) 14263 ext.Error.Set(span, true) 14264 } 14265 14266 return resultVar0, resultVar1 14267 } 14268 14269 func (a *OpenTracingAppLayer) UpdateIncomingWebhook(oldHook *model.IncomingWebhook, updatedHook *model.IncomingWebhook) (*model.IncomingWebhook, *model.AppError) { 14270 origCtx := a.ctx 14271 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateIncomingWebhook") 14272 14273 a.ctx = newCtx 14274 a.app.Srv().Store.SetContext(newCtx) 14275 defer func() { 14276 a.app.Srv().Store.SetContext(origCtx) 14277 a.ctx = origCtx 14278 }() 14279 14280 defer span.Finish() 14281 resultVar0, resultVar1 := a.app.UpdateIncomingWebhook(oldHook, updatedHook) 14282 14283 if resultVar1 != nil { 14284 span.LogFields(spanlog.Error(resultVar1)) 14285 ext.Error.Set(span, true) 14286 } 14287 14288 return resultVar0, resultVar1 14289 } 14290 14291 func (a *OpenTracingAppLayer) UpdateLastActivityAtIfNeeded(session model.Session) { 14292 origCtx := a.ctx 14293 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateLastActivityAtIfNeeded") 14294 14295 a.ctx = newCtx 14296 a.app.Srv().Store.SetContext(newCtx) 14297 defer func() { 14298 a.app.Srv().Store.SetContext(origCtx) 14299 a.ctx = origCtx 14300 }() 14301 14302 defer span.Finish() 14303 a.app.UpdateLastActivityAtIfNeeded(session) 14304 } 14305 14306 func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userId string, token string) *model.AppError { 14307 origCtx := a.ctx 14308 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMfa") 14309 14310 a.ctx = newCtx 14311 a.app.Srv().Store.SetContext(newCtx) 14312 defer func() { 14313 a.app.Srv().Store.SetContext(origCtx) 14314 a.ctx = origCtx 14315 }() 14316 14317 defer span.Finish() 14318 resultVar0 := a.app.UpdateMfa(activate, userId, token) 14319 14320 if resultVar0 != nil { 14321 span.LogFields(spanlog.Error(resultVar0)) 14322 ext.Error.Set(span, true) 14323 } 14324 14325 return resultVar0 14326 } 14327 14328 func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userId string) { 14329 origCtx := a.ctx 14330 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMobileAppBadge") 14331 14332 a.ctx = newCtx 14333 a.app.Srv().Store.SetContext(newCtx) 14334 defer func() { 14335 a.app.Srv().Store.SetContext(origCtx) 14336 a.ctx = origCtx 14337 }() 14338 14339 defer span.Finish() 14340 a.app.UpdateMobileAppBadge(userId) 14341 } 14342 14343 func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string) *model.AppError { 14344 origCtx := a.ctx 14345 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOAuthUserAttrs") 14346 14347 a.ctx = newCtx 14348 a.app.Srv().Store.SetContext(newCtx) 14349 defer func() { 14350 a.app.Srv().Store.SetContext(origCtx) 14351 a.ctx = origCtx 14352 }() 14353 14354 defer span.Finish() 14355 resultVar0 := a.app.UpdateOAuthUserAttrs(userData, user, provider, service) 14356 14357 if resultVar0 != nil { 14358 span.LogFields(spanlog.Error(resultVar0)) 14359 ext.Error.Set(span, true) 14360 } 14361 14362 return resultVar0 14363 } 14364 14365 func (a *OpenTracingAppLayer) UpdateOauthApp(oldApp *model.OAuthApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 14366 origCtx := a.ctx 14367 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOauthApp") 14368 14369 a.ctx = newCtx 14370 a.app.Srv().Store.SetContext(newCtx) 14371 defer func() { 14372 a.app.Srv().Store.SetContext(origCtx) 14373 a.ctx = origCtx 14374 }() 14375 14376 defer span.Finish() 14377 resultVar0, resultVar1 := a.app.UpdateOauthApp(oldApp, updatedApp) 14378 14379 if resultVar1 != nil { 14380 span.LogFields(spanlog.Error(resultVar1)) 14381 ext.Error.Set(span, true) 14382 } 14383 14384 return resultVar0, resultVar1 14385 } 14386 14387 func (a *OpenTracingAppLayer) UpdateOutgoingWebhook(oldHook *model.OutgoingWebhook, updatedHook *model.OutgoingWebhook) (*model.OutgoingWebhook, *model.AppError) { 14388 origCtx := a.ctx 14389 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOutgoingWebhook") 14390 14391 a.ctx = newCtx 14392 a.app.Srv().Store.SetContext(newCtx) 14393 defer func() { 14394 a.app.Srv().Store.SetContext(origCtx) 14395 a.ctx = origCtx 14396 }() 14397 14398 defer span.Finish() 14399 resultVar0, resultVar1 := a.app.UpdateOutgoingWebhook(oldHook, updatedHook) 14400 14401 if resultVar1 != nil { 14402 span.LogFields(spanlog.Error(resultVar1)) 14403 ext.Error.Set(span, true) 14404 } 14405 14406 return resultVar0, resultVar1 14407 } 14408 14409 func (a *OpenTracingAppLayer) UpdatePassword(user *model.User, newPassword string) *model.AppError { 14410 origCtx := a.ctx 14411 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePassword") 14412 14413 a.ctx = newCtx 14414 a.app.Srv().Store.SetContext(newCtx) 14415 defer func() { 14416 a.app.Srv().Store.SetContext(origCtx) 14417 a.ctx = origCtx 14418 }() 14419 14420 defer span.Finish() 14421 resultVar0 := a.app.UpdatePassword(user, newPassword) 14422 14423 if resultVar0 != nil { 14424 span.LogFields(spanlog.Error(resultVar0)) 14425 ext.Error.Set(span, true) 14426 } 14427 14428 return resultVar0 14429 } 14430 14431 func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userId string, currentPassword string, newPassword string) *model.AppError { 14432 origCtx := a.ctx 14433 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordAsUser") 14434 14435 a.ctx = newCtx 14436 a.app.Srv().Store.SetContext(newCtx) 14437 defer func() { 14438 a.app.Srv().Store.SetContext(origCtx) 14439 a.ctx = origCtx 14440 }() 14441 14442 defer span.Finish() 14443 resultVar0 := a.app.UpdatePasswordAsUser(userId, currentPassword, newPassword) 14444 14445 if resultVar0 != nil { 14446 span.LogFields(spanlog.Error(resultVar0)) 14447 ext.Error.Set(span, true) 14448 } 14449 14450 return resultVar0 14451 } 14452 14453 func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userId string, newPassword string, method string) *model.AppError { 14454 origCtx := a.ctx 14455 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordByUserIdSendEmail") 14456 14457 a.ctx = newCtx 14458 a.app.Srv().Store.SetContext(newCtx) 14459 defer func() { 14460 a.app.Srv().Store.SetContext(origCtx) 14461 a.ctx = origCtx 14462 }() 14463 14464 defer span.Finish() 14465 resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userId, newPassword, method) 14466 14467 if resultVar0 != nil { 14468 span.LogFields(spanlog.Error(resultVar0)) 14469 ext.Error.Set(span, true) 14470 } 14471 14472 return resultVar0 14473 } 14474 14475 func (a *OpenTracingAppLayer) UpdatePasswordSendEmail(user *model.User, newPassword string, method string) *model.AppError { 14476 origCtx := a.ctx 14477 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordSendEmail") 14478 14479 a.ctx = newCtx 14480 a.app.Srv().Store.SetContext(newCtx) 14481 defer func() { 14482 a.app.Srv().Store.SetContext(origCtx) 14483 a.ctx = origCtx 14484 }() 14485 14486 defer span.Finish() 14487 resultVar0 := a.app.UpdatePasswordSendEmail(user, newPassword, method) 14488 14489 if resultVar0 != nil { 14490 span.LogFields(spanlog.Error(resultVar0)) 14491 ext.Error.Set(span, true) 14492 } 14493 14494 return resultVar0 14495 } 14496 14497 func (a *OpenTracingAppLayer) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) { 14498 origCtx := a.ctx 14499 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePost") 14500 14501 a.ctx = newCtx 14502 a.app.Srv().Store.SetContext(newCtx) 14503 defer func() { 14504 a.app.Srv().Store.SetContext(origCtx) 14505 a.ctx = origCtx 14506 }() 14507 14508 defer span.Finish() 14509 resultVar0, resultVar1 := a.app.UpdatePost(post, safeUpdate) 14510 14511 if resultVar1 != nil { 14512 span.LogFields(spanlog.Error(resultVar1)) 14513 ext.Error.Set(span, true) 14514 } 14515 14516 return resultVar0, resultVar1 14517 } 14518 14519 func (a *OpenTracingAppLayer) UpdatePreferences(userId string, preferences model.Preferences) *model.AppError { 14520 origCtx := a.ctx 14521 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePreferences") 14522 14523 a.ctx = newCtx 14524 a.app.Srv().Store.SetContext(newCtx) 14525 defer func() { 14526 a.app.Srv().Store.SetContext(origCtx) 14527 a.ctx = origCtx 14528 }() 14529 14530 defer span.Finish() 14531 resultVar0 := a.app.UpdatePreferences(userId, preferences) 14532 14533 if resultVar0 != nil { 14534 span.LogFields(spanlog.Error(resultVar0)) 14535 ext.Error.Set(span, true) 14536 } 14537 14538 return resultVar0 14539 } 14540 14541 func (a *OpenTracingAppLayer) UpdateRole(role *model.Role) (*model.Role, *model.AppError) { 14542 origCtx := a.ctx 14543 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRole") 14544 14545 a.ctx = newCtx 14546 a.app.Srv().Store.SetContext(newCtx) 14547 defer func() { 14548 a.app.Srv().Store.SetContext(origCtx) 14549 a.ctx = origCtx 14550 }() 14551 14552 defer span.Finish() 14553 resultVar0, resultVar1 := a.app.UpdateRole(role) 14554 14555 if resultVar1 != nil { 14556 span.LogFields(spanlog.Error(resultVar1)) 14557 ext.Error.Set(span, true) 14558 } 14559 14560 return resultVar0, resultVar1 14561 } 14562 14563 func (a *OpenTracingAppLayer) UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 14564 origCtx := a.ctx 14565 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateScheme") 14566 14567 a.ctx = newCtx 14568 a.app.Srv().Store.SetContext(newCtx) 14569 defer func() { 14570 a.app.Srv().Store.SetContext(origCtx) 14571 a.ctx = origCtx 14572 }() 14573 14574 defer span.Finish() 14575 resultVar0, resultVar1 := a.app.UpdateScheme(scheme) 14576 14577 if resultVar1 != nil { 14578 span.LogFields(spanlog.Error(resultVar1)) 14579 ext.Error.Set(span, true) 14580 } 14581 14582 return resultVar0, resultVar1 14583 } 14584 14585 func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userId string, isGuest bool) { 14586 origCtx := a.ctx 14587 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSessionsIsGuest") 14588 14589 a.ctx = newCtx 14590 a.app.Srv().Store.SetContext(newCtx) 14591 defer func() { 14592 a.app.Srv().Store.SetContext(origCtx) 14593 a.ctx = origCtx 14594 }() 14595 14596 defer span.Finish() 14597 a.app.UpdateSessionsIsGuest(userId, isGuest) 14598 } 14599 14600 func (a *OpenTracingAppLayer) UpdateSidebarCategories(userId string, teamId string, categories []*model.SidebarCategoryWithChannels) ([]*model.SidebarCategoryWithChannels, *model.AppError) { 14601 origCtx := a.ctx 14602 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategories") 14603 14604 a.ctx = newCtx 14605 a.app.Srv().Store.SetContext(newCtx) 14606 defer func() { 14607 a.app.Srv().Store.SetContext(origCtx) 14608 a.ctx = origCtx 14609 }() 14610 14611 defer span.Finish() 14612 resultVar0, resultVar1 := a.app.UpdateSidebarCategories(userId, teamId, categories) 14613 14614 if resultVar1 != nil { 14615 span.LogFields(spanlog.Error(resultVar1)) 14616 ext.Error.Set(span, true) 14617 } 14618 14619 return resultVar0, resultVar1 14620 } 14621 14622 func (a *OpenTracingAppLayer) UpdateSidebarCategoryOrder(userId string, teamId string, categoryOrder []string) *model.AppError { 14623 origCtx := a.ctx 14624 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSidebarCategoryOrder") 14625 14626 a.ctx = newCtx 14627 a.app.Srv().Store.SetContext(newCtx) 14628 defer func() { 14629 a.app.Srv().Store.SetContext(origCtx) 14630 a.ctx = origCtx 14631 }() 14632 14633 defer span.Finish() 14634 resultVar0 := a.app.UpdateSidebarCategoryOrder(userId, teamId, categoryOrder) 14635 14636 if resultVar0 != nil { 14637 span.LogFields(spanlog.Error(resultVar0)) 14638 ext.Error.Set(span, true) 14639 } 14640 14641 return resultVar0 14642 } 14643 14644 func (a *OpenTracingAppLayer) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { 14645 origCtx := a.ctx 14646 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeam") 14647 14648 a.ctx = newCtx 14649 a.app.Srv().Store.SetContext(newCtx) 14650 defer func() { 14651 a.app.Srv().Store.SetContext(origCtx) 14652 a.ctx = origCtx 14653 }() 14654 14655 defer span.Finish() 14656 resultVar0, resultVar1 := a.app.UpdateTeam(team) 14657 14658 if resultVar1 != nil { 14659 span.LogFields(spanlog.Error(resultVar1)) 14660 ext.Error.Set(span, true) 14661 } 14662 14663 return resultVar0, resultVar1 14664 } 14665 14666 func (a *OpenTracingAppLayer) UpdateTeamMemberRoles(teamId string, userId string, newRoles string) (*model.TeamMember, *model.AppError) { 14667 origCtx := a.ctx 14668 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberRoles") 14669 14670 a.ctx = newCtx 14671 a.app.Srv().Store.SetContext(newCtx) 14672 defer func() { 14673 a.app.Srv().Store.SetContext(origCtx) 14674 a.ctx = origCtx 14675 }() 14676 14677 defer span.Finish() 14678 resultVar0, resultVar1 := a.app.UpdateTeamMemberRoles(teamId, userId, newRoles) 14679 14680 if resultVar1 != nil { 14681 span.LogFields(spanlog.Error(resultVar1)) 14682 ext.Error.Set(span, true) 14683 } 14684 14685 return resultVar0, resultVar1 14686 } 14687 14688 func (a *OpenTracingAppLayer) UpdateTeamMemberSchemeRoles(teamId string, userId string, isSchemeGuest bool, isSchemeUser bool, isSchemeAdmin bool) (*model.TeamMember, *model.AppError) { 14689 origCtx := a.ctx 14690 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamMemberSchemeRoles") 14691 14692 a.ctx = newCtx 14693 a.app.Srv().Store.SetContext(newCtx) 14694 defer func() { 14695 a.app.Srv().Store.SetContext(origCtx) 14696 a.ctx = origCtx 14697 }() 14698 14699 defer span.Finish() 14700 resultVar0, resultVar1 := a.app.UpdateTeamMemberSchemeRoles(teamId, userId, isSchemeGuest, isSchemeUser, isSchemeAdmin) 14701 14702 if resultVar1 != nil { 14703 span.LogFields(spanlog.Error(resultVar1)) 14704 ext.Error.Set(span, true) 14705 } 14706 14707 return resultVar0, resultVar1 14708 } 14709 14710 func (a *OpenTracingAppLayer) UpdateTeamPrivacy(teamId string, teamType string, allowOpenInvite bool) *model.AppError { 14711 origCtx := a.ctx 14712 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamPrivacy") 14713 14714 a.ctx = newCtx 14715 a.app.Srv().Store.SetContext(newCtx) 14716 defer func() { 14717 a.app.Srv().Store.SetContext(origCtx) 14718 a.ctx = origCtx 14719 }() 14720 14721 defer span.Finish() 14722 resultVar0 := a.app.UpdateTeamPrivacy(teamId, teamType, allowOpenInvite) 14723 14724 if resultVar0 != nil { 14725 span.LogFields(spanlog.Error(resultVar0)) 14726 ext.Error.Set(span, true) 14727 } 14728 14729 return resultVar0 14730 } 14731 14732 func (a *OpenTracingAppLayer) UpdateTeamScheme(team *model.Team) (*model.Team, *model.AppError) { 14733 origCtx := a.ctx 14734 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateTeamScheme") 14735 14736 a.ctx = newCtx 14737 a.app.Srv().Store.SetContext(newCtx) 14738 defer func() { 14739 a.app.Srv().Store.SetContext(origCtx) 14740 a.ctx = origCtx 14741 }() 14742 14743 defer span.Finish() 14744 resultVar0, resultVar1 := a.app.UpdateTeamScheme(team) 14745 14746 if resultVar1 != nil { 14747 span.LogFields(spanlog.Error(resultVar1)) 14748 ext.Error.Set(span, true) 14749 } 14750 14751 return resultVar0, resultVar1 14752 } 14753 14754 func (a *OpenTracingAppLayer) UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) { 14755 origCtx := a.ctx 14756 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUser") 14757 14758 a.ctx = newCtx 14759 a.app.Srv().Store.SetContext(newCtx) 14760 defer func() { 14761 a.app.Srv().Store.SetContext(origCtx) 14762 a.ctx = origCtx 14763 }() 14764 14765 defer span.Finish() 14766 resultVar0, resultVar1 := a.app.UpdateUser(user, sendNotifications) 14767 14768 if resultVar1 != nil { 14769 span.LogFields(spanlog.Error(resultVar1)) 14770 ext.Error.Set(span, true) 14771 } 14772 14773 return resultVar0, resultVar1 14774 } 14775 14776 func (a *OpenTracingAppLayer) UpdateUserActive(userId string, active bool) *model.AppError { 14777 origCtx := a.ctx 14778 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive") 14779 14780 a.ctx = newCtx 14781 a.app.Srv().Store.SetContext(newCtx) 14782 defer func() { 14783 a.app.Srv().Store.SetContext(origCtx) 14784 a.ctx = origCtx 14785 }() 14786 14787 defer span.Finish() 14788 resultVar0 := a.app.UpdateUserActive(userId, active) 14789 14790 if resultVar0 != nil { 14791 span.LogFields(spanlog.Error(resultVar0)) 14792 ext.Error.Set(span, true) 14793 } 14794 14795 return resultVar0 14796 } 14797 14798 func (a *OpenTracingAppLayer) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) { 14799 origCtx := a.ctx 14800 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAsUser") 14801 14802 a.ctx = newCtx 14803 a.app.Srv().Store.SetContext(newCtx) 14804 defer func() { 14805 a.app.Srv().Store.SetContext(origCtx) 14806 a.ctx = origCtx 14807 }() 14808 14809 defer span.Finish() 14810 resultVar0, resultVar1 := a.app.UpdateUserAsUser(user, asAdmin) 14811 14812 if resultVar1 != nil { 14813 span.LogFields(spanlog.Error(resultVar1)) 14814 ext.Error.Set(span, true) 14815 } 14816 14817 return resultVar0, resultVar1 14818 } 14819 14820 func (a *OpenTracingAppLayer) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { 14821 origCtx := a.ctx 14822 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAuth") 14823 14824 a.ctx = newCtx 14825 a.app.Srv().Store.SetContext(newCtx) 14826 defer func() { 14827 a.app.Srv().Store.SetContext(origCtx) 14828 a.ctx = origCtx 14829 }() 14830 14831 defer span.Finish() 14832 resultVar0, resultVar1 := a.app.UpdateUserAuth(userId, userAuth) 14833 14834 if resultVar1 != nil { 14835 span.LogFields(spanlog.Error(resultVar1)) 14836 ext.Error.Set(span, true) 14837 } 14838 14839 return resultVar0, resultVar1 14840 } 14841 14842 func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userId string, props map[string]string) (*model.User, *model.AppError) { 14843 origCtx := a.ctx 14844 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserNotifyProps") 14845 14846 a.ctx = newCtx 14847 a.app.Srv().Store.SetContext(newCtx) 14848 defer func() { 14849 a.app.Srv().Store.SetContext(origCtx) 14850 a.ctx = origCtx 14851 }() 14852 14853 defer span.Finish() 14854 resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userId, props) 14855 14856 if resultVar1 != nil { 14857 span.LogFields(spanlog.Error(resultVar1)) 14858 ext.Error.Set(span, true) 14859 } 14860 14861 return resultVar0, resultVar1 14862 } 14863 14864 func (a *OpenTracingAppLayer) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 14865 origCtx := a.ctx 14866 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRoles") 14867 14868 a.ctx = newCtx 14869 a.app.Srv().Store.SetContext(newCtx) 14870 defer func() { 14871 a.app.Srv().Store.SetContext(origCtx) 14872 a.ctx = origCtx 14873 }() 14874 14875 defer span.Finish() 14876 resultVar0, resultVar1 := a.app.UpdateUserRoles(userId, newRoles, sendWebSocketEvent) 14877 14878 if resultVar1 != nil { 14879 span.LogFields(spanlog.Error(resultVar1)) 14880 ext.Error.Set(span, true) 14881 } 14882 14883 return resultVar0, resultVar1 14884 } 14885 14886 func (a *OpenTracingAppLayer) UpdateWebConnUserActivity(session model.Session, activityAt int64) { 14887 origCtx := a.ctx 14888 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateWebConnUserActivity") 14889 14890 a.ctx = newCtx 14891 a.app.Srv().Store.SetContext(newCtx) 14892 defer func() { 14893 a.app.Srv().Store.SetContext(origCtx) 14894 a.ctx = origCtx 14895 }() 14896 14897 defer span.Finish() 14898 a.app.UpdateWebConnUserActivity(session, activityAt) 14899 } 14900 14901 func (a *OpenTracingAppLayer) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError { 14902 origCtx := a.ctx 14903 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadEmojiImage") 14904 14905 a.ctx = newCtx 14906 a.app.Srv().Store.SetContext(newCtx) 14907 defer func() { 14908 a.app.Srv().Store.SetContext(origCtx) 14909 a.ctx = origCtx 14910 }() 14911 14912 defer span.Finish() 14913 resultVar0 := a.app.UploadEmojiImage(id, imageData) 14914 14915 if resultVar0 != nil { 14916 span.LogFields(spanlog.Error(resultVar0)) 14917 ext.Error.Set(span, true) 14918 } 14919 14920 return resultVar0 14921 } 14922 14923 func (a *OpenTracingAppLayer) UploadFile(data []byte, channelId string, filename string) (*model.FileInfo, *model.AppError) { 14924 origCtx := a.ctx 14925 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFile") 14926 14927 a.ctx = newCtx 14928 a.app.Srv().Store.SetContext(newCtx) 14929 defer func() { 14930 a.app.Srv().Store.SetContext(origCtx) 14931 a.ctx = origCtx 14932 }() 14933 14934 defer span.Finish() 14935 resultVar0, resultVar1 := a.app.UploadFile(data, channelId, filename) 14936 14937 if resultVar1 != nil { 14938 span.LogFields(spanlog.Error(resultVar1)) 14939 ext.Error.Set(span, true) 14940 } 14941 14942 return resultVar0, resultVar1 14943 } 14944 14945 func (a *OpenTracingAppLayer) UploadFileX(channelId string, name string, input io.Reader, opts ...func(*app.UploadFileTask)) (*model.FileInfo, *model.AppError) { 14946 origCtx := a.ctx 14947 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFileX") 14948 14949 a.ctx = newCtx 14950 a.app.Srv().Store.SetContext(newCtx) 14951 defer func() { 14952 a.app.Srv().Store.SetContext(origCtx) 14953 a.ctx = origCtx 14954 }() 14955 14956 defer span.Finish() 14957 resultVar0, resultVar1 := a.app.UploadFileX(channelId, name, input, opts...) 14958 14959 if resultVar1 != nil { 14960 span.LogFields(spanlog.Error(resultVar1)) 14961 ext.Error.Set(span, true) 14962 } 14963 14964 return resultVar0, resultVar1 14965 } 14966 14967 func (a *OpenTracingAppLayer) UploadFiles(teamId string, channelId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 14968 origCtx := a.ctx 14969 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFiles") 14970 14971 a.ctx = newCtx 14972 a.app.Srv().Store.SetContext(newCtx) 14973 defer func() { 14974 a.app.Srv().Store.SetContext(origCtx) 14975 a.ctx = origCtx 14976 }() 14977 14978 defer span.Finish() 14979 resultVar0, resultVar1 := a.app.UploadFiles(teamId, channelId, userId, files, filenames, clientIds, now) 14980 14981 if resultVar1 != nil { 14982 span.LogFields(spanlog.Error(resultVar1)) 14983 ext.Error.Set(span, true) 14984 } 14985 14986 return resultVar0, resultVar1 14987 } 14988 14989 func (a *OpenTracingAppLayer) UploadMultipartFiles(teamId string, channelId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 14990 origCtx := a.ctx 14991 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadMultipartFiles") 14992 14993 a.ctx = newCtx 14994 a.app.Srv().Store.SetContext(newCtx) 14995 defer func() { 14996 a.app.Srv().Store.SetContext(origCtx) 14997 a.ctx = origCtx 14998 }() 14999 15000 defer span.Finish() 15001 resultVar0, resultVar1 := a.app.UploadMultipartFiles(teamId, channelId, userId, fileHeaders, clientIds, now) 15002 15003 if resultVar1 != nil { 15004 span.LogFields(spanlog.Error(resultVar1)) 15005 ext.Error.Set(span, true) 15006 } 15007 15008 return resultVar0, resultVar1 15009 } 15010 15011 func (a *OpenTracingAppLayer) UpsertGroupMember(groupID string, userID string) (*model.GroupMember, *model.AppError) { 15012 origCtx := a.ctx 15013 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupMember") 15014 15015 a.ctx = newCtx 15016 a.app.Srv().Store.SetContext(newCtx) 15017 defer func() { 15018 a.app.Srv().Store.SetContext(origCtx) 15019 a.ctx = origCtx 15020 }() 15021 15022 defer span.Finish() 15023 resultVar0, resultVar1 := a.app.UpsertGroupMember(groupID, userID) 15024 15025 if resultVar1 != nil { 15026 span.LogFields(spanlog.Error(resultVar1)) 15027 ext.Error.Set(span, true) 15028 } 15029 15030 return resultVar0, resultVar1 15031 } 15032 15033 func (a *OpenTracingAppLayer) UpsertGroupSyncable(groupSyncable *model.GroupSyncable) (*model.GroupSyncable, *model.AppError) { 15034 origCtx := a.ctx 15035 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpsertGroupSyncable") 15036 15037 a.ctx = newCtx 15038 a.app.Srv().Store.SetContext(newCtx) 15039 defer func() { 15040 a.app.Srv().Store.SetContext(origCtx) 15041 a.ctx = origCtx 15042 }() 15043 15044 defer span.Finish() 15045 resultVar0, resultVar1 := a.app.UpsertGroupSyncable(groupSyncable) 15046 15047 if resultVar1 != nil { 15048 span.LogFields(spanlog.Error(resultVar1)) 15049 ext.Error.Set(span, true) 15050 } 15051 15052 return resultVar0, resultVar1 15053 } 15054 15055 func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) { 15056 origCtx := a.ctx 15057 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserCanSeeOtherUser") 15058 15059 a.ctx = newCtx 15060 a.app.Srv().Store.SetContext(newCtx) 15061 defer func() { 15062 a.app.Srv().Store.SetContext(origCtx) 15063 a.ctx = origCtx 15064 }() 15065 15066 defer span.Finish() 15067 resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userId, otherUserId) 15068 15069 if resultVar1 != nil { 15070 span.LogFields(spanlog.Error(resultVar1)) 15071 ext.Error.Set(span, true) 15072 } 15073 15074 return resultVar0, resultVar1 15075 } 15076 15077 func (a *OpenTracingAppLayer) UserIsInAdminRoleGroup(userID string, syncableID string, syncableType model.GroupSyncableType) (bool, *model.AppError) { 15078 origCtx := a.ctx 15079 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserIsInAdminRoleGroup") 15080 15081 a.ctx = newCtx 15082 a.app.Srv().Store.SetContext(newCtx) 15083 defer func() { 15084 a.app.Srv().Store.SetContext(origCtx) 15085 a.ctx = origCtx 15086 }() 15087 15088 defer span.Finish() 15089 resultVar0, resultVar1 := a.app.UserIsInAdminRoleGroup(userID, syncableID, syncableType) 15090 15091 if resultVar1 != nil { 15092 span.LogFields(spanlog.Error(resultVar1)) 15093 ext.Error.Set(span, true) 15094 } 15095 15096 return resultVar0, resultVar1 15097 } 15098 15099 func (a *OpenTracingAppLayer) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError { 15100 origCtx := a.ctx 15101 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyEmailFromToken") 15102 15103 a.ctx = newCtx 15104 a.app.Srv().Store.SetContext(newCtx) 15105 defer func() { 15106 a.app.Srv().Store.SetContext(origCtx) 15107 a.ctx = origCtx 15108 }() 15109 15110 defer span.Finish() 15111 resultVar0 := a.app.VerifyEmailFromToken(userSuppliedTokenString) 15112 15113 if resultVar0 != nil { 15114 span.LogFields(spanlog.Error(resultVar0)) 15115 ext.Error.Set(span, true) 15116 } 15117 15118 return resultVar0 15119 } 15120 15121 func (a *OpenTracingAppLayer) VerifyPlugin(plugin io.ReadSeeker, signature io.ReadSeeker) *model.AppError { 15122 origCtx := a.ctx 15123 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyPlugin") 15124 15125 a.ctx = newCtx 15126 a.app.Srv().Store.SetContext(newCtx) 15127 defer func() { 15128 a.app.Srv().Store.SetContext(origCtx) 15129 a.ctx = origCtx 15130 }() 15131 15132 defer span.Finish() 15133 resultVar0 := a.app.VerifyPlugin(plugin, signature) 15134 15135 if resultVar0 != nil { 15136 span.LogFields(spanlog.Error(resultVar0)) 15137 ext.Error.Set(span, true) 15138 } 15139 15140 return resultVar0 15141 } 15142 15143 func (a *OpenTracingAppLayer) VerifyUserEmail(userId string, email string) *model.AppError { 15144 origCtx := a.ctx 15145 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyUserEmail") 15146 15147 a.ctx = newCtx 15148 a.app.Srv().Store.SetContext(newCtx) 15149 defer func() { 15150 a.app.Srv().Store.SetContext(origCtx) 15151 a.ctx = origCtx 15152 }() 15153 15154 defer span.Finish() 15155 resultVar0 := a.app.VerifyUserEmail(userId, email) 15156 15157 if resultVar0 != nil { 15158 span.LogFields(spanlog.Error(resultVar0)) 15159 ext.Error.Set(span, true) 15160 } 15161 15162 return resultVar0 15163 } 15164 15165 func (a *OpenTracingAppLayer) ViewChannel(view *model.ChannelView, userId string, currentSessionId string) (map[string]int64, *model.AppError) { 15166 origCtx := a.ctx 15167 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ViewChannel") 15168 15169 a.ctx = newCtx 15170 a.app.Srv().Store.SetContext(newCtx) 15171 defer func() { 15172 a.app.Srv().Store.SetContext(origCtx) 15173 a.ctx = origCtx 15174 }() 15175 15176 defer span.Finish() 15177 resultVar0, resultVar1 := a.app.ViewChannel(view, userId, currentSessionId) 15178 15179 if resultVar1 != nil { 15180 span.LogFields(spanlog.Error(resultVar1)) 15181 ext.Error.Set(span, true) 15182 } 15183 15184 return resultVar0, resultVar1 15185 } 15186 15187 func (a *OpenTracingAppLayer) WaitForChannelMembership(channelId string, userId string) { 15188 origCtx := a.ctx 15189 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WaitForChannelMembership") 15190 15191 a.ctx = newCtx 15192 a.app.Srv().Store.SetContext(newCtx) 15193 defer func() { 15194 a.app.Srv().Store.SetContext(origCtx) 15195 a.ctx = origCtx 15196 }() 15197 15198 defer span.Finish() 15199 a.app.WaitForChannelMembership(channelId, userId) 15200 } 15201 15202 func (a *OpenTracingAppLayer) WriteFile(fr io.Reader, path string) (int64, *model.AppError) { 15203 origCtx := a.ctx 15204 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WriteFile") 15205 15206 a.ctx = newCtx 15207 a.app.Srv().Store.SetContext(newCtx) 15208 defer func() { 15209 a.app.Srv().Store.SetContext(origCtx) 15210 a.ctx = origCtx 15211 }() 15212 15213 defer span.Finish() 15214 resultVar0, resultVar1 := a.app.WriteFile(fr, path) 15215 15216 if resultVar1 != nil { 15217 span.LogFields(spanlog.Error(resultVar1)) 15218 ext.Error.Set(span, true) 15219 } 15220 15221 return resultVar0, resultVar1 15222 } 15223 15224 func NewOpenTracingAppLayer(childApp app.AppIface, ctx context.Context) *OpenTracingAppLayer { 15225 newApp := OpenTracingAppLayer{ 15226 app: childApp, 15227 ctx: ctx, 15228 } 15229 15230 newApp.srv = childApp.Srv() 15231 newApp.log = childApp.Log() 15232 newApp.notificationsLog = childApp.NotificationsLog() 15233 newApp.t = childApp.GetT() 15234 if childApp.Session() != nil { 15235 newApp.session = *childApp.Session() 15236 } 15237 newApp.requestId = childApp.RequestId() 15238 newApp.ipAddress = childApp.IpAddress() 15239 newApp.path = childApp.Path() 15240 newApp.userAgent = childApp.UserAgent() 15241 newApp.acceptLanguage = childApp.AcceptLanguage() 15242 newApp.accountMigration = childApp.AccountMigration() 15243 newApp.cluster = childApp.Cluster() 15244 newApp.compliance = childApp.Compliance() 15245 newApp.dataRetention = childApp.DataRetention() 15246 newApp.searchEngine = childApp.SearchEngine() 15247 newApp.ldap = childApp.Ldap() 15248 newApp.messageExport = childApp.MessageExport() 15249 newApp.metrics = childApp.Metrics() 15250 newApp.notification = childApp.Notification() 15251 newApp.saml = childApp.Saml() 15252 newApp.httpService = childApp.HTTPService() 15253 newApp.imageProxy = childApp.ImageProxy() 15254 newApp.timezones = childApp.Timezones() 15255 newApp.context = childApp.Context() 15256 15257 return &newApp 15258 } 15259 15260 func (a *OpenTracingAppLayer) Srv() *app.Server { 15261 return a.srv 15262 } 15263 func (a *OpenTracingAppLayer) Log() *mlog.Logger { 15264 return a.log 15265 } 15266 func (a *OpenTracingAppLayer) NotificationsLog() *mlog.Logger { 15267 return a.notificationsLog 15268 } 15269 func (a *OpenTracingAppLayer) T(translationID string, args ...interface{}) string { 15270 return a.t(translationID, args...) 15271 } 15272 func (a *OpenTracingAppLayer) Session() *model.Session { 15273 return &a.session 15274 } 15275 func (a *OpenTracingAppLayer) RequestId() string { 15276 return a.requestId 15277 } 15278 func (a *OpenTracingAppLayer) IpAddress() string { 15279 return a.ipAddress 15280 } 15281 func (a *OpenTracingAppLayer) Path() string { 15282 return a.path 15283 } 15284 func (a *OpenTracingAppLayer) UserAgent() string { 15285 return a.userAgent 15286 } 15287 func (a *OpenTracingAppLayer) AcceptLanguage() string { 15288 return a.acceptLanguage 15289 } 15290 func (a *OpenTracingAppLayer) AccountMigration() einterfaces.AccountMigrationInterface { 15291 return a.accountMigration 15292 } 15293 func (a *OpenTracingAppLayer) Cluster() einterfaces.ClusterInterface { 15294 return a.cluster 15295 } 15296 func (a *OpenTracingAppLayer) Compliance() einterfaces.ComplianceInterface { 15297 return a.compliance 15298 } 15299 func (a *OpenTracingAppLayer) DataRetention() einterfaces.DataRetentionInterface { 15300 return a.dataRetention 15301 } 15302 func (a *OpenTracingAppLayer) Ldap() einterfaces.LdapInterface { 15303 return a.ldap 15304 } 15305 func (a *OpenTracingAppLayer) MessageExport() einterfaces.MessageExportInterface { 15306 return a.messageExport 15307 } 15308 func (a *OpenTracingAppLayer) Metrics() einterfaces.MetricsInterface { 15309 return a.metrics 15310 } 15311 func (a *OpenTracingAppLayer) Notification() einterfaces.NotificationInterface { 15312 return a.notification 15313 } 15314 func (a *OpenTracingAppLayer) Saml() einterfaces.SamlInterface { 15315 return a.saml 15316 } 15317 func (a *OpenTracingAppLayer) HTTPService() httpservice.HTTPService { 15318 return a.httpService 15319 } 15320 func (a *OpenTracingAppLayer) ImageProxy() *imageproxy.ImageProxy { 15321 return a.imageProxy 15322 } 15323 func (a *OpenTracingAppLayer) Timezones() *timezones.Timezones { 15324 return a.timezones 15325 } 15326 func (a *OpenTracingAppLayer) Context() context.Context { 15327 return a.context 15328 } 15329 func (a *OpenTracingAppLayer) SetSession(sess *model.Session) { 15330 a.session = *sess 15331 } 15332 func (a *OpenTracingAppLayer) SetT(t i18n.TranslateFunc) { 15333 a.t = t 15334 } 15335 func (a *OpenTracingAppLayer) SetRequestId(str string) { 15336 a.requestId = str 15337 } 15338 func (a *OpenTracingAppLayer) SetIpAddress(str string) { 15339 a.ipAddress = str 15340 } 15341 func (a *OpenTracingAppLayer) SetUserAgent(str string) { 15342 a.userAgent = str 15343 } 15344 func (a *OpenTracingAppLayer) SetAcceptLanguage(str string) { 15345 a.acceptLanguage = str 15346 } 15347 func (a *OpenTracingAppLayer) SetPath(str string) { 15348 a.path = str 15349 } 15350 func (a *OpenTracingAppLayer) SetContext(c context.Context) { 15351 a.context = c 15352 } 15353 func (a *OpenTracingAppLayer) SetServer(srv *app.Server) { 15354 a.srv = srv 15355 } 15356 func (a *OpenTracingAppLayer) GetT() i18n.TranslateFunc { 15357 return a.t 15358 }