github.com/vnforks/kid/v5@v5.22.1-0.20200408055009-b89d99c65676/app/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 app 8 9 import ( 10 "context" 11 "crypto/ecdsa" 12 "html/template" 13 "io" 14 "mime/multipart" 15 "net/http" 16 "net/url" 17 "time" 18 19 "github.com/dyatlov/go-opengraph/opengraph" 20 "github.com/gorilla/websocket" 21 "github.com/mattermost/go-i18n/i18n" 22 goi18n "github.com/mattermost/go-i18n/i18n" 23 "github.com/opentracing/opentracing-go/ext" 24 spanlog "github.com/opentracing/opentracing-go/log" 25 "github.com/vnforks/kid/v5/einterfaces" 26 "github.com/vnforks/kid/v5/mlog" 27 "github.com/vnforks/kid/v5/model" 28 "github.com/vnforks/kid/v5/services/filesstore" 29 "github.com/vnforks/kid/v5/services/httpservice" 30 "github.com/vnforks/kid/v5/services/imageproxy" 31 "github.com/vnforks/kid/v5/services/searchengine" 32 "github.com/vnforks/kid/v5/services/timezones" 33 "github.com/vnforks/kid/v5/services/tracing" 34 "github.com/vnforks/kid/v5/store" 35 ) 36 37 type OpenTracingAppLayer struct { 38 app AppIface 39 40 srv *Server 41 42 log *mlog.Logger 43 notificationsLog *mlog.Logger 44 45 t goi18n.TranslateFunc 46 session model.Session 47 requestId string 48 ipAddress string 49 path string 50 userAgent string 51 acceptLanguage string 52 53 accountMigration einterfaces.AccountMigrationInterface 54 cluster einterfaces.ClusterInterface 55 compliance einterfaces.ComplianceInterface 56 dataRetention einterfaces.DataRetentionInterface 57 searchEngine *searchengine.Broker 58 ldap einterfaces.LdapInterface 59 messageExport einterfaces.MessageExportInterface 60 metrics einterfaces.MetricsInterface 61 notification einterfaces.NotificationInterface 62 saml einterfaces.SamlInterface 63 64 httpService httpservice.HTTPService 65 imageProxy *imageproxy.ImageProxy 66 timezones *timezones.Timezones 67 68 context context.Context 69 ctx context.Context 70 } 71 72 func (a *OpenTracingAppLayer) ActivateMfa(userId string, token string) *model.AppError { 73 origCtx := a.ctx 74 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ActivateMfa") 75 76 a.ctx = newCtx 77 a.app.Srv().Store.SetContext(newCtx) 78 defer func() { 79 a.app.Srv().Store.SetContext(origCtx) 80 a.ctx = origCtx 81 }() 82 83 defer span.Finish() 84 resultVar0 := a.app.ActivateMfa(userId, token) 85 86 if resultVar0 != nil { 87 span.LogFields(spanlog.Error(resultVar0)) 88 ext.Error.Set(span, true) 89 } 90 91 return resultVar0 92 } 93 94 func (a *OpenTracingAppLayer) AddBranchMember(branchId string, userId string) (*model.BranchMember, *model.AppError) { 95 origCtx := a.ctx 96 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddBranchMember") 97 98 a.ctx = newCtx 99 a.app.Srv().Store.SetContext(newCtx) 100 defer func() { 101 a.app.Srv().Store.SetContext(origCtx) 102 a.ctx = origCtx 103 }() 104 105 defer span.Finish() 106 resultVar0, resultVar1 := a.app.AddBranchMember(branchId, userId) 107 108 if resultVar1 != nil { 109 span.LogFields(spanlog.Error(resultVar1)) 110 ext.Error.Set(span, true) 111 } 112 113 return resultVar0, resultVar1 114 } 115 116 func (a *OpenTracingAppLayer) AddBranchMemberByToken(userId string, tokenId string) (*model.BranchMember, *model.AppError) { 117 origCtx := a.ctx 118 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddBranchMemberByToken") 119 120 a.ctx = newCtx 121 a.app.Srv().Store.SetContext(newCtx) 122 defer func() { 123 a.app.Srv().Store.SetContext(origCtx) 124 a.ctx = origCtx 125 }() 126 127 defer span.Finish() 128 resultVar0, resultVar1 := a.app.AddBranchMemberByToken(userId, tokenId) 129 130 if resultVar1 != nil { 131 span.LogFields(spanlog.Error(resultVar1)) 132 ext.Error.Set(span, true) 133 } 134 135 return resultVar0, resultVar1 136 } 137 138 func (a *OpenTracingAppLayer) AddBranchMembers(branchId string, userIds []string, userRequestorId string, graceful bool) ([]*model.BranchMemberWithError, *model.AppError) { 139 origCtx := a.ctx 140 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddBranchMembers") 141 142 a.ctx = newCtx 143 a.app.Srv().Store.SetContext(newCtx) 144 defer func() { 145 a.app.Srv().Store.SetContext(origCtx) 146 a.ctx = origCtx 147 }() 148 149 defer span.Finish() 150 resultVar0, resultVar1 := a.app.AddBranchMembers(branchId, userIds, userRequestorId, graceful) 151 152 if resultVar1 != nil { 153 span.LogFields(spanlog.Error(resultVar1)) 154 ext.Error.Set(span, true) 155 } 156 157 return resultVar0, resultVar1 158 } 159 160 func (a *OpenTracingAppLayer) AddClassMember(userId string, class *model.Class, userRequestorId string, postRootId string) (*model.ClassMember, *model.AppError) { 161 origCtx := a.ctx 162 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddClassMember") 163 164 a.ctx = newCtx 165 a.app.Srv().Store.SetContext(newCtx) 166 defer func() { 167 a.app.Srv().Store.SetContext(origCtx) 168 a.ctx = origCtx 169 }() 170 171 defer span.Finish() 172 resultVar0, resultVar1 := a.app.AddClassMember(userId, class, userRequestorId, postRootId) 173 174 if resultVar1 != nil { 175 span.LogFields(spanlog.Error(resultVar1)) 176 ext.Error.Set(span, true) 177 } 178 179 return resultVar0, resultVar1 180 } 181 182 func (a *OpenTracingAppLayer) AddConfigListener(listener func(*model.Config, *model.Config)) string { 183 origCtx := a.ctx 184 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddConfigListener") 185 186 a.ctx = newCtx 187 a.app.Srv().Store.SetContext(newCtx) 188 defer func() { 189 a.app.Srv().Store.SetContext(origCtx) 190 a.ctx = origCtx 191 }() 192 193 defer span.Finish() 194 resultVar0 := a.app.AddConfigListener(listener) 195 196 return resultVar0 197 } 198 199 func (a *OpenTracingAppLayer) AddCursorIdsForPostList(originalList *model.PostList, afterPost string, beforePost string, since int64, page int, perPage int) { 200 origCtx := a.ctx 201 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddCursorIdsForPostList") 202 203 a.ctx = newCtx 204 a.app.Srv().Store.SetContext(newCtx) 205 defer func() { 206 a.app.Srv().Store.SetContext(origCtx) 207 a.ctx = origCtx 208 }() 209 210 defer span.Finish() 211 a.app.AddCursorIdsForPostList(originalList, afterPost, beforePost, since, page, perPage) 212 } 213 214 func (a *OpenTracingAppLayer) AddDirectClasses(branchId string, user *model.User) *model.AppError { 215 origCtx := a.ctx 216 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddDirectClasses") 217 218 a.ctx = newCtx 219 a.app.Srv().Store.SetContext(newCtx) 220 defer func() { 221 a.app.Srv().Store.SetContext(origCtx) 222 a.ctx = origCtx 223 }() 224 225 defer span.Finish() 226 resultVar0 := a.app.AddDirectClasses(branchId, user) 227 228 if resultVar0 != nil { 229 span.LogFields(spanlog.Error(resultVar0)) 230 ext.Error.Set(span, true) 231 } 232 233 return resultVar0 234 } 235 236 func (a *OpenTracingAppLayer) AddLicenseListener(listener func(oldLicense, newLicense *model.License)) string { 237 origCtx := a.ctx 238 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddLicenseListener") 239 240 a.ctx = newCtx 241 a.app.Srv().Store.SetContext(newCtx) 242 defer func() { 243 a.app.Srv().Store.SetContext(origCtx) 244 a.ctx = origCtx 245 }() 246 247 defer span.Finish() 248 resultVar0 := a.app.AddLicenseListener(listener) 249 250 return resultVar0 251 } 252 253 func (a *OpenTracingAppLayer) AddNotificationEmailToBatch(user *model.User, post *model.Post, branch *model.Branch) *model.AppError { 254 origCtx := a.ctx 255 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddNotificationEmailToBatch") 256 257 a.ctx = newCtx 258 a.app.Srv().Store.SetContext(newCtx) 259 defer func() { 260 a.app.Srv().Store.SetContext(origCtx) 261 a.ctx = origCtx 262 }() 263 264 defer span.Finish() 265 resultVar0 := a.app.AddNotificationEmailToBatch(user, post, branch) 266 267 if resultVar0 != nil { 268 span.LogFields(spanlog.Error(resultVar0)) 269 ext.Error.Set(span, true) 270 } 271 272 return resultVar0 273 } 274 275 func (a *OpenTracingAppLayer) AddSamlIdpCertificate(fileData *multipart.FileHeader) *model.AppError { 276 origCtx := a.ctx 277 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlIdpCertificate") 278 279 a.ctx = newCtx 280 a.app.Srv().Store.SetContext(newCtx) 281 defer func() { 282 a.app.Srv().Store.SetContext(origCtx) 283 a.ctx = origCtx 284 }() 285 286 defer span.Finish() 287 resultVar0 := a.app.AddSamlIdpCertificate(fileData) 288 289 if resultVar0 != nil { 290 span.LogFields(spanlog.Error(resultVar0)) 291 ext.Error.Set(span, true) 292 } 293 294 return resultVar0 295 } 296 297 func (a *OpenTracingAppLayer) AddSamlPrivateCertificate(fileData *multipart.FileHeader) *model.AppError { 298 origCtx := a.ctx 299 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPrivateCertificate") 300 301 a.ctx = newCtx 302 a.app.Srv().Store.SetContext(newCtx) 303 defer func() { 304 a.app.Srv().Store.SetContext(origCtx) 305 a.ctx = origCtx 306 }() 307 308 defer span.Finish() 309 resultVar0 := a.app.AddSamlPrivateCertificate(fileData) 310 311 if resultVar0 != nil { 312 span.LogFields(spanlog.Error(resultVar0)) 313 ext.Error.Set(span, true) 314 } 315 316 return resultVar0 317 } 318 319 func (a *OpenTracingAppLayer) AddSamlPublicCertificate(fileData *multipart.FileHeader) *model.AppError { 320 origCtx := a.ctx 321 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSamlPublicCertificate") 322 323 a.ctx = newCtx 324 a.app.Srv().Store.SetContext(newCtx) 325 defer func() { 326 a.app.Srv().Store.SetContext(origCtx) 327 a.ctx = origCtx 328 }() 329 330 defer span.Finish() 331 resultVar0 := a.app.AddSamlPublicCertificate(fileData) 332 333 if resultVar0 != nil { 334 span.LogFields(spanlog.Error(resultVar0)) 335 ext.Error.Set(span, true) 336 } 337 338 return resultVar0 339 } 340 341 func (a *OpenTracingAppLayer) AddSessionToCache(session *model.Session) { 342 origCtx := a.ctx 343 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddSessionToCache") 344 345 a.ctx = newCtx 346 a.app.Srv().Store.SetContext(newCtx) 347 defer func() { 348 a.app.Srv().Store.SetContext(origCtx) 349 a.ctx = origCtx 350 }() 351 352 defer span.Finish() 353 a.app.AddSessionToCache(session) 354 } 355 356 func (a *OpenTracingAppLayer) AddStatusCache(status *model.Status) { 357 origCtx := a.ctx 358 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCache") 359 360 a.ctx = newCtx 361 a.app.Srv().Store.SetContext(newCtx) 362 defer func() { 363 a.app.Srv().Store.SetContext(origCtx) 364 a.ctx = origCtx 365 }() 366 367 defer span.Finish() 368 a.app.AddStatusCache(status) 369 } 370 371 func (a *OpenTracingAppLayer) AddStatusCacheSkipClusterSend(status *model.Status) { 372 origCtx := a.ctx 373 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddStatusCacheSkipClusterSend") 374 375 a.ctx = newCtx 376 a.app.Srv().Store.SetContext(newCtx) 377 defer func() { 378 a.app.Srv().Store.SetContext(origCtx) 379 a.ctx = origCtx 380 }() 381 382 defer span.Finish() 383 a.app.AddStatusCacheSkipClusterSend(status) 384 } 385 386 func (a *OpenTracingAppLayer) AddUserToBranch(branchId string, userId string, userRequestorId string) (*model.Branch, *model.AppError) { 387 origCtx := a.ctx 388 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToBranch") 389 390 a.ctx = newCtx 391 a.app.Srv().Store.SetContext(newCtx) 392 defer func() { 393 a.app.Srv().Store.SetContext(origCtx) 394 a.ctx = origCtx 395 }() 396 397 defer span.Finish() 398 resultVar0, resultVar1 := a.app.AddUserToBranch(branchId, userId, userRequestorId) 399 400 if resultVar1 != nil { 401 span.LogFields(spanlog.Error(resultVar1)) 402 ext.Error.Set(span, true) 403 } 404 405 return resultVar0, resultVar1 406 } 407 408 func (a *OpenTracingAppLayer) AddUserToBranchByBranchId(branchId string, user *model.User) *model.AppError { 409 origCtx := a.ctx 410 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToBranchByBranchId") 411 412 a.ctx = newCtx 413 a.app.Srv().Store.SetContext(newCtx) 414 defer func() { 415 a.app.Srv().Store.SetContext(origCtx) 416 a.ctx = origCtx 417 }() 418 419 defer span.Finish() 420 resultVar0 := a.app.AddUserToBranchByBranchId(branchId, user) 421 422 if resultVar0 != nil { 423 span.LogFields(spanlog.Error(resultVar0)) 424 ext.Error.Set(span, true) 425 } 426 427 return resultVar0 428 } 429 430 func (a *OpenTracingAppLayer) AddUserToBranchByToken(userId string, tokenId string) (*model.Branch, *model.AppError) { 431 origCtx := a.ctx 432 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToBranchByToken") 433 434 a.ctx = newCtx 435 a.app.Srv().Store.SetContext(newCtx) 436 defer func() { 437 a.app.Srv().Store.SetContext(origCtx) 438 a.ctx = origCtx 439 }() 440 441 defer span.Finish() 442 resultVar0, resultVar1 := a.app.AddUserToBranchByToken(userId, tokenId) 443 444 if resultVar1 != nil { 445 span.LogFields(spanlog.Error(resultVar1)) 446 ext.Error.Set(span, true) 447 } 448 449 return resultVar0, resultVar1 450 } 451 452 func (a *OpenTracingAppLayer) AddUserToClass(user *model.User, class *model.Class) (*model.ClassMember, *model.AppError) { 453 origCtx := a.ctx 454 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AddUserToClass") 455 456 a.ctx = newCtx 457 a.app.Srv().Store.SetContext(newCtx) 458 defer func() { 459 a.app.Srv().Store.SetContext(origCtx) 460 a.ctx = origCtx 461 }() 462 463 defer span.Finish() 464 resultVar0, resultVar1 := a.app.AddUserToClass(user, class) 465 466 if resultVar1 != nil { 467 span.LogFields(spanlog.Error(resultVar1)) 468 ext.Error.Set(span, true) 469 } 470 471 return resultVar0, resultVar1 472 } 473 474 func (a *OpenTracingAppLayer) AllowOAuthAppAccessToUser(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 475 origCtx := a.ctx 476 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AllowOAuthAppAccessToUser") 477 478 a.ctx = newCtx 479 a.app.Srv().Store.SetContext(newCtx) 480 defer func() { 481 a.app.Srv().Store.SetContext(origCtx) 482 a.ctx = origCtx 483 }() 484 485 defer span.Finish() 486 resultVar0, resultVar1 := a.app.AllowOAuthAppAccessToUser(userId, authRequest) 487 488 if resultVar1 != nil { 489 span.LogFields(spanlog.Error(resultVar1)) 490 ext.Error.Set(span, true) 491 } 492 493 return resultVar0, resultVar1 494 } 495 496 func (a *OpenTracingAppLayer) AsymmetricSigningKey() *ecdsa.PrivateKey { 497 origCtx := a.ctx 498 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AsymmetricSigningKey") 499 500 a.ctx = newCtx 501 a.app.Srv().Store.SetContext(newCtx) 502 defer func() { 503 a.app.Srv().Store.SetContext(origCtx) 504 a.ctx = origCtx 505 }() 506 507 defer span.Finish() 508 resultVar0 := a.app.AsymmetricSigningKey() 509 510 return resultVar0 511 } 512 513 func (a *OpenTracingAppLayer) AttachDeviceId(sessionId string, deviceId string, expiresAt int64) *model.AppError { 514 origCtx := a.ctx 515 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachDeviceId") 516 517 a.ctx = newCtx 518 a.app.Srv().Store.SetContext(newCtx) 519 defer func() { 520 a.app.Srv().Store.SetContext(origCtx) 521 a.ctx = origCtx 522 }() 523 524 defer span.Finish() 525 resultVar0 := a.app.AttachDeviceId(sessionId, deviceId, expiresAt) 526 527 if resultVar0 != nil { 528 span.LogFields(spanlog.Error(resultVar0)) 529 ext.Error.Set(span, true) 530 } 531 532 return resultVar0 533 } 534 535 func (a *OpenTracingAppLayer) AttachSessionCookies(w http.ResponseWriter, r *http.Request) { 536 origCtx := a.ctx 537 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AttachSessionCookies") 538 539 a.ctx = newCtx 540 a.app.Srv().Store.SetContext(newCtx) 541 defer func() { 542 a.app.Srv().Store.SetContext(origCtx) 543 a.ctx = origCtx 544 }() 545 546 defer span.Finish() 547 a.app.AttachSessionCookies(w, r) 548 } 549 550 func (a *OpenTracingAppLayer) AuthenticateUserForLogin(id string, loginId string, password string, mfaToken string, ldapOnly bool) (*model.User, *model.AppError) { 551 origCtx := a.ctx 552 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthenticateUserForLogin") 553 554 a.ctx = newCtx 555 a.app.Srv().Store.SetContext(newCtx) 556 defer func() { 557 a.app.Srv().Store.SetContext(origCtx) 558 a.ctx = origCtx 559 }() 560 561 defer span.Finish() 562 resultVar0, resultVar1 := a.app.AuthenticateUserForLogin(id, loginId, password, mfaToken, ldapOnly) 563 564 if resultVar1 != nil { 565 span.LogFields(spanlog.Error(resultVar1)) 566 ext.Error.Set(span, true) 567 } 568 569 return resultVar0, resultVar1 570 } 571 572 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) { 573 origCtx := a.ctx 574 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.AuthorizeOAuthUser") 575 576 a.ctx = newCtx 577 a.app.Srv().Store.SetContext(newCtx) 578 defer func() { 579 a.app.Srv().Store.SetContext(origCtx) 580 a.ctx = origCtx 581 }() 582 583 defer span.Finish() 584 resultVar0, resultVar1, resultVar2, resultVar3 := a.app.AuthorizeOAuthUser(w, r, service, code, state, redirectUri) 585 586 if resultVar3 != nil { 587 span.LogFields(spanlog.Error(resultVar3)) 588 ext.Error.Set(span, true) 589 } 590 591 return resultVar0, resultVar1, resultVar2, resultVar3 592 } 593 594 func (a *OpenTracingAppLayer) BroadcastStatus(status *model.Status) { 595 origCtx := a.ctx 596 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BroadcastStatus") 597 598 a.ctx = newCtx 599 a.app.Srv().Store.SetContext(newCtx) 600 defer func() { 601 a.app.Srv().Store.SetContext(origCtx) 602 a.ctx = origCtx 603 }() 604 605 defer span.Finish() 606 a.app.BroadcastStatus(status) 607 } 608 609 func (a *OpenTracingAppLayer) BuildPushNotificationMessage(contentsConfig string, post *model.Post, user *model.User, class *model.Class, className string, senderName string, explicitMention bool, classWideMention bool, replyToThreadType string) (*model.PushNotification, *model.AppError) { 610 origCtx := a.ctx 611 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildPushNotificationMessage") 612 613 a.ctx = newCtx 614 a.app.Srv().Store.SetContext(newCtx) 615 defer func() { 616 a.app.Srv().Store.SetContext(origCtx) 617 a.ctx = origCtx 618 }() 619 620 defer span.Finish() 621 resultVar0, resultVar1 := a.app.BuildPushNotificationMessage(contentsConfig, post, user, class, className, senderName, explicitMention, classWideMention, replyToThreadType) 622 623 if resultVar1 != nil { 624 span.LogFields(spanlog.Error(resultVar1)) 625 ext.Error.Set(span, true) 626 } 627 628 return resultVar0, resultVar1 629 } 630 631 func (a *OpenTracingAppLayer) BuildSamlMetadataObject(idpMetadata []byte) (*model.SamlMetadataResponse, *model.AppError) { 632 origCtx := a.ctx 633 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BuildSamlMetadataObject") 634 635 a.ctx = newCtx 636 a.app.Srv().Store.SetContext(newCtx) 637 defer func() { 638 a.app.Srv().Store.SetContext(origCtx) 639 a.ctx = origCtx 640 }() 641 642 defer span.Finish() 643 resultVar0, resultVar1 := a.app.BuildSamlMetadataObject(idpMetadata) 644 645 if resultVar1 != nil { 646 span.LogFields(spanlog.Error(resultVar1)) 647 ext.Error.Set(span, true) 648 } 649 650 return resultVar0, resultVar1 651 } 652 653 func (a *OpenTracingAppLayer) BulkExport(writer io.Writer, file string, pathToEmojiDir string, dirNameToExportEmoji string) *model.AppError { 654 origCtx := a.ctx 655 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.BulkExport") 656 657 a.ctx = newCtx 658 a.app.Srv().Store.SetContext(newCtx) 659 defer func() { 660 a.app.Srv().Store.SetContext(origCtx) 661 a.ctx = origCtx 662 }() 663 664 defer span.Finish() 665 resultVar0 := a.app.BulkExport(writer, file, pathToEmojiDir, dirNameToExportEmoji) 666 667 if resultVar0 != nil { 668 span.LogFields(spanlog.Error(resultVar0)) 669 ext.Error.Set(span, true) 670 } 671 672 return resultVar0 673 } 674 675 func (a *OpenTracingAppLayer) CancelJob(jobId string) *model.AppError { 676 origCtx := a.ctx 677 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CancelJob") 678 679 a.ctx = newCtx 680 a.app.Srv().Store.SetContext(newCtx) 681 defer func() { 682 a.app.Srv().Store.SetContext(origCtx) 683 a.ctx = origCtx 684 }() 685 686 defer span.Finish() 687 resultVar0 := a.app.CancelJob(jobId) 688 689 if resultVar0 != nil { 690 span.LogFields(spanlog.Error(resultVar0)) 691 ext.Error.Set(span, true) 692 } 693 694 return resultVar0 695 } 696 697 func (a *OpenTracingAppLayer) CheckForClientSideCert(r *http.Request) (string, string, string) { 698 origCtx := a.ctx 699 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckForClientSideCert") 700 701 a.ctx = newCtx 702 a.app.Srv().Store.SetContext(newCtx) 703 defer func() { 704 a.app.Srv().Store.SetContext(origCtx) 705 a.ctx = origCtx 706 }() 707 708 defer span.Finish() 709 resultVar0, resultVar1, resultVar2 := a.app.CheckForClientSideCert(r) 710 711 return resultVar0, resultVar1, resultVar2 712 } 713 714 func (a *OpenTracingAppLayer) CheckPasswordAndAllCriteria(user *model.User, password string, mfaToken string) *model.AppError { 715 origCtx := a.ctx 716 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckPasswordAndAllCriteria") 717 718 a.ctx = newCtx 719 a.app.Srv().Store.SetContext(newCtx) 720 defer func() { 721 a.app.Srv().Store.SetContext(origCtx) 722 a.ctx = origCtx 723 }() 724 725 defer span.Finish() 726 resultVar0 := a.app.CheckPasswordAndAllCriteria(user, password, mfaToken) 727 728 if resultVar0 != nil { 729 span.LogFields(spanlog.Error(resultVar0)) 730 ext.Error.Set(span, true) 731 } 732 733 return resultVar0 734 } 735 736 func (a *OpenTracingAppLayer) CheckRolesExist(roleNames []string) *model.AppError { 737 origCtx := a.ctx 738 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckRolesExist") 739 740 a.ctx = newCtx 741 a.app.Srv().Store.SetContext(newCtx) 742 defer func() { 743 a.app.Srv().Store.SetContext(origCtx) 744 a.ctx = origCtx 745 }() 746 747 defer span.Finish() 748 resultVar0 := a.app.CheckRolesExist(roleNames) 749 750 if resultVar0 != nil { 751 span.LogFields(spanlog.Error(resultVar0)) 752 ext.Error.Set(span, true) 753 } 754 755 return resultVar0 756 } 757 758 func (a *OpenTracingAppLayer) CheckUserAllAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 759 origCtx := a.ctx 760 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserAllAuthenticationCriteria") 761 762 a.ctx = newCtx 763 a.app.Srv().Store.SetContext(newCtx) 764 defer func() { 765 a.app.Srv().Store.SetContext(origCtx) 766 a.ctx = origCtx 767 }() 768 769 defer span.Finish() 770 resultVar0 := a.app.CheckUserAllAuthenticationCriteria(user, mfaToken) 771 772 if resultVar0 != nil { 773 span.LogFields(spanlog.Error(resultVar0)) 774 ext.Error.Set(span, true) 775 } 776 777 return resultVar0 778 } 779 780 func (a *OpenTracingAppLayer) CheckUserMfa(user *model.User, token string) *model.AppError { 781 origCtx := a.ctx 782 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserMfa") 783 784 a.ctx = newCtx 785 a.app.Srv().Store.SetContext(newCtx) 786 defer func() { 787 a.app.Srv().Store.SetContext(origCtx) 788 a.ctx = origCtx 789 }() 790 791 defer span.Finish() 792 resultVar0 := a.app.CheckUserMfa(user, token) 793 794 if resultVar0 != nil { 795 span.LogFields(spanlog.Error(resultVar0)) 796 ext.Error.Set(span, true) 797 } 798 799 return resultVar0 800 } 801 802 func (a *OpenTracingAppLayer) CheckUserNotificationMessageflightAuthenticationCriteria(user *model.User) *model.AppError { 803 origCtx := a.ctx 804 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserNotificationMessageflightAuthenticationCriteria") 805 806 a.ctx = newCtx 807 a.app.Srv().Store.SetContext(newCtx) 808 defer func() { 809 a.app.Srv().Store.SetContext(origCtx) 810 a.ctx = origCtx 811 }() 812 813 defer span.Finish() 814 resultVar0 := a.app.CheckUserNotificationMessageflightAuthenticationCriteria(user) 815 816 if resultVar0 != nil { 817 span.LogFields(spanlog.Error(resultVar0)) 818 ext.Error.Set(span, true) 819 } 820 821 return resultVar0 822 } 823 824 func (a *OpenTracingAppLayer) CheckUserPostflightAuthenticationCriteria(user *model.User) *model.AppError { 825 origCtx := a.ctx 826 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPostflightAuthenticationCriteria") 827 828 a.ctx = newCtx 829 a.app.Srv().Store.SetContext(newCtx) 830 defer func() { 831 a.app.Srv().Store.SetContext(origCtx) 832 a.ctx = origCtx 833 }() 834 835 defer span.Finish() 836 resultVar0 := a.app.CheckUserPostflightAuthenticationCriteria(user) 837 838 if resultVar0 != nil { 839 span.LogFields(spanlog.Error(resultVar0)) 840 ext.Error.Set(span, true) 841 } 842 843 return resultVar0 844 } 845 846 func (a *OpenTracingAppLayer) CheckUserPreflightAuthenticationCriteria(user *model.User, mfaToken string) *model.AppError { 847 origCtx := a.ctx 848 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CheckUserPreflightAuthenticationCriteria") 849 850 a.ctx = newCtx 851 a.app.Srv().Store.SetContext(newCtx) 852 defer func() { 853 a.app.Srv().Store.SetContext(origCtx) 854 a.ctx = origCtx 855 }() 856 857 defer span.Finish() 858 resultVar0 := a.app.CheckUserPreflightAuthenticationCriteria(user, mfaToken) 859 860 if resultVar0 != nil { 861 span.LogFields(spanlog.Error(resultVar0)) 862 ext.Error.Set(span, true) 863 } 864 865 return resultVar0 866 } 867 868 func (a *OpenTracingAppLayer) ClearBranchMembersCache(branchID string) { 869 origCtx := a.ctx 870 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearBranchMembersCache") 871 872 a.ctx = newCtx 873 a.app.Srv().Store.SetContext(newCtx) 874 defer func() { 875 a.app.Srv().Store.SetContext(origCtx) 876 a.ctx = origCtx 877 }() 878 879 defer span.Finish() 880 a.app.ClearBranchMembersCache(branchID) 881 } 882 883 func (a *OpenTracingAppLayer) ClearClassMembersCache(classID string) { 884 origCtx := a.ctx 885 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearClassMembersCache") 886 887 a.ctx = newCtx 888 a.app.Srv().Store.SetContext(newCtx) 889 defer func() { 890 a.app.Srv().Store.SetContext(origCtx) 891 a.ctx = origCtx 892 }() 893 894 defer span.Finish() 895 a.app.ClearClassMembersCache(classID) 896 } 897 898 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsers() { 899 origCtx := a.ctx 900 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsers") 901 902 a.ctx = newCtx 903 a.app.Srv().Store.SetContext(newCtx) 904 defer func() { 905 a.app.Srv().Store.SetContext(origCtx) 906 a.ctx = origCtx 907 }() 908 909 defer span.Finish() 910 a.app.ClearSessionCacheForAllUsers() 911 } 912 913 func (a *OpenTracingAppLayer) ClearSessionCacheForAllUsersSkipClusterSend() { 914 origCtx := a.ctx 915 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForAllUsersSkipClusterSend") 916 917 a.ctx = newCtx 918 a.app.Srv().Store.SetContext(newCtx) 919 defer func() { 920 a.app.Srv().Store.SetContext(origCtx) 921 a.ctx = origCtx 922 }() 923 924 defer span.Finish() 925 a.app.ClearSessionCacheForAllUsersSkipClusterSend() 926 } 927 928 func (a *OpenTracingAppLayer) ClearSessionCacheForUser(userId string) { 929 origCtx := a.ctx 930 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUser") 931 932 a.ctx = newCtx 933 a.app.Srv().Store.SetContext(newCtx) 934 defer func() { 935 a.app.Srv().Store.SetContext(origCtx) 936 a.ctx = origCtx 937 }() 938 939 defer span.Finish() 940 a.app.ClearSessionCacheForUser(userId) 941 } 942 943 func (a *OpenTracingAppLayer) ClearSessionCacheForUserSkipClusterSend(userId string) { 944 origCtx := a.ctx 945 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClearSessionCacheForUserSkipClusterSend") 946 947 a.ctx = newCtx 948 a.app.Srv().Store.SetContext(newCtx) 949 defer func() { 950 a.app.Srv().Store.SetContext(origCtx) 951 a.ctx = origCtx 952 }() 953 954 defer span.Finish() 955 a.app.ClearSessionCacheForUserSkipClusterSend(userId) 956 } 957 958 func (a *OpenTracingAppLayer) ClientConfig() map[string]string { 959 origCtx := a.ctx 960 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfig") 961 962 a.ctx = newCtx 963 a.app.Srv().Store.SetContext(newCtx) 964 defer func() { 965 a.app.Srv().Store.SetContext(origCtx) 966 a.ctx = origCtx 967 }() 968 969 defer span.Finish() 970 resultVar0 := a.app.ClientConfig() 971 972 return resultVar0 973 } 974 975 func (a *OpenTracingAppLayer) ClientConfigHash() string { 976 origCtx := a.ctx 977 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigHash") 978 979 a.ctx = newCtx 980 a.app.Srv().Store.SetContext(newCtx) 981 defer func() { 982 a.app.Srv().Store.SetContext(origCtx) 983 a.ctx = origCtx 984 }() 985 986 defer span.Finish() 987 resultVar0 := a.app.ClientConfigHash() 988 989 return resultVar0 990 } 991 992 func (a *OpenTracingAppLayer) ClientConfigWithComputed() map[string]string { 993 origCtx := a.ctx 994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientConfigWithComputed") 995 996 a.ctx = newCtx 997 a.app.Srv().Store.SetContext(newCtx) 998 defer func() { 999 a.app.Srv().Store.SetContext(origCtx) 1000 a.ctx = origCtx 1001 }() 1002 1003 defer span.Finish() 1004 resultVar0 := a.app.ClientConfigWithComputed() 1005 1006 return resultVar0 1007 } 1008 1009 func (a *OpenTracingAppLayer) ClientLicense() map[string]string { 1010 origCtx := a.ctx 1011 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ClientLicense") 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.ClientLicense() 1022 1023 return resultVar0 1024 } 1025 1026 func (a *OpenTracingAppLayer) CompleteOAuth(service string, body io.ReadCloser, branchId string, props map[string]string) (*model.User, *model.AppError) { 1027 origCtx := a.ctx 1028 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteOAuth") 1029 1030 a.ctx = newCtx 1031 a.app.Srv().Store.SetContext(newCtx) 1032 defer func() { 1033 a.app.Srv().Store.SetContext(origCtx) 1034 a.ctx = origCtx 1035 }() 1036 1037 defer span.Finish() 1038 resultVar0, resultVar1 := a.app.CompleteOAuth(service, body, branchId, props) 1039 1040 if resultVar1 != nil { 1041 span.LogFields(spanlog.Error(resultVar1)) 1042 ext.Error.Set(span, true) 1043 } 1044 1045 return resultVar0, resultVar1 1046 } 1047 1048 func (a *OpenTracingAppLayer) CompleteSwitchWithOAuth(service string, userData io.Reader, email string) (*model.User, *model.AppError) { 1049 origCtx := a.ctx 1050 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CompleteSwitchWithOAuth") 1051 1052 a.ctx = newCtx 1053 a.app.Srv().Store.SetContext(newCtx) 1054 defer func() { 1055 a.app.Srv().Store.SetContext(origCtx) 1056 a.ctx = origCtx 1057 }() 1058 1059 defer span.Finish() 1060 resultVar0, resultVar1 := a.app.CompleteSwitchWithOAuth(service, userData, email) 1061 1062 if resultVar1 != nil { 1063 span.LogFields(spanlog.Error(resultVar1)) 1064 ext.Error.Set(span, true) 1065 } 1066 1067 return resultVar0, resultVar1 1068 } 1069 1070 func (a *OpenTracingAppLayer) Config() *model.Config { 1071 origCtx := a.ctx 1072 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Config") 1073 1074 a.ctx = newCtx 1075 a.app.Srv().Store.SetContext(newCtx) 1076 defer func() { 1077 a.app.Srv().Store.SetContext(origCtx) 1078 a.ctx = origCtx 1079 }() 1080 1081 defer span.Finish() 1082 resultVar0 := a.app.Config() 1083 1084 return resultVar0 1085 } 1086 1087 func (a *OpenTracingAppLayer) CopyFileInfos(userId string, fileIds []string) ([]string, *model.AppError) { 1088 origCtx := a.ctx 1089 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CopyFileInfos") 1090 1091 a.ctx = newCtx 1092 a.app.Srv().Store.SetContext(newCtx) 1093 defer func() { 1094 a.app.Srv().Store.SetContext(origCtx) 1095 a.ctx = origCtx 1096 }() 1097 1098 defer span.Finish() 1099 resultVar0, resultVar1 := a.app.CopyFileInfos(userId, fileIds) 1100 1101 if resultVar1 != nil { 1102 span.LogFields(spanlog.Error(resultVar1)) 1103 ext.Error.Set(span, true) 1104 } 1105 1106 return resultVar0, resultVar1 1107 } 1108 1109 func (a *OpenTracingAppLayer) CreateBranch(branch *model.Branch) (*model.Branch, *model.AppError) { 1110 origCtx := a.ctx 1111 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBranch") 1112 1113 a.ctx = newCtx 1114 a.app.Srv().Store.SetContext(newCtx) 1115 defer func() { 1116 a.app.Srv().Store.SetContext(origCtx) 1117 a.ctx = origCtx 1118 }() 1119 1120 defer span.Finish() 1121 resultVar0, resultVar1 := a.app.CreateBranch(branch) 1122 1123 if resultVar1 != nil { 1124 span.LogFields(spanlog.Error(resultVar1)) 1125 ext.Error.Set(span, true) 1126 } 1127 1128 return resultVar0, resultVar1 1129 } 1130 1131 func (a *OpenTracingAppLayer) CreateBranchWithUser(branch *model.Branch, userId string) (*model.Branch, *model.AppError) { 1132 origCtx := a.ctx 1133 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateBranchWithUser") 1134 1135 a.ctx = newCtx 1136 a.app.Srv().Store.SetContext(newCtx) 1137 defer func() { 1138 a.app.Srv().Store.SetContext(origCtx) 1139 a.ctx = origCtx 1140 }() 1141 1142 defer span.Finish() 1143 resultVar0, resultVar1 := a.app.CreateBranchWithUser(branch, userId) 1144 1145 if resultVar1 != nil { 1146 span.LogFields(spanlog.Error(resultVar1)) 1147 ext.Error.Set(span, true) 1148 } 1149 1150 return resultVar0, resultVar1 1151 } 1152 1153 func (a *OpenTracingAppLayer) CreateClass(class *model.Class, addMember bool) (*model.Class, *model.AppError) { 1154 origCtx := a.ctx 1155 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateClass") 1156 1157 a.ctx = newCtx 1158 a.app.Srv().Store.SetContext(newCtx) 1159 defer func() { 1160 a.app.Srv().Store.SetContext(origCtx) 1161 a.ctx = origCtx 1162 }() 1163 1164 defer span.Finish() 1165 resultVar0, resultVar1 := a.app.CreateClass(class, addMember) 1166 1167 if resultVar1 != nil { 1168 span.LogFields(spanlog.Error(resultVar1)) 1169 ext.Error.Set(span, true) 1170 } 1171 1172 return resultVar0, resultVar1 1173 } 1174 1175 func (a *OpenTracingAppLayer) CreateClassScheme(class *model.Class) (*model.Scheme, *model.AppError) { 1176 origCtx := a.ctx 1177 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateClassScheme") 1178 1179 a.ctx = newCtx 1180 a.app.Srv().Store.SetContext(newCtx) 1181 defer func() { 1182 a.app.Srv().Store.SetContext(origCtx) 1183 a.ctx = origCtx 1184 }() 1185 1186 defer span.Finish() 1187 resultVar0, resultVar1 := a.app.CreateClassScheme(class) 1188 1189 if resultVar1 != nil { 1190 span.LogFields(spanlog.Error(resultVar1)) 1191 ext.Error.Set(span, true) 1192 } 1193 1194 return resultVar0, resultVar1 1195 } 1196 1197 func (a *OpenTracingAppLayer) CreateClassWithUser(class *model.Class, userId string) (*model.Class, *model.AppError) { 1198 origCtx := a.ctx 1199 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateClassWithUser") 1200 1201 a.ctx = newCtx 1202 a.app.Srv().Store.SetContext(newCtx) 1203 defer func() { 1204 a.app.Srv().Store.SetContext(origCtx) 1205 a.ctx = origCtx 1206 }() 1207 1208 defer span.Finish() 1209 resultVar0, resultVar1 := a.app.CreateClassWithUser(class, userId) 1210 1211 if resultVar1 != nil { 1212 span.LogFields(spanlog.Error(resultVar1)) 1213 ext.Error.Set(span, true) 1214 } 1215 1216 return resultVar0, resultVar1 1217 } 1218 1219 func (a *OpenTracingAppLayer) CreateCommand(cmd *model.Command) (*model.Command, *model.AppError) { 1220 origCtx := a.ctx 1221 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateCommand") 1222 1223 a.ctx = newCtx 1224 a.app.Srv().Store.SetContext(newCtx) 1225 defer func() { 1226 a.app.Srv().Store.SetContext(origCtx) 1227 a.ctx = origCtx 1228 }() 1229 1230 defer span.Finish() 1231 resultVar0, resultVar1 := a.app.CreateCommand(cmd) 1232 1233 if resultVar1 != nil { 1234 span.LogFields(spanlog.Error(resultVar1)) 1235 ext.Error.Set(span, true) 1236 } 1237 1238 return resultVar0, resultVar1 1239 } 1240 1241 func (a *OpenTracingAppLayer) CreateDefaultClasses(branchID string) ([]*model.Class, *model.AppError) { 1242 origCtx := a.ctx 1243 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateDefaultClasses") 1244 1245 a.ctx = newCtx 1246 a.app.Srv().Store.SetContext(newCtx) 1247 defer func() { 1248 a.app.Srv().Store.SetContext(origCtx) 1249 a.ctx = origCtx 1250 }() 1251 1252 defer span.Finish() 1253 resultVar0, resultVar1 := a.app.CreateDefaultClasses(branchID) 1254 1255 if resultVar1 != nil { 1256 span.LogFields(spanlog.Error(resultVar1)) 1257 ext.Error.Set(span, true) 1258 } 1259 1260 return resultVar0, resultVar1 1261 } 1262 1263 func (a *OpenTracingAppLayer) CreateEmoji(sessionUserId string, emoji *model.Emoji, multiPartImageData *multipart.Form) (*model.Emoji, *model.AppError) { 1264 origCtx := a.ctx 1265 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateEmoji") 1266 1267 a.ctx = newCtx 1268 a.app.Srv().Store.SetContext(newCtx) 1269 defer func() { 1270 a.app.Srv().Store.SetContext(origCtx) 1271 a.ctx = origCtx 1272 }() 1273 1274 defer span.Finish() 1275 resultVar0, resultVar1 := a.app.CreateEmoji(sessionUserId, emoji, multiPartImageData) 1276 1277 if resultVar1 != nil { 1278 span.LogFields(spanlog.Error(resultVar1)) 1279 ext.Error.Set(span, true) 1280 } 1281 1282 return resultVar0, resultVar1 1283 } 1284 1285 func (a *OpenTracingAppLayer) CreateGuest(user *model.User) (*model.User, *model.AppError) { 1286 origCtx := a.ctx 1287 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateGuest") 1288 1289 a.ctx = newCtx 1290 a.app.Srv().Store.SetContext(newCtx) 1291 defer func() { 1292 a.app.Srv().Store.SetContext(origCtx) 1293 a.ctx = origCtx 1294 }() 1295 1296 defer span.Finish() 1297 resultVar0, resultVar1 := a.app.CreateGuest(user) 1298 1299 if resultVar1 != nil { 1300 span.LogFields(spanlog.Error(resultVar1)) 1301 ext.Error.Set(span, true) 1302 } 1303 1304 return resultVar0, resultVar1 1305 } 1306 1307 func (a *OpenTracingAppLayer) CreateJob(job *model.Job) (*model.Job, *model.AppError) { 1308 origCtx := a.ctx 1309 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateJob") 1310 1311 a.ctx = newCtx 1312 a.app.Srv().Store.SetContext(newCtx) 1313 defer func() { 1314 a.app.Srv().Store.SetContext(origCtx) 1315 a.ctx = origCtx 1316 }() 1317 1318 defer span.Finish() 1319 resultVar0, resultVar1 := a.app.CreateJob(job) 1320 1321 if resultVar1 != nil { 1322 span.LogFields(spanlog.Error(resultVar1)) 1323 ext.Error.Set(span, true) 1324 } 1325 1326 return resultVar0, resultVar1 1327 } 1328 1329 func (a *OpenTracingAppLayer) CreateOAuthApp(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 1330 origCtx := a.ctx 1331 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthApp") 1332 1333 a.ctx = newCtx 1334 a.app.Srv().Store.SetContext(newCtx) 1335 defer func() { 1336 a.app.Srv().Store.SetContext(origCtx) 1337 a.ctx = origCtx 1338 }() 1339 1340 defer span.Finish() 1341 resultVar0, resultVar1 := a.app.CreateOAuthApp(app) 1342 1343 if resultVar1 != nil { 1344 span.LogFields(spanlog.Error(resultVar1)) 1345 ext.Error.Set(span, true) 1346 } 1347 1348 return resultVar0, resultVar1 1349 } 1350 1351 func (a *OpenTracingAppLayer) CreateOAuthStateToken(extra string) (*model.Token, *model.AppError) { 1352 origCtx := a.ctx 1353 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthStateToken") 1354 1355 a.ctx = newCtx 1356 a.app.Srv().Store.SetContext(newCtx) 1357 defer func() { 1358 a.app.Srv().Store.SetContext(origCtx) 1359 a.ctx = origCtx 1360 }() 1361 1362 defer span.Finish() 1363 resultVar0, resultVar1 := a.app.CreateOAuthStateToken(extra) 1364 1365 if resultVar1 != nil { 1366 span.LogFields(spanlog.Error(resultVar1)) 1367 ext.Error.Set(span, true) 1368 } 1369 1370 return resultVar0, resultVar1 1371 } 1372 1373 func (a *OpenTracingAppLayer) CreateOAuthUser(service string, userData io.Reader, branchId string) (*model.User, *model.AppError) { 1374 origCtx := a.ctx 1375 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateOAuthUser") 1376 1377 a.ctx = newCtx 1378 a.app.Srv().Store.SetContext(newCtx) 1379 defer func() { 1380 a.app.Srv().Store.SetContext(origCtx) 1381 a.ctx = origCtx 1382 }() 1383 1384 defer span.Finish() 1385 resultVar0, resultVar1 := a.app.CreateOAuthUser(service, userData, branchId) 1386 1387 if resultVar1 != nil { 1388 span.LogFields(spanlog.Error(resultVar1)) 1389 ext.Error.Set(span, true) 1390 } 1391 1392 return resultVar0, resultVar1 1393 } 1394 1395 func (a *OpenTracingAppLayer) CreatePasswordRecoveryToken(userId string, email string) (*model.Token, *model.AppError) { 1396 origCtx := a.ctx 1397 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePasswordRecoveryToken") 1398 1399 a.ctx = newCtx 1400 a.app.Srv().Store.SetContext(newCtx) 1401 defer func() { 1402 a.app.Srv().Store.SetContext(origCtx) 1403 a.ctx = origCtx 1404 }() 1405 1406 defer span.Finish() 1407 resultVar0, resultVar1 := a.app.CreatePasswordRecoveryToken(userId, email) 1408 1409 if resultVar1 != nil { 1410 span.LogFields(spanlog.Error(resultVar1)) 1411 ext.Error.Set(span, true) 1412 } 1413 1414 return resultVar0, resultVar1 1415 } 1416 1417 func (a *OpenTracingAppLayer) CreatePost(post *model.Post, class *model.Class, triggerWebhooks bool) (*model.Post, *model.AppError) { 1418 origCtx := a.ctx 1419 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePost") 1420 1421 a.ctx = newCtx 1422 a.app.Srv().Store.SetContext(newCtx) 1423 defer func() { 1424 a.app.Srv().Store.SetContext(origCtx) 1425 a.ctx = origCtx 1426 }() 1427 1428 defer span.Finish() 1429 resultVar0, resultVar1 := a.app.CreatePost(post, class, triggerWebhooks) 1430 1431 if resultVar1 != nil { 1432 span.LogFields(spanlog.Error(resultVar1)) 1433 ext.Error.Set(span, true) 1434 } 1435 1436 return resultVar0, resultVar1 1437 } 1438 1439 func (a *OpenTracingAppLayer) CreatePostAsUser(post *model.Post, currentSessionId string) (*model.Post, *model.AppError) { 1440 origCtx := a.ctx 1441 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostAsUser") 1442 1443 a.ctx = newCtx 1444 a.app.Srv().Store.SetContext(newCtx) 1445 defer func() { 1446 a.app.Srv().Store.SetContext(origCtx) 1447 a.ctx = origCtx 1448 }() 1449 1450 defer span.Finish() 1451 resultVar0, resultVar1 := a.app.CreatePostAsUser(post, currentSessionId) 1452 1453 if resultVar1 != nil { 1454 span.LogFields(spanlog.Error(resultVar1)) 1455 ext.Error.Set(span, true) 1456 } 1457 1458 return resultVar0, resultVar1 1459 } 1460 1461 func (a *OpenTracingAppLayer) CreatePostMissingClass(post *model.Post, triggerWebhooks bool) (*model.Post, *model.AppError) { 1462 origCtx := a.ctx 1463 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreatePostMissingClass") 1464 1465 a.ctx = newCtx 1466 a.app.Srv().Store.SetContext(newCtx) 1467 defer func() { 1468 a.app.Srv().Store.SetContext(origCtx) 1469 a.ctx = origCtx 1470 }() 1471 1472 defer span.Finish() 1473 resultVar0, resultVar1 := a.app.CreatePostMissingClass(post, triggerWebhooks) 1474 1475 if resultVar1 != nil { 1476 span.LogFields(spanlog.Error(resultVar1)) 1477 ext.Error.Set(span, true) 1478 } 1479 1480 return resultVar0, resultVar1 1481 } 1482 1483 func (a *OpenTracingAppLayer) CreateRole(role *model.Role) (*model.Role, *model.AppError) { 1484 origCtx := a.ctx 1485 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateRole") 1486 1487 a.ctx = newCtx 1488 a.app.Srv().Store.SetContext(newCtx) 1489 defer func() { 1490 a.app.Srv().Store.SetContext(origCtx) 1491 a.ctx = origCtx 1492 }() 1493 1494 defer span.Finish() 1495 resultVar0, resultVar1 := a.app.CreateRole(role) 1496 1497 if resultVar1 != nil { 1498 span.LogFields(spanlog.Error(resultVar1)) 1499 ext.Error.Set(span, true) 1500 } 1501 1502 return resultVar0, resultVar1 1503 } 1504 1505 func (a *OpenTracingAppLayer) CreateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 1506 origCtx := a.ctx 1507 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateScheme") 1508 1509 a.ctx = newCtx 1510 a.app.Srv().Store.SetContext(newCtx) 1511 defer func() { 1512 a.app.Srv().Store.SetContext(origCtx) 1513 a.ctx = origCtx 1514 }() 1515 1516 defer span.Finish() 1517 resultVar0, resultVar1 := a.app.CreateScheme(scheme) 1518 1519 if resultVar1 != nil { 1520 span.LogFields(spanlog.Error(resultVar1)) 1521 ext.Error.Set(span, true) 1522 } 1523 1524 return resultVar0, resultVar1 1525 } 1526 1527 func (a *OpenTracingAppLayer) CreateSession(session *model.Session) (*model.Session, *model.AppError) { 1528 origCtx := a.ctx 1529 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateSession") 1530 1531 a.ctx = newCtx 1532 a.app.Srv().Store.SetContext(newCtx) 1533 defer func() { 1534 a.app.Srv().Store.SetContext(origCtx) 1535 a.ctx = origCtx 1536 }() 1537 1538 defer span.Finish() 1539 resultVar0, resultVar1 := a.app.CreateSession(session) 1540 1541 if resultVar1 != nil { 1542 span.LogFields(spanlog.Error(resultVar1)) 1543 ext.Error.Set(span, true) 1544 } 1545 1546 return resultVar0, resultVar1 1547 } 1548 1549 func (a *OpenTracingAppLayer) CreateTermsOfService(text string, userId string) (*model.TermsOfService, *model.AppError) { 1550 origCtx := a.ctx 1551 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateTermsOfService") 1552 1553 a.ctx = newCtx 1554 a.app.Srv().Store.SetContext(newCtx) 1555 defer func() { 1556 a.app.Srv().Store.SetContext(origCtx) 1557 a.ctx = origCtx 1558 }() 1559 1560 defer span.Finish() 1561 resultVar0, resultVar1 := a.app.CreateTermsOfService(text, userId) 1562 1563 if resultVar1 != nil { 1564 span.LogFields(spanlog.Error(resultVar1)) 1565 ext.Error.Set(span, true) 1566 } 1567 1568 return resultVar0, resultVar1 1569 } 1570 1571 func (a *OpenTracingAppLayer) CreateUser(user *model.User) (*model.User, *model.AppError) { 1572 origCtx := a.ctx 1573 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUser") 1574 1575 a.ctx = newCtx 1576 a.app.Srv().Store.SetContext(newCtx) 1577 defer func() { 1578 a.app.Srv().Store.SetContext(origCtx) 1579 a.ctx = origCtx 1580 }() 1581 1582 defer span.Finish() 1583 resultVar0, resultVar1 := a.app.CreateUser(user) 1584 1585 if resultVar1 != nil { 1586 span.LogFields(spanlog.Error(resultVar1)) 1587 ext.Error.Set(span, true) 1588 } 1589 1590 return resultVar0, resultVar1 1591 } 1592 1593 func (a *OpenTracingAppLayer) CreateUserAccessToken(token *model.UserAccessToken) (*model.UserAccessToken, *model.AppError) { 1594 origCtx := a.ctx 1595 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAccessToken") 1596 1597 a.ctx = newCtx 1598 a.app.Srv().Store.SetContext(newCtx) 1599 defer func() { 1600 a.app.Srv().Store.SetContext(origCtx) 1601 a.ctx = origCtx 1602 }() 1603 1604 defer span.Finish() 1605 resultVar0, resultVar1 := a.app.CreateUserAccessToken(token) 1606 1607 if resultVar1 != nil { 1608 span.LogFields(spanlog.Error(resultVar1)) 1609 ext.Error.Set(span, true) 1610 } 1611 1612 return resultVar0, resultVar1 1613 } 1614 1615 func (a *OpenTracingAppLayer) CreateUserAsAdmin(user *model.User) (*model.User, *model.AppError) { 1616 origCtx := a.ctx 1617 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserAsAdmin") 1618 1619 a.ctx = newCtx 1620 a.app.Srv().Store.SetContext(newCtx) 1621 defer func() { 1622 a.app.Srv().Store.SetContext(origCtx) 1623 a.ctx = origCtx 1624 }() 1625 1626 defer span.Finish() 1627 resultVar0, resultVar1 := a.app.CreateUserAsAdmin(user) 1628 1629 if resultVar1 != nil { 1630 span.LogFields(spanlog.Error(resultVar1)) 1631 ext.Error.Set(span, true) 1632 } 1633 1634 return resultVar0, resultVar1 1635 } 1636 1637 func (a *OpenTracingAppLayer) CreateUserFromSignup(user *model.User) (*model.User, *model.AppError) { 1638 origCtx := a.ctx 1639 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserFromSignup") 1640 1641 a.ctx = newCtx 1642 a.app.Srv().Store.SetContext(newCtx) 1643 defer func() { 1644 a.app.Srv().Store.SetContext(origCtx) 1645 a.ctx = origCtx 1646 }() 1647 1648 defer span.Finish() 1649 resultVar0, resultVar1 := a.app.CreateUserFromSignup(user) 1650 1651 if resultVar1 != nil { 1652 span.LogFields(spanlog.Error(resultVar1)) 1653 ext.Error.Set(span, true) 1654 } 1655 1656 return resultVar0, resultVar1 1657 } 1658 1659 func (a *OpenTracingAppLayer) CreateUserWithToken(user *model.User, token *model.Token) (*model.User, *model.AppError) { 1660 origCtx := a.ctx 1661 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateUserWithToken") 1662 1663 a.ctx = newCtx 1664 a.app.Srv().Store.SetContext(newCtx) 1665 defer func() { 1666 a.app.Srv().Store.SetContext(origCtx) 1667 a.ctx = origCtx 1668 }() 1669 1670 defer span.Finish() 1671 resultVar0, resultVar1 := a.app.CreateUserWithToken(user, token) 1672 1673 if resultVar1 != nil { 1674 span.LogFields(spanlog.Error(resultVar1)) 1675 ext.Error.Set(span, true) 1676 } 1677 1678 return resultVar0, resultVar1 1679 } 1680 1681 func (a *OpenTracingAppLayer) CreateVerifyEmailToken(userId string, newEmail string) (*model.Token, *model.AppError) { 1682 origCtx := a.ctx 1683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.CreateVerifyEmailToken") 1684 1685 a.ctx = newCtx 1686 a.app.Srv().Store.SetContext(newCtx) 1687 defer func() { 1688 a.app.Srv().Store.SetContext(origCtx) 1689 a.ctx = origCtx 1690 }() 1691 1692 defer span.Finish() 1693 resultVar0, resultVar1 := a.app.CreateVerifyEmailToken(userId, newEmail) 1694 1695 if resultVar1 != nil { 1696 span.LogFields(spanlog.Error(resultVar1)) 1697 ext.Error.Set(span, true) 1698 } 1699 1700 return resultVar0, resultVar1 1701 } 1702 1703 func (a *OpenTracingAppLayer) DeactivateMfa(userId string) *model.AppError { 1704 origCtx := a.ctx 1705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeactivateMfa") 1706 1707 a.ctx = newCtx 1708 a.app.Srv().Store.SetContext(newCtx) 1709 defer func() { 1710 a.app.Srv().Store.SetContext(origCtx) 1711 a.ctx = origCtx 1712 }() 1713 1714 defer span.Finish() 1715 resultVar0 := a.app.DeactivateMfa(userId) 1716 1717 if resultVar0 != nil { 1718 span.LogFields(spanlog.Error(resultVar0)) 1719 ext.Error.Set(span, true) 1720 } 1721 1722 return resultVar0 1723 } 1724 1725 func (a *OpenTracingAppLayer) DeauthorizeOAuthAppForUser(userId string, appId string) *model.AppError { 1726 origCtx := a.ctx 1727 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeauthorizeOAuthAppForUser") 1728 1729 a.ctx = newCtx 1730 a.app.Srv().Store.SetContext(newCtx) 1731 defer func() { 1732 a.app.Srv().Store.SetContext(origCtx) 1733 a.ctx = origCtx 1734 }() 1735 1736 defer span.Finish() 1737 resultVar0 := a.app.DeauthorizeOAuthAppForUser(userId, appId) 1738 1739 if resultVar0 != nil { 1740 span.LogFields(spanlog.Error(resultVar0)) 1741 ext.Error.Set(span, true) 1742 } 1743 1744 return resultVar0 1745 } 1746 1747 func (a *OpenTracingAppLayer) DefaultClassNames() []string { 1748 origCtx := a.ctx 1749 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DefaultClassNames") 1750 1751 a.ctx = newCtx 1752 a.app.Srv().Store.SetContext(newCtx) 1753 defer func() { 1754 a.app.Srv().Store.SetContext(origCtx) 1755 a.ctx = origCtx 1756 }() 1757 1758 defer span.Finish() 1759 resultVar0 := a.app.DefaultClassNames() 1760 1761 return resultVar0 1762 } 1763 1764 func (a *OpenTracingAppLayer) DeleteBrandImage() *model.AppError { 1765 origCtx := a.ctx 1766 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteBrandImage") 1767 1768 a.ctx = newCtx 1769 a.app.Srv().Store.SetContext(newCtx) 1770 defer func() { 1771 a.app.Srv().Store.SetContext(origCtx) 1772 a.ctx = origCtx 1773 }() 1774 1775 defer span.Finish() 1776 resultVar0 := a.app.DeleteBrandImage() 1777 1778 if resultVar0 != nil { 1779 span.LogFields(spanlog.Error(resultVar0)) 1780 ext.Error.Set(span, true) 1781 } 1782 1783 return resultVar0 1784 } 1785 1786 func (a *OpenTracingAppLayer) DeleteClass(class *model.Class, userId string) *model.AppError { 1787 origCtx := a.ctx 1788 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteClass") 1789 1790 a.ctx = newCtx 1791 a.app.Srv().Store.SetContext(newCtx) 1792 defer func() { 1793 a.app.Srv().Store.SetContext(origCtx) 1794 a.ctx = origCtx 1795 }() 1796 1797 defer span.Finish() 1798 resultVar0 := a.app.DeleteClass(class, userId) 1799 1800 if resultVar0 != nil { 1801 span.LogFields(spanlog.Error(resultVar0)) 1802 ext.Error.Set(span, true) 1803 } 1804 1805 return resultVar0 1806 } 1807 1808 func (a *OpenTracingAppLayer) DeleteClassScheme(class *model.Class) (*model.Class, *model.AppError) { 1809 origCtx := a.ctx 1810 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteClassScheme") 1811 1812 a.ctx = newCtx 1813 a.app.Srv().Store.SetContext(newCtx) 1814 defer func() { 1815 a.app.Srv().Store.SetContext(origCtx) 1816 a.ctx = origCtx 1817 }() 1818 1819 defer span.Finish() 1820 resultVar0, resultVar1 := a.app.DeleteClassScheme(class) 1821 1822 if resultVar1 != nil { 1823 span.LogFields(spanlog.Error(resultVar1)) 1824 ext.Error.Set(span, true) 1825 } 1826 1827 return resultVar0, resultVar1 1828 } 1829 1830 func (a *OpenTracingAppLayer) DeleteCommand(commandId string) *model.AppError { 1831 origCtx := a.ctx 1832 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteCommand") 1833 1834 a.ctx = newCtx 1835 a.app.Srv().Store.SetContext(newCtx) 1836 defer func() { 1837 a.app.Srv().Store.SetContext(origCtx) 1838 a.ctx = origCtx 1839 }() 1840 1841 defer span.Finish() 1842 resultVar0 := a.app.DeleteCommand(commandId) 1843 1844 if resultVar0 != nil { 1845 span.LogFields(spanlog.Error(resultVar0)) 1846 ext.Error.Set(span, true) 1847 } 1848 1849 return resultVar0 1850 } 1851 1852 func (a *OpenTracingAppLayer) DeleteEmoji(emoji *model.Emoji) *model.AppError { 1853 origCtx := a.ctx 1854 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEmoji") 1855 1856 a.ctx = newCtx 1857 a.app.Srv().Store.SetContext(newCtx) 1858 defer func() { 1859 a.app.Srv().Store.SetContext(origCtx) 1860 a.ctx = origCtx 1861 }() 1862 1863 defer span.Finish() 1864 resultVar0 := a.app.DeleteEmoji(emoji) 1865 1866 if resultVar0 != nil { 1867 span.LogFields(spanlog.Error(resultVar0)) 1868 ext.Error.Set(span, true) 1869 } 1870 1871 return resultVar0 1872 } 1873 1874 func (a *OpenTracingAppLayer) DeleteEphemeralPost(userId string, postId string) { 1875 origCtx := a.ctx 1876 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteEphemeralPost") 1877 1878 a.ctx = newCtx 1879 a.app.Srv().Store.SetContext(newCtx) 1880 defer func() { 1881 a.app.Srv().Store.SetContext(origCtx) 1882 a.ctx = origCtx 1883 }() 1884 1885 defer span.Finish() 1886 a.app.DeleteEphemeralPost(userId, postId) 1887 } 1888 1889 func (a *OpenTracingAppLayer) DeleteFlaggedPosts(postId string) { 1890 origCtx := a.ctx 1891 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteFlaggedPosts") 1892 1893 a.ctx = newCtx 1894 a.app.Srv().Store.SetContext(newCtx) 1895 defer func() { 1896 a.app.Srv().Store.SetContext(origCtx) 1897 a.ctx = origCtx 1898 }() 1899 1900 defer span.Finish() 1901 a.app.DeleteFlaggedPosts(postId) 1902 } 1903 1904 func (a *OpenTracingAppLayer) DeleteOAuthApp(appId string) *model.AppError { 1905 origCtx := a.ctx 1906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteOAuthApp") 1907 1908 a.ctx = newCtx 1909 a.app.Srv().Store.SetContext(newCtx) 1910 defer func() { 1911 a.app.Srv().Store.SetContext(origCtx) 1912 a.ctx = origCtx 1913 }() 1914 1915 defer span.Finish() 1916 resultVar0 := a.app.DeleteOAuthApp(appId) 1917 1918 if resultVar0 != nil { 1919 span.LogFields(spanlog.Error(resultVar0)) 1920 ext.Error.Set(span, true) 1921 } 1922 1923 return resultVar0 1924 } 1925 1926 func (a *OpenTracingAppLayer) DeletePost(postId string, deleteByID string) (*model.Post, *model.AppError) { 1927 origCtx := a.ctx 1928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePost") 1929 1930 a.ctx = newCtx 1931 a.app.Srv().Store.SetContext(newCtx) 1932 defer func() { 1933 a.app.Srv().Store.SetContext(origCtx) 1934 a.ctx = origCtx 1935 }() 1936 1937 defer span.Finish() 1938 resultVar0, resultVar1 := a.app.DeletePost(postId, deleteByID) 1939 1940 if resultVar1 != nil { 1941 span.LogFields(spanlog.Error(resultVar1)) 1942 ext.Error.Set(span, true) 1943 } 1944 1945 return resultVar0, resultVar1 1946 } 1947 1948 func (a *OpenTracingAppLayer) DeletePostFiles(post *model.Post) { 1949 origCtx := a.ctx 1950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePostFiles") 1951 1952 a.ctx = newCtx 1953 a.app.Srv().Store.SetContext(newCtx) 1954 defer func() { 1955 a.app.Srv().Store.SetContext(origCtx) 1956 a.ctx = origCtx 1957 }() 1958 1959 defer span.Finish() 1960 a.app.DeletePostFiles(post) 1961 } 1962 1963 func (a *OpenTracingAppLayer) DeletePreferences(userId string, preferences model.Preferences) *model.AppError { 1964 origCtx := a.ctx 1965 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeletePreferences") 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 := a.app.DeletePreferences(userId, preferences) 1976 1977 if resultVar0 != nil { 1978 span.LogFields(spanlog.Error(resultVar0)) 1979 ext.Error.Set(span, true) 1980 } 1981 1982 return resultVar0 1983 } 1984 1985 func (a *OpenTracingAppLayer) DeleteReactionForPost(reaction *model.Reaction) *model.AppError { 1986 origCtx := a.ctx 1987 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteReactionForPost") 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 := a.app.DeleteReactionForPost(reaction) 1998 1999 if resultVar0 != nil { 2000 span.LogFields(spanlog.Error(resultVar0)) 2001 ext.Error.Set(span, true) 2002 } 2003 2004 return resultVar0 2005 } 2006 2007 func (a *OpenTracingAppLayer) DeleteScheme(schemeId string) (*model.Scheme, *model.AppError) { 2008 origCtx := a.ctx 2009 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteScheme") 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.DeleteScheme(schemeId) 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) DeleteToken(token *model.Token) *model.AppError { 2030 origCtx := a.ctx 2031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DeleteToken") 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 := a.app.DeleteToken(token) 2042 2043 if resultVar0 != nil { 2044 span.LogFields(spanlog.Error(resultVar0)) 2045 ext.Error.Set(span, true) 2046 } 2047 2048 return resultVar0 2049 } 2050 2051 func (a *OpenTracingAppLayer) DiagnosticId() string { 2052 origCtx := a.ctx 2053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DiagnosticId") 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 := a.app.DiagnosticId() 2064 2065 return resultVar0 2066 } 2067 2068 func (a *OpenTracingAppLayer) DisableUserAccessToken(token *model.UserAccessToken) *model.AppError { 2069 origCtx := a.ctx 2070 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DisableUserAccessToken") 2071 2072 a.ctx = newCtx 2073 a.app.Srv().Store.SetContext(newCtx) 2074 defer func() { 2075 a.app.Srv().Store.SetContext(origCtx) 2076 a.ctx = origCtx 2077 }() 2078 2079 defer span.Finish() 2080 resultVar0 := a.app.DisableUserAccessToken(token) 2081 2082 if resultVar0 != nil { 2083 span.LogFields(spanlog.Error(resultVar0)) 2084 ext.Error.Set(span, true) 2085 } 2086 2087 return resultVar0 2088 } 2089 2090 func (a *OpenTracingAppLayer) DoAdvancedPermissionsMigration() { 2091 origCtx := a.ctx 2092 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAdvancedPermissionsMigration") 2093 2094 a.ctx = newCtx 2095 a.app.Srv().Store.SetContext(newCtx) 2096 defer func() { 2097 a.app.Srv().Store.SetContext(origCtx) 2098 a.ctx = origCtx 2099 }() 2100 2101 defer span.Finish() 2102 a.app.DoAdvancedPermissionsMigration() 2103 } 2104 2105 func (a *OpenTracingAppLayer) DoAppMigrations() { 2106 origCtx := a.ctx 2107 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoAppMigrations") 2108 2109 a.ctx = newCtx 2110 a.app.Srv().Store.SetContext(newCtx) 2111 defer func() { 2112 a.app.Srv().Store.SetContext(origCtx) 2113 a.ctx = origCtx 2114 }() 2115 2116 defer span.Finish() 2117 a.app.DoAppMigrations() 2118 } 2119 2120 func (a *OpenTracingAppLayer) DoEmojisPermissionsMigration() { 2121 origCtx := a.ctx 2122 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoEmojisPermissionsMigration") 2123 2124 a.ctx = newCtx 2125 a.app.Srv().Store.SetContext(newCtx) 2126 defer func() { 2127 a.app.Srv().Store.SetContext(origCtx) 2128 a.ctx = origCtx 2129 }() 2130 2131 defer span.Finish() 2132 a.app.DoEmojisPermissionsMigration() 2133 } 2134 2135 func (a *OpenTracingAppLayer) DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId string) *model.AppError { 2136 origCtx := a.ctx 2137 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoLogin") 2138 2139 a.ctx = newCtx 2140 a.app.Srv().Store.SetContext(newCtx) 2141 defer func() { 2142 a.app.Srv().Store.SetContext(origCtx) 2143 a.ctx = origCtx 2144 }() 2145 2146 defer span.Finish() 2147 resultVar0 := a.app.DoLogin(w, r, user, deviceId) 2148 2149 if resultVar0 != nil { 2150 span.LogFields(spanlog.Error(resultVar0)) 2151 ext.Error.Set(span, true) 2152 } 2153 2154 return resultVar0 2155 } 2156 2157 func (a *OpenTracingAppLayer) DoPermissionsMigrations() error { 2158 origCtx := a.ctx 2159 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoPermissionsMigrations") 2160 2161 a.ctx = newCtx 2162 a.app.Srv().Store.SetContext(newCtx) 2163 defer func() { 2164 a.app.Srv().Store.SetContext(origCtx) 2165 a.ctx = origCtx 2166 }() 2167 2168 defer span.Finish() 2169 resultVar0 := a.app.DoPermissionsMigrations() 2170 2171 return resultVar0 2172 } 2173 2174 func (a *OpenTracingAppLayer) DoUploadFile(now time.Time, rawBranchId string, rawClassId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, *model.AppError) { 2175 origCtx := a.ctx 2176 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFile") 2177 2178 a.ctx = newCtx 2179 a.app.Srv().Store.SetContext(newCtx) 2180 defer func() { 2181 a.app.Srv().Store.SetContext(origCtx) 2182 a.ctx = origCtx 2183 }() 2184 2185 defer span.Finish() 2186 resultVar0, resultVar1 := a.app.DoUploadFile(now, rawBranchId, rawClassId, rawUserId, rawFilename, data) 2187 2188 if resultVar1 != nil { 2189 span.LogFields(spanlog.Error(resultVar1)) 2190 ext.Error.Set(span, true) 2191 } 2192 2193 return resultVar0, resultVar1 2194 } 2195 2196 func (a *OpenTracingAppLayer) DoUploadFileExpectModification(now time.Time, rawBranchId string, rawClassId string, rawUserId string, rawFilename string, data []byte) (*model.FileInfo, []byte, *model.AppError) { 2197 origCtx := a.ctx 2198 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoUploadFileExpectModification") 2199 2200 a.ctx = newCtx 2201 a.app.Srv().Store.SetContext(newCtx) 2202 defer func() { 2203 a.app.Srv().Store.SetContext(origCtx) 2204 a.ctx = origCtx 2205 }() 2206 2207 defer span.Finish() 2208 resultVar0, resultVar1, resultVar2 := a.app.DoUploadFileExpectModification(now, rawBranchId, rawClassId, rawUserId, rawFilename, data) 2209 2210 if resultVar2 != nil { 2211 span.LogFields(spanlog.Error(resultVar2)) 2212 ext.Error.Set(span, true) 2213 } 2214 2215 return resultVar0, resultVar1, resultVar2 2216 } 2217 2218 func (a *OpenTracingAppLayer) DoubleCheckPassword(user *model.User, password string) *model.AppError { 2219 origCtx := a.ctx 2220 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DoubleCheckPassword") 2221 2222 a.ctx = newCtx 2223 a.app.Srv().Store.SetContext(newCtx) 2224 defer func() { 2225 a.app.Srv().Store.SetContext(origCtx) 2226 a.ctx = origCtx 2227 }() 2228 2229 defer span.Finish() 2230 resultVar0 := a.app.DoubleCheckPassword(user, password) 2231 2232 if resultVar0 != nil { 2233 span.LogFields(spanlog.Error(resultVar0)) 2234 ext.Error.Set(span, true) 2235 } 2236 2237 return resultVar0 2238 } 2239 2240 func (a *OpenTracingAppLayer) DownloadFromURL(downloadURL string) ([]byte, error) { 2241 origCtx := a.ctx 2242 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.DownloadFromURL") 2243 2244 a.ctx = newCtx 2245 a.app.Srv().Store.SetContext(newCtx) 2246 defer func() { 2247 a.app.Srv().Store.SetContext(origCtx) 2248 a.ctx = origCtx 2249 }() 2250 2251 defer span.Finish() 2252 resultVar0, resultVar1 := a.app.DownloadFromURL(downloadURL) 2253 2254 return resultVar0, resultVar1 2255 } 2256 2257 func (a *OpenTracingAppLayer) EnableUserAccessToken(token *model.UserAccessToken) *model.AppError { 2258 origCtx := a.ctx 2259 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnableUserAccessToken") 2260 2261 a.ctx = newCtx 2262 a.app.Srv().Store.SetContext(newCtx) 2263 defer func() { 2264 a.app.Srv().Store.SetContext(origCtx) 2265 a.ctx = origCtx 2266 }() 2267 2268 defer span.Finish() 2269 resultVar0 := a.app.EnableUserAccessToken(token) 2270 2271 if resultVar0 != nil { 2272 span.LogFields(spanlog.Error(resultVar0)) 2273 ext.Error.Set(span, true) 2274 } 2275 2276 return resultVar0 2277 } 2278 2279 func (a *OpenTracingAppLayer) EnvironmentConfig() map[string]interface{} { 2280 origCtx := a.ctx 2281 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.EnvironmentConfig") 2282 2283 a.ctx = newCtx 2284 a.app.Srv().Store.SetContext(newCtx) 2285 defer func() { 2286 a.app.Srv().Store.SetContext(origCtx) 2287 a.ctx = origCtx 2288 }() 2289 2290 defer span.Finish() 2291 resultVar0 := a.app.EnvironmentConfig() 2292 2293 return resultVar0 2294 } 2295 2296 func (a *OpenTracingAppLayer) ExecuteCommand(args *model.CommandArgs) (*model.CommandResponse, *model.AppError) { 2297 origCtx := a.ctx 2298 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExecuteCommand") 2299 2300 a.ctx = newCtx 2301 a.app.Srv().Store.SetContext(newCtx) 2302 defer func() { 2303 a.app.Srv().Store.SetContext(origCtx) 2304 a.ctx = origCtx 2305 }() 2306 2307 defer span.Finish() 2308 resultVar0, resultVar1 := a.app.ExecuteCommand(args) 2309 2310 if resultVar1 != nil { 2311 span.LogFields(spanlog.Error(resultVar1)) 2312 ext.Error.Set(span, true) 2313 } 2314 2315 return resultVar0, resultVar1 2316 } 2317 2318 func (a *OpenTracingAppLayer) ExportPermissions(w io.Writer) error { 2319 origCtx := a.ctx 2320 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ExportPermissions") 2321 2322 a.ctx = newCtx 2323 a.app.Srv().Store.SetContext(newCtx) 2324 defer func() { 2325 a.app.Srv().Store.SetContext(origCtx) 2326 a.ctx = origCtx 2327 }() 2328 2329 defer span.Finish() 2330 resultVar0 := a.app.ExportPermissions(w) 2331 2332 return resultVar0 2333 } 2334 2335 func (a *OpenTracingAppLayer) FetchSamlMetadataFromIdp(url string) ([]byte, *model.AppError) { 2336 origCtx := a.ctx 2337 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FetchSamlMetadataFromIdp") 2338 2339 a.ctx = newCtx 2340 a.app.Srv().Store.SetContext(newCtx) 2341 defer func() { 2342 a.app.Srv().Store.SetContext(origCtx) 2343 a.ctx = origCtx 2344 }() 2345 2346 defer span.Finish() 2347 resultVar0, resultVar1 := a.app.FetchSamlMetadataFromIdp(url) 2348 2349 if resultVar1 != nil { 2350 span.LogFields(spanlog.Error(resultVar1)) 2351 ext.Error.Set(span, true) 2352 } 2353 2354 return resultVar0, resultVar1 2355 } 2356 2357 func (a *OpenTracingAppLayer) FileBackend() (filesstore.FileBackend, *model.AppError) { 2358 origCtx := a.ctx 2359 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileBackend") 2360 2361 a.ctx = newCtx 2362 a.app.Srv().Store.SetContext(newCtx) 2363 defer func() { 2364 a.app.Srv().Store.SetContext(origCtx) 2365 a.ctx = origCtx 2366 }() 2367 2368 defer span.Finish() 2369 resultVar0, resultVar1 := a.app.FileBackend() 2370 2371 if resultVar1 != nil { 2372 span.LogFields(spanlog.Error(resultVar1)) 2373 ext.Error.Set(span, true) 2374 } 2375 2376 return resultVar0, resultVar1 2377 } 2378 2379 func (a *OpenTracingAppLayer) FileExists(path string) (bool, *model.AppError) { 2380 origCtx := a.ctx 2381 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileExists") 2382 2383 a.ctx = newCtx 2384 a.app.Srv().Store.SetContext(newCtx) 2385 defer func() { 2386 a.app.Srv().Store.SetContext(origCtx) 2387 a.ctx = origCtx 2388 }() 2389 2390 defer span.Finish() 2391 resultVar0, resultVar1 := a.app.FileExists(path) 2392 2393 if resultVar1 != nil { 2394 span.LogFields(spanlog.Error(resultVar1)) 2395 ext.Error.Set(span, true) 2396 } 2397 2398 return resultVar0, resultVar1 2399 } 2400 2401 func (a *OpenTracingAppLayer) FileReader(path string) (filesstore.ReadCloseSeeker, *model.AppError) { 2402 origCtx := a.ctx 2403 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FileReader") 2404 2405 a.ctx = newCtx 2406 a.app.Srv().Store.SetContext(newCtx) 2407 defer func() { 2408 a.app.Srv().Store.SetContext(origCtx) 2409 a.ctx = origCtx 2410 }() 2411 2412 defer span.Finish() 2413 resultVar0, resultVar1 := a.app.FileReader(path) 2414 2415 if resultVar1 != nil { 2416 span.LogFields(spanlog.Error(resultVar1)) 2417 ext.Error.Set(span, true) 2418 } 2419 2420 return resultVar0, resultVar1 2421 } 2422 2423 func (a *OpenTracingAppLayer) FindBranchByName(name string) bool { 2424 origCtx := a.ctx 2425 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.FindBranchByName") 2426 2427 a.ctx = newCtx 2428 a.app.Srv().Store.SetContext(newCtx) 2429 defer func() { 2430 a.app.Srv().Store.SetContext(origCtx) 2431 a.ctx = origCtx 2432 }() 2433 2434 defer span.Finish() 2435 resultVar0 := a.app.FindBranchByName(name) 2436 2437 return resultVar0 2438 } 2439 2440 func (a *OpenTracingAppLayer) GenerateMfaSecret(userId string) (*model.MfaSecret, *model.AppError) { 2441 origCtx := a.ctx 2442 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GenerateMfaSecret") 2443 2444 a.ctx = newCtx 2445 a.app.Srv().Store.SetContext(newCtx) 2446 defer func() { 2447 a.app.Srv().Store.SetContext(origCtx) 2448 a.ctx = origCtx 2449 }() 2450 2451 defer span.Finish() 2452 resultVar0, resultVar1 := a.app.GenerateMfaSecret(userId) 2453 2454 if resultVar1 != nil { 2455 span.LogFields(spanlog.Error(resultVar1)) 2456 ext.Error.Set(span, true) 2457 } 2458 2459 return resultVar0, resultVar1 2460 } 2461 2462 func (a *OpenTracingAppLayer) GeneratePublicLink(siteURL string, info *model.FileInfo) string { 2463 origCtx := a.ctx 2464 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GeneratePublicLink") 2465 2466 a.ctx = newCtx 2467 a.app.Srv().Store.SetContext(newCtx) 2468 defer func() { 2469 a.app.Srv().Store.SetContext(origCtx) 2470 a.ctx = origCtx 2471 }() 2472 2473 defer span.Finish() 2474 resultVar0 := a.app.GeneratePublicLink(siteURL, info) 2475 2476 return resultVar0 2477 } 2478 2479 func (a *OpenTracingAppLayer) GetAllBranches() ([]*model.Branch, *model.AppError) { 2480 origCtx := a.ctx 2481 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllBranches") 2482 2483 a.ctx = newCtx 2484 a.app.Srv().Store.SetContext(newCtx) 2485 defer func() { 2486 a.app.Srv().Store.SetContext(origCtx) 2487 a.ctx = origCtx 2488 }() 2489 2490 defer span.Finish() 2491 resultVar0, resultVar1 := a.app.GetAllBranches() 2492 2493 if resultVar1 != nil { 2494 span.LogFields(spanlog.Error(resultVar1)) 2495 ext.Error.Set(span, true) 2496 } 2497 2498 return resultVar0, resultVar1 2499 } 2500 2501 func (a *OpenTracingAppLayer) GetAllBranchesPage(offset int, limit int) ([]*model.Branch, *model.AppError) { 2502 origCtx := a.ctx 2503 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllBranchesPage") 2504 2505 a.ctx = newCtx 2506 a.app.Srv().Store.SetContext(newCtx) 2507 defer func() { 2508 a.app.Srv().Store.SetContext(origCtx) 2509 a.ctx = origCtx 2510 }() 2511 2512 defer span.Finish() 2513 resultVar0, resultVar1 := a.app.GetAllBranchesPage(offset, limit) 2514 2515 if resultVar1 != nil { 2516 span.LogFields(spanlog.Error(resultVar1)) 2517 ext.Error.Set(span, true) 2518 } 2519 2520 return resultVar0, resultVar1 2521 } 2522 2523 func (a *OpenTracingAppLayer) GetAllBranchesPageWithCount(offset int, limit int) (*model.BranchesWithCount, *model.AppError) { 2524 origCtx := a.ctx 2525 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllBranchesPageWithCount") 2526 2527 a.ctx = newCtx 2528 a.app.Srv().Store.SetContext(newCtx) 2529 defer func() { 2530 a.app.Srv().Store.SetContext(origCtx) 2531 a.ctx = origCtx 2532 }() 2533 2534 defer span.Finish() 2535 resultVar0, resultVar1 := a.app.GetAllBranchesPageWithCount(offset, limit) 2536 2537 if resultVar1 != nil { 2538 span.LogFields(spanlog.Error(resultVar1)) 2539 ext.Error.Set(span, true) 2540 } 2541 2542 return resultVar0, resultVar1 2543 } 2544 2545 func (a *OpenTracingAppLayer) GetAllClasses(page int, perPage int, opts model.ClassSearchOpts) (*model.ClassListWithBranchData, *model.AppError) { 2546 origCtx := a.ctx 2547 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllClasses") 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 resultVar0, resultVar1 := a.app.GetAllClasses(page, perPage, opts) 2558 2559 if resultVar1 != nil { 2560 span.LogFields(spanlog.Error(resultVar1)) 2561 ext.Error.Set(span, true) 2562 } 2563 2564 return resultVar0, resultVar1 2565 } 2566 2567 func (a *OpenTracingAppLayer) GetAllClassesCount(opts model.ClassSearchOpts) (int64, *model.AppError) { 2568 origCtx := a.ctx 2569 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllClassesCount") 2570 2571 a.ctx = newCtx 2572 a.app.Srv().Store.SetContext(newCtx) 2573 defer func() { 2574 a.app.Srv().Store.SetContext(origCtx) 2575 a.ctx = origCtx 2576 }() 2577 2578 defer span.Finish() 2579 resultVar0, resultVar1 := a.app.GetAllClassesCount(opts) 2580 2581 if resultVar1 != nil { 2582 span.LogFields(spanlog.Error(resultVar1)) 2583 ext.Error.Set(span, true) 2584 } 2585 2586 return resultVar0, resultVar1 2587 } 2588 2589 func (a *OpenTracingAppLayer) GetAllRoles() ([]*model.Role, *model.AppError) { 2590 origCtx := a.ctx 2591 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllRoles") 2592 2593 a.ctx = newCtx 2594 a.app.Srv().Store.SetContext(newCtx) 2595 defer func() { 2596 a.app.Srv().Store.SetContext(origCtx) 2597 a.ctx = origCtx 2598 }() 2599 2600 defer span.Finish() 2601 resultVar0, resultVar1 := a.app.GetAllRoles() 2602 2603 if resultVar1 != nil { 2604 span.LogFields(spanlog.Error(resultVar1)) 2605 ext.Error.Set(span, true) 2606 } 2607 2608 return resultVar0, resultVar1 2609 } 2610 2611 func (a *OpenTracingAppLayer) GetAllStatuses() map[string]*model.Status { 2612 origCtx := a.ctx 2613 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAllStatuses") 2614 2615 a.ctx = newCtx 2616 a.app.Srv().Store.SetContext(newCtx) 2617 defer func() { 2618 a.app.Srv().Store.SetContext(origCtx) 2619 a.ctx = origCtx 2620 }() 2621 2622 defer span.Finish() 2623 resultVar0 := a.app.GetAllStatuses() 2624 2625 return resultVar0 2626 } 2627 2628 func (a *OpenTracingAppLayer) GetAnalytics(name string, branchId string) (model.AnalyticsRows, *model.AppError) { 2629 origCtx := a.ctx 2630 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAnalytics") 2631 2632 a.ctx = newCtx 2633 a.app.Srv().Store.SetContext(newCtx) 2634 defer func() { 2635 a.app.Srv().Store.SetContext(origCtx) 2636 a.ctx = origCtx 2637 }() 2638 2639 defer span.Finish() 2640 resultVar0, resultVar1 := a.app.GetAnalytics(name, branchId) 2641 2642 if resultVar1 != nil { 2643 span.LogFields(spanlog.Error(resultVar1)) 2644 ext.Error.Set(span, true) 2645 } 2646 2647 return resultVar0, resultVar1 2648 } 2649 2650 func (a *OpenTracingAppLayer) GetAudits(userId string, limit int) (model.Audits, *model.AppError) { 2651 origCtx := a.ctx 2652 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAudits") 2653 2654 a.ctx = newCtx 2655 a.app.Srv().Store.SetContext(newCtx) 2656 defer func() { 2657 a.app.Srv().Store.SetContext(origCtx) 2658 a.ctx = origCtx 2659 }() 2660 2661 defer span.Finish() 2662 resultVar0, resultVar1 := a.app.GetAudits(userId, limit) 2663 2664 if resultVar1 != nil { 2665 span.LogFields(spanlog.Error(resultVar1)) 2666 ext.Error.Set(span, true) 2667 } 2668 2669 return resultVar0, resultVar1 2670 } 2671 2672 func (a *OpenTracingAppLayer) GetAuditsPage(userId string, page int, perPage int) (model.Audits, *model.AppError) { 2673 origCtx := a.ctx 2674 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuditsPage") 2675 2676 a.ctx = newCtx 2677 a.app.Srv().Store.SetContext(newCtx) 2678 defer func() { 2679 a.app.Srv().Store.SetContext(origCtx) 2680 a.ctx = origCtx 2681 }() 2682 2683 defer span.Finish() 2684 resultVar0, resultVar1 := a.app.GetAuditsPage(userId, page, perPage) 2685 2686 if resultVar1 != nil { 2687 span.LogFields(spanlog.Error(resultVar1)) 2688 ext.Error.Set(span, true) 2689 } 2690 2691 return resultVar0, resultVar1 2692 } 2693 2694 func (a *OpenTracingAppLayer) GetAuthorizationCode(w http.ResponseWriter, r *http.Request, service string, props map[string]string, loginHint string) (string, *model.AppError) { 2695 origCtx := a.ctx 2696 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizationCode") 2697 2698 a.ctx = newCtx 2699 a.app.Srv().Store.SetContext(newCtx) 2700 defer func() { 2701 a.app.Srv().Store.SetContext(origCtx) 2702 a.ctx = origCtx 2703 }() 2704 2705 defer span.Finish() 2706 resultVar0, resultVar1 := a.app.GetAuthorizationCode(w, r, service, props, loginHint) 2707 2708 if resultVar1 != nil { 2709 span.LogFields(spanlog.Error(resultVar1)) 2710 ext.Error.Set(span, true) 2711 } 2712 2713 return resultVar0, resultVar1 2714 } 2715 2716 func (a *OpenTracingAppLayer) GetAuthorizedAppsForUser(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 2717 origCtx := a.ctx 2718 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetAuthorizedAppsForUser") 2719 2720 a.ctx = newCtx 2721 a.app.Srv().Store.SetContext(newCtx) 2722 defer func() { 2723 a.app.Srv().Store.SetContext(origCtx) 2724 a.ctx = origCtx 2725 }() 2726 2727 defer span.Finish() 2728 resultVar0, resultVar1 := a.app.GetAuthorizedAppsForUser(userId, page, perPage) 2729 2730 if resultVar1 != nil { 2731 span.LogFields(spanlog.Error(resultVar1)) 2732 ext.Error.Set(span, true) 2733 } 2734 2735 return resultVar0, resultVar1 2736 } 2737 2738 func (a *OpenTracingAppLayer) GetBranch(branchId string) (*model.Branch, *model.AppError) { 2739 origCtx := a.ctx 2740 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranch") 2741 2742 a.ctx = newCtx 2743 a.app.Srv().Store.SetContext(newCtx) 2744 defer func() { 2745 a.app.Srv().Store.SetContext(origCtx) 2746 a.ctx = origCtx 2747 }() 2748 2749 defer span.Finish() 2750 resultVar0, resultVar1 := a.app.GetBranch(branchId) 2751 2752 if resultVar1 != nil { 2753 span.LogFields(spanlog.Error(resultVar1)) 2754 ext.Error.Set(span, true) 2755 } 2756 2757 return resultVar0, resultVar1 2758 } 2759 2760 func (a *OpenTracingAppLayer) GetBranchByName(name string) (*model.Branch, *model.AppError) { 2761 origCtx := a.ctx 2762 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchByName") 2763 2764 a.ctx = newCtx 2765 a.app.Srv().Store.SetContext(newCtx) 2766 defer func() { 2767 a.app.Srv().Store.SetContext(origCtx) 2768 a.ctx = origCtx 2769 }() 2770 2771 defer span.Finish() 2772 resultVar0, resultVar1 := a.app.GetBranchByName(name) 2773 2774 if resultVar1 != nil { 2775 span.LogFields(spanlog.Error(resultVar1)) 2776 ext.Error.Set(span, true) 2777 } 2778 2779 return resultVar0, resultVar1 2780 } 2781 2782 func (a *OpenTracingAppLayer) GetBranchIcon(branch *model.Branch) ([]byte, *model.AppError) { 2783 origCtx := a.ctx 2784 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchIcon") 2785 2786 a.ctx = newCtx 2787 a.app.Srv().Store.SetContext(newCtx) 2788 defer func() { 2789 a.app.Srv().Store.SetContext(origCtx) 2790 a.ctx = origCtx 2791 }() 2792 2793 defer span.Finish() 2794 resultVar0, resultVar1 := a.app.GetBranchIcon(branch) 2795 2796 if resultVar1 != nil { 2797 span.LogFields(spanlog.Error(resultVar1)) 2798 ext.Error.Set(span, true) 2799 } 2800 2801 return resultVar0, resultVar1 2802 } 2803 2804 func (a *OpenTracingAppLayer) GetBranchIdFromQuery(query url.Values) (string, *model.AppError) { 2805 origCtx := a.ctx 2806 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchIdFromQuery") 2807 2808 a.ctx = newCtx 2809 a.app.Srv().Store.SetContext(newCtx) 2810 defer func() { 2811 a.app.Srv().Store.SetContext(origCtx) 2812 a.ctx = origCtx 2813 }() 2814 2815 defer span.Finish() 2816 resultVar0, resultVar1 := a.app.GetBranchIdFromQuery(query) 2817 2818 if resultVar1 != nil { 2819 span.LogFields(spanlog.Error(resultVar1)) 2820 ext.Error.Set(span, true) 2821 } 2822 2823 return resultVar0, resultVar1 2824 } 2825 2826 func (a *OpenTracingAppLayer) GetBranchMember(branchId string, userId string) (*model.BranchMember, *model.AppError) { 2827 origCtx := a.ctx 2828 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchMember") 2829 2830 a.ctx = newCtx 2831 a.app.Srv().Store.SetContext(newCtx) 2832 defer func() { 2833 a.app.Srv().Store.SetContext(origCtx) 2834 a.ctx = origCtx 2835 }() 2836 2837 defer span.Finish() 2838 resultVar0, resultVar1 := a.app.GetBranchMember(branchId, userId) 2839 2840 if resultVar1 != nil { 2841 span.LogFields(spanlog.Error(resultVar1)) 2842 ext.Error.Set(span, true) 2843 } 2844 2845 return resultVar0, resultVar1 2846 } 2847 2848 func (a *OpenTracingAppLayer) GetBranchMembers(branchId string, offset int, limit int, branchMembersGetOptions *model.BranchMembersGetOptions) ([]*model.BranchMember, *model.AppError) { 2849 origCtx := a.ctx 2850 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchMembers") 2851 2852 a.ctx = newCtx 2853 a.app.Srv().Store.SetContext(newCtx) 2854 defer func() { 2855 a.app.Srv().Store.SetContext(origCtx) 2856 a.ctx = origCtx 2857 }() 2858 2859 defer span.Finish() 2860 resultVar0, resultVar1 := a.app.GetBranchMembers(branchId, offset, limit, branchMembersGetOptions) 2861 2862 if resultVar1 != nil { 2863 span.LogFields(spanlog.Error(resultVar1)) 2864 ext.Error.Set(span, true) 2865 } 2866 2867 return resultVar0, resultVar1 2868 } 2869 2870 func (a *OpenTracingAppLayer) GetBranchMembersByIds(branchId string, userIds []string, restrictions *model.ViewUsersRestrictions) ([]*model.BranchMember, *model.AppError) { 2871 origCtx := a.ctx 2872 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchMembersByIds") 2873 2874 a.ctx = newCtx 2875 a.app.Srv().Store.SetContext(newCtx) 2876 defer func() { 2877 a.app.Srv().Store.SetContext(origCtx) 2878 a.ctx = origCtx 2879 }() 2880 2881 defer span.Finish() 2882 resultVar0, resultVar1 := a.app.GetBranchMembersByIds(branchId, userIds, restrictions) 2883 2884 if resultVar1 != nil { 2885 span.LogFields(spanlog.Error(resultVar1)) 2886 ext.Error.Set(span, true) 2887 } 2888 2889 return resultVar0, resultVar1 2890 } 2891 2892 func (a *OpenTracingAppLayer) GetBranchMembersForUser(userId string) ([]*model.BranchMember, *model.AppError) { 2893 origCtx := a.ctx 2894 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchMembersForUser") 2895 2896 a.ctx = newCtx 2897 a.app.Srv().Store.SetContext(newCtx) 2898 defer func() { 2899 a.app.Srv().Store.SetContext(origCtx) 2900 a.ctx = origCtx 2901 }() 2902 2903 defer span.Finish() 2904 resultVar0, resultVar1 := a.app.GetBranchMembersForUser(userId) 2905 2906 if resultVar1 != nil { 2907 span.LogFields(spanlog.Error(resultVar1)) 2908 ext.Error.Set(span, true) 2909 } 2910 2911 return resultVar0, resultVar1 2912 } 2913 2914 func (a *OpenTracingAppLayer) GetBranchMembersForUserWithPagination(userId string, page int, perPage int) ([]*model.BranchMember, *model.AppError) { 2915 origCtx := a.ctx 2916 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchMembersForUserWithPagination") 2917 2918 a.ctx = newCtx 2919 a.app.Srv().Store.SetContext(newCtx) 2920 defer func() { 2921 a.app.Srv().Store.SetContext(origCtx) 2922 a.ctx = origCtx 2923 }() 2924 2925 defer span.Finish() 2926 resultVar0, resultVar1 := a.app.GetBranchMembersForUserWithPagination(userId, page, perPage) 2927 2928 if resultVar1 != nil { 2929 span.LogFields(spanlog.Error(resultVar1)) 2930 ext.Error.Set(span, true) 2931 } 2932 2933 return resultVar0, resultVar1 2934 } 2935 2936 func (a *OpenTracingAppLayer) GetBranchSchemeClassRoles(branchId string) (string, string, *model.AppError) { 2937 origCtx := a.ctx 2938 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchSchemeClassRoles") 2939 2940 a.ctx = newCtx 2941 a.app.Srv().Store.SetContext(newCtx) 2942 defer func() { 2943 a.app.Srv().Store.SetContext(origCtx) 2944 a.ctx = origCtx 2945 }() 2946 2947 defer span.Finish() 2948 resultVar0, resultVar1, resultVar2 := a.app.GetBranchSchemeClassRoles(branchId) 2949 2950 if resultVar2 != nil { 2951 span.LogFields(spanlog.Error(resultVar2)) 2952 ext.Error.Set(span, true) 2953 } 2954 2955 return resultVar0, resultVar1, resultVar2 2956 } 2957 2958 func (a *OpenTracingAppLayer) GetBranchStats(branchId string, restrictions *model.ViewUsersRestrictions) (*model.BranchStats, *model.AppError) { 2959 origCtx := a.ctx 2960 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchStats") 2961 2962 a.ctx = newCtx 2963 a.app.Srv().Store.SetContext(newCtx) 2964 defer func() { 2965 a.app.Srv().Store.SetContext(origCtx) 2966 a.ctx = origCtx 2967 }() 2968 2969 defer span.Finish() 2970 resultVar0, resultVar1 := a.app.GetBranchStats(branchId, restrictions) 2971 2972 if resultVar1 != nil { 2973 span.LogFields(spanlog.Error(resultVar1)) 2974 ext.Error.Set(span, true) 2975 } 2976 2977 return resultVar0, resultVar1 2978 } 2979 2980 func (a *OpenTracingAppLayer) GetBranchesForScheme(scheme *model.Scheme, offset int, limit int) ([]*model.Branch, *model.AppError) { 2981 origCtx := a.ctx 2982 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchesForScheme") 2983 2984 a.ctx = newCtx 2985 a.app.Srv().Store.SetContext(newCtx) 2986 defer func() { 2987 a.app.Srv().Store.SetContext(origCtx) 2988 a.ctx = origCtx 2989 }() 2990 2991 defer span.Finish() 2992 resultVar0, resultVar1 := a.app.GetBranchesForScheme(scheme, offset, limit) 2993 2994 if resultVar1 != nil { 2995 span.LogFields(spanlog.Error(resultVar1)) 2996 ext.Error.Set(span, true) 2997 } 2998 2999 return resultVar0, resultVar1 3000 } 3001 3002 func (a *OpenTracingAppLayer) GetBranchesForSchemePage(scheme *model.Scheme, page int, perPage int) ([]*model.Branch, *model.AppError) { 3003 origCtx := a.ctx 3004 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchesForSchemePage") 3005 3006 a.ctx = newCtx 3007 a.app.Srv().Store.SetContext(newCtx) 3008 defer func() { 3009 a.app.Srv().Store.SetContext(origCtx) 3010 a.ctx = origCtx 3011 }() 3012 3013 defer span.Finish() 3014 resultVar0, resultVar1 := a.app.GetBranchesForSchemePage(scheme, page, perPage) 3015 3016 if resultVar1 != nil { 3017 span.LogFields(spanlog.Error(resultVar1)) 3018 ext.Error.Set(span, true) 3019 } 3020 3021 return resultVar0, resultVar1 3022 } 3023 3024 func (a *OpenTracingAppLayer) GetBranchesForUser(userId string) ([]*model.Branch, *model.AppError) { 3025 origCtx := a.ctx 3026 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBranchesForUser") 3027 3028 a.ctx = newCtx 3029 a.app.Srv().Store.SetContext(newCtx) 3030 defer func() { 3031 a.app.Srv().Store.SetContext(origCtx) 3032 a.ctx = origCtx 3033 }() 3034 3035 defer span.Finish() 3036 resultVar0, resultVar1 := a.app.GetBranchesForUser(userId) 3037 3038 if resultVar1 != nil { 3039 span.LogFields(spanlog.Error(resultVar1)) 3040 ext.Error.Set(span, true) 3041 } 3042 3043 return resultVar0, resultVar1 3044 } 3045 3046 func (a *OpenTracingAppLayer) GetBrandImage() ([]byte, *model.AppError) { 3047 origCtx := a.ctx 3048 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBrandImage") 3049 3050 a.ctx = newCtx 3051 a.app.Srv().Store.SetContext(newCtx) 3052 defer func() { 3053 a.app.Srv().Store.SetContext(origCtx) 3054 a.ctx = origCtx 3055 }() 3056 3057 defer span.Finish() 3058 resultVar0, resultVar1 := a.app.GetBrandImage() 3059 3060 if resultVar1 != nil { 3061 span.LogFields(spanlog.Error(resultVar1)) 3062 ext.Error.Set(span, true) 3063 } 3064 3065 return resultVar0, resultVar1 3066 } 3067 3068 func (a *OpenTracingAppLayer) GetBulkReactionsForPosts(postIds []string) (map[string][]*model.Reaction, *model.AppError) { 3069 origCtx := a.ctx 3070 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetBulkReactionsForPosts") 3071 3072 a.ctx = newCtx 3073 a.app.Srv().Store.SetContext(newCtx) 3074 defer func() { 3075 a.app.Srv().Store.SetContext(origCtx) 3076 a.ctx = origCtx 3077 }() 3078 3079 defer span.Finish() 3080 resultVar0, resultVar1 := a.app.GetBulkReactionsForPosts(postIds) 3081 3082 if resultVar1 != nil { 3083 span.LogFields(spanlog.Error(resultVar1)) 3084 ext.Error.Set(span, true) 3085 } 3086 3087 return resultVar0, resultVar1 3088 } 3089 3090 func (a *OpenTracingAppLayer) GetClass(classId string) (*model.Class, *model.AppError) { 3091 origCtx := a.ctx 3092 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClass") 3093 3094 a.ctx = newCtx 3095 a.app.Srv().Store.SetContext(newCtx) 3096 defer func() { 3097 a.app.Srv().Store.SetContext(origCtx) 3098 a.ctx = origCtx 3099 }() 3100 3101 defer span.Finish() 3102 resultVar0, resultVar1 := a.app.GetClass(classId) 3103 3104 if resultVar1 != nil { 3105 span.LogFields(spanlog.Error(resultVar1)) 3106 ext.Error.Set(span, true) 3107 } 3108 3109 return resultVar0, resultVar1 3110 } 3111 3112 func (a *OpenTracingAppLayer) GetClassByName(className string, branchId string, includeDeleted bool) (*model.Class, *model.AppError) { 3113 origCtx := a.ctx 3114 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassByName") 3115 3116 a.ctx = newCtx 3117 a.app.Srv().Store.SetContext(newCtx) 3118 defer func() { 3119 a.app.Srv().Store.SetContext(origCtx) 3120 a.ctx = origCtx 3121 }() 3122 3123 defer span.Finish() 3124 resultVar0, resultVar1 := a.app.GetClassByName(className, branchId, includeDeleted) 3125 3126 if resultVar1 != nil { 3127 span.LogFields(spanlog.Error(resultVar1)) 3128 ext.Error.Set(span, true) 3129 } 3130 3131 return resultVar0, resultVar1 3132 } 3133 3134 func (a *OpenTracingAppLayer) GetClassByNameForBranchName(className string, branchName string, includeDeleted bool) (*model.Class, *model.AppError) { 3135 origCtx := a.ctx 3136 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassByNameForBranchName") 3137 3138 a.ctx = newCtx 3139 a.app.Srv().Store.SetContext(newCtx) 3140 defer func() { 3141 a.app.Srv().Store.SetContext(origCtx) 3142 a.ctx = origCtx 3143 }() 3144 3145 defer span.Finish() 3146 resultVar0, resultVar1 := a.app.GetClassByNameForBranchName(className, branchName, includeDeleted) 3147 3148 if resultVar1 != nil { 3149 span.LogFields(spanlog.Error(resultVar1)) 3150 ext.Error.Set(span, true) 3151 } 3152 3153 return resultVar0, resultVar1 3154 } 3155 3156 func (a *OpenTracingAppLayer) GetClassMember(classId string, userId string) (*model.ClassMember, *model.AppError) { 3157 origCtx := a.ctx 3158 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMember") 3159 3160 a.ctx = newCtx 3161 a.app.Srv().Store.SetContext(newCtx) 3162 defer func() { 3163 a.app.Srv().Store.SetContext(origCtx) 3164 a.ctx = origCtx 3165 }() 3166 3167 defer span.Finish() 3168 resultVar0, resultVar1 := a.app.GetClassMember(classId, userId) 3169 3170 if resultVar1 != nil { 3171 span.LogFields(spanlog.Error(resultVar1)) 3172 ext.Error.Set(span, true) 3173 } 3174 3175 return resultVar0, resultVar1 3176 } 3177 3178 func (a *OpenTracingAppLayer) GetClassMemberCount(classId string) (int64, *model.AppError) { 3179 origCtx := a.ctx 3180 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMemberCount") 3181 3182 a.ctx = newCtx 3183 a.app.Srv().Store.SetContext(newCtx) 3184 defer func() { 3185 a.app.Srv().Store.SetContext(origCtx) 3186 a.ctx = origCtx 3187 }() 3188 3189 defer span.Finish() 3190 resultVar0, resultVar1 := a.app.GetClassMemberCount(classId) 3191 3192 if resultVar1 != nil { 3193 span.LogFields(spanlog.Error(resultVar1)) 3194 ext.Error.Set(span, true) 3195 } 3196 3197 return resultVar0, resultVar1 3198 } 3199 3200 func (a *OpenTracingAppLayer) GetClassMembersByIds(classId string, userIds []string) (*model.ClassMembers, *model.AppError) { 3201 origCtx := a.ctx 3202 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMembersByIds") 3203 3204 a.ctx = newCtx 3205 a.app.Srv().Store.SetContext(newCtx) 3206 defer func() { 3207 a.app.Srv().Store.SetContext(origCtx) 3208 a.ctx = origCtx 3209 }() 3210 3211 defer span.Finish() 3212 resultVar0, resultVar1 := a.app.GetClassMembersByIds(classId, userIds) 3213 3214 if resultVar1 != nil { 3215 span.LogFields(spanlog.Error(resultVar1)) 3216 ext.Error.Set(span, true) 3217 } 3218 3219 return resultVar0, resultVar1 3220 } 3221 3222 func (a *OpenTracingAppLayer) GetClassMembersForUser(branchId string, userId string) (*model.ClassMembers, *model.AppError) { 3223 origCtx := a.ctx 3224 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMembersForUser") 3225 3226 a.ctx = newCtx 3227 a.app.Srv().Store.SetContext(newCtx) 3228 defer func() { 3229 a.app.Srv().Store.SetContext(origCtx) 3230 a.ctx = origCtx 3231 }() 3232 3233 defer span.Finish() 3234 resultVar0, resultVar1 := a.app.GetClassMembersForUser(branchId, userId) 3235 3236 if resultVar1 != nil { 3237 span.LogFields(spanlog.Error(resultVar1)) 3238 ext.Error.Set(span, true) 3239 } 3240 3241 return resultVar0, resultVar1 3242 } 3243 3244 func (a *OpenTracingAppLayer) GetClassMembersForUserWithPagination(branchId string, userId string, page int, perPage int) ([]*model.ClassMember, *model.AppError) { 3245 origCtx := a.ctx 3246 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMembersForUserWithPagination") 3247 3248 a.ctx = newCtx 3249 a.app.Srv().Store.SetContext(newCtx) 3250 defer func() { 3251 a.app.Srv().Store.SetContext(origCtx) 3252 a.ctx = origCtx 3253 }() 3254 3255 defer span.Finish() 3256 resultVar0, resultVar1 := a.app.GetClassMembersForUserWithPagination(branchId, userId, page, perPage) 3257 3258 if resultVar1 != nil { 3259 span.LogFields(spanlog.Error(resultVar1)) 3260 ext.Error.Set(span, true) 3261 } 3262 3263 return resultVar0, resultVar1 3264 } 3265 3266 func (a *OpenTracingAppLayer) GetClassMembersPage(classId string, page int, perPage int) (*model.ClassMembers, *model.AppError) { 3267 origCtx := a.ctx 3268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMembersPage") 3269 3270 a.ctx = newCtx 3271 a.app.Srv().Store.SetContext(newCtx) 3272 defer func() { 3273 a.app.Srv().Store.SetContext(origCtx) 3274 a.ctx = origCtx 3275 }() 3276 3277 defer span.Finish() 3278 resultVar0, resultVar1 := a.app.GetClassMembersPage(classId, page, perPage) 3279 3280 if resultVar1 != nil { 3281 span.LogFields(spanlog.Error(resultVar1)) 3282 ext.Error.Set(span, true) 3283 } 3284 3285 return resultVar0, resultVar1 3286 } 3287 3288 func (a *OpenTracingAppLayer) GetClassMembersTimezones(classId string) ([]string, *model.AppError) { 3289 origCtx := a.ctx 3290 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassMembersTimezones") 3291 3292 a.ctx = newCtx 3293 a.app.Srv().Store.SetContext(newCtx) 3294 defer func() { 3295 a.app.Srv().Store.SetContext(origCtx) 3296 a.ctx = origCtx 3297 }() 3298 3299 defer span.Finish() 3300 resultVar0, resultVar1 := a.app.GetClassMembersTimezones(classId) 3301 3302 if resultVar1 != nil { 3303 span.LogFields(spanlog.Error(resultVar1)) 3304 ext.Error.Set(span, true) 3305 } 3306 3307 return resultVar0, resultVar1 3308 } 3309 3310 func (a *OpenTracingAppLayer) GetClassModerationsForClass(class *model.Class) ([]*model.ClassModeration, *model.AppError) { 3311 origCtx := a.ctx 3312 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassModerationsForClass") 3313 3314 a.ctx = newCtx 3315 a.app.Srv().Store.SetContext(newCtx) 3316 defer func() { 3317 a.app.Srv().Store.SetContext(origCtx) 3318 a.ctx = origCtx 3319 }() 3320 3321 defer span.Finish() 3322 resultVar0, resultVar1 := a.app.GetClassModerationsForClass(class) 3323 3324 if resultVar1 != nil { 3325 span.LogFields(spanlog.Error(resultVar1)) 3326 ext.Error.Set(span, true) 3327 } 3328 3329 return resultVar0, resultVar1 3330 } 3331 3332 func (a *OpenTracingAppLayer) GetClassesByNames(classNames []string, branchId string) ([]*model.Class, *model.AppError) { 3333 origCtx := a.ctx 3334 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassesByNames") 3335 3336 a.ctx = newCtx 3337 a.app.Srv().Store.SetContext(newCtx) 3338 defer func() { 3339 a.app.Srv().Store.SetContext(origCtx) 3340 a.ctx = origCtx 3341 }() 3342 3343 defer span.Finish() 3344 resultVar0, resultVar1 := a.app.GetClassesByNames(classNames, branchId) 3345 3346 if resultVar1 != nil { 3347 span.LogFields(spanlog.Error(resultVar1)) 3348 ext.Error.Set(span, true) 3349 } 3350 3351 return resultVar0, resultVar1 3352 } 3353 3354 func (a *OpenTracingAppLayer) GetClassesForScheme(scheme *model.Scheme, offset int, limit int) (model.ClassList, *model.AppError) { 3355 origCtx := a.ctx 3356 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassesForScheme") 3357 3358 a.ctx = newCtx 3359 a.app.Srv().Store.SetContext(newCtx) 3360 defer func() { 3361 a.app.Srv().Store.SetContext(origCtx) 3362 a.ctx = origCtx 3363 }() 3364 3365 defer span.Finish() 3366 resultVar0, resultVar1 := a.app.GetClassesForScheme(scheme, offset, limit) 3367 3368 if resultVar1 != nil { 3369 span.LogFields(spanlog.Error(resultVar1)) 3370 ext.Error.Set(span, true) 3371 } 3372 3373 return resultVar0, resultVar1 3374 } 3375 3376 func (a *OpenTracingAppLayer) GetClassesForSchemePage(scheme *model.Scheme, page int, perPage int) (model.ClassList, *model.AppError) { 3377 origCtx := a.ctx 3378 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassesForSchemePage") 3379 3380 a.ctx = newCtx 3381 a.app.Srv().Store.SetContext(newCtx) 3382 defer func() { 3383 a.app.Srv().Store.SetContext(origCtx) 3384 a.ctx = origCtx 3385 }() 3386 3387 defer span.Finish() 3388 resultVar0, resultVar1 := a.app.GetClassesForSchemePage(scheme, page, perPage) 3389 3390 if resultVar1 != nil { 3391 span.LogFields(spanlog.Error(resultVar1)) 3392 ext.Error.Set(span, true) 3393 } 3394 3395 return resultVar0, resultVar1 3396 } 3397 3398 func (a *OpenTracingAppLayer) GetClassesForUser(branchId string, userId string, includeDeleted bool) (*model.ClassList, *model.AppError) { 3399 origCtx := a.ctx 3400 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassesForUser") 3401 3402 a.ctx = newCtx 3403 a.app.Srv().Store.SetContext(newCtx) 3404 defer func() { 3405 a.app.Srv().Store.SetContext(origCtx) 3406 a.ctx = origCtx 3407 }() 3408 3409 defer span.Finish() 3410 resultVar0, resultVar1 := a.app.GetClassesForUser(branchId, userId, includeDeleted) 3411 3412 if resultVar1 != nil { 3413 span.LogFields(spanlog.Error(resultVar1)) 3414 ext.Error.Set(span, true) 3415 } 3416 3417 return resultVar0, resultVar1 3418 } 3419 3420 func (a *OpenTracingAppLayer) GetClassesUserNotIn(branchId string, userId string, offset int, limit int) (*model.ClassList, *model.AppError) { 3421 origCtx := a.ctx 3422 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClassesUserNotIn") 3423 3424 a.ctx = newCtx 3425 a.app.Srv().Store.SetContext(newCtx) 3426 defer func() { 3427 a.app.Srv().Store.SetContext(origCtx) 3428 a.ctx = origCtx 3429 }() 3430 3431 defer span.Finish() 3432 resultVar0, resultVar1 := a.app.GetClassesUserNotIn(branchId, userId, offset, limit) 3433 3434 if resultVar1 != nil { 3435 span.LogFields(spanlog.Error(resultVar1)) 3436 ext.Error.Set(span, true) 3437 } 3438 3439 return resultVar0, resultVar1 3440 } 3441 3442 func (a *OpenTracingAppLayer) GetClusterId() string { 3443 origCtx := a.ctx 3444 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterId") 3445 3446 a.ctx = newCtx 3447 a.app.Srv().Store.SetContext(newCtx) 3448 defer func() { 3449 a.app.Srv().Store.SetContext(origCtx) 3450 a.ctx = origCtx 3451 }() 3452 3453 defer span.Finish() 3454 resultVar0 := a.app.GetClusterId() 3455 3456 return resultVar0 3457 } 3458 3459 func (a *OpenTracingAppLayer) GetClusterStatus() []*model.ClusterInfo { 3460 origCtx := a.ctx 3461 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetClusterStatus") 3462 3463 a.ctx = newCtx 3464 a.app.Srv().Store.SetContext(newCtx) 3465 defer func() { 3466 a.app.Srv().Store.SetContext(origCtx) 3467 a.ctx = origCtx 3468 }() 3469 3470 defer span.Finish() 3471 resultVar0 := a.app.GetClusterStatus() 3472 3473 return resultVar0 3474 } 3475 3476 func (a *OpenTracingAppLayer) GetCommand(commandId string) (*model.Command, *model.AppError) { 3477 origCtx := a.ctx 3478 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCommand") 3479 3480 a.ctx = newCtx 3481 a.app.Srv().Store.SetContext(newCtx) 3482 defer func() { 3483 a.app.Srv().Store.SetContext(origCtx) 3484 a.ctx = origCtx 3485 }() 3486 3487 defer span.Finish() 3488 resultVar0, resultVar1 := a.app.GetCommand(commandId) 3489 3490 if resultVar1 != nil { 3491 span.LogFields(spanlog.Error(resultVar1)) 3492 ext.Error.Set(span, true) 3493 } 3494 3495 return resultVar0, resultVar1 3496 } 3497 3498 func (a *OpenTracingAppLayer) GetComplianceFile(job *model.Compliance) ([]byte, *model.AppError) { 3499 origCtx := a.ctx 3500 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceFile") 3501 3502 a.ctx = newCtx 3503 a.app.Srv().Store.SetContext(newCtx) 3504 defer func() { 3505 a.app.Srv().Store.SetContext(origCtx) 3506 a.ctx = origCtx 3507 }() 3508 3509 defer span.Finish() 3510 resultVar0, resultVar1 := a.app.GetComplianceFile(job) 3511 3512 if resultVar1 != nil { 3513 span.LogFields(spanlog.Error(resultVar1)) 3514 ext.Error.Set(span, true) 3515 } 3516 3517 return resultVar0, resultVar1 3518 } 3519 3520 func (a *OpenTracingAppLayer) GetComplianceReport(reportId string) (*model.Compliance, *model.AppError) { 3521 origCtx := a.ctx 3522 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReport") 3523 3524 a.ctx = newCtx 3525 a.app.Srv().Store.SetContext(newCtx) 3526 defer func() { 3527 a.app.Srv().Store.SetContext(origCtx) 3528 a.ctx = origCtx 3529 }() 3530 3531 defer span.Finish() 3532 resultVar0, resultVar1 := a.app.GetComplianceReport(reportId) 3533 3534 if resultVar1 != nil { 3535 span.LogFields(spanlog.Error(resultVar1)) 3536 ext.Error.Set(span, true) 3537 } 3538 3539 return resultVar0, resultVar1 3540 } 3541 3542 func (a *OpenTracingAppLayer) GetComplianceReports(page int, perPage int) (model.Compliances, *model.AppError) { 3543 origCtx := a.ctx 3544 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetComplianceReports") 3545 3546 a.ctx = newCtx 3547 a.app.Srv().Store.SetContext(newCtx) 3548 defer func() { 3549 a.app.Srv().Store.SetContext(origCtx) 3550 a.ctx = origCtx 3551 }() 3552 3553 defer span.Finish() 3554 resultVar0, resultVar1 := a.app.GetComplianceReports(page, perPage) 3555 3556 if resultVar1 != nil { 3557 span.LogFields(spanlog.Error(resultVar1)) 3558 ext.Error.Set(span, true) 3559 } 3560 3561 return resultVar0, resultVar1 3562 } 3563 3564 func (a *OpenTracingAppLayer) GetConfigFile(name string) ([]byte, error) { 3565 origCtx := a.ctx 3566 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetConfigFile") 3567 3568 a.ctx = newCtx 3569 a.app.Srv().Store.SetContext(newCtx) 3570 defer func() { 3571 a.app.Srv().Store.SetContext(origCtx) 3572 a.ctx = origCtx 3573 }() 3574 3575 defer span.Finish() 3576 resultVar0, resultVar1 := a.app.GetConfigFile(name) 3577 3578 return resultVar0, resultVar1 3579 } 3580 3581 func (a *OpenTracingAppLayer) GetCookieDomain() string { 3582 origCtx := a.ctx 3583 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetCookieDomain") 3584 3585 a.ctx = newCtx 3586 a.app.Srv().Store.SetContext(newCtx) 3587 defer func() { 3588 a.app.Srv().Store.SetContext(origCtx) 3589 a.ctx = origCtx 3590 }() 3591 3592 defer span.Finish() 3593 resultVar0 := a.app.GetCookieDomain() 3594 3595 return resultVar0 3596 } 3597 3598 func (a *OpenTracingAppLayer) GetDataRetentionPolicy() (*model.DataRetentionPolicy, *model.AppError) { 3599 origCtx := a.ctx 3600 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDataRetentionPolicy") 3601 3602 a.ctx = newCtx 3603 a.app.Srv().Store.SetContext(newCtx) 3604 defer func() { 3605 a.app.Srv().Store.SetContext(origCtx) 3606 a.ctx = origCtx 3607 }() 3608 3609 defer span.Finish() 3610 resultVar0, resultVar1 := a.app.GetDataRetentionPolicy() 3611 3612 if resultVar1 != nil { 3613 span.LogFields(spanlog.Error(resultVar1)) 3614 ext.Error.Set(span, true) 3615 } 3616 3617 return resultVar0, resultVar1 3618 } 3619 3620 func (a *OpenTracingAppLayer) GetDefaultProfileImage(user *model.User) ([]byte, *model.AppError) { 3621 origCtx := a.ctx 3622 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDefaultProfileImage") 3623 3624 a.ctx = newCtx 3625 a.app.Srv().Store.SetContext(newCtx) 3626 defer func() { 3627 a.app.Srv().Store.SetContext(origCtx) 3628 a.ctx = origCtx 3629 }() 3630 3631 defer span.Finish() 3632 resultVar0, resultVar1 := a.app.GetDefaultProfileImage(user) 3633 3634 if resultVar1 != nil { 3635 span.LogFields(spanlog.Error(resultVar1)) 3636 ext.Error.Set(span, true) 3637 } 3638 3639 return resultVar0, resultVar1 3640 } 3641 3642 func (a *OpenTracingAppLayer) GetDeletedClasses(branchId string, offset int, limit int, userId string) (*model.ClassList, *model.AppError) { 3643 origCtx := a.ctx 3644 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetDeletedClasses") 3645 3646 a.ctx = newCtx 3647 a.app.Srv().Store.SetContext(newCtx) 3648 defer func() { 3649 a.app.Srv().Store.SetContext(origCtx) 3650 a.ctx = origCtx 3651 }() 3652 3653 defer span.Finish() 3654 resultVar0, resultVar1 := a.app.GetDeletedClasses(branchId, offset, limit, userId) 3655 3656 if resultVar1 != nil { 3657 span.LogFields(spanlog.Error(resultVar1)) 3658 ext.Error.Set(span, true) 3659 } 3660 3661 return resultVar0, resultVar1 3662 } 3663 3664 func (a *OpenTracingAppLayer) GetEmoji(emojiId string) (*model.Emoji, *model.AppError) { 3665 origCtx := a.ctx 3666 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmoji") 3667 3668 a.ctx = newCtx 3669 a.app.Srv().Store.SetContext(newCtx) 3670 defer func() { 3671 a.app.Srv().Store.SetContext(origCtx) 3672 a.ctx = origCtx 3673 }() 3674 3675 defer span.Finish() 3676 resultVar0, resultVar1 := a.app.GetEmoji(emojiId) 3677 3678 if resultVar1 != nil { 3679 span.LogFields(spanlog.Error(resultVar1)) 3680 ext.Error.Set(span, true) 3681 } 3682 3683 return resultVar0, resultVar1 3684 } 3685 3686 func (a *OpenTracingAppLayer) GetEmojiByName(emojiName string) (*model.Emoji, *model.AppError) { 3687 origCtx := a.ctx 3688 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiByName") 3689 3690 a.ctx = newCtx 3691 a.app.Srv().Store.SetContext(newCtx) 3692 defer func() { 3693 a.app.Srv().Store.SetContext(origCtx) 3694 a.ctx = origCtx 3695 }() 3696 3697 defer span.Finish() 3698 resultVar0, resultVar1 := a.app.GetEmojiByName(emojiName) 3699 3700 if resultVar1 != nil { 3701 span.LogFields(spanlog.Error(resultVar1)) 3702 ext.Error.Set(span, true) 3703 } 3704 3705 return resultVar0, resultVar1 3706 } 3707 3708 func (a *OpenTracingAppLayer) GetEmojiImage(emojiId string) ([]byte, string, *model.AppError) { 3709 origCtx := a.ctx 3710 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiImage") 3711 3712 a.ctx = newCtx 3713 a.app.Srv().Store.SetContext(newCtx) 3714 defer func() { 3715 a.app.Srv().Store.SetContext(origCtx) 3716 a.ctx = origCtx 3717 }() 3718 3719 defer span.Finish() 3720 resultVar0, resultVar1, resultVar2 := a.app.GetEmojiImage(emojiId) 3721 3722 if resultVar2 != nil { 3723 span.LogFields(spanlog.Error(resultVar2)) 3724 ext.Error.Set(span, true) 3725 } 3726 3727 return resultVar0, resultVar1, resultVar2 3728 } 3729 3730 func (a *OpenTracingAppLayer) GetEmojiList(page int, perPage int, sort string) ([]*model.Emoji, *model.AppError) { 3731 origCtx := a.ctx 3732 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiList") 3733 3734 a.ctx = newCtx 3735 a.app.Srv().Store.SetContext(newCtx) 3736 defer func() { 3737 a.app.Srv().Store.SetContext(origCtx) 3738 a.ctx = origCtx 3739 }() 3740 3741 defer span.Finish() 3742 resultVar0, resultVar1 := a.app.GetEmojiList(page, perPage, sort) 3743 3744 if resultVar1 != nil { 3745 span.LogFields(spanlog.Error(resultVar1)) 3746 ext.Error.Set(span, true) 3747 } 3748 3749 return resultVar0, resultVar1 3750 } 3751 3752 func (a *OpenTracingAppLayer) GetEmojiStaticUrl(emojiName string) (string, *model.AppError) { 3753 origCtx := a.ctx 3754 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEmojiStaticUrl") 3755 3756 a.ctx = newCtx 3757 a.app.Srv().Store.SetContext(newCtx) 3758 defer func() { 3759 a.app.Srv().Store.SetContext(origCtx) 3760 a.ctx = origCtx 3761 }() 3762 3763 defer span.Finish() 3764 resultVar0, resultVar1 := a.app.GetEmojiStaticUrl(emojiName) 3765 3766 if resultVar1 != nil { 3767 span.LogFields(spanlog.Error(resultVar1)) 3768 ext.Error.Set(span, true) 3769 } 3770 3771 return resultVar0, resultVar1 3772 } 3773 3774 func (a *OpenTracingAppLayer) GetEnvironmentConfig() map[string]interface{} { 3775 origCtx := a.ctx 3776 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetEnvironmentConfig") 3777 3778 a.ctx = newCtx 3779 a.app.Srv().Store.SetContext(newCtx) 3780 defer func() { 3781 a.app.Srv().Store.SetContext(origCtx) 3782 a.ctx = origCtx 3783 }() 3784 3785 defer span.Finish() 3786 resultVar0 := a.app.GetEnvironmentConfig() 3787 3788 return resultVar0 3789 } 3790 3791 func (a *OpenTracingAppLayer) GetFile(fileId string) ([]byte, *model.AppError) { 3792 origCtx := a.ctx 3793 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFile") 3794 3795 a.ctx = newCtx 3796 a.app.Srv().Store.SetContext(newCtx) 3797 defer func() { 3798 a.app.Srv().Store.SetContext(origCtx) 3799 a.ctx = origCtx 3800 }() 3801 3802 defer span.Finish() 3803 resultVar0, resultVar1 := a.app.GetFile(fileId) 3804 3805 if resultVar1 != nil { 3806 span.LogFields(spanlog.Error(resultVar1)) 3807 ext.Error.Set(span, true) 3808 } 3809 3810 return resultVar0, resultVar1 3811 } 3812 3813 func (a *OpenTracingAppLayer) GetFileInfo(fileId string) (*model.FileInfo, *model.AppError) { 3814 origCtx := a.ctx 3815 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfo") 3816 3817 a.ctx = newCtx 3818 a.app.Srv().Store.SetContext(newCtx) 3819 defer func() { 3820 a.app.Srv().Store.SetContext(origCtx) 3821 a.ctx = origCtx 3822 }() 3823 3824 defer span.Finish() 3825 resultVar0, resultVar1 := a.app.GetFileInfo(fileId) 3826 3827 if resultVar1 != nil { 3828 span.LogFields(spanlog.Error(resultVar1)) 3829 ext.Error.Set(span, true) 3830 } 3831 3832 return resultVar0, resultVar1 3833 } 3834 3835 func (a *OpenTracingAppLayer) GetFileInfos(page int, perPage int, opt *model.GetFileInfosOptions) ([]*model.FileInfo, *model.AppError) { 3836 origCtx := a.ctx 3837 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfos") 3838 3839 a.ctx = newCtx 3840 a.app.Srv().Store.SetContext(newCtx) 3841 defer func() { 3842 a.app.Srv().Store.SetContext(origCtx) 3843 a.ctx = origCtx 3844 }() 3845 3846 defer span.Finish() 3847 resultVar0, resultVar1 := a.app.GetFileInfos(page, perPage, opt) 3848 3849 if resultVar1 != nil { 3850 span.LogFields(spanlog.Error(resultVar1)) 3851 ext.Error.Set(span, true) 3852 } 3853 3854 return resultVar0, resultVar1 3855 } 3856 3857 func (a *OpenTracingAppLayer) GetFileInfosForPost(postId string, fromMaster bool) ([]*model.FileInfo, *model.AppError) { 3858 origCtx := a.ctx 3859 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPost") 3860 3861 a.ctx = newCtx 3862 a.app.Srv().Store.SetContext(newCtx) 3863 defer func() { 3864 a.app.Srv().Store.SetContext(origCtx) 3865 a.ctx = origCtx 3866 }() 3867 3868 defer span.Finish() 3869 resultVar0, resultVar1 := a.app.GetFileInfosForPost(postId, fromMaster) 3870 3871 if resultVar1 != nil { 3872 span.LogFields(spanlog.Error(resultVar1)) 3873 ext.Error.Set(span, true) 3874 } 3875 3876 return resultVar0, resultVar1 3877 } 3878 3879 func (a *OpenTracingAppLayer) GetFileInfosForPostWithMigration(postId string) ([]*model.FileInfo, *model.AppError) { 3880 origCtx := a.ctx 3881 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFileInfosForPostWithMigration") 3882 3883 a.ctx = newCtx 3884 a.app.Srv().Store.SetContext(newCtx) 3885 defer func() { 3886 a.app.Srv().Store.SetContext(origCtx) 3887 a.ctx = origCtx 3888 }() 3889 3890 defer span.Finish() 3891 resultVar0, resultVar1 := a.app.GetFileInfosForPostWithMigration(postId) 3892 3893 if resultVar1 != nil { 3894 span.LogFields(spanlog.Error(resultVar1)) 3895 ext.Error.Set(span, true) 3896 } 3897 3898 return resultVar0, resultVar1 3899 } 3900 3901 func (a *OpenTracingAppLayer) GetFlaggedPosts(userId string, offset int, limit int) (*model.PostList, *model.AppError) { 3902 origCtx := a.ctx 3903 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPosts") 3904 3905 a.ctx = newCtx 3906 a.app.Srv().Store.SetContext(newCtx) 3907 defer func() { 3908 a.app.Srv().Store.SetContext(origCtx) 3909 a.ctx = origCtx 3910 }() 3911 3912 defer span.Finish() 3913 resultVar0, resultVar1 := a.app.GetFlaggedPosts(userId, offset, limit) 3914 3915 if resultVar1 != nil { 3916 span.LogFields(spanlog.Error(resultVar1)) 3917 ext.Error.Set(span, true) 3918 } 3919 3920 return resultVar0, resultVar1 3921 } 3922 3923 func (a *OpenTracingAppLayer) GetFlaggedPostsForBranch(userId string, branchId string, offset int, limit int) (*model.PostList, *model.AppError) { 3924 origCtx := a.ctx 3925 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForBranch") 3926 3927 a.ctx = newCtx 3928 a.app.Srv().Store.SetContext(newCtx) 3929 defer func() { 3930 a.app.Srv().Store.SetContext(origCtx) 3931 a.ctx = origCtx 3932 }() 3933 3934 defer span.Finish() 3935 resultVar0, resultVar1 := a.app.GetFlaggedPostsForBranch(userId, branchId, offset, limit) 3936 3937 if resultVar1 != nil { 3938 span.LogFields(spanlog.Error(resultVar1)) 3939 ext.Error.Set(span, true) 3940 } 3941 3942 return resultVar0, resultVar1 3943 } 3944 3945 func (a *OpenTracingAppLayer) GetFlaggedPostsForClass(userId string, classId string, offset int, limit int) (*model.PostList, *model.AppError) { 3946 origCtx := a.ctx 3947 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetFlaggedPostsForClass") 3948 3949 a.ctx = newCtx 3950 a.app.Srv().Store.SetContext(newCtx) 3951 defer func() { 3952 a.app.Srv().Store.SetContext(origCtx) 3953 a.ctx = origCtx 3954 }() 3955 3956 defer span.Finish() 3957 resultVar0, resultVar1 := a.app.GetFlaggedPostsForClass(userId, classId, offset, limit) 3958 3959 if resultVar1 != nil { 3960 span.LogFields(spanlog.Error(resultVar1)) 3961 ext.Error.Set(span, true) 3962 } 3963 3964 return resultVar0, resultVar1 3965 } 3966 3967 func (a *OpenTracingAppLayer) GetHubForUserId(userId string) *Hub { 3968 origCtx := a.ctx 3969 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetHubForUserId") 3970 3971 a.ctx = newCtx 3972 a.app.Srv().Store.SetContext(newCtx) 3973 defer func() { 3974 a.app.Srv().Store.SetContext(origCtx) 3975 a.ctx = origCtx 3976 }() 3977 3978 defer span.Finish() 3979 resultVar0 := a.app.GetHubForUserId(userId) 3980 3981 return resultVar0 3982 } 3983 3984 func (a *OpenTracingAppLayer) GetJob(id string) (*model.Job, *model.AppError) { 3985 origCtx := a.ctx 3986 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJob") 3987 3988 a.ctx = newCtx 3989 a.app.Srv().Store.SetContext(newCtx) 3990 defer func() { 3991 a.app.Srv().Store.SetContext(origCtx) 3992 a.ctx = origCtx 3993 }() 3994 3995 defer span.Finish() 3996 resultVar0, resultVar1 := a.app.GetJob(id) 3997 3998 if resultVar1 != nil { 3999 span.LogFields(spanlog.Error(resultVar1)) 4000 ext.Error.Set(span, true) 4001 } 4002 4003 return resultVar0, resultVar1 4004 } 4005 4006 func (a *OpenTracingAppLayer) GetJobs(offset int, limit int) ([]*model.Job, *model.AppError) { 4007 origCtx := a.ctx 4008 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobs") 4009 4010 a.ctx = newCtx 4011 a.app.Srv().Store.SetContext(newCtx) 4012 defer func() { 4013 a.app.Srv().Store.SetContext(origCtx) 4014 a.ctx = origCtx 4015 }() 4016 4017 defer span.Finish() 4018 resultVar0, resultVar1 := a.app.GetJobs(offset, limit) 4019 4020 if resultVar1 != nil { 4021 span.LogFields(spanlog.Error(resultVar1)) 4022 ext.Error.Set(span, true) 4023 } 4024 4025 return resultVar0, resultVar1 4026 } 4027 4028 func (a *OpenTracingAppLayer) GetJobsByType(jobType string, offset int, limit int) ([]*model.Job, *model.AppError) { 4029 origCtx := a.ctx 4030 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByType") 4031 4032 a.ctx = newCtx 4033 a.app.Srv().Store.SetContext(newCtx) 4034 defer func() { 4035 a.app.Srv().Store.SetContext(origCtx) 4036 a.ctx = origCtx 4037 }() 4038 4039 defer span.Finish() 4040 resultVar0, resultVar1 := a.app.GetJobsByType(jobType, offset, limit) 4041 4042 if resultVar1 != nil { 4043 span.LogFields(spanlog.Error(resultVar1)) 4044 ext.Error.Set(span, true) 4045 } 4046 4047 return resultVar0, resultVar1 4048 } 4049 4050 func (a *OpenTracingAppLayer) GetJobsByTypePage(jobType string, page int, perPage int) ([]*model.Job, *model.AppError) { 4051 origCtx := a.ctx 4052 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsByTypePage") 4053 4054 a.ctx = newCtx 4055 a.app.Srv().Store.SetContext(newCtx) 4056 defer func() { 4057 a.app.Srv().Store.SetContext(origCtx) 4058 a.ctx = origCtx 4059 }() 4060 4061 defer span.Finish() 4062 resultVar0, resultVar1 := a.app.GetJobsByTypePage(jobType, page, perPage) 4063 4064 if resultVar1 != nil { 4065 span.LogFields(spanlog.Error(resultVar1)) 4066 ext.Error.Set(span, true) 4067 } 4068 4069 return resultVar0, resultVar1 4070 } 4071 4072 func (a *OpenTracingAppLayer) GetJobsPage(page int, perPage int) ([]*model.Job, *model.AppError) { 4073 origCtx := a.ctx 4074 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetJobsPage") 4075 4076 a.ctx = newCtx 4077 a.app.Srv().Store.SetContext(newCtx) 4078 defer func() { 4079 a.app.Srv().Store.SetContext(origCtx) 4080 a.ctx = origCtx 4081 }() 4082 4083 defer span.Finish() 4084 resultVar0, resultVar1 := a.app.GetJobsPage(page, perPage) 4085 4086 if resultVar1 != nil { 4087 span.LogFields(spanlog.Error(resultVar1)) 4088 ext.Error.Set(span, true) 4089 } 4090 4091 return resultVar0, resultVar1 4092 } 4093 4094 func (a *OpenTracingAppLayer) GetLatestTermsOfService() (*model.TermsOfService, *model.AppError) { 4095 origCtx := a.ctx 4096 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLatestTermsOfService") 4097 4098 a.ctx = newCtx 4099 a.app.Srv().Store.SetContext(newCtx) 4100 defer func() { 4101 a.app.Srv().Store.SetContext(origCtx) 4102 a.ctx = origCtx 4103 }() 4104 4105 defer span.Finish() 4106 resultVar0, resultVar1 := a.app.GetLatestTermsOfService() 4107 4108 if resultVar1 != nil { 4109 span.LogFields(spanlog.Error(resultVar1)) 4110 ext.Error.Set(span, true) 4111 } 4112 4113 return resultVar0, resultVar1 4114 } 4115 4116 func (a *OpenTracingAppLayer) GetLogs(page int, perPage int) ([]string, *model.AppError) { 4117 origCtx := a.ctx 4118 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogs") 4119 4120 a.ctx = newCtx 4121 a.app.Srv().Store.SetContext(newCtx) 4122 defer func() { 4123 a.app.Srv().Store.SetContext(origCtx) 4124 a.ctx = origCtx 4125 }() 4126 4127 defer span.Finish() 4128 resultVar0, resultVar1 := a.app.GetLogs(page, perPage) 4129 4130 if resultVar1 != nil { 4131 span.LogFields(spanlog.Error(resultVar1)) 4132 ext.Error.Set(span, true) 4133 } 4134 4135 return resultVar0, resultVar1 4136 } 4137 4138 func (a *OpenTracingAppLayer) GetLogsSkipSend(page int, perPage int) ([]string, *model.AppError) { 4139 origCtx := a.ctx 4140 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetLogsSkipSend") 4141 4142 a.ctx = newCtx 4143 a.app.Srv().Store.SetContext(newCtx) 4144 defer func() { 4145 a.app.Srv().Store.SetContext(origCtx) 4146 a.ctx = origCtx 4147 }() 4148 4149 defer span.Finish() 4150 resultVar0, resultVar1 := a.app.GetLogsSkipSend(page, perPage) 4151 4152 if resultVar1 != nil { 4153 span.LogFields(spanlog.Error(resultVar1)) 4154 ext.Error.Set(span, true) 4155 } 4156 4157 return resultVar0, resultVar1 4158 } 4159 4160 func (a *OpenTracingAppLayer) GetMessageForNotification(post *model.Post, translateFunc i18n.TranslateFunc) string { 4161 origCtx := a.ctx 4162 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMessageForNotification") 4163 4164 a.ctx = newCtx 4165 a.app.Srv().Store.SetContext(newCtx) 4166 defer func() { 4167 a.app.Srv().Store.SetContext(origCtx) 4168 a.ctx = origCtx 4169 }() 4170 4171 defer span.Finish() 4172 resultVar0 := a.app.GetMessageForNotification(post, translateFunc) 4173 4174 return resultVar0 4175 } 4176 4177 func (a *OpenTracingAppLayer) GetMultipleEmojiByName(names []string) ([]*model.Emoji, *model.AppError) { 4178 origCtx := a.ctx 4179 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetMultipleEmojiByName") 4180 4181 a.ctx = newCtx 4182 a.app.Srv().Store.SetContext(newCtx) 4183 defer func() { 4184 a.app.Srv().Store.SetContext(origCtx) 4185 a.ctx = origCtx 4186 }() 4187 4188 defer span.Finish() 4189 resultVar0, resultVar1 := a.app.GetMultipleEmojiByName(names) 4190 4191 if resultVar1 != nil { 4192 span.LogFields(spanlog.Error(resultVar1)) 4193 ext.Error.Set(span, true) 4194 } 4195 4196 return resultVar0, resultVar1 4197 } 4198 4199 func (a *OpenTracingAppLayer) GetNewUsersForBranchPage(branchId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 4200 origCtx := a.ctx 4201 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNewUsersForBranchPage") 4202 4203 a.ctx = newCtx 4204 a.app.Srv().Store.SetContext(newCtx) 4205 defer func() { 4206 a.app.Srv().Store.SetContext(origCtx) 4207 a.ctx = origCtx 4208 }() 4209 4210 defer span.Finish() 4211 resultVar0, resultVar1 := a.app.GetNewUsersForBranchPage(branchId, page, perPage, asAdmin, viewRestrictions) 4212 4213 if resultVar1 != nil { 4214 span.LogFields(spanlog.Error(resultVar1)) 4215 ext.Error.Set(span, true) 4216 } 4217 4218 return resultVar0, resultVar1 4219 } 4220 4221 func (a *OpenTracingAppLayer) GetNextPostIdFromPostList(postList *model.PostList) string { 4222 origCtx := a.ctx 4223 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNextPostIdFromPostList") 4224 4225 a.ctx = newCtx 4226 a.app.Srv().Store.SetContext(newCtx) 4227 defer func() { 4228 a.app.Srv().Store.SetContext(origCtx) 4229 a.ctx = origCtx 4230 }() 4231 4232 defer span.Finish() 4233 resultVar0 := a.app.GetNextPostIdFromPostList(postList) 4234 4235 return resultVar0 4236 } 4237 4238 func (a *OpenTracingAppLayer) GetNotificationNameFormat(user *model.User) string { 4239 origCtx := a.ctx 4240 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNotificationNameFormat") 4241 4242 a.ctx = newCtx 4243 a.app.Srv().Store.SetContext(newCtx) 4244 defer func() { 4245 a.app.Srv().Store.SetContext(origCtx) 4246 a.ctx = origCtx 4247 }() 4248 4249 defer span.Finish() 4250 resultVar0 := a.app.GetNotificationNameFormat(user) 4251 4252 return resultVar0 4253 } 4254 4255 func (a *OpenTracingAppLayer) GetNumberOfClassesOnBranch(branchId string) (int, *model.AppError) { 4256 origCtx := a.ctx 4257 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetNumberOfClassesOnBranch") 4258 4259 a.ctx = newCtx 4260 a.app.Srv().Store.SetContext(newCtx) 4261 defer func() { 4262 a.app.Srv().Store.SetContext(origCtx) 4263 a.ctx = origCtx 4264 }() 4265 4266 defer span.Finish() 4267 resultVar0, resultVar1 := a.app.GetNumberOfClassesOnBranch(branchId) 4268 4269 if resultVar1 != nil { 4270 span.LogFields(spanlog.Error(resultVar1)) 4271 ext.Error.Set(span, true) 4272 } 4273 4274 return resultVar0, resultVar1 4275 } 4276 4277 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForCodeFlow(clientId string, grantType string, redirectUri string, code string, secret string, refreshToken string) (*model.AccessResponse, *model.AppError) { 4278 origCtx := a.ctx 4279 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForCodeFlow") 4280 4281 a.ctx = newCtx 4282 a.app.Srv().Store.SetContext(newCtx) 4283 defer func() { 4284 a.app.Srv().Store.SetContext(origCtx) 4285 a.ctx = origCtx 4286 }() 4287 4288 defer span.Finish() 4289 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForCodeFlow(clientId, grantType, redirectUri, code, secret, refreshToken) 4290 4291 if resultVar1 != nil { 4292 span.LogFields(spanlog.Error(resultVar1)) 4293 ext.Error.Set(span, true) 4294 } 4295 4296 return resultVar0, resultVar1 4297 } 4298 4299 func (a *OpenTracingAppLayer) GetOAuthAccessTokenForImplicitFlow(userId string, authRequest *model.AuthorizeRequest) (*model.Session, *model.AppError) { 4300 origCtx := a.ctx 4301 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAccessTokenForImplicitFlow") 4302 4303 a.ctx = newCtx 4304 a.app.Srv().Store.SetContext(newCtx) 4305 defer func() { 4306 a.app.Srv().Store.SetContext(origCtx) 4307 a.ctx = origCtx 4308 }() 4309 4310 defer span.Finish() 4311 resultVar0, resultVar1 := a.app.GetOAuthAccessTokenForImplicitFlow(userId, authRequest) 4312 4313 if resultVar1 != nil { 4314 span.LogFields(spanlog.Error(resultVar1)) 4315 ext.Error.Set(span, true) 4316 } 4317 4318 return resultVar0, resultVar1 4319 } 4320 4321 func (a *OpenTracingAppLayer) GetOAuthApp(appId string) (*model.OAuthApp, *model.AppError) { 4322 origCtx := a.ctx 4323 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApp") 4324 4325 a.ctx = newCtx 4326 a.app.Srv().Store.SetContext(newCtx) 4327 defer func() { 4328 a.app.Srv().Store.SetContext(origCtx) 4329 a.ctx = origCtx 4330 }() 4331 4332 defer span.Finish() 4333 resultVar0, resultVar1 := a.app.GetOAuthApp(appId) 4334 4335 if resultVar1 != nil { 4336 span.LogFields(spanlog.Error(resultVar1)) 4337 ext.Error.Set(span, true) 4338 } 4339 4340 return resultVar0, resultVar1 4341 } 4342 4343 func (a *OpenTracingAppLayer) GetOAuthApps(page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 4344 origCtx := a.ctx 4345 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthApps") 4346 4347 a.ctx = newCtx 4348 a.app.Srv().Store.SetContext(newCtx) 4349 defer func() { 4350 a.app.Srv().Store.SetContext(origCtx) 4351 a.ctx = origCtx 4352 }() 4353 4354 defer span.Finish() 4355 resultVar0, resultVar1 := a.app.GetOAuthApps(page, perPage) 4356 4357 if resultVar1 != nil { 4358 span.LogFields(spanlog.Error(resultVar1)) 4359 ext.Error.Set(span, true) 4360 } 4361 4362 return resultVar0, resultVar1 4363 } 4364 4365 func (a *OpenTracingAppLayer) GetOAuthAppsByCreator(userId string, page int, perPage int) ([]*model.OAuthApp, *model.AppError) { 4366 origCtx := a.ctx 4367 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthAppsByCreator") 4368 4369 a.ctx = newCtx 4370 a.app.Srv().Store.SetContext(newCtx) 4371 defer func() { 4372 a.app.Srv().Store.SetContext(origCtx) 4373 a.ctx = origCtx 4374 }() 4375 4376 defer span.Finish() 4377 resultVar0, resultVar1 := a.app.GetOAuthAppsByCreator(userId, page, perPage) 4378 4379 if resultVar1 != nil { 4380 span.LogFields(spanlog.Error(resultVar1)) 4381 ext.Error.Set(span, true) 4382 } 4383 4384 return resultVar0, resultVar1 4385 } 4386 4387 func (a *OpenTracingAppLayer) GetOAuthCodeRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 4388 origCtx := a.ctx 4389 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthCodeRedirect") 4390 4391 a.ctx = newCtx 4392 a.app.Srv().Store.SetContext(newCtx) 4393 defer func() { 4394 a.app.Srv().Store.SetContext(origCtx) 4395 a.ctx = origCtx 4396 }() 4397 4398 defer span.Finish() 4399 resultVar0, resultVar1 := a.app.GetOAuthCodeRedirect(userId, authRequest) 4400 4401 if resultVar1 != nil { 4402 span.LogFields(spanlog.Error(resultVar1)) 4403 ext.Error.Set(span, true) 4404 } 4405 4406 return resultVar0, resultVar1 4407 } 4408 4409 func (a *OpenTracingAppLayer) GetOAuthImplicitRedirect(userId string, authRequest *model.AuthorizeRequest) (string, *model.AppError) { 4410 origCtx := a.ctx 4411 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthImplicitRedirect") 4412 4413 a.ctx = newCtx 4414 a.app.Srv().Store.SetContext(newCtx) 4415 defer func() { 4416 a.app.Srv().Store.SetContext(origCtx) 4417 a.ctx = origCtx 4418 }() 4419 4420 defer span.Finish() 4421 resultVar0, resultVar1 := a.app.GetOAuthImplicitRedirect(userId, authRequest) 4422 4423 if resultVar1 != nil { 4424 span.LogFields(spanlog.Error(resultVar1)) 4425 ext.Error.Set(span, true) 4426 } 4427 4428 return resultVar0, resultVar1 4429 } 4430 4431 func (a *OpenTracingAppLayer) GetOAuthLoginEndpoint(w http.ResponseWriter, r *http.Request, service string, branchId string, action string, redirectTo string, loginHint string) (string, *model.AppError) { 4432 origCtx := a.ctx 4433 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthLoginEndpoint") 4434 4435 a.ctx = newCtx 4436 a.app.Srv().Store.SetContext(newCtx) 4437 defer func() { 4438 a.app.Srv().Store.SetContext(origCtx) 4439 a.ctx = origCtx 4440 }() 4441 4442 defer span.Finish() 4443 resultVar0, resultVar1 := a.app.GetOAuthLoginEndpoint(w, r, service, branchId, action, redirectTo, loginHint) 4444 4445 if resultVar1 != nil { 4446 span.LogFields(spanlog.Error(resultVar1)) 4447 ext.Error.Set(span, true) 4448 } 4449 4450 return resultVar0, resultVar1 4451 } 4452 4453 func (a *OpenTracingAppLayer) GetOAuthSignupEndpoint(w http.ResponseWriter, r *http.Request, service string, branchId string) (string, *model.AppError) { 4454 origCtx := a.ctx 4455 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthSignupEndpoint") 4456 4457 a.ctx = newCtx 4458 a.app.Srv().Store.SetContext(newCtx) 4459 defer func() { 4460 a.app.Srv().Store.SetContext(origCtx) 4461 a.ctx = origCtx 4462 }() 4463 4464 defer span.Finish() 4465 resultVar0, resultVar1 := a.app.GetOAuthSignupEndpoint(w, r, service, branchId) 4466 4467 if resultVar1 != nil { 4468 span.LogFields(spanlog.Error(resultVar1)) 4469 ext.Error.Set(span, true) 4470 } 4471 4472 return resultVar0, resultVar1 4473 } 4474 4475 func (a *OpenTracingAppLayer) GetOAuthStateToken(token string) (*model.Token, *model.AppError) { 4476 origCtx := a.ctx 4477 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOAuthStateToken") 4478 4479 a.ctx = newCtx 4480 a.app.Srv().Store.SetContext(newCtx) 4481 defer func() { 4482 a.app.Srv().Store.SetContext(origCtx) 4483 a.ctx = origCtx 4484 }() 4485 4486 defer span.Finish() 4487 resultVar0, resultVar1 := a.app.GetOAuthStateToken(token) 4488 4489 if resultVar1 != nil { 4490 span.LogFields(spanlog.Error(resultVar1)) 4491 ext.Error.Set(span, true) 4492 } 4493 4494 return resultVar0, resultVar1 4495 } 4496 4497 func (a *OpenTracingAppLayer) GetOpenGraphMetadata(requestURL string) *opengraph.OpenGraph { 4498 origCtx := a.ctx 4499 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetOpenGraphMetadata") 4500 4501 a.ctx = newCtx 4502 a.app.Srv().Store.SetContext(newCtx) 4503 defer func() { 4504 a.app.Srv().Store.SetContext(origCtx) 4505 a.ctx = origCtx 4506 }() 4507 4508 defer span.Finish() 4509 resultVar0 := a.app.GetOpenGraphMetadata(requestURL) 4510 4511 return resultVar0 4512 } 4513 4514 func (a *OpenTracingAppLayer) GetPasswordRecoveryToken(token string) (*model.Token, *model.AppError) { 4515 origCtx := a.ctx 4516 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPasswordRecoveryToken") 4517 4518 a.ctx = newCtx 4519 a.app.Srv().Store.SetContext(newCtx) 4520 defer func() { 4521 a.app.Srv().Store.SetContext(origCtx) 4522 a.ctx = origCtx 4523 }() 4524 4525 defer span.Finish() 4526 resultVar0, resultVar1 := a.app.GetPasswordRecoveryToken(token) 4527 4528 if resultVar1 != nil { 4529 span.LogFields(spanlog.Error(resultVar1)) 4530 ext.Error.Set(span, true) 4531 } 4532 4533 return resultVar0, resultVar1 4534 } 4535 4536 func (a *OpenTracingAppLayer) GetPermalinkPost(postId string, userId string) (*model.PostList, *model.AppError) { 4537 origCtx := a.ctx 4538 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPermalinkPost") 4539 4540 a.ctx = newCtx 4541 a.app.Srv().Store.SetContext(newCtx) 4542 defer func() { 4543 a.app.Srv().Store.SetContext(origCtx) 4544 a.ctx = origCtx 4545 }() 4546 4547 defer span.Finish() 4548 resultVar0, resultVar1 := a.app.GetPermalinkPost(postId, userId) 4549 4550 if resultVar1 != nil { 4551 span.LogFields(spanlog.Error(resultVar1)) 4552 ext.Error.Set(span, true) 4553 } 4554 4555 return resultVar0, resultVar1 4556 } 4557 4558 func (a *OpenTracingAppLayer) GetPostAfterTime(classId string, time int64) (*model.Post, *model.AppError) { 4559 origCtx := a.ctx 4560 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostAfterTime") 4561 4562 a.ctx = newCtx 4563 a.app.Srv().Store.SetContext(newCtx) 4564 defer func() { 4565 a.app.Srv().Store.SetContext(origCtx) 4566 a.ctx = origCtx 4567 }() 4568 4569 defer span.Finish() 4570 resultVar0, resultVar1 := a.app.GetPostAfterTime(classId, time) 4571 4572 if resultVar1 != nil { 4573 span.LogFields(spanlog.Error(resultVar1)) 4574 ext.Error.Set(span, true) 4575 } 4576 4577 return resultVar0, resultVar1 4578 } 4579 4580 func (a *OpenTracingAppLayer) GetPostIdAfterTime(classId string, time int64) (string, *model.AppError) { 4581 origCtx := a.ctx 4582 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdAfterTime") 4583 4584 a.ctx = newCtx 4585 a.app.Srv().Store.SetContext(newCtx) 4586 defer func() { 4587 a.app.Srv().Store.SetContext(origCtx) 4588 a.ctx = origCtx 4589 }() 4590 4591 defer span.Finish() 4592 resultVar0, resultVar1 := a.app.GetPostIdAfterTime(classId, time) 4593 4594 if resultVar1 != nil { 4595 span.LogFields(spanlog.Error(resultVar1)) 4596 ext.Error.Set(span, true) 4597 } 4598 4599 return resultVar0, resultVar1 4600 } 4601 4602 func (a *OpenTracingAppLayer) GetPostIdBeforeTime(classId string, time int64) (string, *model.AppError) { 4603 origCtx := a.ctx 4604 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostIdBeforeTime") 4605 4606 a.ctx = newCtx 4607 a.app.Srv().Store.SetContext(newCtx) 4608 defer func() { 4609 a.app.Srv().Store.SetContext(origCtx) 4610 a.ctx = origCtx 4611 }() 4612 4613 defer span.Finish() 4614 resultVar0, resultVar1 := a.app.GetPostIdBeforeTime(classId, time) 4615 4616 if resultVar1 != nil { 4617 span.LogFields(spanlog.Error(resultVar1)) 4618 ext.Error.Set(span, true) 4619 } 4620 4621 return resultVar0, resultVar1 4622 } 4623 4624 func (a *OpenTracingAppLayer) GetPosts(classId string, offset int, limit int) (*model.PostList, *model.AppError) { 4625 origCtx := a.ctx 4626 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPosts") 4627 4628 a.ctx = newCtx 4629 a.app.Srv().Store.SetContext(newCtx) 4630 defer func() { 4631 a.app.Srv().Store.SetContext(origCtx) 4632 a.ctx = origCtx 4633 }() 4634 4635 defer span.Finish() 4636 resultVar0, resultVar1 := a.app.GetPosts(classId, offset, limit) 4637 4638 if resultVar1 != nil { 4639 span.LogFields(spanlog.Error(resultVar1)) 4640 ext.Error.Set(span, true) 4641 } 4642 4643 return resultVar0, resultVar1 4644 } 4645 4646 func (a *OpenTracingAppLayer) GetPostsAfterPost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 4647 origCtx := a.ctx 4648 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAfterPost") 4649 4650 a.ctx = newCtx 4651 a.app.Srv().Store.SetContext(newCtx) 4652 defer func() { 4653 a.app.Srv().Store.SetContext(origCtx) 4654 a.ctx = origCtx 4655 }() 4656 4657 defer span.Finish() 4658 resultVar0, resultVar1 := a.app.GetPostsAfterPost(options) 4659 4660 if resultVar1 != nil { 4661 span.LogFields(spanlog.Error(resultVar1)) 4662 ext.Error.Set(span, true) 4663 } 4664 4665 return resultVar0, resultVar1 4666 } 4667 4668 func (a *OpenTracingAppLayer) GetPostsAroundPost(before bool, options model.GetPostsOptions) (*model.PostList, *model.AppError) { 4669 origCtx := a.ctx 4670 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsAroundPost") 4671 4672 a.ctx = newCtx 4673 a.app.Srv().Store.SetContext(newCtx) 4674 defer func() { 4675 a.app.Srv().Store.SetContext(origCtx) 4676 a.ctx = origCtx 4677 }() 4678 4679 defer span.Finish() 4680 resultVar0, resultVar1 := a.app.GetPostsAroundPost(before, options) 4681 4682 if resultVar1 != nil { 4683 span.LogFields(spanlog.Error(resultVar1)) 4684 ext.Error.Set(span, true) 4685 } 4686 4687 return resultVar0, resultVar1 4688 } 4689 4690 func (a *OpenTracingAppLayer) GetPostsBeforePost(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 4691 origCtx := a.ctx 4692 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsBeforePost") 4693 4694 a.ctx = newCtx 4695 a.app.Srv().Store.SetContext(newCtx) 4696 defer func() { 4697 a.app.Srv().Store.SetContext(origCtx) 4698 a.ctx = origCtx 4699 }() 4700 4701 defer span.Finish() 4702 resultVar0, resultVar1 := a.app.GetPostsBeforePost(options) 4703 4704 if resultVar1 != nil { 4705 span.LogFields(spanlog.Error(resultVar1)) 4706 ext.Error.Set(span, true) 4707 } 4708 4709 return resultVar0, resultVar1 4710 } 4711 4712 func (a *OpenTracingAppLayer) GetPostsEtag(classId string) string { 4713 origCtx := a.ctx 4714 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsEtag") 4715 4716 a.ctx = newCtx 4717 a.app.Srv().Store.SetContext(newCtx) 4718 defer func() { 4719 a.app.Srv().Store.SetContext(origCtx) 4720 a.ctx = origCtx 4721 }() 4722 4723 defer span.Finish() 4724 resultVar0 := a.app.GetPostsEtag(classId) 4725 4726 return resultVar0 4727 } 4728 4729 func (a *OpenTracingAppLayer) GetPostsPage(options model.GetPostsOptions) (*model.PostList, *model.AppError) { 4730 origCtx := a.ctx 4731 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsPage") 4732 4733 a.ctx = newCtx 4734 a.app.Srv().Store.SetContext(newCtx) 4735 defer func() { 4736 a.app.Srv().Store.SetContext(origCtx) 4737 a.ctx = origCtx 4738 }() 4739 4740 defer span.Finish() 4741 resultVar0, resultVar1 := a.app.GetPostsPage(options) 4742 4743 if resultVar1 != nil { 4744 span.LogFields(spanlog.Error(resultVar1)) 4745 ext.Error.Set(span, true) 4746 } 4747 4748 return resultVar0, resultVar1 4749 } 4750 4751 func (a *OpenTracingAppLayer) GetPostsSince(options model.GetPostsSinceOptions) (*model.PostList, *model.AppError) { 4752 origCtx := a.ctx 4753 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPostsSince") 4754 4755 a.ctx = newCtx 4756 a.app.Srv().Store.SetContext(newCtx) 4757 defer func() { 4758 a.app.Srv().Store.SetContext(origCtx) 4759 a.ctx = origCtx 4760 }() 4761 4762 defer span.Finish() 4763 resultVar0, resultVar1 := a.app.GetPostsSince(options) 4764 4765 if resultVar1 != nil { 4766 span.LogFields(spanlog.Error(resultVar1)) 4767 ext.Error.Set(span, true) 4768 } 4769 4770 return resultVar0, resultVar1 4771 } 4772 4773 func (a *OpenTracingAppLayer) GetPreferenceByCategoryAndNameForUser(userId string, category string, preferenceName string) (*model.Preference, *model.AppError) { 4774 origCtx := a.ctx 4775 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryAndNameForUser") 4776 4777 a.ctx = newCtx 4778 a.app.Srv().Store.SetContext(newCtx) 4779 defer func() { 4780 a.app.Srv().Store.SetContext(origCtx) 4781 a.ctx = origCtx 4782 }() 4783 4784 defer span.Finish() 4785 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryAndNameForUser(userId, category, preferenceName) 4786 4787 if resultVar1 != nil { 4788 span.LogFields(spanlog.Error(resultVar1)) 4789 ext.Error.Set(span, true) 4790 } 4791 4792 return resultVar0, resultVar1 4793 } 4794 4795 func (a *OpenTracingAppLayer) GetPreferenceByCategoryForUser(userId string, category string) (model.Preferences, *model.AppError) { 4796 origCtx := a.ctx 4797 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferenceByCategoryForUser") 4798 4799 a.ctx = newCtx 4800 a.app.Srv().Store.SetContext(newCtx) 4801 defer func() { 4802 a.app.Srv().Store.SetContext(origCtx) 4803 a.ctx = origCtx 4804 }() 4805 4806 defer span.Finish() 4807 resultVar0, resultVar1 := a.app.GetPreferenceByCategoryForUser(userId, category) 4808 4809 if resultVar1 != nil { 4810 span.LogFields(spanlog.Error(resultVar1)) 4811 ext.Error.Set(span, true) 4812 } 4813 4814 return resultVar0, resultVar1 4815 } 4816 4817 func (a *OpenTracingAppLayer) GetPreferencesForUser(userId string) (model.Preferences, *model.AppError) { 4818 origCtx := a.ctx 4819 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPreferencesForUser") 4820 4821 a.ctx = newCtx 4822 a.app.Srv().Store.SetContext(newCtx) 4823 defer func() { 4824 a.app.Srv().Store.SetContext(origCtx) 4825 a.ctx = origCtx 4826 }() 4827 4828 defer span.Finish() 4829 resultVar0, resultVar1 := a.app.GetPreferencesForUser(userId) 4830 4831 if resultVar1 != nil { 4832 span.LogFields(spanlog.Error(resultVar1)) 4833 ext.Error.Set(span, true) 4834 } 4835 4836 return resultVar0, resultVar1 4837 } 4838 4839 func (a *OpenTracingAppLayer) GetPrevPostIdFromPostList(postList *model.PostList) string { 4840 origCtx := a.ctx 4841 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetPrevPostIdFromPostList") 4842 4843 a.ctx = newCtx 4844 a.app.Srv().Store.SetContext(newCtx) 4845 defer func() { 4846 a.app.Srv().Store.SetContext(origCtx) 4847 a.ctx = origCtx 4848 }() 4849 4850 defer span.Finish() 4851 resultVar0 := a.app.GetPrevPostIdFromPostList(postList) 4852 4853 return resultVar0 4854 } 4855 4856 func (a *OpenTracingAppLayer) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) { 4857 origCtx := a.ctx 4858 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetProfileImage") 4859 4860 a.ctx = newCtx 4861 a.app.Srv().Store.SetContext(newCtx) 4862 defer func() { 4863 a.app.Srv().Store.SetContext(origCtx) 4864 a.ctx = origCtx 4865 }() 4866 4867 defer span.Finish() 4868 resultVar0, resultVar1, resultVar2 := a.app.GetProfileImage(user) 4869 4870 if resultVar2 != nil { 4871 span.LogFields(spanlog.Error(resultVar2)) 4872 ext.Error.Set(span, true) 4873 } 4874 4875 return resultVar0, resultVar1, resultVar2 4876 } 4877 4878 func (a *OpenTracingAppLayer) GetReactionsForPost(postId string) ([]*model.Reaction, *model.AppError) { 4879 origCtx := a.ctx 4880 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetReactionsForPost") 4881 4882 a.ctx = newCtx 4883 a.app.Srv().Store.SetContext(newCtx) 4884 defer func() { 4885 a.app.Srv().Store.SetContext(origCtx) 4886 a.ctx = origCtx 4887 }() 4888 4889 defer span.Finish() 4890 resultVar0, resultVar1 := a.app.GetReactionsForPost(postId) 4891 4892 if resultVar1 != nil { 4893 span.LogFields(spanlog.Error(resultVar1)) 4894 ext.Error.Set(span, true) 4895 } 4896 4897 return resultVar0, resultVar1 4898 } 4899 4900 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForBranch(branchId string) (map[string]*model.User, *model.AppError) { 4901 origCtx := a.ctx 4902 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForBranch") 4903 4904 a.ctx = newCtx 4905 a.app.Srv().Store.SetContext(newCtx) 4906 defer func() { 4907 a.app.Srv().Store.SetContext(origCtx) 4908 a.ctx = origCtx 4909 }() 4910 4911 defer span.Finish() 4912 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForBranch(branchId) 4913 4914 if resultVar1 != nil { 4915 span.LogFields(spanlog.Error(resultVar1)) 4916 ext.Error.Set(span, true) 4917 } 4918 4919 return resultVar0, resultVar1 4920 } 4921 4922 func (a *OpenTracingAppLayer) GetRecentlyActiveUsersForBranchPage(branchId string, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 4923 origCtx := a.ctx 4924 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRecentlyActiveUsersForBranchPage") 4925 4926 a.ctx = newCtx 4927 a.app.Srv().Store.SetContext(newCtx) 4928 defer func() { 4929 a.app.Srv().Store.SetContext(origCtx) 4930 a.ctx = origCtx 4931 }() 4932 4933 defer span.Finish() 4934 resultVar0, resultVar1 := a.app.GetRecentlyActiveUsersForBranchPage(branchId, page, perPage, asAdmin, viewRestrictions) 4935 4936 if resultVar1 != nil { 4937 span.LogFields(spanlog.Error(resultVar1)) 4938 ext.Error.Set(span, true) 4939 } 4940 4941 return resultVar0, resultVar1 4942 } 4943 4944 func (a *OpenTracingAppLayer) GetRole(id string) (*model.Role, *model.AppError) { 4945 origCtx := a.ctx 4946 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRole") 4947 4948 a.ctx = newCtx 4949 a.app.Srv().Store.SetContext(newCtx) 4950 defer func() { 4951 a.app.Srv().Store.SetContext(origCtx) 4952 a.ctx = origCtx 4953 }() 4954 4955 defer span.Finish() 4956 resultVar0, resultVar1 := a.app.GetRole(id) 4957 4958 if resultVar1 != nil { 4959 span.LogFields(spanlog.Error(resultVar1)) 4960 ext.Error.Set(span, true) 4961 } 4962 4963 return resultVar0, resultVar1 4964 } 4965 4966 func (a *OpenTracingAppLayer) GetRoleByName(name string) (*model.Role, *model.AppError) { 4967 origCtx := a.ctx 4968 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRoleByName") 4969 4970 a.ctx = newCtx 4971 a.app.Srv().Store.SetContext(newCtx) 4972 defer func() { 4973 a.app.Srv().Store.SetContext(origCtx) 4974 a.ctx = origCtx 4975 }() 4976 4977 defer span.Finish() 4978 resultVar0, resultVar1 := a.app.GetRoleByName(name) 4979 4980 if resultVar1 != nil { 4981 span.LogFields(spanlog.Error(resultVar1)) 4982 ext.Error.Set(span, true) 4983 } 4984 4985 return resultVar0, resultVar1 4986 } 4987 4988 func (a *OpenTracingAppLayer) GetRolesByNames(names []string) ([]*model.Role, *model.AppError) { 4989 origCtx := a.ctx 4990 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetRolesByNames") 4991 4992 a.ctx = newCtx 4993 a.app.Srv().Store.SetContext(newCtx) 4994 defer func() { 4995 a.app.Srv().Store.SetContext(origCtx) 4996 a.ctx = origCtx 4997 }() 4998 4999 defer span.Finish() 5000 resultVar0, resultVar1 := a.app.GetRolesByNames(names) 5001 5002 if resultVar1 != nil { 5003 span.LogFields(spanlog.Error(resultVar1)) 5004 ext.Error.Set(span, true) 5005 } 5006 5007 return resultVar0, resultVar1 5008 } 5009 5010 func (a *OpenTracingAppLayer) GetSamlCertificateStatus() *model.SamlCertificateStatus { 5011 origCtx := a.ctx 5012 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlCertificateStatus") 5013 5014 a.ctx = newCtx 5015 a.app.Srv().Store.SetContext(newCtx) 5016 defer func() { 5017 a.app.Srv().Store.SetContext(origCtx) 5018 a.ctx = origCtx 5019 }() 5020 5021 defer span.Finish() 5022 resultVar0 := a.app.GetSamlCertificateStatus() 5023 5024 return resultVar0 5025 } 5026 5027 func (a *OpenTracingAppLayer) GetSamlMetadata() (string, *model.AppError) { 5028 origCtx := a.ctx 5029 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadata") 5030 5031 a.ctx = newCtx 5032 a.app.Srv().Store.SetContext(newCtx) 5033 defer func() { 5034 a.app.Srv().Store.SetContext(origCtx) 5035 a.ctx = origCtx 5036 }() 5037 5038 defer span.Finish() 5039 resultVar0, resultVar1 := a.app.GetSamlMetadata() 5040 5041 if resultVar1 != nil { 5042 span.LogFields(spanlog.Error(resultVar1)) 5043 ext.Error.Set(span, true) 5044 } 5045 5046 return resultVar0, resultVar1 5047 } 5048 5049 func (a *OpenTracingAppLayer) GetSamlMetadataFromIdp(idpMetadataUrl string) (*model.SamlMetadataResponse, *model.AppError) { 5050 origCtx := a.ctx 5051 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSamlMetadataFromIdp") 5052 5053 a.ctx = newCtx 5054 a.app.Srv().Store.SetContext(newCtx) 5055 defer func() { 5056 a.app.Srv().Store.SetContext(origCtx) 5057 a.ctx = origCtx 5058 }() 5059 5060 defer span.Finish() 5061 resultVar0, resultVar1 := a.app.GetSamlMetadataFromIdp(idpMetadataUrl) 5062 5063 if resultVar1 != nil { 5064 span.LogFields(spanlog.Error(resultVar1)) 5065 ext.Error.Set(span, true) 5066 } 5067 5068 return resultVar0, resultVar1 5069 } 5070 5071 func (a *OpenTracingAppLayer) GetSanitizeOptions(asAdmin bool) map[string]bool { 5072 origCtx := a.ctx 5073 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizeOptions") 5074 5075 a.ctx = newCtx 5076 a.app.Srv().Store.SetContext(newCtx) 5077 defer func() { 5078 a.app.Srv().Store.SetContext(origCtx) 5079 a.ctx = origCtx 5080 }() 5081 5082 defer span.Finish() 5083 resultVar0 := a.app.GetSanitizeOptions(asAdmin) 5084 5085 return resultVar0 5086 } 5087 5088 func (a *OpenTracingAppLayer) GetSanitizedClientLicense() map[string]string { 5089 origCtx := a.ctx 5090 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizedClientLicense") 5091 5092 a.ctx = newCtx 5093 a.app.Srv().Store.SetContext(newCtx) 5094 defer func() { 5095 a.app.Srv().Store.SetContext(origCtx) 5096 a.ctx = origCtx 5097 }() 5098 5099 defer span.Finish() 5100 resultVar0 := a.app.GetSanitizedClientLicense() 5101 5102 return resultVar0 5103 } 5104 5105 func (a *OpenTracingAppLayer) GetSanitizedConfig() *model.Config { 5106 origCtx := a.ctx 5107 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSanitizedConfig") 5108 5109 a.ctx = newCtx 5110 a.app.Srv().Store.SetContext(newCtx) 5111 defer func() { 5112 a.app.Srv().Store.SetContext(origCtx) 5113 a.ctx = origCtx 5114 }() 5115 5116 defer span.Finish() 5117 resultVar0 := a.app.GetSanitizedConfig() 5118 5119 return resultVar0 5120 } 5121 5122 func (a *OpenTracingAppLayer) GetScheme(id string) (*model.Scheme, *model.AppError) { 5123 origCtx := a.ctx 5124 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetScheme") 5125 5126 a.ctx = newCtx 5127 a.app.Srv().Store.SetContext(newCtx) 5128 defer func() { 5129 a.app.Srv().Store.SetContext(origCtx) 5130 a.ctx = origCtx 5131 }() 5132 5133 defer span.Finish() 5134 resultVar0, resultVar1 := a.app.GetScheme(id) 5135 5136 if resultVar1 != nil { 5137 span.LogFields(spanlog.Error(resultVar1)) 5138 ext.Error.Set(span, true) 5139 } 5140 5141 return resultVar0, resultVar1 5142 } 5143 5144 func (a *OpenTracingAppLayer) GetSchemeByName(name string) (*model.Scheme, *model.AppError) { 5145 origCtx := a.ctx 5146 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeByName") 5147 5148 a.ctx = newCtx 5149 a.app.Srv().Store.SetContext(newCtx) 5150 defer func() { 5151 a.app.Srv().Store.SetContext(origCtx) 5152 a.ctx = origCtx 5153 }() 5154 5155 defer span.Finish() 5156 resultVar0, resultVar1 := a.app.GetSchemeByName(name) 5157 5158 if resultVar1 != nil { 5159 span.LogFields(spanlog.Error(resultVar1)) 5160 ext.Error.Set(span, true) 5161 } 5162 5163 return resultVar0, resultVar1 5164 } 5165 5166 func (a *OpenTracingAppLayer) GetSchemeRolesForBranch(branchId string) (string, string, *model.AppError) { 5167 origCtx := a.ctx 5168 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForBranch") 5169 5170 a.ctx = newCtx 5171 a.app.Srv().Store.SetContext(newCtx) 5172 defer func() { 5173 a.app.Srv().Store.SetContext(origCtx) 5174 a.ctx = origCtx 5175 }() 5176 5177 defer span.Finish() 5178 resultVar0, resultVar1, resultVar2 := a.app.GetSchemeRolesForBranch(branchId) 5179 5180 if resultVar2 != nil { 5181 span.LogFields(spanlog.Error(resultVar2)) 5182 ext.Error.Set(span, true) 5183 } 5184 5185 return resultVar0, resultVar1, resultVar2 5186 } 5187 5188 func (a *OpenTracingAppLayer) GetSchemeRolesForClass(classId string) (string, string, *model.AppError) { 5189 origCtx := a.ctx 5190 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemeRolesForClass") 5191 5192 a.ctx = newCtx 5193 a.app.Srv().Store.SetContext(newCtx) 5194 defer func() { 5195 a.app.Srv().Store.SetContext(origCtx) 5196 a.ctx = origCtx 5197 }() 5198 5199 defer span.Finish() 5200 resultVar0, resultVar1, resultVar2 := a.app.GetSchemeRolesForClass(classId) 5201 5202 if resultVar2 != nil { 5203 span.LogFields(spanlog.Error(resultVar2)) 5204 ext.Error.Set(span, true) 5205 } 5206 5207 return resultVar0, resultVar1, resultVar2 5208 } 5209 5210 func (a *OpenTracingAppLayer) GetSchemes(scope string, offset int, limit int) ([]*model.Scheme, *model.AppError) { 5211 origCtx := a.ctx 5212 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemes") 5213 5214 a.ctx = newCtx 5215 a.app.Srv().Store.SetContext(newCtx) 5216 defer func() { 5217 a.app.Srv().Store.SetContext(origCtx) 5218 a.ctx = origCtx 5219 }() 5220 5221 defer span.Finish() 5222 resultVar0, resultVar1 := a.app.GetSchemes(scope, offset, limit) 5223 5224 if resultVar1 != nil { 5225 span.LogFields(spanlog.Error(resultVar1)) 5226 ext.Error.Set(span, true) 5227 } 5228 5229 return resultVar0, resultVar1 5230 } 5231 5232 func (a *OpenTracingAppLayer) GetSchemesPage(scope string, page int, perPage int) ([]*model.Scheme, *model.AppError) { 5233 origCtx := a.ctx 5234 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSchemesPage") 5235 5236 a.ctx = newCtx 5237 a.app.Srv().Store.SetContext(newCtx) 5238 defer func() { 5239 a.app.Srv().Store.SetContext(origCtx) 5240 a.ctx = origCtx 5241 }() 5242 5243 defer span.Finish() 5244 resultVar0, resultVar1 := a.app.GetSchemesPage(scope, page, perPage) 5245 5246 if resultVar1 != nil { 5247 span.LogFields(spanlog.Error(resultVar1)) 5248 ext.Error.Set(span, true) 5249 } 5250 5251 return resultVar0, resultVar1 5252 } 5253 5254 func (a *OpenTracingAppLayer) GetSession(token string) (*model.Session, *model.AppError) { 5255 origCtx := a.ctx 5256 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSession") 5257 5258 a.ctx = newCtx 5259 a.app.Srv().Store.SetContext(newCtx) 5260 defer func() { 5261 a.app.Srv().Store.SetContext(origCtx) 5262 a.ctx = origCtx 5263 }() 5264 5265 defer span.Finish() 5266 resultVar0, resultVar1 := a.app.GetSession(token) 5267 5268 if resultVar1 != nil { 5269 span.LogFields(spanlog.Error(resultVar1)) 5270 ext.Error.Set(span, true) 5271 } 5272 5273 return resultVar0, resultVar1 5274 } 5275 5276 func (a *OpenTracingAppLayer) GetSessionById(sessionId string) (*model.Session, *model.AppError) { 5277 origCtx := a.ctx 5278 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessionById") 5279 5280 a.ctx = newCtx 5281 a.app.Srv().Store.SetContext(newCtx) 5282 defer func() { 5283 a.app.Srv().Store.SetContext(origCtx) 5284 a.ctx = origCtx 5285 }() 5286 5287 defer span.Finish() 5288 resultVar0, resultVar1 := a.app.GetSessionById(sessionId) 5289 5290 if resultVar1 != nil { 5291 span.LogFields(spanlog.Error(resultVar1)) 5292 ext.Error.Set(span, true) 5293 } 5294 5295 return resultVar0, resultVar1 5296 } 5297 5298 func (a *OpenTracingAppLayer) GetSessions(userId string) ([]*model.Session, *model.AppError) { 5299 origCtx := a.ctx 5300 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSessions") 5301 5302 a.ctx = newCtx 5303 a.app.Srv().Store.SetContext(newCtx) 5304 defer func() { 5305 a.app.Srv().Store.SetContext(origCtx) 5306 a.ctx = origCtx 5307 }() 5308 5309 defer span.Finish() 5310 resultVar0, resultVar1 := a.app.GetSessions(userId) 5311 5312 if resultVar1 != nil { 5313 span.LogFields(spanlog.Error(resultVar1)) 5314 ext.Error.Set(span, true) 5315 } 5316 5317 return resultVar0, resultVar1 5318 } 5319 5320 func (a *OpenTracingAppLayer) GetSinglePost(postId string) (*model.Post, *model.AppError) { 5321 origCtx := a.ctx 5322 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSinglePost") 5323 5324 a.ctx = newCtx 5325 a.app.Srv().Store.SetContext(newCtx) 5326 defer func() { 5327 a.app.Srv().Store.SetContext(origCtx) 5328 a.ctx = origCtx 5329 }() 5330 5331 defer span.Finish() 5332 resultVar0, resultVar1 := a.app.GetSinglePost(postId) 5333 5334 if resultVar1 != nil { 5335 span.LogFields(spanlog.Error(resultVar1)) 5336 ext.Error.Set(span, true) 5337 } 5338 5339 return resultVar0, resultVar1 5340 } 5341 5342 func (a *OpenTracingAppLayer) GetSiteURL() string { 5343 origCtx := a.ctx 5344 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetSiteURL") 5345 5346 a.ctx = newCtx 5347 a.app.Srv().Store.SetContext(newCtx) 5348 defer func() { 5349 a.app.Srv().Store.SetContext(origCtx) 5350 a.ctx = origCtx 5351 }() 5352 5353 defer span.Finish() 5354 resultVar0 := a.app.GetSiteURL() 5355 5356 return resultVar0 5357 } 5358 5359 func (a *OpenTracingAppLayer) GetStatus(userId string) (*model.Status, *model.AppError) { 5360 origCtx := a.ctx 5361 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatus") 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.GetStatus(userId) 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) GetStatusFromCache(userId string) *model.Status { 5382 origCtx := a.ctx 5383 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusFromCache") 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 := a.app.GetStatusFromCache(userId) 5394 5395 return resultVar0 5396 } 5397 5398 func (a *OpenTracingAppLayer) GetStatusesByIds(userIds []string) (map[string]interface{}, *model.AppError) { 5399 origCtx := a.ctx 5400 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetStatusesByIds") 5401 5402 a.ctx = newCtx 5403 a.app.Srv().Store.SetContext(newCtx) 5404 defer func() { 5405 a.app.Srv().Store.SetContext(origCtx) 5406 a.ctx = origCtx 5407 }() 5408 5409 defer span.Finish() 5410 resultVar0, resultVar1 := a.app.GetStatusesByIds(userIds) 5411 5412 if resultVar1 != nil { 5413 span.LogFields(spanlog.Error(resultVar1)) 5414 ext.Error.Set(span, true) 5415 } 5416 5417 return resultVar0, resultVar1 5418 } 5419 5420 func (a *OpenTracingAppLayer) GetTermsOfService(id string) (*model.TermsOfService, *model.AppError) { 5421 origCtx := a.ctx 5422 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTermsOfService") 5423 5424 a.ctx = newCtx 5425 a.app.Srv().Store.SetContext(newCtx) 5426 defer func() { 5427 a.app.Srv().Store.SetContext(origCtx) 5428 a.ctx = origCtx 5429 }() 5430 5431 defer span.Finish() 5432 resultVar0, resultVar1 := a.app.GetTermsOfService(id) 5433 5434 if resultVar1 != nil { 5435 span.LogFields(spanlog.Error(resultVar1)) 5436 ext.Error.Set(span, true) 5437 } 5438 5439 return resultVar0, resultVar1 5440 } 5441 5442 func (a *OpenTracingAppLayer) GetTotalUsersStats(viewRestrictions *model.ViewUsersRestrictions) (*model.UsersStats, *model.AppError) { 5443 origCtx := a.ctx 5444 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetTotalUsersStats") 5445 5446 a.ctx = newCtx 5447 a.app.Srv().Store.SetContext(newCtx) 5448 defer func() { 5449 a.app.Srv().Store.SetContext(origCtx) 5450 a.ctx = origCtx 5451 }() 5452 5453 defer span.Finish() 5454 resultVar0, resultVar1 := a.app.GetTotalUsersStats(viewRestrictions) 5455 5456 if resultVar1 != nil { 5457 span.LogFields(spanlog.Error(resultVar1)) 5458 ext.Error.Set(span, true) 5459 } 5460 5461 return resultVar0, resultVar1 5462 } 5463 5464 func (a *OpenTracingAppLayer) GetUser(userId string) (*model.User, *model.AppError) { 5465 origCtx := a.ctx 5466 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUser") 5467 5468 a.ctx = newCtx 5469 a.app.Srv().Store.SetContext(newCtx) 5470 defer func() { 5471 a.app.Srv().Store.SetContext(origCtx) 5472 a.ctx = origCtx 5473 }() 5474 5475 defer span.Finish() 5476 resultVar0, resultVar1 := a.app.GetUser(userId) 5477 5478 if resultVar1 != nil { 5479 span.LogFields(spanlog.Error(resultVar1)) 5480 ext.Error.Set(span, true) 5481 } 5482 5483 return resultVar0, resultVar1 5484 } 5485 5486 func (a *OpenTracingAppLayer) GetUserAccessToken(tokenId string, sanitize bool) (*model.UserAccessToken, *model.AppError) { 5487 origCtx := a.ctx 5488 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessToken") 5489 5490 a.ctx = newCtx 5491 a.app.Srv().Store.SetContext(newCtx) 5492 defer func() { 5493 a.app.Srv().Store.SetContext(origCtx) 5494 a.ctx = origCtx 5495 }() 5496 5497 defer span.Finish() 5498 resultVar0, resultVar1 := a.app.GetUserAccessToken(tokenId, sanitize) 5499 5500 if resultVar1 != nil { 5501 span.LogFields(spanlog.Error(resultVar1)) 5502 ext.Error.Set(span, true) 5503 } 5504 5505 return resultVar0, resultVar1 5506 } 5507 5508 func (a *OpenTracingAppLayer) GetUserAccessTokens(page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 5509 origCtx := a.ctx 5510 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokens") 5511 5512 a.ctx = newCtx 5513 a.app.Srv().Store.SetContext(newCtx) 5514 defer func() { 5515 a.app.Srv().Store.SetContext(origCtx) 5516 a.ctx = origCtx 5517 }() 5518 5519 defer span.Finish() 5520 resultVar0, resultVar1 := a.app.GetUserAccessTokens(page, perPage) 5521 5522 if resultVar1 != nil { 5523 span.LogFields(spanlog.Error(resultVar1)) 5524 ext.Error.Set(span, true) 5525 } 5526 5527 return resultVar0, resultVar1 5528 } 5529 5530 func (a *OpenTracingAppLayer) GetUserAccessTokensForUser(userId string, page int, perPage int) ([]*model.UserAccessToken, *model.AppError) { 5531 origCtx := a.ctx 5532 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserAccessTokensForUser") 5533 5534 a.ctx = newCtx 5535 a.app.Srv().Store.SetContext(newCtx) 5536 defer func() { 5537 a.app.Srv().Store.SetContext(origCtx) 5538 a.ctx = origCtx 5539 }() 5540 5541 defer span.Finish() 5542 resultVar0, resultVar1 := a.app.GetUserAccessTokensForUser(userId, page, perPage) 5543 5544 if resultVar1 != nil { 5545 span.LogFields(spanlog.Error(resultVar1)) 5546 ext.Error.Set(span, true) 5547 } 5548 5549 return resultVar0, resultVar1 5550 } 5551 5552 func (a *OpenTracingAppLayer) GetUserByAuth(authData *string, authService string) (*model.User, *model.AppError) { 5553 origCtx := a.ctx 5554 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByAuth") 5555 5556 a.ctx = newCtx 5557 a.app.Srv().Store.SetContext(newCtx) 5558 defer func() { 5559 a.app.Srv().Store.SetContext(origCtx) 5560 a.ctx = origCtx 5561 }() 5562 5563 defer span.Finish() 5564 resultVar0, resultVar1 := a.app.GetUserByAuth(authData, authService) 5565 5566 if resultVar1 != nil { 5567 span.LogFields(spanlog.Error(resultVar1)) 5568 ext.Error.Set(span, true) 5569 } 5570 5571 return resultVar0, resultVar1 5572 } 5573 5574 func (a *OpenTracingAppLayer) GetUserByEmail(email string) (*model.User, *model.AppError) { 5575 origCtx := a.ctx 5576 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByEmail") 5577 5578 a.ctx = newCtx 5579 a.app.Srv().Store.SetContext(newCtx) 5580 defer func() { 5581 a.app.Srv().Store.SetContext(origCtx) 5582 a.ctx = origCtx 5583 }() 5584 5585 defer span.Finish() 5586 resultVar0, resultVar1 := a.app.GetUserByEmail(email) 5587 5588 if resultVar1 != nil { 5589 span.LogFields(spanlog.Error(resultVar1)) 5590 ext.Error.Set(span, true) 5591 } 5592 5593 return resultVar0, resultVar1 5594 } 5595 5596 func (a *OpenTracingAppLayer) GetUserByUsername(username string) (*model.User, *model.AppError) { 5597 origCtx := a.ctx 5598 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserByUsername") 5599 5600 a.ctx = newCtx 5601 a.app.Srv().Store.SetContext(newCtx) 5602 defer func() { 5603 a.app.Srv().Store.SetContext(origCtx) 5604 a.ctx = origCtx 5605 }() 5606 5607 defer span.Finish() 5608 resultVar0, resultVar1 := a.app.GetUserByUsername(username) 5609 5610 if resultVar1 != nil { 5611 span.LogFields(spanlog.Error(resultVar1)) 5612 ext.Error.Set(span, true) 5613 } 5614 5615 return resultVar0, resultVar1 5616 } 5617 5618 func (a *OpenTracingAppLayer) GetUserForLogin(id string, loginId string) (*model.User, *model.AppError) { 5619 origCtx := a.ctx 5620 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserForLogin") 5621 5622 a.ctx = newCtx 5623 a.app.Srv().Store.SetContext(newCtx) 5624 defer func() { 5625 a.app.Srv().Store.SetContext(origCtx) 5626 a.ctx = origCtx 5627 }() 5628 5629 defer span.Finish() 5630 resultVar0, resultVar1 := a.app.GetUserForLogin(id, loginId) 5631 5632 if resultVar1 != nil { 5633 span.LogFields(spanlog.Error(resultVar1)) 5634 ext.Error.Set(span, true) 5635 } 5636 5637 return resultVar0, resultVar1 5638 } 5639 5640 func (a *OpenTracingAppLayer) GetUserStatusesByIds(userIds []string) ([]*model.Status, *model.AppError) { 5641 origCtx := a.ctx 5642 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserStatusesByIds") 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.GetUserStatusesByIds(userIds) 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) GetUserTermsOfService(userId string) (*model.UserTermsOfService, *model.AppError) { 5663 origCtx := a.ctx 5664 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUserTermsOfService") 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.GetUserTermsOfService(userId) 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) GetUsers(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 5685 origCtx := a.ctx 5686 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsers") 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.GetUsers(options) 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) GetUsersByIds(userIds []string, options *store.UserGetByIdsOpts) ([]*model.User, *model.AppError) { 5707 origCtx := a.ctx 5708 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByIds") 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.GetUsersByIds(userIds, options) 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) GetUsersByUsernames(usernames []string, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5729 origCtx := a.ctx 5730 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersByUsernames") 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.GetUsersByUsernames(usernames, asAdmin, viewRestrictions) 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) GetUsersEtag(restrictionsHash string) string { 5751 origCtx := a.ctx 5752 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersEtag") 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 := a.app.GetUsersEtag(restrictionsHash) 5763 5764 return resultVar0 5765 } 5766 5767 func (a *OpenTracingAppLayer) GetUsersInBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 5768 origCtx := a.ctx 5769 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInBranch") 5770 5771 a.ctx = newCtx 5772 a.app.Srv().Store.SetContext(newCtx) 5773 defer func() { 5774 a.app.Srv().Store.SetContext(origCtx) 5775 a.ctx = origCtx 5776 }() 5777 5778 defer span.Finish() 5779 resultVar0, resultVar1 := a.app.GetUsersInBranch(options) 5780 5781 if resultVar1 != nil { 5782 span.LogFields(spanlog.Error(resultVar1)) 5783 ext.Error.Set(span, true) 5784 } 5785 5786 return resultVar0, resultVar1 5787 } 5788 5789 func (a *OpenTracingAppLayer) GetUsersInBranchEtag(branchId string, restrictionsHash string) string { 5790 origCtx := a.ctx 5791 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInBranchEtag") 5792 5793 a.ctx = newCtx 5794 a.app.Srv().Store.SetContext(newCtx) 5795 defer func() { 5796 a.app.Srv().Store.SetContext(origCtx) 5797 a.ctx = origCtx 5798 }() 5799 5800 defer span.Finish() 5801 resultVar0 := a.app.GetUsersInBranchEtag(branchId, restrictionsHash) 5802 5803 return resultVar0 5804 } 5805 5806 func (a *OpenTracingAppLayer) GetUsersInBranchPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 5807 origCtx := a.ctx 5808 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInBranchPage") 5809 5810 a.ctx = newCtx 5811 a.app.Srv().Store.SetContext(newCtx) 5812 defer func() { 5813 a.app.Srv().Store.SetContext(origCtx) 5814 a.ctx = origCtx 5815 }() 5816 5817 defer span.Finish() 5818 resultVar0, resultVar1 := a.app.GetUsersInBranchPage(options, asAdmin) 5819 5820 if resultVar1 != nil { 5821 span.LogFields(spanlog.Error(resultVar1)) 5822 ext.Error.Set(span, true) 5823 } 5824 5825 return resultVar0, resultVar1 5826 } 5827 5828 func (a *OpenTracingAppLayer) GetUsersInClass(classId string, offset int, limit int) ([]*model.User, *model.AppError) { 5829 origCtx := a.ctx 5830 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInClass") 5831 5832 a.ctx = newCtx 5833 a.app.Srv().Store.SetContext(newCtx) 5834 defer func() { 5835 a.app.Srv().Store.SetContext(origCtx) 5836 a.ctx = origCtx 5837 }() 5838 5839 defer span.Finish() 5840 resultVar0, resultVar1 := a.app.GetUsersInClass(classId, offset, limit) 5841 5842 if resultVar1 != nil { 5843 span.LogFields(spanlog.Error(resultVar1)) 5844 ext.Error.Set(span, true) 5845 } 5846 5847 return resultVar0, resultVar1 5848 } 5849 5850 func (a *OpenTracingAppLayer) GetUsersInClassByStatus(classId string, offset int, limit int) ([]*model.User, *model.AppError) { 5851 origCtx := a.ctx 5852 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInClassByStatus") 5853 5854 a.ctx = newCtx 5855 a.app.Srv().Store.SetContext(newCtx) 5856 defer func() { 5857 a.app.Srv().Store.SetContext(origCtx) 5858 a.ctx = origCtx 5859 }() 5860 5861 defer span.Finish() 5862 resultVar0, resultVar1 := a.app.GetUsersInClassByStatus(classId, offset, limit) 5863 5864 if resultVar1 != nil { 5865 span.LogFields(spanlog.Error(resultVar1)) 5866 ext.Error.Set(span, true) 5867 } 5868 5869 return resultVar0, resultVar1 5870 } 5871 5872 func (a *OpenTracingAppLayer) GetUsersInClassMap(classId string, offset int, limit int, asAdmin bool) (map[string]*model.User, *model.AppError) { 5873 origCtx := a.ctx 5874 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInClassMap") 5875 5876 a.ctx = newCtx 5877 a.app.Srv().Store.SetContext(newCtx) 5878 defer func() { 5879 a.app.Srv().Store.SetContext(origCtx) 5880 a.ctx = origCtx 5881 }() 5882 5883 defer span.Finish() 5884 resultVar0, resultVar1 := a.app.GetUsersInClassMap(classId, offset, limit, asAdmin) 5885 5886 if resultVar1 != nil { 5887 span.LogFields(spanlog.Error(resultVar1)) 5888 ext.Error.Set(span, true) 5889 } 5890 5891 return resultVar0, resultVar1 5892 } 5893 5894 func (a *OpenTracingAppLayer) GetUsersInClassPage(classId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) { 5895 origCtx := a.ctx 5896 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInClassPage") 5897 5898 a.ctx = newCtx 5899 a.app.Srv().Store.SetContext(newCtx) 5900 defer func() { 5901 a.app.Srv().Store.SetContext(origCtx) 5902 a.ctx = origCtx 5903 }() 5904 5905 defer span.Finish() 5906 resultVar0, resultVar1 := a.app.GetUsersInClassPage(classId, page, perPage, asAdmin) 5907 5908 if resultVar1 != nil { 5909 span.LogFields(spanlog.Error(resultVar1)) 5910 ext.Error.Set(span, true) 5911 } 5912 5913 return resultVar0, resultVar1 5914 } 5915 5916 func (a *OpenTracingAppLayer) GetUsersInClassPageByStatus(classId string, page int, perPage int, asAdmin bool) ([]*model.User, *model.AppError) { 5917 origCtx := a.ctx 5918 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersInClassPageByStatus") 5919 5920 a.ctx = newCtx 5921 a.app.Srv().Store.SetContext(newCtx) 5922 defer func() { 5923 a.app.Srv().Store.SetContext(origCtx) 5924 a.ctx = origCtx 5925 }() 5926 5927 defer span.Finish() 5928 resultVar0, resultVar1 := a.app.GetUsersInClassPageByStatus(classId, page, perPage, asAdmin) 5929 5930 if resultVar1 != nil { 5931 span.LogFields(spanlog.Error(resultVar1)) 5932 ext.Error.Set(span, true) 5933 } 5934 5935 return resultVar0, resultVar1 5936 } 5937 5938 func (a *OpenTracingAppLayer) GetUsersNotInClass(branchId string, classId string, groupConstrained bool, offset int, limit int, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5939 origCtx := a.ctx 5940 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInClass") 5941 5942 a.ctx = newCtx 5943 a.app.Srv().Store.SetContext(newCtx) 5944 defer func() { 5945 a.app.Srv().Store.SetContext(origCtx) 5946 a.ctx = origCtx 5947 }() 5948 5949 defer span.Finish() 5950 resultVar0, resultVar1 := a.app.GetUsersNotInClass(branchId, classId, groupConstrained, offset, limit, viewRestrictions) 5951 5952 if resultVar1 != nil { 5953 span.LogFields(spanlog.Error(resultVar1)) 5954 ext.Error.Set(span, true) 5955 } 5956 5957 return resultVar0, resultVar1 5958 } 5959 5960 func (a *OpenTracingAppLayer) GetUsersNotInClassMap(branchId string, classId string, groupConstrained bool, offset int, limit int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) (map[string]*model.User, *model.AppError) { 5961 origCtx := a.ctx 5962 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInClassMap") 5963 5964 a.ctx = newCtx 5965 a.app.Srv().Store.SetContext(newCtx) 5966 defer func() { 5967 a.app.Srv().Store.SetContext(origCtx) 5968 a.ctx = origCtx 5969 }() 5970 5971 defer span.Finish() 5972 resultVar0, resultVar1 := a.app.GetUsersNotInClassMap(branchId, classId, groupConstrained, offset, limit, asAdmin, viewRestrictions) 5973 5974 if resultVar1 != nil { 5975 span.LogFields(spanlog.Error(resultVar1)) 5976 ext.Error.Set(span, true) 5977 } 5978 5979 return resultVar0, resultVar1 5980 } 5981 5982 func (a *OpenTracingAppLayer) GetUsersNotInClassPage(branchId string, classId string, groupConstrained bool, page int, perPage int, asAdmin bool, viewRestrictions *model.ViewUsersRestrictions) ([]*model.User, *model.AppError) { 5983 origCtx := a.ctx 5984 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersNotInClassPage") 5985 5986 a.ctx = newCtx 5987 a.app.Srv().Store.SetContext(newCtx) 5988 defer func() { 5989 a.app.Srv().Store.SetContext(origCtx) 5990 a.ctx = origCtx 5991 }() 5992 5993 defer span.Finish() 5994 resultVar0, resultVar1 := a.app.GetUsersNotInClassPage(branchId, classId, groupConstrained, page, perPage, asAdmin, viewRestrictions) 5995 5996 if resultVar1 != nil { 5997 span.LogFields(spanlog.Error(resultVar1)) 5998 ext.Error.Set(span, true) 5999 } 6000 6001 return resultVar0, resultVar1 6002 } 6003 6004 func (a *OpenTracingAppLayer) GetUsersPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 6005 origCtx := a.ctx 6006 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersPage") 6007 6008 a.ctx = newCtx 6009 a.app.Srv().Store.SetContext(newCtx) 6010 defer func() { 6011 a.app.Srv().Store.SetContext(origCtx) 6012 a.ctx = origCtx 6013 }() 6014 6015 defer span.Finish() 6016 resultVar0, resultVar1 := a.app.GetUsersPage(options, asAdmin) 6017 6018 if resultVar1 != nil { 6019 span.LogFields(spanlog.Error(resultVar1)) 6020 ext.Error.Set(span, true) 6021 } 6022 6023 return resultVar0, resultVar1 6024 } 6025 6026 func (a *OpenTracingAppLayer) GetUsersWithoutBranch(options *model.UserGetOptions) ([]*model.User, *model.AppError) { 6027 origCtx := a.ctx 6028 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutBranch") 6029 6030 a.ctx = newCtx 6031 a.app.Srv().Store.SetContext(newCtx) 6032 defer func() { 6033 a.app.Srv().Store.SetContext(origCtx) 6034 a.ctx = origCtx 6035 }() 6036 6037 defer span.Finish() 6038 resultVar0, resultVar1 := a.app.GetUsersWithoutBranch(options) 6039 6040 if resultVar1 != nil { 6041 span.LogFields(spanlog.Error(resultVar1)) 6042 ext.Error.Set(span, true) 6043 } 6044 6045 return resultVar0, resultVar1 6046 } 6047 6048 func (a *OpenTracingAppLayer) GetUsersWithoutBranchPage(options *model.UserGetOptions, asAdmin bool) ([]*model.User, *model.AppError) { 6049 origCtx := a.ctx 6050 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetUsersWithoutBranchPage") 6051 6052 a.ctx = newCtx 6053 a.app.Srv().Store.SetContext(newCtx) 6054 defer func() { 6055 a.app.Srv().Store.SetContext(origCtx) 6056 a.ctx = origCtx 6057 }() 6058 6059 defer span.Finish() 6060 resultVar0, resultVar1 := a.app.GetUsersWithoutBranchPage(options, asAdmin) 6061 6062 if resultVar1 != nil { 6063 span.LogFields(spanlog.Error(resultVar1)) 6064 ext.Error.Set(span, true) 6065 } 6066 6067 return resultVar0, resultVar1 6068 } 6069 6070 func (a *OpenTracingAppLayer) GetVerifyEmailToken(token string) (*model.Token, *model.AppError) { 6071 origCtx := a.ctx 6072 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetVerifyEmailToken") 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, resultVar1 := a.app.GetVerifyEmailToken(token) 6083 6084 if resultVar1 != nil { 6085 span.LogFields(spanlog.Error(resultVar1)) 6086 ext.Error.Set(span, true) 6087 } 6088 6089 return resultVar0, resultVar1 6090 } 6091 6092 func (a *OpenTracingAppLayer) GetViewUsersRestrictions(userId string) (*model.ViewUsersRestrictions, *model.AppError) { 6093 origCtx := a.ctx 6094 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.GetViewUsersRestrictions") 6095 6096 a.ctx = newCtx 6097 a.app.Srv().Store.SetContext(newCtx) 6098 defer func() { 6099 a.app.Srv().Store.SetContext(origCtx) 6100 a.ctx = origCtx 6101 }() 6102 6103 defer span.Finish() 6104 resultVar0, resultVar1 := a.app.GetViewUsersRestrictions(userId) 6105 6106 if resultVar1 != nil { 6107 span.LogFields(spanlog.Error(resultVar1)) 6108 ext.Error.Set(span, true) 6109 } 6110 6111 return resultVar0, resultVar1 6112 } 6113 6114 func (a *OpenTracingAppLayer) HTMLTemplates() *template.Template { 6115 origCtx := a.ctx 6116 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HTMLTemplates") 6117 6118 a.ctx = newCtx 6119 a.app.Srv().Store.SetContext(newCtx) 6120 defer func() { 6121 a.app.Srv().Store.SetContext(origCtx) 6122 a.ctx = origCtx 6123 }() 6124 6125 defer span.Finish() 6126 resultVar0 := a.app.HTMLTemplates() 6127 6128 return resultVar0 6129 } 6130 6131 func (a *OpenTracingAppLayer) Handle404(w http.ResponseWriter, r *http.Request) { 6132 origCtx := a.ctx 6133 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Handle404") 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 a.app.Handle404(w, r) 6144 } 6145 6146 func (a *OpenTracingAppLayer) HandleCommandResponse(command *model.Command, args *model.CommandArgs, response *model.CommandResponse, builtIn bool) (*model.CommandResponse, *model.AppError) { 6147 origCtx := a.ctx 6148 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleCommandResponse") 6149 6150 a.ctx = newCtx 6151 a.app.Srv().Store.SetContext(newCtx) 6152 defer func() { 6153 a.app.Srv().Store.SetContext(origCtx) 6154 a.ctx = origCtx 6155 }() 6156 6157 defer span.Finish() 6158 resultVar0, resultVar1 := a.app.HandleCommandResponse(command, args, response, builtIn) 6159 6160 if resultVar1 != nil { 6161 span.LogFields(spanlog.Error(resultVar1)) 6162 ext.Error.Set(span, true) 6163 } 6164 6165 return resultVar0, resultVar1 6166 } 6167 6168 func (a *OpenTracingAppLayer) HandleImages(previewPathList []string, thumbnailPathList []string, fileData [][]byte) { 6169 origCtx := a.ctx 6170 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleImages") 6171 6172 a.ctx = newCtx 6173 a.app.Srv().Store.SetContext(newCtx) 6174 defer func() { 6175 a.app.Srv().Store.SetContext(origCtx) 6176 a.ctx = origCtx 6177 }() 6178 6179 defer span.Finish() 6180 a.app.HandleImages(previewPathList, thumbnailPathList, fileData) 6181 } 6182 6183 func (a *OpenTracingAppLayer) HandleMessageExportConfig(cfg *model.Config, appCfg *model.Config) { 6184 origCtx := a.ctx 6185 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HandleMessageExportConfig") 6186 6187 a.ctx = newCtx 6188 a.app.Srv().Store.SetContext(newCtx) 6189 defer func() { 6190 a.app.Srv().Store.SetContext(origCtx) 6191 a.ctx = origCtx 6192 }() 6193 6194 defer span.Finish() 6195 a.app.HandleMessageExportConfig(cfg, appCfg) 6196 } 6197 6198 func (a *OpenTracingAppLayer) HasPermissionTo(askingUserId string, permission *model.Permission) bool { 6199 origCtx := a.ctx 6200 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionTo") 6201 6202 a.ctx = newCtx 6203 a.app.Srv().Store.SetContext(newCtx) 6204 defer func() { 6205 a.app.Srv().Store.SetContext(origCtx) 6206 a.ctx = origCtx 6207 }() 6208 6209 defer span.Finish() 6210 resultVar0 := a.app.HasPermissionTo(askingUserId, permission) 6211 6212 return resultVar0 6213 } 6214 6215 func (a *OpenTracingAppLayer) HasPermissionToBranch(askingUserId string, branchId string, permission *model.Permission) bool { 6216 origCtx := a.ctx 6217 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToBranch") 6218 6219 a.ctx = newCtx 6220 a.app.Srv().Store.SetContext(newCtx) 6221 defer func() { 6222 a.app.Srv().Store.SetContext(origCtx) 6223 a.ctx = origCtx 6224 }() 6225 6226 defer span.Finish() 6227 resultVar0 := a.app.HasPermissionToBranch(askingUserId, branchId, permission) 6228 6229 return resultVar0 6230 } 6231 6232 func (a *OpenTracingAppLayer) HasPermissionToClass(askingUserId string, classId string, permission *model.Permission) bool { 6233 origCtx := a.ctx 6234 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToClass") 6235 6236 a.ctx = newCtx 6237 a.app.Srv().Store.SetContext(newCtx) 6238 defer func() { 6239 a.app.Srv().Store.SetContext(origCtx) 6240 a.ctx = origCtx 6241 }() 6242 6243 defer span.Finish() 6244 resultVar0 := a.app.HasPermissionToClass(askingUserId, classId, permission) 6245 6246 return resultVar0 6247 } 6248 6249 func (a *OpenTracingAppLayer) HasPermissionToUser(askingUserId string, userId string) bool { 6250 origCtx := a.ctx 6251 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HasPermissionToUser") 6252 6253 a.ctx = newCtx 6254 a.app.Srv().Store.SetContext(newCtx) 6255 defer func() { 6256 a.app.Srv().Store.SetContext(origCtx) 6257 a.ctx = origCtx 6258 }() 6259 6260 defer span.Finish() 6261 resultVar0 := a.app.HasPermissionToUser(askingUserId, userId) 6262 6263 return resultVar0 6264 } 6265 6266 func (a *OpenTracingAppLayer) HubRegister(webConn *WebConn) { 6267 origCtx := a.ctx 6268 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubRegister") 6269 6270 a.ctx = newCtx 6271 a.app.Srv().Store.SetContext(newCtx) 6272 defer func() { 6273 a.app.Srv().Store.SetContext(origCtx) 6274 a.ctx = origCtx 6275 }() 6276 6277 defer span.Finish() 6278 a.app.HubRegister(webConn) 6279 } 6280 6281 func (a *OpenTracingAppLayer) HubStart() { 6282 origCtx := a.ctx 6283 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStart") 6284 6285 a.ctx = newCtx 6286 a.app.Srv().Store.SetContext(newCtx) 6287 defer func() { 6288 a.app.Srv().Store.SetContext(origCtx) 6289 a.ctx = origCtx 6290 }() 6291 6292 defer span.Finish() 6293 a.app.HubStart() 6294 } 6295 6296 func (a *OpenTracingAppLayer) HubStop() { 6297 origCtx := a.ctx 6298 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubStop") 6299 6300 a.ctx = newCtx 6301 a.app.Srv().Store.SetContext(newCtx) 6302 defer func() { 6303 a.app.Srv().Store.SetContext(origCtx) 6304 a.ctx = origCtx 6305 }() 6306 6307 defer span.Finish() 6308 a.app.HubStop() 6309 } 6310 6311 func (a *OpenTracingAppLayer) HubUnregister(webConn *WebConn) { 6312 origCtx := a.ctx 6313 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.HubUnregister") 6314 6315 a.ctx = newCtx 6316 a.app.Srv().Store.SetContext(newCtx) 6317 defer func() { 6318 a.app.Srv().Store.SetContext(origCtx) 6319 a.ctx = origCtx 6320 }() 6321 6322 defer span.Finish() 6323 a.app.HubUnregister(webConn) 6324 } 6325 6326 func (a *OpenTracingAppLayer) ImageProxyAdder() func(string) string { 6327 origCtx := a.ctx 6328 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyAdder") 6329 6330 a.ctx = newCtx 6331 a.app.Srv().Store.SetContext(newCtx) 6332 defer func() { 6333 a.app.Srv().Store.SetContext(origCtx) 6334 a.ctx = origCtx 6335 }() 6336 6337 defer span.Finish() 6338 resultVar0 := a.app.ImageProxyAdder() 6339 6340 return resultVar0 6341 } 6342 6343 func (a *OpenTracingAppLayer) ImageProxyRemover() func(string) string { 6344 origCtx := a.ctx 6345 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImageProxyRemover") 6346 6347 a.ctx = newCtx 6348 a.app.Srv().Store.SetContext(newCtx) 6349 defer func() { 6350 a.app.Srv().Store.SetContext(origCtx) 6351 a.ctx = origCtx 6352 }() 6353 6354 defer span.Finish() 6355 resultVar0 := a.app.ImageProxyRemover() 6356 6357 return resultVar0 6358 } 6359 6360 func (a *OpenTracingAppLayer) ImportPermissions(jsonl io.Reader) error { 6361 origCtx := a.ctx 6362 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ImportPermissions") 6363 6364 a.ctx = newCtx 6365 a.app.Srv().Store.SetContext(newCtx) 6366 defer func() { 6367 a.app.Srv().Store.SetContext(origCtx) 6368 a.ctx = origCtx 6369 }() 6370 6371 defer span.Finish() 6372 resultVar0 := a.app.ImportPermissions(jsonl) 6373 6374 return resultVar0 6375 } 6376 6377 func (a *OpenTracingAppLayer) InitPostMetadata() { 6378 origCtx := a.ctx 6379 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InitPostMetadata") 6380 6381 a.ctx = newCtx 6382 a.app.Srv().Store.SetContext(newCtx) 6383 defer func() { 6384 a.app.Srv().Store.SetContext(origCtx) 6385 a.ctx = origCtx 6386 }() 6387 6388 defer span.Finish() 6389 a.app.InitPostMetadata() 6390 } 6391 6392 func (a *OpenTracingAppLayer) InvalidateAllCaches() *model.AppError { 6393 origCtx := a.ctx 6394 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllCaches") 6395 6396 a.ctx = newCtx 6397 a.app.Srv().Store.SetContext(newCtx) 6398 defer func() { 6399 a.app.Srv().Store.SetContext(origCtx) 6400 a.ctx = origCtx 6401 }() 6402 6403 defer span.Finish() 6404 resultVar0 := a.app.InvalidateAllCaches() 6405 6406 if resultVar0 != nil { 6407 span.LogFields(spanlog.Error(resultVar0)) 6408 ext.Error.Set(span, true) 6409 } 6410 6411 return resultVar0 6412 } 6413 6414 func (a *OpenTracingAppLayer) InvalidateAllCachesSkipSend() { 6415 origCtx := a.ctx 6416 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateAllCachesSkipSend") 6417 6418 a.ctx = newCtx 6419 a.app.Srv().Store.SetContext(newCtx) 6420 defer func() { 6421 a.app.Srv().Store.SetContext(origCtx) 6422 a.ctx = origCtx 6423 }() 6424 6425 defer span.Finish() 6426 a.app.InvalidateAllCachesSkipSend() 6427 } 6428 6429 func (a *OpenTracingAppLayer) InvalidateCacheForUser(userId string) { 6430 origCtx := a.ctx 6431 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateCacheForUser") 6432 6433 a.ctx = newCtx 6434 a.app.Srv().Store.SetContext(newCtx) 6435 defer func() { 6436 a.app.Srv().Store.SetContext(origCtx) 6437 a.ctx = origCtx 6438 }() 6439 6440 defer span.Finish() 6441 a.app.InvalidateCacheForUser(userId) 6442 } 6443 6444 func (a *OpenTracingAppLayer) InvalidateWebConnSessionCacheForUser(userId string) { 6445 origCtx := a.ctx 6446 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.InvalidateWebConnSessionCacheForUser") 6447 6448 a.ctx = newCtx 6449 a.app.Srv().Store.SetContext(newCtx) 6450 defer func() { 6451 a.app.Srv().Store.SetContext(origCtx) 6452 a.ctx = origCtx 6453 }() 6454 6455 defer span.Finish() 6456 a.app.InvalidateWebConnSessionCacheForUser(userId) 6457 } 6458 6459 func (a *OpenTracingAppLayer) IsFirstUserAccount() bool { 6460 origCtx := a.ctx 6461 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsFirstUserAccount") 6462 6463 a.ctx = newCtx 6464 a.app.Srv().Store.SetContext(newCtx) 6465 defer func() { 6466 a.app.Srv().Store.SetContext(origCtx) 6467 a.ctx = origCtx 6468 }() 6469 6470 defer span.Finish() 6471 resultVar0 := a.app.IsFirstUserAccount() 6472 6473 return resultVar0 6474 } 6475 6476 func (a *OpenTracingAppLayer) IsLeader() bool { 6477 origCtx := a.ctx 6478 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsLeader") 6479 6480 a.ctx = newCtx 6481 a.app.Srv().Store.SetContext(newCtx) 6482 defer func() { 6483 a.app.Srv().Store.SetContext(origCtx) 6484 a.ctx = origCtx 6485 }() 6486 6487 defer span.Finish() 6488 resultVar0 := a.app.IsLeader() 6489 6490 return resultVar0 6491 } 6492 6493 func (a *OpenTracingAppLayer) IsPasswordValid(password string) *model.AppError { 6494 origCtx := a.ctx 6495 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPasswordValid") 6496 6497 a.ctx = newCtx 6498 a.app.Srv().Store.SetContext(newCtx) 6499 defer func() { 6500 a.app.Srv().Store.SetContext(origCtx) 6501 a.ctx = origCtx 6502 }() 6503 6504 defer span.Finish() 6505 resultVar0 := a.app.IsPasswordValid(password) 6506 6507 if resultVar0 != nil { 6508 span.LogFields(spanlog.Error(resultVar0)) 6509 ext.Error.Set(span, true) 6510 } 6511 6512 return resultVar0 6513 } 6514 6515 func (a *OpenTracingAppLayer) IsPhase2MigrationCompleted() *model.AppError { 6516 origCtx := a.ctx 6517 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsPhase2MigrationCompleted") 6518 6519 a.ctx = newCtx 6520 a.app.Srv().Store.SetContext(newCtx) 6521 defer func() { 6522 a.app.Srv().Store.SetContext(origCtx) 6523 a.ctx = origCtx 6524 }() 6525 6526 defer span.Finish() 6527 resultVar0 := a.app.IsPhase2MigrationCompleted() 6528 6529 if resultVar0 != nil { 6530 span.LogFields(spanlog.Error(resultVar0)) 6531 ext.Error.Set(span, true) 6532 } 6533 6534 return resultVar0 6535 } 6536 6537 func (a *OpenTracingAppLayer) IsUserAway(lastActivityAt int64) bool { 6538 origCtx := a.ctx 6539 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserAway") 6540 6541 a.ctx = newCtx 6542 a.app.Srv().Store.SetContext(newCtx) 6543 defer func() { 6544 a.app.Srv().Store.SetContext(origCtx) 6545 a.ctx = origCtx 6546 }() 6547 6548 defer span.Finish() 6549 resultVar0 := a.app.IsUserAway(lastActivityAt) 6550 6551 return resultVar0 6552 } 6553 6554 func (a *OpenTracingAppLayer) IsUserSignUpAllowed() *model.AppError { 6555 origCtx := a.ctx 6556 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUserSignUpAllowed") 6557 6558 a.ctx = newCtx 6559 a.app.Srv().Store.SetContext(newCtx) 6560 defer func() { 6561 a.app.Srv().Store.SetContext(origCtx) 6562 a.ctx = origCtx 6563 }() 6564 6565 defer span.Finish() 6566 resultVar0 := a.app.IsUserSignUpAllowed() 6567 6568 if resultVar0 != nil { 6569 span.LogFields(spanlog.Error(resultVar0)) 6570 ext.Error.Set(span, true) 6571 } 6572 6573 return resultVar0 6574 } 6575 6576 func (a *OpenTracingAppLayer) IsUsernameTaken(name string) bool { 6577 origCtx := a.ctx 6578 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.IsUsernameTaken") 6579 6580 a.ctx = newCtx 6581 a.app.Srv().Store.SetContext(newCtx) 6582 defer func() { 6583 a.app.Srv().Store.SetContext(origCtx) 6584 a.ctx = origCtx 6585 }() 6586 6587 defer span.Finish() 6588 resultVar0 := a.app.IsUsernameTaken(name) 6589 6590 return resultVar0 6591 } 6592 6593 func (a *OpenTracingAppLayer) JoinClass(class *model.Class, userId string) *model.AppError { 6594 origCtx := a.ctx 6595 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinClass") 6596 6597 a.ctx = newCtx 6598 a.app.Srv().Store.SetContext(newCtx) 6599 defer func() { 6600 a.app.Srv().Store.SetContext(origCtx) 6601 a.ctx = origCtx 6602 }() 6603 6604 defer span.Finish() 6605 resultVar0 := a.app.JoinClass(class, userId) 6606 6607 if resultVar0 != nil { 6608 span.LogFields(spanlog.Error(resultVar0)) 6609 ext.Error.Set(span, true) 6610 } 6611 6612 return resultVar0 6613 } 6614 6615 func (a *OpenTracingAppLayer) JoinDefaultClasses(branchId string, user *model.User, shouldBeAdmin bool, userRequestorId string) *model.AppError { 6616 origCtx := a.ctx 6617 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinDefaultClasses") 6618 6619 a.ctx = newCtx 6620 a.app.Srv().Store.SetContext(newCtx) 6621 defer func() { 6622 a.app.Srv().Store.SetContext(origCtx) 6623 a.ctx = origCtx 6624 }() 6625 6626 defer span.Finish() 6627 resultVar0 := a.app.JoinDefaultClasses(branchId, user, shouldBeAdmin, userRequestorId) 6628 6629 if resultVar0 != nil { 6630 span.LogFields(spanlog.Error(resultVar0)) 6631 ext.Error.Set(span, true) 6632 } 6633 6634 return resultVar0 6635 } 6636 6637 func (a *OpenTracingAppLayer) JoinUserToBranch(branch *model.Branch, user *model.User, userRequestorId string) *model.AppError { 6638 origCtx := a.ctx 6639 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.JoinUserToBranch") 6640 6641 a.ctx = newCtx 6642 a.app.Srv().Store.SetContext(newCtx) 6643 defer func() { 6644 a.app.Srv().Store.SetContext(origCtx) 6645 a.ctx = origCtx 6646 }() 6647 6648 defer span.Finish() 6649 resultVar0 := a.app.JoinUserToBranch(branch, user, userRequestorId) 6650 6651 if resultVar0 != nil { 6652 span.LogFields(spanlog.Error(resultVar0)) 6653 ext.Error.Set(span, true) 6654 } 6655 6656 return resultVar0 6657 } 6658 6659 func (a *OpenTracingAppLayer) LeaveBranch(branch *model.Branch, user *model.User, requestorId string) *model.AppError { 6660 origCtx := a.ctx 6661 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveBranch") 6662 6663 a.ctx = newCtx 6664 a.app.Srv().Store.SetContext(newCtx) 6665 defer func() { 6666 a.app.Srv().Store.SetContext(origCtx) 6667 a.ctx = origCtx 6668 }() 6669 6670 defer span.Finish() 6671 resultVar0 := a.app.LeaveBranch(branch, user, requestorId) 6672 6673 if resultVar0 != nil { 6674 span.LogFields(spanlog.Error(resultVar0)) 6675 ext.Error.Set(span, true) 6676 } 6677 6678 return resultVar0 6679 } 6680 6681 func (a *OpenTracingAppLayer) LeaveClass(classId string, userId string) *model.AppError { 6682 origCtx := a.ctx 6683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LeaveClass") 6684 6685 a.ctx = newCtx 6686 a.app.Srv().Store.SetContext(newCtx) 6687 defer func() { 6688 a.app.Srv().Store.SetContext(origCtx) 6689 a.ctx = origCtx 6690 }() 6691 6692 defer span.Finish() 6693 resultVar0 := a.app.LeaveClass(classId, userId) 6694 6695 if resultVar0 != nil { 6696 span.LogFields(spanlog.Error(resultVar0)) 6697 ext.Error.Set(span, true) 6698 } 6699 6700 return resultVar0 6701 } 6702 6703 func (a *OpenTracingAppLayer) License() *model.License { 6704 origCtx := a.ctx 6705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.License") 6706 6707 a.ctx = newCtx 6708 a.app.Srv().Store.SetContext(newCtx) 6709 defer func() { 6710 a.app.Srv().Store.SetContext(origCtx) 6711 a.ctx = origCtx 6712 }() 6713 6714 defer span.Finish() 6715 resultVar0 := a.app.License() 6716 6717 return resultVar0 6718 } 6719 6720 func (a *OpenTracingAppLayer) LimitedClientConfig() map[string]string { 6721 origCtx := a.ctx 6722 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfig") 6723 6724 a.ctx = newCtx 6725 a.app.Srv().Store.SetContext(newCtx) 6726 defer func() { 6727 a.app.Srv().Store.SetContext(origCtx) 6728 a.ctx = origCtx 6729 }() 6730 6731 defer span.Finish() 6732 resultVar0 := a.app.LimitedClientConfig() 6733 6734 return resultVar0 6735 } 6736 6737 func (a *OpenTracingAppLayer) LimitedClientConfigWithComputed() map[string]string { 6738 origCtx := a.ctx 6739 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LimitedClientConfigWithComputed") 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 := a.app.LimitedClientConfigWithComputed() 6750 6751 return resultVar0 6752 } 6753 6754 func (a *OpenTracingAppLayer) ListAllCommands(branchId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 6755 origCtx := a.ctx 6756 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAllCommands") 6757 6758 a.ctx = newCtx 6759 a.app.Srv().Store.SetContext(newCtx) 6760 defer func() { 6761 a.app.Srv().Store.SetContext(origCtx) 6762 a.ctx = origCtx 6763 }() 6764 6765 defer span.Finish() 6766 resultVar0, resultVar1 := a.app.ListAllCommands(branchId, T) 6767 6768 if resultVar1 != nil { 6769 span.LogFields(spanlog.Error(resultVar1)) 6770 ext.Error.Set(span, true) 6771 } 6772 6773 return resultVar0, resultVar1 6774 } 6775 6776 func (a *OpenTracingAppLayer) ListAutocompleteCommands(branchId string, T goi18n.TranslateFunc) ([]*model.Command, *model.AppError) { 6777 origCtx := a.ctx 6778 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListAutocompleteCommands") 6779 6780 a.ctx = newCtx 6781 a.app.Srv().Store.SetContext(newCtx) 6782 defer func() { 6783 a.app.Srv().Store.SetContext(origCtx) 6784 a.ctx = origCtx 6785 }() 6786 6787 defer span.Finish() 6788 resultVar0, resultVar1 := a.app.ListAutocompleteCommands(branchId, T) 6789 6790 if resultVar1 != nil { 6791 span.LogFields(spanlog.Error(resultVar1)) 6792 ext.Error.Set(span, true) 6793 } 6794 6795 return resultVar0, resultVar1 6796 } 6797 6798 func (a *OpenTracingAppLayer) ListBranchCommands(branchId string) ([]*model.Command, *model.AppError) { 6799 origCtx := a.ctx 6800 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListBranchCommands") 6801 6802 a.ctx = newCtx 6803 a.app.Srv().Store.SetContext(newCtx) 6804 defer func() { 6805 a.app.Srv().Store.SetContext(origCtx) 6806 a.ctx = origCtx 6807 }() 6808 6809 defer span.Finish() 6810 resultVar0, resultVar1 := a.app.ListBranchCommands(branchId) 6811 6812 if resultVar1 != nil { 6813 span.LogFields(spanlog.Error(resultVar1)) 6814 ext.Error.Set(span, true) 6815 } 6816 6817 return resultVar0, resultVar1 6818 } 6819 6820 func (a *OpenTracingAppLayer) ListDirectory(path string) ([]string, *model.AppError) { 6821 origCtx := a.ctx 6822 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ListDirectory") 6823 6824 a.ctx = newCtx 6825 a.app.Srv().Store.SetContext(newCtx) 6826 defer func() { 6827 a.app.Srv().Store.SetContext(origCtx) 6828 a.ctx = origCtx 6829 }() 6830 6831 defer span.Finish() 6832 resultVar0, resultVar1 := a.app.ListDirectory(path) 6833 6834 if resultVar1 != nil { 6835 span.LogFields(spanlog.Error(resultVar1)) 6836 ext.Error.Set(span, true) 6837 } 6838 6839 return resultVar0, resultVar1 6840 } 6841 6842 func (a *OpenTracingAppLayer) LoadLicense() { 6843 origCtx := a.ctx 6844 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoadLicense") 6845 6846 a.ctx = newCtx 6847 a.app.Srv().Store.SetContext(newCtx) 6848 defer func() { 6849 a.app.Srv().Store.SetContext(origCtx) 6850 a.ctx = origCtx 6851 }() 6852 6853 defer span.Finish() 6854 a.app.LoadLicense() 6855 } 6856 6857 func (a *OpenTracingAppLayer) LoginByOAuth(service string, userData io.Reader, branchId string) (*model.User, *model.AppError) { 6858 origCtx := a.ctx 6859 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.LoginByOAuth") 6860 6861 a.ctx = newCtx 6862 a.app.Srv().Store.SetContext(newCtx) 6863 defer func() { 6864 a.app.Srv().Store.SetContext(origCtx) 6865 a.ctx = origCtx 6866 }() 6867 6868 defer span.Finish() 6869 resultVar0, resultVar1 := a.app.LoginByOAuth(service, userData, branchId) 6870 6871 if resultVar1 != nil { 6872 span.LogFields(spanlog.Error(resultVar1)) 6873 ext.Error.Set(span, true) 6874 } 6875 6876 return resultVar0, resultVar1 6877 } 6878 6879 func (a *OpenTracingAppLayer) MakePermissionError(permission *model.Permission) *model.AppError { 6880 origCtx := a.ctx 6881 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MakePermissionError") 6882 6883 a.ctx = newCtx 6884 a.app.Srv().Store.SetContext(newCtx) 6885 defer func() { 6886 a.app.Srv().Store.SetContext(origCtx) 6887 a.ctx = origCtx 6888 }() 6889 6890 defer span.Finish() 6891 resultVar0 := a.app.MakePermissionError(permission) 6892 6893 if resultVar0 != nil { 6894 span.LogFields(spanlog.Error(resultVar0)) 6895 ext.Error.Set(span, true) 6896 } 6897 6898 return resultVar0 6899 } 6900 6901 func (a *OpenTracingAppLayer) MaxPostSize() int { 6902 origCtx := a.ctx 6903 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MaxPostSize") 6904 6905 a.ctx = newCtx 6906 a.app.Srv().Store.SetContext(newCtx) 6907 defer func() { 6908 a.app.Srv().Store.SetContext(origCtx) 6909 a.ctx = origCtx 6910 }() 6911 6912 defer span.Finish() 6913 resultVar0 := a.app.MaxPostSize() 6914 6915 return resultVar0 6916 } 6917 6918 func (a *OpenTracingAppLayer) MigrateFilenamesToFileInfos(post *model.Post) []*model.FileInfo { 6919 origCtx := a.ctx 6920 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MigrateFilenamesToFileInfos") 6921 6922 a.ctx = newCtx 6923 a.app.Srv().Store.SetContext(newCtx) 6924 defer func() { 6925 a.app.Srv().Store.SetContext(origCtx) 6926 a.ctx = origCtx 6927 }() 6928 6929 defer span.Finish() 6930 resultVar0 := a.app.MigrateFilenamesToFileInfos(post) 6931 6932 return resultVar0 6933 } 6934 6935 func (a *OpenTracingAppLayer) MoveClass(branch *model.Branch, class *model.Class, user *model.User, removeDeactivatedMembers bool) *model.AppError { 6936 origCtx := a.ctx 6937 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveClass") 6938 6939 a.ctx = newCtx 6940 a.app.Srv().Store.SetContext(newCtx) 6941 defer func() { 6942 a.app.Srv().Store.SetContext(origCtx) 6943 a.ctx = origCtx 6944 }() 6945 6946 defer span.Finish() 6947 resultVar0 := a.app.MoveClass(branch, class, user, removeDeactivatedMembers) 6948 6949 if resultVar0 != nil { 6950 span.LogFields(spanlog.Error(resultVar0)) 6951 ext.Error.Set(span, true) 6952 } 6953 6954 return resultVar0 6955 } 6956 6957 func (a *OpenTracingAppLayer) MoveCommand(branch *model.Branch, command *model.Command) *model.AppError { 6958 origCtx := a.ctx 6959 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveCommand") 6960 6961 a.ctx = newCtx 6962 a.app.Srv().Store.SetContext(newCtx) 6963 defer func() { 6964 a.app.Srv().Store.SetContext(origCtx) 6965 a.ctx = origCtx 6966 }() 6967 6968 defer span.Finish() 6969 resultVar0 := a.app.MoveCommand(branch, command) 6970 6971 if resultVar0 != nil { 6972 span.LogFields(spanlog.Error(resultVar0)) 6973 ext.Error.Set(span, true) 6974 } 6975 6976 return resultVar0 6977 } 6978 6979 func (a *OpenTracingAppLayer) MoveFile(oldPath string, newPath string) *model.AppError { 6980 origCtx := a.ctx 6981 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.MoveFile") 6982 6983 a.ctx = newCtx 6984 a.app.Srv().Store.SetContext(newCtx) 6985 defer func() { 6986 a.app.Srv().Store.SetContext(origCtx) 6987 a.ctx = origCtx 6988 }() 6989 6990 defer span.Finish() 6991 resultVar0 := a.app.MoveFile(oldPath, newPath) 6992 6993 if resultVar0 != nil { 6994 span.LogFields(spanlog.Error(resultVar0)) 6995 ext.Error.Set(span, true) 6996 } 6997 6998 return resultVar0 6999 } 7000 7001 func (a *OpenTracingAppLayer) NewClusterDiscoveryService() *ClusterDiscoveryService { 7002 origCtx := a.ctx 7003 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewClusterDiscoveryService") 7004 7005 a.ctx = newCtx 7006 a.app.Srv().Store.SetContext(newCtx) 7007 defer func() { 7008 a.app.Srv().Store.SetContext(origCtx) 7009 a.ctx = origCtx 7010 }() 7011 7012 defer span.Finish() 7013 resultVar0 := a.app.NewClusterDiscoveryService() 7014 7015 return resultVar0 7016 } 7017 7018 func (a *OpenTracingAppLayer) NewWebConn(ws *websocket.Conn, session model.Session, t goi18n.TranslateFunc, locale string) *WebConn { 7019 origCtx := a.ctx 7020 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebConn") 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.NewWebConn(ws, session, t, locale) 7031 7032 return resultVar0 7033 } 7034 7035 func (a *OpenTracingAppLayer) NewWebHub() *Hub { 7036 origCtx := a.ctx 7037 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.NewWebHub") 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 := a.app.NewWebHub() 7048 7049 return resultVar0 7050 } 7051 7052 func (a *OpenTracingAppLayer) OriginChecker() func(*http.Request) bool { 7053 origCtx := a.ctx 7054 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OriginChecker") 7055 7056 a.ctx = newCtx 7057 a.app.Srv().Store.SetContext(newCtx) 7058 defer func() { 7059 a.app.Srv().Store.SetContext(origCtx) 7060 a.ctx = origCtx 7061 }() 7062 7063 defer span.Finish() 7064 resultVar0 := a.app.OriginChecker() 7065 7066 return resultVar0 7067 } 7068 7069 func (a *OpenTracingAppLayer) OverrideIconURLIfEmoji(post *model.Post) { 7070 origCtx := a.ctx 7071 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.OverrideIconURLIfEmoji") 7072 7073 a.ctx = newCtx 7074 a.app.Srv().Store.SetContext(newCtx) 7075 defer func() { 7076 a.app.Srv().Store.SetContext(origCtx) 7077 a.ctx = origCtx 7078 }() 7079 7080 defer span.Finish() 7081 a.app.OverrideIconURLIfEmoji(post) 7082 } 7083 7084 func (a *OpenTracingAppLayer) PatchBranch(branchId string, patch *model.BranchPatch) (*model.Branch, *model.AppError) { 7085 origCtx := a.ctx 7086 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchBranch") 7087 7088 a.ctx = newCtx 7089 a.app.Srv().Store.SetContext(newCtx) 7090 defer func() { 7091 a.app.Srv().Store.SetContext(origCtx) 7092 a.ctx = origCtx 7093 }() 7094 7095 defer span.Finish() 7096 resultVar0, resultVar1 := a.app.PatchBranch(branchId, patch) 7097 7098 if resultVar1 != nil { 7099 span.LogFields(spanlog.Error(resultVar1)) 7100 ext.Error.Set(span, true) 7101 } 7102 7103 return resultVar0, resultVar1 7104 } 7105 7106 func (a *OpenTracingAppLayer) PatchClass(class *model.Class, patch *model.ClassPatch, userId string) (*model.Class, *model.AppError) { 7107 origCtx := a.ctx 7108 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchClass") 7109 7110 a.ctx = newCtx 7111 a.app.Srv().Store.SetContext(newCtx) 7112 defer func() { 7113 a.app.Srv().Store.SetContext(origCtx) 7114 a.ctx = origCtx 7115 }() 7116 7117 defer span.Finish() 7118 resultVar0, resultVar1 := a.app.PatchClass(class, patch, userId) 7119 7120 if resultVar1 != nil { 7121 span.LogFields(spanlog.Error(resultVar1)) 7122 ext.Error.Set(span, true) 7123 } 7124 7125 return resultVar0, resultVar1 7126 } 7127 7128 func (a *OpenTracingAppLayer) PatchClassModerationsForClass(class *model.Class, classModerationsPatch []*model.ClassModerationPatch) ([]*model.ClassModeration, *model.AppError) { 7129 origCtx := a.ctx 7130 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchClassModerationsForClass") 7131 7132 a.ctx = newCtx 7133 a.app.Srv().Store.SetContext(newCtx) 7134 defer func() { 7135 a.app.Srv().Store.SetContext(origCtx) 7136 a.ctx = origCtx 7137 }() 7138 7139 defer span.Finish() 7140 resultVar0, resultVar1 := a.app.PatchClassModerationsForClass(class, classModerationsPatch) 7141 7142 if resultVar1 != nil { 7143 span.LogFields(spanlog.Error(resultVar1)) 7144 ext.Error.Set(span, true) 7145 } 7146 7147 return resultVar0, resultVar1 7148 } 7149 7150 func (a *OpenTracingAppLayer) PatchPost(postId string, patch *model.PostPatch) (*model.Post, *model.AppError) { 7151 origCtx := a.ctx 7152 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchPost") 7153 7154 a.ctx = newCtx 7155 a.app.Srv().Store.SetContext(newCtx) 7156 defer func() { 7157 a.app.Srv().Store.SetContext(origCtx) 7158 a.ctx = origCtx 7159 }() 7160 7161 defer span.Finish() 7162 resultVar0, resultVar1 := a.app.PatchPost(postId, patch) 7163 7164 if resultVar1 != nil { 7165 span.LogFields(spanlog.Error(resultVar1)) 7166 ext.Error.Set(span, true) 7167 } 7168 7169 return resultVar0, resultVar1 7170 } 7171 7172 func (a *OpenTracingAppLayer) PatchRole(role *model.Role, patch *model.RolePatch) (*model.Role, *model.AppError) { 7173 origCtx := a.ctx 7174 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchRole") 7175 7176 a.ctx = newCtx 7177 a.app.Srv().Store.SetContext(newCtx) 7178 defer func() { 7179 a.app.Srv().Store.SetContext(origCtx) 7180 a.ctx = origCtx 7181 }() 7182 7183 defer span.Finish() 7184 resultVar0, resultVar1 := a.app.PatchRole(role, patch) 7185 7186 if resultVar1 != nil { 7187 span.LogFields(spanlog.Error(resultVar1)) 7188 ext.Error.Set(span, true) 7189 } 7190 7191 return resultVar0, resultVar1 7192 } 7193 7194 func (a *OpenTracingAppLayer) PatchScheme(scheme *model.Scheme, patch *model.SchemePatch) (*model.Scheme, *model.AppError) { 7195 origCtx := a.ctx 7196 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchScheme") 7197 7198 a.ctx = newCtx 7199 a.app.Srv().Store.SetContext(newCtx) 7200 defer func() { 7201 a.app.Srv().Store.SetContext(origCtx) 7202 a.ctx = origCtx 7203 }() 7204 7205 defer span.Finish() 7206 resultVar0, resultVar1 := a.app.PatchScheme(scheme, patch) 7207 7208 if resultVar1 != nil { 7209 span.LogFields(spanlog.Error(resultVar1)) 7210 ext.Error.Set(span, true) 7211 } 7212 7213 return resultVar0, resultVar1 7214 } 7215 7216 func (a *OpenTracingAppLayer) PatchUser(userId string, patch *model.UserPatch, asAdmin bool) (*model.User, *model.AppError) { 7217 origCtx := a.ctx 7218 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PatchUser") 7219 7220 a.ctx = newCtx 7221 a.app.Srv().Store.SetContext(newCtx) 7222 defer func() { 7223 a.app.Srv().Store.SetContext(origCtx) 7224 a.ctx = origCtx 7225 }() 7226 7227 defer span.Finish() 7228 resultVar0, resultVar1 := a.app.PatchUser(userId, patch, asAdmin) 7229 7230 if resultVar1 != nil { 7231 span.LogFields(spanlog.Error(resultVar1)) 7232 ext.Error.Set(span, true) 7233 } 7234 7235 return resultVar0, resultVar1 7236 } 7237 7238 func (a *OpenTracingAppLayer) PermanentDeleteAllUsers() *model.AppError { 7239 origCtx := a.ctx 7240 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteAllUsers") 7241 7242 a.ctx = newCtx 7243 a.app.Srv().Store.SetContext(newCtx) 7244 defer func() { 7245 a.app.Srv().Store.SetContext(origCtx) 7246 a.ctx = origCtx 7247 }() 7248 7249 defer span.Finish() 7250 resultVar0 := a.app.PermanentDeleteAllUsers() 7251 7252 if resultVar0 != nil { 7253 span.LogFields(spanlog.Error(resultVar0)) 7254 ext.Error.Set(span, true) 7255 } 7256 7257 return resultVar0 7258 } 7259 7260 func (a *OpenTracingAppLayer) PermanentDeleteBranch(branch *model.Branch) *model.AppError { 7261 origCtx := a.ctx 7262 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteBranch") 7263 7264 a.ctx = newCtx 7265 a.app.Srv().Store.SetContext(newCtx) 7266 defer func() { 7267 a.app.Srv().Store.SetContext(origCtx) 7268 a.ctx = origCtx 7269 }() 7270 7271 defer span.Finish() 7272 resultVar0 := a.app.PermanentDeleteBranch(branch) 7273 7274 if resultVar0 != nil { 7275 span.LogFields(spanlog.Error(resultVar0)) 7276 ext.Error.Set(span, true) 7277 } 7278 7279 return resultVar0 7280 } 7281 7282 func (a *OpenTracingAppLayer) PermanentDeleteBranchId(branchId string) *model.AppError { 7283 origCtx := a.ctx 7284 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteBranchId") 7285 7286 a.ctx = newCtx 7287 a.app.Srv().Store.SetContext(newCtx) 7288 defer func() { 7289 a.app.Srv().Store.SetContext(origCtx) 7290 a.ctx = origCtx 7291 }() 7292 7293 defer span.Finish() 7294 resultVar0 := a.app.PermanentDeleteBranchId(branchId) 7295 7296 if resultVar0 != nil { 7297 span.LogFields(spanlog.Error(resultVar0)) 7298 ext.Error.Set(span, true) 7299 } 7300 7301 return resultVar0 7302 } 7303 7304 func (a *OpenTracingAppLayer) PermanentDeleteClass(class *model.Class) *model.AppError { 7305 origCtx := a.ctx 7306 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteClass") 7307 7308 a.ctx = newCtx 7309 a.app.Srv().Store.SetContext(newCtx) 7310 defer func() { 7311 a.app.Srv().Store.SetContext(origCtx) 7312 a.ctx = origCtx 7313 }() 7314 7315 defer span.Finish() 7316 resultVar0 := a.app.PermanentDeleteClass(class) 7317 7318 if resultVar0 != nil { 7319 span.LogFields(spanlog.Error(resultVar0)) 7320 ext.Error.Set(span, true) 7321 } 7322 7323 return resultVar0 7324 } 7325 7326 func (a *OpenTracingAppLayer) PermanentDeleteUser(user *model.User) *model.AppError { 7327 origCtx := a.ctx 7328 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PermanentDeleteUser") 7329 7330 a.ctx = newCtx 7331 a.app.Srv().Store.SetContext(newCtx) 7332 defer func() { 7333 a.app.Srv().Store.SetContext(origCtx) 7334 a.ctx = origCtx 7335 }() 7336 7337 defer span.Finish() 7338 resultVar0 := a.app.PermanentDeleteUser(user) 7339 7340 if resultVar0 != nil { 7341 span.LogFields(spanlog.Error(resultVar0)) 7342 ext.Error.Set(span, true) 7343 } 7344 7345 return resultVar0 7346 } 7347 7348 func (a *OpenTracingAppLayer) PostActionCookieSecret() []byte { 7349 origCtx := a.ctx 7350 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostActionCookieSecret") 7351 7352 a.ctx = newCtx 7353 a.app.Srv().Store.SetContext(newCtx) 7354 defer func() { 7355 a.app.Srv().Store.SetContext(origCtx) 7356 a.ctx = origCtx 7357 }() 7358 7359 defer span.Finish() 7360 resultVar0 := a.app.PostActionCookieSecret() 7361 7362 return resultVar0 7363 } 7364 7365 func (a *OpenTracingAppLayer) PostPatchWithProxyRemovedFromImageURLs(patch *model.PostPatch) *model.PostPatch { 7366 origCtx := a.ctx 7367 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostPatchWithProxyRemovedFromImageURLs") 7368 7369 a.ctx = newCtx 7370 a.app.Srv().Store.SetContext(newCtx) 7371 defer func() { 7372 a.app.Srv().Store.SetContext(origCtx) 7373 a.ctx = origCtx 7374 }() 7375 7376 defer span.Finish() 7377 resultVar0 := a.app.PostPatchWithProxyRemovedFromImageURLs(patch) 7378 7379 return resultVar0 7380 } 7381 7382 func (a *OpenTracingAppLayer) PostWithProxyAddedToImageURLs(post *model.Post) *model.Post { 7383 origCtx := a.ctx 7384 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyAddedToImageURLs") 7385 7386 a.ctx = newCtx 7387 a.app.Srv().Store.SetContext(newCtx) 7388 defer func() { 7389 a.app.Srv().Store.SetContext(origCtx) 7390 a.ctx = origCtx 7391 }() 7392 7393 defer span.Finish() 7394 resultVar0 := a.app.PostWithProxyAddedToImageURLs(post) 7395 7396 return resultVar0 7397 } 7398 7399 func (a *OpenTracingAppLayer) PostWithProxyRemovedFromImageURLs(post *model.Post) *model.Post { 7400 origCtx := a.ctx 7401 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PostWithProxyRemovedFromImageURLs") 7402 7403 a.ctx = newCtx 7404 a.app.Srv().Store.SetContext(newCtx) 7405 defer func() { 7406 a.app.Srv().Store.SetContext(origCtx) 7407 a.ctx = origCtx 7408 }() 7409 7410 defer span.Finish() 7411 resultVar0 := a.app.PostWithProxyRemovedFromImageURLs(post) 7412 7413 return resultVar0 7414 } 7415 7416 func (a *OpenTracingAppLayer) PreparePostForClient(originalPost *model.Post, isNewPost bool, isEditPost bool) *model.Post { 7417 origCtx := a.ctx 7418 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostForClient") 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 := a.app.PreparePostForClient(originalPost, isNewPost, isEditPost) 7429 7430 return resultVar0 7431 } 7432 7433 func (a *OpenTracingAppLayer) PreparePostListForClient(originalList *model.PostList) *model.PostList { 7434 origCtx := a.ctx 7435 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PreparePostListForClient") 7436 7437 a.ctx = newCtx 7438 a.app.Srv().Store.SetContext(newCtx) 7439 defer func() { 7440 a.app.Srv().Store.SetContext(origCtx) 7441 a.ctx = origCtx 7442 }() 7443 7444 defer span.Finish() 7445 resultVar0 := a.app.PreparePostListForClient(originalList) 7446 7447 return resultVar0 7448 } 7449 7450 func (a *OpenTracingAppLayer) Publish(message *model.WebSocketEvent) { 7451 origCtx := a.ctx 7452 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Publish") 7453 7454 a.ctx = newCtx 7455 a.app.Srv().Store.SetContext(newCtx) 7456 defer func() { 7457 a.app.Srv().Store.SetContext(origCtx) 7458 a.ctx = origCtx 7459 }() 7460 7461 defer span.Finish() 7462 a.app.Publish(message) 7463 } 7464 7465 func (a *OpenTracingAppLayer) PublishSkipClusterSend(message *model.WebSocketEvent) { 7466 origCtx := a.ctx 7467 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PublishSkipClusterSend") 7468 7469 a.ctx = newCtx 7470 a.app.Srv().Store.SetContext(newCtx) 7471 defer func() { 7472 a.app.Srv().Store.SetContext(origCtx) 7473 a.ctx = origCtx 7474 }() 7475 7476 defer span.Finish() 7477 a.app.PublishSkipClusterSend(message) 7478 } 7479 7480 func (a *OpenTracingAppLayer) PurgeElasticsearchIndexes() *model.AppError { 7481 origCtx := a.ctx 7482 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.PurgeElasticsearchIndexes") 7483 7484 a.ctx = newCtx 7485 a.app.Srv().Store.SetContext(newCtx) 7486 defer func() { 7487 a.app.Srv().Store.SetContext(origCtx) 7488 a.ctx = origCtx 7489 }() 7490 7491 defer span.Finish() 7492 resultVar0 := a.app.PurgeElasticsearchIndexes() 7493 7494 if resultVar0 != nil { 7495 span.LogFields(spanlog.Error(resultVar0)) 7496 ext.Error.Set(span, true) 7497 } 7498 7499 return resultVar0 7500 } 7501 7502 func (a *OpenTracingAppLayer) ReadFile(path string) ([]byte, *model.AppError) { 7503 origCtx := a.ctx 7504 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReadFile") 7505 7506 a.ctx = newCtx 7507 a.app.Srv().Store.SetContext(newCtx) 7508 defer func() { 7509 a.app.Srv().Store.SetContext(origCtx) 7510 a.ctx = origCtx 7511 }() 7512 7513 defer span.Finish() 7514 resultVar0, resultVar1 := a.app.ReadFile(path) 7515 7516 if resultVar1 != nil { 7517 span.LogFields(spanlog.Error(resultVar1)) 7518 ext.Error.Set(span, true) 7519 } 7520 7521 return resultVar0, resultVar1 7522 } 7523 7524 func (a *OpenTracingAppLayer) RecycleDatabaseConnection() { 7525 origCtx := a.ctx 7526 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RecycleDatabaseConnection") 7527 7528 a.ctx = newCtx 7529 a.app.Srv().Store.SetContext(newCtx) 7530 defer func() { 7531 a.app.Srv().Store.SetContext(origCtx) 7532 a.ctx = origCtx 7533 }() 7534 7535 defer span.Finish() 7536 a.app.RecycleDatabaseConnection() 7537 } 7538 7539 func (a *OpenTracingAppLayer) RegenCommandToken(cmd *model.Command) (*model.Command, *model.AppError) { 7540 origCtx := a.ctx 7541 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenCommandToken") 7542 7543 a.ctx = newCtx 7544 a.app.Srv().Store.SetContext(newCtx) 7545 defer func() { 7546 a.app.Srv().Store.SetContext(origCtx) 7547 a.ctx = origCtx 7548 }() 7549 7550 defer span.Finish() 7551 resultVar0, resultVar1 := a.app.RegenCommandToken(cmd) 7552 7553 if resultVar1 != nil { 7554 span.LogFields(spanlog.Error(resultVar1)) 7555 ext.Error.Set(span, true) 7556 } 7557 7558 return resultVar0, resultVar1 7559 } 7560 7561 func (a *OpenTracingAppLayer) RegenerateOAuthAppSecret(app *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 7562 origCtx := a.ctx 7563 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RegenerateOAuthAppSecret") 7564 7565 a.ctx = newCtx 7566 a.app.Srv().Store.SetContext(newCtx) 7567 defer func() { 7568 a.app.Srv().Store.SetContext(origCtx) 7569 a.ctx = origCtx 7570 }() 7571 7572 defer span.Finish() 7573 resultVar0, resultVar1 := a.app.RegenerateOAuthAppSecret(app) 7574 7575 if resultVar1 != nil { 7576 span.LogFields(spanlog.Error(resultVar1)) 7577 ext.Error.Set(span, true) 7578 } 7579 7580 return resultVar0, resultVar1 7581 } 7582 7583 func (a *OpenTracingAppLayer) ReloadConfig() error { 7584 origCtx := a.ctx 7585 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ReloadConfig") 7586 7587 a.ctx = newCtx 7588 a.app.Srv().Store.SetContext(newCtx) 7589 defer func() { 7590 a.app.Srv().Store.SetContext(origCtx) 7591 a.ctx = origCtx 7592 }() 7593 7594 defer span.Finish() 7595 resultVar0 := a.app.ReloadConfig() 7596 7597 return resultVar0 7598 } 7599 7600 func (a *OpenTracingAppLayer) RemoveBranchIcon(branchId string) *model.AppError { 7601 origCtx := a.ctx 7602 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveBranchIcon") 7603 7604 a.ctx = newCtx 7605 a.app.Srv().Store.SetContext(newCtx) 7606 defer func() { 7607 a.app.Srv().Store.SetContext(origCtx) 7608 a.ctx = origCtx 7609 }() 7610 7611 defer span.Finish() 7612 resultVar0 := a.app.RemoveBranchIcon(branchId) 7613 7614 if resultVar0 != nil { 7615 span.LogFields(spanlog.Error(resultVar0)) 7616 ext.Error.Set(span, true) 7617 } 7618 7619 return resultVar0 7620 } 7621 7622 func (a *OpenTracingAppLayer) RemoveBranchMemberFromBranch(branchMember *model.BranchMember, requestorId string) *model.AppError { 7623 origCtx := a.ctx 7624 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveBranchMemberFromBranch") 7625 7626 a.ctx = newCtx 7627 a.app.Srv().Store.SetContext(newCtx) 7628 defer func() { 7629 a.app.Srv().Store.SetContext(origCtx) 7630 a.ctx = origCtx 7631 }() 7632 7633 defer span.Finish() 7634 resultVar0 := a.app.RemoveBranchMemberFromBranch(branchMember, requestorId) 7635 7636 if resultVar0 != nil { 7637 span.LogFields(spanlog.Error(resultVar0)) 7638 ext.Error.Set(span, true) 7639 } 7640 7641 return resultVar0 7642 } 7643 7644 func (a *OpenTracingAppLayer) RemoveConfigListener(id string) { 7645 origCtx := a.ctx 7646 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveConfigListener") 7647 7648 a.ctx = newCtx 7649 a.app.Srv().Store.SetContext(newCtx) 7650 defer func() { 7651 a.app.Srv().Store.SetContext(origCtx) 7652 a.ctx = origCtx 7653 }() 7654 7655 defer span.Finish() 7656 a.app.RemoveConfigListener(id) 7657 } 7658 7659 func (a *OpenTracingAppLayer) RemoveFile(path string) *model.AppError { 7660 origCtx := a.ctx 7661 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveFile") 7662 7663 a.ctx = newCtx 7664 a.app.Srv().Store.SetContext(newCtx) 7665 defer func() { 7666 a.app.Srv().Store.SetContext(origCtx) 7667 a.ctx = origCtx 7668 }() 7669 7670 defer span.Finish() 7671 resultVar0 := a.app.RemoveFile(path) 7672 7673 if resultVar0 != nil { 7674 span.LogFields(spanlog.Error(resultVar0)) 7675 ext.Error.Set(span, true) 7676 } 7677 7678 return resultVar0 7679 } 7680 7681 func (a *OpenTracingAppLayer) RemoveLicense() *model.AppError { 7682 origCtx := a.ctx 7683 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLicense") 7684 7685 a.ctx = newCtx 7686 a.app.Srv().Store.SetContext(newCtx) 7687 defer func() { 7688 a.app.Srv().Store.SetContext(origCtx) 7689 a.ctx = origCtx 7690 }() 7691 7692 defer span.Finish() 7693 resultVar0 := a.app.RemoveLicense() 7694 7695 if resultVar0 != nil { 7696 span.LogFields(spanlog.Error(resultVar0)) 7697 ext.Error.Set(span, true) 7698 } 7699 7700 return resultVar0 7701 } 7702 7703 func (a *OpenTracingAppLayer) RemoveLicenseListener(id string) { 7704 origCtx := a.ctx 7705 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveLicenseListener") 7706 7707 a.ctx = newCtx 7708 a.app.Srv().Store.SetContext(newCtx) 7709 defer func() { 7710 a.app.Srv().Store.SetContext(origCtx) 7711 a.ctx = origCtx 7712 }() 7713 7714 defer span.Finish() 7715 a.app.RemoveLicenseListener(id) 7716 } 7717 7718 func (a *OpenTracingAppLayer) RemoveSamlIdpCertificate() *model.AppError { 7719 origCtx := a.ctx 7720 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlIdpCertificate") 7721 7722 a.ctx = newCtx 7723 a.app.Srv().Store.SetContext(newCtx) 7724 defer func() { 7725 a.app.Srv().Store.SetContext(origCtx) 7726 a.ctx = origCtx 7727 }() 7728 7729 defer span.Finish() 7730 resultVar0 := a.app.RemoveSamlIdpCertificate() 7731 7732 if resultVar0 != nil { 7733 span.LogFields(spanlog.Error(resultVar0)) 7734 ext.Error.Set(span, true) 7735 } 7736 7737 return resultVar0 7738 } 7739 7740 func (a *OpenTracingAppLayer) RemoveSamlPrivateCertificate() *model.AppError { 7741 origCtx := a.ctx 7742 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPrivateCertificate") 7743 7744 a.ctx = newCtx 7745 a.app.Srv().Store.SetContext(newCtx) 7746 defer func() { 7747 a.app.Srv().Store.SetContext(origCtx) 7748 a.ctx = origCtx 7749 }() 7750 7751 defer span.Finish() 7752 resultVar0 := a.app.RemoveSamlPrivateCertificate() 7753 7754 if resultVar0 != nil { 7755 span.LogFields(spanlog.Error(resultVar0)) 7756 ext.Error.Set(span, true) 7757 } 7758 7759 return resultVar0 7760 } 7761 7762 func (a *OpenTracingAppLayer) RemoveSamlPublicCertificate() *model.AppError { 7763 origCtx := a.ctx 7764 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveSamlPublicCertificate") 7765 7766 a.ctx = newCtx 7767 a.app.Srv().Store.SetContext(newCtx) 7768 defer func() { 7769 a.app.Srv().Store.SetContext(origCtx) 7770 a.ctx = origCtx 7771 }() 7772 7773 defer span.Finish() 7774 resultVar0 := a.app.RemoveSamlPublicCertificate() 7775 7776 if resultVar0 != nil { 7777 span.LogFields(spanlog.Error(resultVar0)) 7778 ext.Error.Set(span, true) 7779 } 7780 7781 return resultVar0 7782 } 7783 7784 func (a *OpenTracingAppLayer) RemoveUserFromBranch(branchId string, userId string, requestorId string) *model.AppError { 7785 origCtx := a.ctx 7786 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromBranch") 7787 7788 a.ctx = newCtx 7789 a.app.Srv().Store.SetContext(newCtx) 7790 defer func() { 7791 a.app.Srv().Store.SetContext(origCtx) 7792 a.ctx = origCtx 7793 }() 7794 7795 defer span.Finish() 7796 resultVar0 := a.app.RemoveUserFromBranch(branchId, userId, requestorId) 7797 7798 if resultVar0 != nil { 7799 span.LogFields(spanlog.Error(resultVar0)) 7800 ext.Error.Set(span, true) 7801 } 7802 7803 return resultVar0 7804 } 7805 7806 func (a *OpenTracingAppLayer) RemoveUserFromClass(userIdToRemove string, removerUserId string, class *model.Class) *model.AppError { 7807 origCtx := a.ctx 7808 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RemoveUserFromClass") 7809 7810 a.ctx = newCtx 7811 a.app.Srv().Store.SetContext(newCtx) 7812 defer func() { 7813 a.app.Srv().Store.SetContext(origCtx) 7814 a.ctx = origCtx 7815 }() 7816 7817 defer span.Finish() 7818 resultVar0 := a.app.RemoveUserFromClass(userIdToRemove, removerUserId, class) 7819 7820 if resultVar0 != nil { 7821 span.LogFields(spanlog.Error(resultVar0)) 7822 ext.Error.Set(span, true) 7823 } 7824 7825 return resultVar0 7826 } 7827 7828 func (a *OpenTracingAppLayer) RenameBranch(branch *model.Branch, newBranchName string, newDisplayName string) (*model.Branch, *model.AppError) { 7829 origCtx := a.ctx 7830 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameBranch") 7831 7832 a.ctx = newCtx 7833 a.app.Srv().Store.SetContext(newCtx) 7834 defer func() { 7835 a.app.Srv().Store.SetContext(origCtx) 7836 a.ctx = origCtx 7837 }() 7838 7839 defer span.Finish() 7840 resultVar0, resultVar1 := a.app.RenameBranch(branch, newBranchName, newDisplayName) 7841 7842 if resultVar1 != nil { 7843 span.LogFields(spanlog.Error(resultVar1)) 7844 ext.Error.Set(span, true) 7845 } 7846 7847 return resultVar0, resultVar1 7848 } 7849 7850 func (a *OpenTracingAppLayer) RenameClass(class *model.Class, newClassName string, newDisplayName string) (*model.Class, *model.AppError) { 7851 origCtx := a.ctx 7852 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RenameClass") 7853 7854 a.ctx = newCtx 7855 a.app.Srv().Store.SetContext(newCtx) 7856 defer func() { 7857 a.app.Srv().Store.SetContext(origCtx) 7858 a.ctx = origCtx 7859 }() 7860 7861 defer span.Finish() 7862 resultVar0, resultVar1 := a.app.RenameClass(class, newClassName, newDisplayName) 7863 7864 if resultVar1 != nil { 7865 span.LogFields(spanlog.Error(resultVar1)) 7866 ext.Error.Set(span, true) 7867 } 7868 7869 return resultVar0, resultVar1 7870 } 7871 7872 func (a *OpenTracingAppLayer) ResetPasswordFromToken(userSuppliedTokenString string, newPassword string) *model.AppError { 7873 origCtx := a.ctx 7874 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPasswordFromToken") 7875 7876 a.ctx = newCtx 7877 a.app.Srv().Store.SetContext(newCtx) 7878 defer func() { 7879 a.app.Srv().Store.SetContext(origCtx) 7880 a.ctx = origCtx 7881 }() 7882 7883 defer span.Finish() 7884 resultVar0 := a.app.ResetPasswordFromToken(userSuppliedTokenString, newPassword) 7885 7886 if resultVar0 != nil { 7887 span.LogFields(spanlog.Error(resultVar0)) 7888 ext.Error.Set(span, true) 7889 } 7890 7891 return resultVar0 7892 } 7893 7894 func (a *OpenTracingAppLayer) ResetPermissionsSystem() *model.AppError { 7895 origCtx := a.ctx 7896 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ResetPermissionsSystem") 7897 7898 a.ctx = newCtx 7899 a.app.Srv().Store.SetContext(newCtx) 7900 defer func() { 7901 a.app.Srv().Store.SetContext(origCtx) 7902 a.ctx = origCtx 7903 }() 7904 7905 defer span.Finish() 7906 resultVar0 := a.app.ResetPermissionsSystem() 7907 7908 if resultVar0 != nil { 7909 span.LogFields(spanlog.Error(resultVar0)) 7910 ext.Error.Set(span, true) 7911 } 7912 7913 return resultVar0 7914 } 7915 7916 func (a *OpenTracingAppLayer) RestoreBranch(branchId string) *model.AppError { 7917 origCtx := a.ctx 7918 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreBranch") 7919 7920 a.ctx = newCtx 7921 a.app.Srv().Store.SetContext(newCtx) 7922 defer func() { 7923 a.app.Srv().Store.SetContext(origCtx) 7924 a.ctx = origCtx 7925 }() 7926 7927 defer span.Finish() 7928 resultVar0 := a.app.RestoreBranch(branchId) 7929 7930 if resultVar0 != nil { 7931 span.LogFields(spanlog.Error(resultVar0)) 7932 ext.Error.Set(span, true) 7933 } 7934 7935 return resultVar0 7936 } 7937 7938 func (a *OpenTracingAppLayer) RestoreClass(class *model.Class, userId string) (*model.Class, *model.AppError) { 7939 origCtx := a.ctx 7940 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestoreClass") 7941 7942 a.ctx = newCtx 7943 a.app.Srv().Store.SetContext(newCtx) 7944 defer func() { 7945 a.app.Srv().Store.SetContext(origCtx) 7946 a.ctx = origCtx 7947 }() 7948 7949 defer span.Finish() 7950 resultVar0, resultVar1 := a.app.RestoreClass(class, userId) 7951 7952 if resultVar1 != nil { 7953 span.LogFields(spanlog.Error(resultVar1)) 7954 ext.Error.Set(span, true) 7955 } 7956 7957 return resultVar0, resultVar1 7958 } 7959 7960 func (a *OpenTracingAppLayer) RestrictUsersGetByPermissions(userId string, options *model.UserGetOptions) (*model.UserGetOptions, *model.AppError) { 7961 origCtx := a.ctx 7962 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersGetByPermissions") 7963 7964 a.ctx = newCtx 7965 a.app.Srv().Store.SetContext(newCtx) 7966 defer func() { 7967 a.app.Srv().Store.SetContext(origCtx) 7968 a.ctx = origCtx 7969 }() 7970 7971 defer span.Finish() 7972 resultVar0, resultVar1 := a.app.RestrictUsersGetByPermissions(userId, options) 7973 7974 if resultVar1 != nil { 7975 span.LogFields(spanlog.Error(resultVar1)) 7976 ext.Error.Set(span, true) 7977 } 7978 7979 return resultVar0, resultVar1 7980 } 7981 7982 func (a *OpenTracingAppLayer) RestrictUsersSearchByPermissions(userId string, options *model.UserSearchOptions) (*model.UserSearchOptions, *model.AppError) { 7983 origCtx := a.ctx 7984 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RestrictUsersSearchByPermissions") 7985 7986 a.ctx = newCtx 7987 a.app.Srv().Store.SetContext(newCtx) 7988 defer func() { 7989 a.app.Srv().Store.SetContext(origCtx) 7990 a.ctx = origCtx 7991 }() 7992 7993 defer span.Finish() 7994 resultVar0, resultVar1 := a.app.RestrictUsersSearchByPermissions(userId, options) 7995 7996 if resultVar1 != nil { 7997 span.LogFields(spanlog.Error(resultVar1)) 7998 ext.Error.Set(span, true) 7999 } 8000 8001 return resultVar0, resultVar1 8002 } 8003 8004 func (a *OpenTracingAppLayer) RevokeAccessToken(token string) *model.AppError { 8005 origCtx := a.ctx 8006 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAccessToken") 8007 8008 a.ctx = newCtx 8009 a.app.Srv().Store.SetContext(newCtx) 8010 defer func() { 8011 a.app.Srv().Store.SetContext(origCtx) 8012 a.ctx = origCtx 8013 }() 8014 8015 defer span.Finish() 8016 resultVar0 := a.app.RevokeAccessToken(token) 8017 8018 if resultVar0 != nil { 8019 span.LogFields(spanlog.Error(resultVar0)) 8020 ext.Error.Set(span, true) 8021 } 8022 8023 return resultVar0 8024 } 8025 8026 func (a *OpenTracingAppLayer) RevokeAllSessions(userId string) *model.AppError { 8027 origCtx := a.ctx 8028 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeAllSessions") 8029 8030 a.ctx = newCtx 8031 a.app.Srv().Store.SetContext(newCtx) 8032 defer func() { 8033 a.app.Srv().Store.SetContext(origCtx) 8034 a.ctx = origCtx 8035 }() 8036 8037 defer span.Finish() 8038 resultVar0 := a.app.RevokeAllSessions(userId) 8039 8040 if resultVar0 != nil { 8041 span.LogFields(spanlog.Error(resultVar0)) 8042 ext.Error.Set(span, true) 8043 } 8044 8045 return resultVar0 8046 } 8047 8048 func (a *OpenTracingAppLayer) RevokeSession(session *model.Session) *model.AppError { 8049 origCtx := a.ctx 8050 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSession") 8051 8052 a.ctx = newCtx 8053 a.app.Srv().Store.SetContext(newCtx) 8054 defer func() { 8055 a.app.Srv().Store.SetContext(origCtx) 8056 a.ctx = origCtx 8057 }() 8058 8059 defer span.Finish() 8060 resultVar0 := a.app.RevokeSession(session) 8061 8062 if resultVar0 != nil { 8063 span.LogFields(spanlog.Error(resultVar0)) 8064 ext.Error.Set(span, true) 8065 } 8066 8067 return resultVar0 8068 } 8069 8070 func (a *OpenTracingAppLayer) RevokeSessionById(sessionId string) *model.AppError { 8071 origCtx := a.ctx 8072 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionById") 8073 8074 a.ctx = newCtx 8075 a.app.Srv().Store.SetContext(newCtx) 8076 defer func() { 8077 a.app.Srv().Store.SetContext(origCtx) 8078 a.ctx = origCtx 8079 }() 8080 8081 defer span.Finish() 8082 resultVar0 := a.app.RevokeSessionById(sessionId) 8083 8084 if resultVar0 != nil { 8085 span.LogFields(spanlog.Error(resultVar0)) 8086 ext.Error.Set(span, true) 8087 } 8088 8089 return resultVar0 8090 } 8091 8092 func (a *OpenTracingAppLayer) RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId string) *model.AppError { 8093 origCtx := a.ctx 8094 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsForDeviceId") 8095 8096 a.ctx = newCtx 8097 a.app.Srv().Store.SetContext(newCtx) 8098 defer func() { 8099 a.app.Srv().Store.SetContext(origCtx) 8100 a.ctx = origCtx 8101 }() 8102 8103 defer span.Finish() 8104 resultVar0 := a.app.RevokeSessionsForDeviceId(userId, deviceId, currentSessionId) 8105 8106 if resultVar0 != nil { 8107 span.LogFields(spanlog.Error(resultVar0)) 8108 ext.Error.Set(span, true) 8109 } 8110 8111 return resultVar0 8112 } 8113 8114 func (a *OpenTracingAppLayer) RevokeSessionsFromAllUsers() *model.AppError { 8115 origCtx := a.ctx 8116 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeSessionsFromAllUsers") 8117 8118 a.ctx = newCtx 8119 a.app.Srv().Store.SetContext(newCtx) 8120 defer func() { 8121 a.app.Srv().Store.SetContext(origCtx) 8122 a.ctx = origCtx 8123 }() 8124 8125 defer span.Finish() 8126 resultVar0 := a.app.RevokeSessionsFromAllUsers() 8127 8128 if resultVar0 != nil { 8129 span.LogFields(spanlog.Error(resultVar0)) 8130 ext.Error.Set(span, true) 8131 } 8132 8133 return resultVar0 8134 } 8135 8136 func (a *OpenTracingAppLayer) RevokeUserAccessToken(token *model.UserAccessToken) *model.AppError { 8137 origCtx := a.ctx 8138 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RevokeUserAccessToken") 8139 8140 a.ctx = newCtx 8141 a.app.Srv().Store.SetContext(newCtx) 8142 defer func() { 8143 a.app.Srv().Store.SetContext(origCtx) 8144 a.ctx = origCtx 8145 }() 8146 8147 defer span.Finish() 8148 resultVar0 := a.app.RevokeUserAccessToken(token) 8149 8150 if resultVar0 != nil { 8151 span.LogFields(spanlog.Error(resultVar0)) 8152 ext.Error.Set(span, true) 8153 } 8154 8155 return resultVar0 8156 } 8157 8158 func (a *OpenTracingAppLayer) RolesGrantPermission(roleNames []string, permissionId string) bool { 8159 origCtx := a.ctx 8160 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.RolesGrantPermission") 8161 8162 a.ctx = newCtx 8163 a.app.Srv().Store.SetContext(newCtx) 8164 defer func() { 8165 a.app.Srv().Store.SetContext(origCtx) 8166 a.ctx = origCtx 8167 }() 8168 8169 defer span.Finish() 8170 resultVar0 := a.app.RolesGrantPermission(roleNames, permissionId) 8171 8172 return resultVar0 8173 } 8174 8175 func (a *OpenTracingAppLayer) SanitizeBranch(session model.Session, branch *model.Branch) *model.Branch { 8176 origCtx := a.ctx 8177 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeBranch") 8178 8179 a.ctx = newCtx 8180 a.app.Srv().Store.SetContext(newCtx) 8181 defer func() { 8182 a.app.Srv().Store.SetContext(origCtx) 8183 a.ctx = origCtx 8184 }() 8185 8186 defer span.Finish() 8187 resultVar0 := a.app.SanitizeBranch(session, branch) 8188 8189 return resultVar0 8190 } 8191 8192 func (a *OpenTracingAppLayer) SanitizeBranches(session model.Session, branches []*model.Branch) []*model.Branch { 8193 origCtx := a.ctx 8194 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeBranches") 8195 8196 a.ctx = newCtx 8197 a.app.Srv().Store.SetContext(newCtx) 8198 defer func() { 8199 a.app.Srv().Store.SetContext(origCtx) 8200 a.ctx = origCtx 8201 }() 8202 8203 defer span.Finish() 8204 resultVar0 := a.app.SanitizeBranches(session, branches) 8205 8206 return resultVar0 8207 } 8208 8209 func (a *OpenTracingAppLayer) SanitizeProfile(user *model.User, asAdmin bool) { 8210 origCtx := a.ctx 8211 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SanitizeProfile") 8212 8213 a.ctx = newCtx 8214 a.app.Srv().Store.SetContext(newCtx) 8215 defer func() { 8216 a.app.Srv().Store.SetContext(origCtx) 8217 a.ctx = origCtx 8218 }() 8219 8220 defer span.Finish() 8221 a.app.SanitizeProfile(user, asAdmin) 8222 } 8223 8224 func (a *OpenTracingAppLayer) SaveAndBroadcastStatus(status *model.Status) { 8225 origCtx := a.ctx 8226 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveAndBroadcastStatus") 8227 8228 a.ctx = newCtx 8229 a.app.Srv().Store.SetContext(newCtx) 8230 defer func() { 8231 a.app.Srv().Store.SetContext(origCtx) 8232 a.ctx = origCtx 8233 }() 8234 8235 defer span.Finish() 8236 a.app.SaveAndBroadcastStatus(status) 8237 } 8238 8239 func (a *OpenTracingAppLayer) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError { 8240 origCtx := a.ctx 8241 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveBrandImage") 8242 8243 a.ctx = newCtx 8244 a.app.Srv().Store.SetContext(newCtx) 8245 defer func() { 8246 a.app.Srv().Store.SetContext(origCtx) 8247 a.ctx = origCtx 8248 }() 8249 8250 defer span.Finish() 8251 resultVar0 := a.app.SaveBrandImage(imageData) 8252 8253 if resultVar0 != nil { 8254 span.LogFields(spanlog.Error(resultVar0)) 8255 ext.Error.Set(span, true) 8256 } 8257 8258 return resultVar0 8259 } 8260 8261 func (a *OpenTracingAppLayer) SaveComplianceReport(job *model.Compliance) (*model.Compliance, *model.AppError) { 8262 origCtx := a.ctx 8263 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveComplianceReport") 8264 8265 a.ctx = newCtx 8266 a.app.Srv().Store.SetContext(newCtx) 8267 defer func() { 8268 a.app.Srv().Store.SetContext(origCtx) 8269 a.ctx = origCtx 8270 }() 8271 8272 defer span.Finish() 8273 resultVar0, resultVar1 := a.app.SaveComplianceReport(job) 8274 8275 if resultVar1 != nil { 8276 span.LogFields(spanlog.Error(resultVar1)) 8277 ext.Error.Set(span, true) 8278 } 8279 8280 return resultVar0, resultVar1 8281 } 8282 8283 func (a *OpenTracingAppLayer) SaveConfig(newCfg *model.Config, sendConfigChangeClusterMessage bool) *model.AppError { 8284 origCtx := a.ctx 8285 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveConfig") 8286 8287 a.ctx = newCtx 8288 a.app.Srv().Store.SetContext(newCtx) 8289 defer func() { 8290 a.app.Srv().Store.SetContext(origCtx) 8291 a.ctx = origCtx 8292 }() 8293 8294 defer span.Finish() 8295 resultVar0 := a.app.SaveConfig(newCfg, sendConfigChangeClusterMessage) 8296 8297 if resultVar0 != nil { 8298 span.LogFields(spanlog.Error(resultVar0)) 8299 ext.Error.Set(span, true) 8300 } 8301 8302 return resultVar0 8303 } 8304 8305 func (a *OpenTracingAppLayer) SaveLicense(licenseBytes []byte) (*model.License, *model.AppError) { 8306 origCtx := a.ctx 8307 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveLicense") 8308 8309 a.ctx = newCtx 8310 a.app.Srv().Store.SetContext(newCtx) 8311 defer func() { 8312 a.app.Srv().Store.SetContext(origCtx) 8313 a.ctx = origCtx 8314 }() 8315 8316 defer span.Finish() 8317 resultVar0, resultVar1 := a.app.SaveLicense(licenseBytes) 8318 8319 if resultVar1 != nil { 8320 span.LogFields(spanlog.Error(resultVar1)) 8321 ext.Error.Set(span, true) 8322 } 8323 8324 return resultVar0, resultVar1 8325 } 8326 8327 func (a *OpenTracingAppLayer) SaveReactionForPost(reaction *model.Reaction) (*model.Reaction, *model.AppError) { 8328 origCtx := a.ctx 8329 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveReactionForPost") 8330 8331 a.ctx = newCtx 8332 a.app.Srv().Store.SetContext(newCtx) 8333 defer func() { 8334 a.app.Srv().Store.SetContext(origCtx) 8335 a.ctx = origCtx 8336 }() 8337 8338 defer span.Finish() 8339 resultVar0, resultVar1 := a.app.SaveReactionForPost(reaction) 8340 8341 if resultVar1 != nil { 8342 span.LogFields(spanlog.Error(resultVar1)) 8343 ext.Error.Set(span, true) 8344 } 8345 8346 return resultVar0, resultVar1 8347 } 8348 8349 func (a *OpenTracingAppLayer) SaveUserTermsOfService(userId string, termsOfServiceId string, accepted bool) *model.AppError { 8350 origCtx := a.ctx 8351 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SaveUserTermsOfService") 8352 8353 a.ctx = newCtx 8354 a.app.Srv().Store.SetContext(newCtx) 8355 defer func() { 8356 a.app.Srv().Store.SetContext(origCtx) 8357 a.ctx = origCtx 8358 }() 8359 8360 defer span.Finish() 8361 resultVar0 := a.app.SaveUserTermsOfService(userId, termsOfServiceId, accepted) 8362 8363 if resultVar0 != nil { 8364 span.LogFields(spanlog.Error(resultVar0)) 8365 ext.Error.Set(span, true) 8366 } 8367 8368 return resultVar0 8369 } 8370 8371 func (a *OpenTracingAppLayer) SchemesIterator(scope string, batchSize int) func() []*model.Scheme { 8372 origCtx := a.ctx 8373 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SchemesIterator") 8374 8375 a.ctx = newCtx 8376 a.app.Srv().Store.SetContext(newCtx) 8377 defer func() { 8378 a.app.Srv().Store.SetContext(origCtx) 8379 a.ctx = origCtx 8380 }() 8381 8382 defer span.Finish() 8383 resultVar0 := a.app.SchemesIterator(scope, batchSize) 8384 8385 return resultVar0 8386 } 8387 8388 func (a *OpenTracingAppLayer) SearchEmoji(name string, prefixOnly bool, limit int) ([]*model.Emoji, *model.AppError) { 8389 origCtx := a.ctx 8390 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEmoji") 8391 8392 a.ctx = newCtx 8393 a.app.Srv().Store.SetContext(newCtx) 8394 defer func() { 8395 a.app.Srv().Store.SetContext(origCtx) 8396 a.ctx = origCtx 8397 }() 8398 8399 defer span.Finish() 8400 resultVar0, resultVar1 := a.app.SearchEmoji(name, prefixOnly, limit) 8401 8402 if resultVar1 != nil { 8403 span.LogFields(spanlog.Error(resultVar1)) 8404 ext.Error.Set(span, true) 8405 } 8406 8407 return resultVar0, resultVar1 8408 } 8409 8410 func (a *OpenTracingAppLayer) SearchEngine() *searchengine.Broker { 8411 origCtx := a.ctx 8412 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchEngine") 8413 8414 a.ctx = newCtx 8415 a.app.Srv().Store.SetContext(newCtx) 8416 defer func() { 8417 a.app.Srv().Store.SetContext(origCtx) 8418 a.ctx = origCtx 8419 }() 8420 8421 defer span.Finish() 8422 resultVar0 := a.app.SearchEngine() 8423 8424 return resultVar0 8425 } 8426 8427 func (a *OpenTracingAppLayer) SearchUserAccessTokens(term string) ([]*model.UserAccessToken, *model.AppError) { 8428 origCtx := a.ctx 8429 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SearchUserAccessTokens") 8430 8431 a.ctx = newCtx 8432 a.app.Srv().Store.SetContext(newCtx) 8433 defer func() { 8434 a.app.Srv().Store.SetContext(origCtx) 8435 a.ctx = origCtx 8436 }() 8437 8438 defer span.Finish() 8439 resultVar0, resultVar1 := a.app.SearchUserAccessTokens(term) 8440 8441 if resultVar1 != nil { 8442 span.LogFields(spanlog.Error(resultVar1)) 8443 ext.Error.Set(span, true) 8444 } 8445 8446 return resultVar0, resultVar1 8447 } 8448 8449 func (a *OpenTracingAppLayer) SendAckToPushProxy(ack *model.PushNotificationAck) error { 8450 origCtx := a.ctx 8451 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendAckToPushProxy") 8452 8453 a.ctx = newCtx 8454 a.app.Srv().Store.SetContext(newCtx) 8455 defer func() { 8456 a.app.Srv().Store.SetContext(origCtx) 8457 a.ctx = origCtx 8458 }() 8459 8460 defer span.Finish() 8461 resultVar0 := a.app.SendAckToPushProxy(ack) 8462 8463 return resultVar0 8464 } 8465 8466 func (a *OpenTracingAppLayer) SendDailyDiagnostics() { 8467 origCtx := a.ctx 8468 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendDailyDiagnostics") 8469 8470 a.ctx = newCtx 8471 a.app.Srv().Store.SetContext(newCtx) 8472 defer func() { 8473 a.app.Srv().Store.SetContext(origCtx) 8474 a.ctx = origCtx 8475 }() 8476 8477 defer span.Finish() 8478 a.app.SendDailyDiagnostics() 8479 } 8480 8481 func (a *OpenTracingAppLayer) SendDeactivateAccountEmail(email string, locale string, siteURL string) *model.AppError { 8482 origCtx := a.ctx 8483 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendDeactivateAccountEmail") 8484 8485 a.ctx = newCtx 8486 a.app.Srv().Store.SetContext(newCtx) 8487 defer func() { 8488 a.app.Srv().Store.SetContext(origCtx) 8489 a.ctx = origCtx 8490 }() 8491 8492 defer span.Finish() 8493 resultVar0 := a.app.SendDeactivateAccountEmail(email, locale, siteURL) 8494 8495 if resultVar0 != nil { 8496 span.LogFields(spanlog.Error(resultVar0)) 8497 ext.Error.Set(span, true) 8498 } 8499 8500 return resultVar0 8501 } 8502 8503 func (a *OpenTracingAppLayer) SendDiagnostic(event string, properties map[string]interface{}) { 8504 origCtx := a.ctx 8505 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendDiagnostic") 8506 8507 a.ctx = newCtx 8508 a.app.Srv().Store.SetContext(newCtx) 8509 defer func() { 8510 a.app.Srv().Store.SetContext(origCtx) 8511 a.ctx = origCtx 8512 }() 8513 8514 defer span.Finish() 8515 a.app.SendDiagnostic(event, properties) 8516 } 8517 8518 func (a *OpenTracingAppLayer) SendEmailVerification(user *model.User, newEmail string) *model.AppError { 8519 origCtx := a.ctx 8520 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEmailVerification") 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.SendEmailVerification(user, newEmail) 8531 8532 if resultVar0 != nil { 8533 span.LogFields(spanlog.Error(resultVar0)) 8534 ext.Error.Set(span, true) 8535 } 8536 8537 return resultVar0 8538 } 8539 8540 func (a *OpenTracingAppLayer) SendEphemeralPost(userId string, post *model.Post) *model.Post { 8541 origCtx := a.ctx 8542 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendEphemeralPost") 8543 8544 a.ctx = newCtx 8545 a.app.Srv().Store.SetContext(newCtx) 8546 defer func() { 8547 a.app.Srv().Store.SetContext(origCtx) 8548 a.ctx = origCtx 8549 }() 8550 8551 defer span.Finish() 8552 resultVar0 := a.app.SendEphemeralPost(userId, post) 8553 8554 return resultVar0 8555 } 8556 8557 func (a *OpenTracingAppLayer) SendInviteEmails(branch *model.Branch, senderName string, senderUserId string, invites []string, siteURL string) { 8558 origCtx := a.ctx 8559 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendInviteEmails") 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 a.app.SendInviteEmails(branch, senderName, senderUserId, invites, siteURL) 8570 } 8571 8572 func (a *OpenTracingAppLayer) SendNotifications(post *model.Post, branch *model.Branch, class *model.Class, sender *model.User, parentPostList *model.PostList) ([]string, error) { 8573 origCtx := a.ctx 8574 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendNotifications") 8575 8576 a.ctx = newCtx 8577 a.app.Srv().Store.SetContext(newCtx) 8578 defer func() { 8579 a.app.Srv().Store.SetContext(origCtx) 8580 a.ctx = origCtx 8581 }() 8582 8583 defer span.Finish() 8584 resultVar0, resultVar1 := a.app.SendNotifications(post, branch, class, sender, parentPostList) 8585 8586 return resultVar0, resultVar1 8587 } 8588 8589 func (a *OpenTracingAppLayer) SendPasswordReset(email string, siteURL string) (bool, *model.AppError) { 8590 origCtx := a.ctx 8591 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPasswordReset") 8592 8593 a.ctx = newCtx 8594 a.app.Srv().Store.SetContext(newCtx) 8595 defer func() { 8596 a.app.Srv().Store.SetContext(origCtx) 8597 a.ctx = origCtx 8598 }() 8599 8600 defer span.Finish() 8601 resultVar0, resultVar1 := a.app.SendPasswordReset(email, siteURL) 8602 8603 if resultVar1 != nil { 8604 span.LogFields(spanlog.Error(resultVar1)) 8605 ext.Error.Set(span, true) 8606 } 8607 8608 return resultVar0, resultVar1 8609 } 8610 8611 func (a *OpenTracingAppLayer) SendPasswordResetEmail(email string, token *model.Token, locale string, siteURL string) (bool, *model.AppError) { 8612 origCtx := a.ctx 8613 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendPasswordResetEmail") 8614 8615 a.ctx = newCtx 8616 a.app.Srv().Store.SetContext(newCtx) 8617 defer func() { 8618 a.app.Srv().Store.SetContext(origCtx) 8619 a.ctx = origCtx 8620 }() 8621 8622 defer span.Finish() 8623 resultVar0, resultVar1 := a.app.SendPasswordResetEmail(email, token, locale, siteURL) 8624 8625 if resultVar1 != nil { 8626 span.LogFields(spanlog.Error(resultVar1)) 8627 ext.Error.Set(span, true) 8628 } 8629 8630 return resultVar0, resultVar1 8631 } 8632 8633 func (a *OpenTracingAppLayer) SendSignInChangeEmail(email string, method string, locale string, siteURL string) *model.AppError { 8634 origCtx := a.ctx 8635 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SendSignInChangeEmail") 8636 8637 a.ctx = newCtx 8638 a.app.Srv().Store.SetContext(newCtx) 8639 defer func() { 8640 a.app.Srv().Store.SetContext(origCtx) 8641 a.ctx = origCtx 8642 }() 8643 8644 defer span.Finish() 8645 resultVar0 := a.app.SendSignInChangeEmail(email, method, locale, siteURL) 8646 8647 if resultVar0 != nil { 8648 span.LogFields(spanlog.Error(resultVar0)) 8649 ext.Error.Set(span, true) 8650 } 8651 8652 return resultVar0 8653 } 8654 8655 func (a *OpenTracingAppLayer) ServerBusyStateChanged(sbs *model.ServerBusyState) { 8656 origCtx := a.ctx 8657 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ServerBusyStateChanged") 8658 8659 a.ctx = newCtx 8660 a.app.Srv().Store.SetContext(newCtx) 8661 defer func() { 8662 a.app.Srv().Store.SetContext(origCtx) 8663 a.ctx = origCtx 8664 }() 8665 8666 defer span.Finish() 8667 a.app.ServerBusyStateChanged(sbs) 8668 } 8669 8670 func (a *OpenTracingAppLayer) SessionCacheLength() int { 8671 origCtx := a.ctx 8672 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionCacheLength") 8673 8674 a.ctx = newCtx 8675 a.app.Srv().Store.SetContext(newCtx) 8676 defer func() { 8677 a.app.Srv().Store.SetContext(origCtx) 8678 a.ctx = origCtx 8679 }() 8680 8681 defer span.Finish() 8682 resultVar0 := a.app.SessionCacheLength() 8683 8684 return resultVar0 8685 } 8686 8687 func (a *OpenTracingAppLayer) SessionHasPermissionTo(session model.Session, permission *model.Permission) bool { 8688 origCtx := a.ctx 8689 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionTo") 8690 8691 a.ctx = newCtx 8692 a.app.Srv().Store.SetContext(newCtx) 8693 defer func() { 8694 a.app.Srv().Store.SetContext(origCtx) 8695 a.ctx = origCtx 8696 }() 8697 8698 defer span.Finish() 8699 resultVar0 := a.app.SessionHasPermissionTo(session, permission) 8700 8701 return resultVar0 8702 } 8703 8704 func (a *OpenTracingAppLayer) SessionHasPermissionToBranch(session model.Session, branchId string, permission *model.Permission) bool { 8705 origCtx := a.ctx 8706 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToBranch") 8707 8708 a.ctx = newCtx 8709 a.app.Srv().Store.SetContext(newCtx) 8710 defer func() { 8711 a.app.Srv().Store.SetContext(origCtx) 8712 a.ctx = origCtx 8713 }() 8714 8715 defer span.Finish() 8716 resultVar0 := a.app.SessionHasPermissionToBranch(session, branchId, permission) 8717 8718 return resultVar0 8719 } 8720 8721 func (a *OpenTracingAppLayer) SessionHasPermissionToClass(session model.Session, classId string, permission *model.Permission) bool { 8722 origCtx := a.ctx 8723 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToClass") 8724 8725 a.ctx = newCtx 8726 a.app.Srv().Store.SetContext(newCtx) 8727 defer func() { 8728 a.app.Srv().Store.SetContext(origCtx) 8729 a.ctx = origCtx 8730 }() 8731 8732 defer span.Finish() 8733 resultVar0 := a.app.SessionHasPermissionToClass(session, classId, permission) 8734 8735 return resultVar0 8736 } 8737 8738 func (a *OpenTracingAppLayer) SessionHasPermissionToClassByPost(session model.Session, postId string, permission *model.Permission) bool { 8739 origCtx := a.ctx 8740 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToClassByPost") 8741 8742 a.ctx = newCtx 8743 a.app.Srv().Store.SetContext(newCtx) 8744 defer func() { 8745 a.app.Srv().Store.SetContext(origCtx) 8746 a.ctx = origCtx 8747 }() 8748 8749 defer span.Finish() 8750 resultVar0 := a.app.SessionHasPermissionToClassByPost(session, postId, permission) 8751 8752 return resultVar0 8753 } 8754 8755 func (a *OpenTracingAppLayer) SessionHasPermissionToUser(session model.Session, userId string) bool { 8756 origCtx := a.ctx 8757 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SessionHasPermissionToUser") 8758 8759 a.ctx = newCtx 8760 a.app.Srv().Store.SetContext(newCtx) 8761 defer func() { 8762 a.app.Srv().Store.SetContext(origCtx) 8763 a.ctx = origCtx 8764 }() 8765 8766 defer span.Finish() 8767 resultVar0 := a.app.SessionHasPermissionToUser(session, userId) 8768 8769 return resultVar0 8770 } 8771 8772 func (a *OpenTracingAppLayer) SetActiveClass(userId string, classId string) *model.AppError { 8773 origCtx := a.ctx 8774 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetActiveClass") 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 := a.app.SetActiveClass(userId, classId) 8785 8786 if resultVar0 != nil { 8787 span.LogFields(spanlog.Error(resultVar0)) 8788 ext.Error.Set(span, true) 8789 } 8790 8791 return resultVar0 8792 } 8793 8794 func (a *OpenTracingAppLayer) SetBranchIcon(branchId string, imageData *multipart.FileHeader) *model.AppError { 8795 origCtx := a.ctx 8796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBranchIcon") 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.SetBranchIcon(branchId, imageData) 8807 8808 if resultVar0 != nil { 8809 span.LogFields(spanlog.Error(resultVar0)) 8810 ext.Error.Set(span, true) 8811 } 8812 8813 return resultVar0 8814 } 8815 8816 func (a *OpenTracingAppLayer) SetBranchIconFromFile(branch *model.Branch, file io.Reader) *model.AppError { 8817 origCtx := a.ctx 8818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBranchIconFromFile") 8819 8820 a.ctx = newCtx 8821 a.app.Srv().Store.SetContext(newCtx) 8822 defer func() { 8823 a.app.Srv().Store.SetContext(origCtx) 8824 a.ctx = origCtx 8825 }() 8826 8827 defer span.Finish() 8828 resultVar0 := a.app.SetBranchIconFromFile(branch, file) 8829 8830 if resultVar0 != nil { 8831 span.LogFields(spanlog.Error(resultVar0)) 8832 ext.Error.Set(span, true) 8833 } 8834 8835 return resultVar0 8836 } 8837 8838 func (a *OpenTracingAppLayer) SetBranchIconFromMultiPartFile(branchId string, file multipart.File) *model.AppError { 8839 origCtx := a.ctx 8840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetBranchIconFromMultiPartFile") 8841 8842 a.ctx = newCtx 8843 a.app.Srv().Store.SetContext(newCtx) 8844 defer func() { 8845 a.app.Srv().Store.SetContext(origCtx) 8846 a.ctx = origCtx 8847 }() 8848 8849 defer span.Finish() 8850 resultVar0 := a.app.SetBranchIconFromMultiPartFile(branchId, file) 8851 8852 if resultVar0 != nil { 8853 span.LogFields(spanlog.Error(resultVar0)) 8854 ext.Error.Set(span, true) 8855 } 8856 8857 return resultVar0 8858 } 8859 8860 func (a *OpenTracingAppLayer) SetClientLicense(m map[string]string) { 8861 origCtx := a.ctx 8862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetClientLicense") 8863 8864 a.ctx = newCtx 8865 a.app.Srv().Store.SetContext(newCtx) 8866 defer func() { 8867 a.app.Srv().Store.SetContext(origCtx) 8868 a.ctx = origCtx 8869 }() 8870 8871 defer span.Finish() 8872 a.app.SetClientLicense(m) 8873 } 8874 8875 func (a *OpenTracingAppLayer) SetDefaultProfileImage(user *model.User) *model.AppError { 8876 origCtx := a.ctx 8877 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDefaultProfileImage") 8878 8879 a.ctx = newCtx 8880 a.app.Srv().Store.SetContext(newCtx) 8881 defer func() { 8882 a.app.Srv().Store.SetContext(origCtx) 8883 a.ctx = origCtx 8884 }() 8885 8886 defer span.Finish() 8887 resultVar0 := a.app.SetDefaultProfileImage(user) 8888 8889 if resultVar0 != nil { 8890 span.LogFields(spanlog.Error(resultVar0)) 8891 ext.Error.Set(span, true) 8892 } 8893 8894 return resultVar0 8895 } 8896 8897 func (a *OpenTracingAppLayer) SetDiagnosticId(id string) { 8898 origCtx := a.ctx 8899 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetDiagnosticId") 8900 8901 a.ctx = newCtx 8902 a.app.Srv().Store.SetContext(newCtx) 8903 defer func() { 8904 a.app.Srv().Store.SetContext(origCtx) 8905 a.ctx = origCtx 8906 }() 8907 8908 defer span.Finish() 8909 a.app.SetDiagnosticId(id) 8910 } 8911 8912 func (a *OpenTracingAppLayer) SetLicense(license *model.License) bool { 8913 origCtx := a.ctx 8914 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetLicense") 8915 8916 a.ctx = newCtx 8917 a.app.Srv().Store.SetContext(newCtx) 8918 defer func() { 8919 a.app.Srv().Store.SetContext(origCtx) 8920 a.ctx = origCtx 8921 }() 8922 8923 defer span.Finish() 8924 resultVar0 := a.app.SetLicense(license) 8925 8926 return resultVar0 8927 } 8928 8929 func (a *OpenTracingAppLayer) SetLog(l *mlog.Logger) { 8930 origCtx := a.ctx 8931 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetLog") 8932 8933 a.ctx = newCtx 8934 a.app.Srv().Store.SetContext(newCtx) 8935 defer func() { 8936 a.app.Srv().Store.SetContext(origCtx) 8937 a.ctx = origCtx 8938 }() 8939 8940 defer span.Finish() 8941 a.app.SetLog(l) 8942 } 8943 8944 func (a *OpenTracingAppLayer) SetPhase2PermissionsMigrationStatus(isComplete bool) error { 8945 origCtx := a.ctx 8946 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetPhase2PermissionsMigrationStatus") 8947 8948 a.ctx = newCtx 8949 a.app.Srv().Store.SetContext(newCtx) 8950 defer func() { 8951 a.app.Srv().Store.SetContext(origCtx) 8952 a.ctx = origCtx 8953 }() 8954 8955 defer span.Finish() 8956 resultVar0 := a.app.SetPhase2PermissionsMigrationStatus(isComplete) 8957 8958 return resultVar0 8959 } 8960 8961 func (a *OpenTracingAppLayer) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError { 8962 origCtx := a.ctx 8963 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImage") 8964 8965 a.ctx = newCtx 8966 a.app.Srv().Store.SetContext(newCtx) 8967 defer func() { 8968 a.app.Srv().Store.SetContext(origCtx) 8969 a.ctx = origCtx 8970 }() 8971 8972 defer span.Finish() 8973 resultVar0 := a.app.SetProfileImage(userId, imageData) 8974 8975 if resultVar0 != nil { 8976 span.LogFields(spanlog.Error(resultVar0)) 8977 ext.Error.Set(span, true) 8978 } 8979 8980 return resultVar0 8981 } 8982 8983 func (a *OpenTracingAppLayer) SetProfileImageFromFile(userId string, file io.Reader) *model.AppError { 8984 origCtx := a.ctx 8985 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromFile") 8986 8987 a.ctx = newCtx 8988 a.app.Srv().Store.SetContext(newCtx) 8989 defer func() { 8990 a.app.Srv().Store.SetContext(origCtx) 8991 a.ctx = origCtx 8992 }() 8993 8994 defer span.Finish() 8995 resultVar0 := a.app.SetProfileImageFromFile(userId, file) 8996 8997 if resultVar0 != nil { 8998 span.LogFields(spanlog.Error(resultVar0)) 8999 ext.Error.Set(span, true) 9000 } 9001 9002 return resultVar0 9003 } 9004 9005 func (a *OpenTracingAppLayer) SetProfileImageFromMultiPartFile(userId string, file multipart.File) *model.AppError { 9006 origCtx := a.ctx 9007 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetProfileImageFromMultiPartFile") 9008 9009 a.ctx = newCtx 9010 a.app.Srv().Store.SetContext(newCtx) 9011 defer func() { 9012 a.app.Srv().Store.SetContext(origCtx) 9013 a.ctx = origCtx 9014 }() 9015 9016 defer span.Finish() 9017 resultVar0 := a.app.SetProfileImageFromMultiPartFile(userId, file) 9018 9019 if resultVar0 != nil { 9020 span.LogFields(spanlog.Error(resultVar0)) 9021 ext.Error.Set(span, true) 9022 } 9023 9024 return resultVar0 9025 } 9026 9027 func (a *OpenTracingAppLayer) SetSamlIdpCertificateFromMetadata(data []byte) *model.AppError { 9028 origCtx := a.ctx 9029 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSamlIdpCertificateFromMetadata") 9030 9031 a.ctx = newCtx 9032 a.app.Srv().Store.SetContext(newCtx) 9033 defer func() { 9034 a.app.Srv().Store.SetContext(origCtx) 9035 a.ctx = origCtx 9036 }() 9037 9038 defer span.Finish() 9039 resultVar0 := a.app.SetSamlIdpCertificateFromMetadata(data) 9040 9041 if resultVar0 != nil { 9042 span.LogFields(spanlog.Error(resultVar0)) 9043 ext.Error.Set(span, true) 9044 } 9045 9046 return resultVar0 9047 } 9048 9049 func (a *OpenTracingAppLayer) SetSearchEngine(se *searchengine.Broker) { 9050 origCtx := a.ctx 9051 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetSearchEngine") 9052 9053 a.ctx = newCtx 9054 a.app.Srv().Store.SetContext(newCtx) 9055 defer func() { 9056 a.app.Srv().Store.SetContext(origCtx) 9057 a.ctx = origCtx 9058 }() 9059 9060 defer span.Finish() 9061 a.app.SetSearchEngine(se) 9062 } 9063 9064 func (a *OpenTracingAppLayer) SetStatusAwayIfNeeded(userId string, manual bool) { 9065 origCtx := a.ctx 9066 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusAwayIfNeeded") 9067 9068 a.ctx = newCtx 9069 a.app.Srv().Store.SetContext(newCtx) 9070 defer func() { 9071 a.app.Srv().Store.SetContext(origCtx) 9072 a.ctx = origCtx 9073 }() 9074 9075 defer span.Finish() 9076 a.app.SetStatusAwayIfNeeded(userId, manual) 9077 } 9078 9079 func (a *OpenTracingAppLayer) SetStatusDoNotDisturb(userId string) { 9080 origCtx := a.ctx 9081 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusDoNotDisturb") 9082 9083 a.ctx = newCtx 9084 a.app.Srv().Store.SetContext(newCtx) 9085 defer func() { 9086 a.app.Srv().Store.SetContext(origCtx) 9087 a.ctx = origCtx 9088 }() 9089 9090 defer span.Finish() 9091 a.app.SetStatusDoNotDisturb(userId) 9092 } 9093 9094 func (a *OpenTracingAppLayer) SetStatusLastActivityAt(userId string, activityAt int64) { 9095 origCtx := a.ctx 9096 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusLastActivityAt") 9097 9098 a.ctx = newCtx 9099 a.app.Srv().Store.SetContext(newCtx) 9100 defer func() { 9101 a.app.Srv().Store.SetContext(origCtx) 9102 a.ctx = origCtx 9103 }() 9104 9105 defer span.Finish() 9106 a.app.SetStatusLastActivityAt(userId, activityAt) 9107 } 9108 9109 func (a *OpenTracingAppLayer) SetStatusOffline(userId string, manual bool) { 9110 origCtx := a.ctx 9111 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOffline") 9112 9113 a.ctx = newCtx 9114 a.app.Srv().Store.SetContext(newCtx) 9115 defer func() { 9116 a.app.Srv().Store.SetContext(origCtx) 9117 a.ctx = origCtx 9118 }() 9119 9120 defer span.Finish() 9121 a.app.SetStatusOffline(userId, manual) 9122 } 9123 9124 func (a *OpenTracingAppLayer) SetStatusOnline(userId string, manual bool) { 9125 origCtx := a.ctx 9126 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOnline") 9127 9128 a.ctx = newCtx 9129 a.app.Srv().Store.SetContext(newCtx) 9130 defer func() { 9131 a.app.Srv().Store.SetContext(origCtx) 9132 a.ctx = origCtx 9133 }() 9134 9135 defer span.Finish() 9136 a.app.SetStatusOnline(userId, manual) 9137 } 9138 9139 func (a *OpenTracingAppLayer) SetStatusOutOfOffice(userId string) { 9140 origCtx := a.ctx 9141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetStatusOutOfOffice") 9142 9143 a.ctx = newCtx 9144 a.app.Srv().Store.SetContext(newCtx) 9145 defer func() { 9146 a.app.Srv().Store.SetContext(origCtx) 9147 a.ctx = origCtx 9148 }() 9149 9150 defer span.Finish() 9151 a.app.SetStatusOutOfOffice(userId) 9152 } 9153 9154 func (a *OpenTracingAppLayer) SetupInviteEmailRateLimiting() error { 9155 origCtx := a.ctx 9156 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SetupInviteEmailRateLimiting") 9157 9158 a.ctx = newCtx 9159 a.app.Srv().Store.SetContext(newCtx) 9160 defer func() { 9161 a.app.Srv().Store.SetContext(origCtx) 9162 a.ctx = origCtx 9163 }() 9164 9165 defer span.Finish() 9166 resultVar0 := a.app.SetupInviteEmailRateLimiting() 9167 9168 return resultVar0 9169 } 9170 9171 func (a *OpenTracingAppLayer) Shutdown() { 9172 origCtx := a.ctx 9173 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.Shutdown") 9174 9175 a.ctx = newCtx 9176 a.app.Srv().Store.SetContext(newCtx) 9177 defer func() { 9178 a.app.Srv().Store.SetContext(origCtx) 9179 a.ctx = origCtx 9180 }() 9181 9182 defer span.Finish() 9183 a.app.Shutdown() 9184 } 9185 9186 func (a *OpenTracingAppLayer) SoftDeleteBranch(branchId string) *model.AppError { 9187 origCtx := a.ctx 9188 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SoftDeleteBranch") 9189 9190 a.ctx = newCtx 9191 a.app.Srv().Store.SetContext(newCtx) 9192 defer func() { 9193 a.app.Srv().Store.SetContext(origCtx) 9194 a.ctx = origCtx 9195 }() 9196 9197 defer span.Finish() 9198 resultVar0 := a.app.SoftDeleteBranch(branchId) 9199 9200 if resultVar0 != nil { 9201 span.LogFields(spanlog.Error(resultVar0)) 9202 ext.Error.Set(span, true) 9203 } 9204 9205 return resultVar0 9206 } 9207 9208 func (a *OpenTracingAppLayer) StartPushNotificationsHubWorkers() { 9209 origCtx := a.ctx 9210 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.StartPushNotificationsHubWorkers") 9211 9212 a.ctx = newCtx 9213 a.app.Srv().Store.SetContext(newCtx) 9214 defer func() { 9215 a.app.Srv().Store.SetContext(origCtx) 9216 a.ctx = origCtx 9217 }() 9218 9219 defer span.Finish() 9220 a.app.StartPushNotificationsHubWorkers() 9221 } 9222 9223 func (a *OpenTracingAppLayer) StopPushNotificationsHubWorkers() { 9224 origCtx := a.ctx 9225 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.StopPushNotificationsHubWorkers") 9226 9227 a.ctx = newCtx 9228 a.app.Srv().Store.SetContext(newCtx) 9229 defer func() { 9230 a.app.Srv().Store.SetContext(origCtx) 9231 a.ctx = origCtx 9232 }() 9233 9234 defer span.Finish() 9235 a.app.StopPushNotificationsHubWorkers() 9236 } 9237 9238 func (a *OpenTracingAppLayer) SwitchEmailToLdap(email string, password string, code string, ldapLoginId string, ldapPassword string) (string, *model.AppError) { 9239 origCtx := a.ctx 9240 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToLdap") 9241 9242 a.ctx = newCtx 9243 a.app.Srv().Store.SetContext(newCtx) 9244 defer func() { 9245 a.app.Srv().Store.SetContext(origCtx) 9246 a.ctx = origCtx 9247 }() 9248 9249 defer span.Finish() 9250 resultVar0, resultVar1 := a.app.SwitchEmailToLdap(email, password, code, ldapLoginId, ldapPassword) 9251 9252 if resultVar1 != nil { 9253 span.LogFields(spanlog.Error(resultVar1)) 9254 ext.Error.Set(span, true) 9255 } 9256 9257 return resultVar0, resultVar1 9258 } 9259 9260 func (a *OpenTracingAppLayer) SwitchEmailToOAuth(w http.ResponseWriter, r *http.Request, email string, password string, code string, service string) (string, *model.AppError) { 9261 origCtx := a.ctx 9262 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchEmailToOAuth") 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, resultVar1 := a.app.SwitchEmailToOAuth(w, r, email, password, code, service) 9273 9274 if resultVar1 != nil { 9275 span.LogFields(spanlog.Error(resultVar1)) 9276 ext.Error.Set(span, true) 9277 } 9278 9279 return resultVar0, resultVar1 9280 } 9281 9282 func (a *OpenTracingAppLayer) SwitchLdapToEmail(ldapPassword string, code string, email string, newPassword string) (string, *model.AppError) { 9283 origCtx := a.ctx 9284 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchLdapToEmail") 9285 9286 a.ctx = newCtx 9287 a.app.Srv().Store.SetContext(newCtx) 9288 defer func() { 9289 a.app.Srv().Store.SetContext(origCtx) 9290 a.ctx = origCtx 9291 }() 9292 9293 defer span.Finish() 9294 resultVar0, resultVar1 := a.app.SwitchLdapToEmail(ldapPassword, code, email, newPassword) 9295 9296 if resultVar1 != nil { 9297 span.LogFields(spanlog.Error(resultVar1)) 9298 ext.Error.Set(span, true) 9299 } 9300 9301 return resultVar0, resultVar1 9302 } 9303 9304 func (a *OpenTracingAppLayer) SwitchOAuthToEmail(email string, password string, requesterId string) (string, *model.AppError) { 9305 origCtx := a.ctx 9306 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SwitchOAuthToEmail") 9307 9308 a.ctx = newCtx 9309 a.app.Srv().Store.SetContext(newCtx) 9310 defer func() { 9311 a.app.Srv().Store.SetContext(origCtx) 9312 a.ctx = origCtx 9313 }() 9314 9315 defer span.Finish() 9316 resultVar0, resultVar1 := a.app.SwitchOAuthToEmail(email, password, requesterId) 9317 9318 if resultVar1 != nil { 9319 span.LogFields(spanlog.Error(resultVar1)) 9320 ext.Error.Set(span, true) 9321 } 9322 9323 return resultVar0, resultVar1 9324 } 9325 9326 func (a *OpenTracingAppLayer) SyncLdap() { 9327 origCtx := a.ctx 9328 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.SyncLdap") 9329 9330 a.ctx = newCtx 9331 a.app.Srv().Store.SetContext(newCtx) 9332 defer func() { 9333 a.app.Srv().Store.SetContext(origCtx) 9334 a.ctx = origCtx 9335 }() 9336 9337 defer span.Finish() 9338 a.app.SyncLdap() 9339 } 9340 9341 func (a *OpenTracingAppLayer) TestElasticsearch(cfg *model.Config) *model.AppError { 9342 origCtx := a.ctx 9343 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestElasticsearch") 9344 9345 a.ctx = newCtx 9346 a.app.Srv().Store.SetContext(newCtx) 9347 defer func() { 9348 a.app.Srv().Store.SetContext(origCtx) 9349 a.ctx = origCtx 9350 }() 9351 9352 defer span.Finish() 9353 resultVar0 := a.app.TestElasticsearch(cfg) 9354 9355 if resultVar0 != nil { 9356 span.LogFields(spanlog.Error(resultVar0)) 9357 ext.Error.Set(span, true) 9358 } 9359 9360 return resultVar0 9361 } 9362 9363 func (a *OpenTracingAppLayer) TestEmail(userId string, cfg *model.Config) *model.AppError { 9364 origCtx := a.ctx 9365 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestEmail") 9366 9367 a.ctx = newCtx 9368 a.app.Srv().Store.SetContext(newCtx) 9369 defer func() { 9370 a.app.Srv().Store.SetContext(origCtx) 9371 a.ctx = origCtx 9372 }() 9373 9374 defer span.Finish() 9375 resultVar0 := a.app.TestEmail(userId, cfg) 9376 9377 if resultVar0 != nil { 9378 span.LogFields(spanlog.Error(resultVar0)) 9379 ext.Error.Set(span, true) 9380 } 9381 9382 return resultVar0 9383 } 9384 9385 func (a *OpenTracingAppLayer) TestLdap() *model.AppError { 9386 origCtx := a.ctx 9387 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestLdap") 9388 9389 a.ctx = newCtx 9390 a.app.Srv().Store.SetContext(newCtx) 9391 defer func() { 9392 a.app.Srv().Store.SetContext(origCtx) 9393 a.ctx = origCtx 9394 }() 9395 9396 defer span.Finish() 9397 resultVar0 := a.app.TestLdap() 9398 9399 if resultVar0 != nil { 9400 span.LogFields(spanlog.Error(resultVar0)) 9401 ext.Error.Set(span, true) 9402 } 9403 9404 return resultVar0 9405 } 9406 9407 func (a *OpenTracingAppLayer) TestSiteURL(siteURL string) *model.AppError { 9408 origCtx := a.ctx 9409 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TestSiteURL") 9410 9411 a.ctx = newCtx 9412 a.app.Srv().Store.SetContext(newCtx) 9413 defer func() { 9414 a.app.Srv().Store.SetContext(origCtx) 9415 a.ctx = origCtx 9416 }() 9417 9418 defer span.Finish() 9419 resultVar0 := a.app.TestSiteURL(siteURL) 9420 9421 if resultVar0 != nil { 9422 span.LogFields(spanlog.Error(resultVar0)) 9423 ext.Error.Set(span, true) 9424 } 9425 9426 return resultVar0 9427 } 9428 9429 func (a *OpenTracingAppLayer) TotalWebsocketConnections() int { 9430 origCtx := a.ctx 9431 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.TotalWebsocketConnections") 9432 9433 a.ctx = newCtx 9434 a.app.Srv().Store.SetContext(newCtx) 9435 defer func() { 9436 a.app.Srv().Store.SetContext(origCtx) 9437 a.ctx = origCtx 9438 }() 9439 9440 defer span.Finish() 9441 resultVar0 := a.app.TotalWebsocketConnections() 9442 9443 return resultVar0 9444 } 9445 9446 func (a *OpenTracingAppLayer) UpdateActive(user *model.User, active bool) (*model.User, *model.AppError) { 9447 origCtx := a.ctx 9448 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateActive") 9449 9450 a.ctx = newCtx 9451 a.app.Srv().Store.SetContext(newCtx) 9452 defer func() { 9453 a.app.Srv().Store.SetContext(origCtx) 9454 a.ctx = origCtx 9455 }() 9456 9457 defer span.Finish() 9458 resultVar0, resultVar1 := a.app.UpdateActive(user, active) 9459 9460 if resultVar1 != nil { 9461 span.LogFields(spanlog.Error(resultVar1)) 9462 ext.Error.Set(span, true) 9463 } 9464 9465 return resultVar0, resultVar1 9466 } 9467 9468 func (a *OpenTracingAppLayer) UpdateBranch(branch *model.Branch) (*model.Branch, *model.AppError) { 9469 origCtx := a.ctx 9470 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBranch") 9471 9472 a.ctx = newCtx 9473 a.app.Srv().Store.SetContext(newCtx) 9474 defer func() { 9475 a.app.Srv().Store.SetContext(origCtx) 9476 a.ctx = origCtx 9477 }() 9478 9479 defer span.Finish() 9480 resultVar0, resultVar1 := a.app.UpdateBranch(branch) 9481 9482 if resultVar1 != nil { 9483 span.LogFields(spanlog.Error(resultVar1)) 9484 ext.Error.Set(span, true) 9485 } 9486 9487 return resultVar0, resultVar1 9488 } 9489 9490 func (a *OpenTracingAppLayer) UpdateBranchMemberRoles(branchId string, userId string, newRoles string) (*model.BranchMember, *model.AppError) { 9491 origCtx := a.ctx 9492 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBranchMemberRoles") 9493 9494 a.ctx = newCtx 9495 a.app.Srv().Store.SetContext(newCtx) 9496 defer func() { 9497 a.app.Srv().Store.SetContext(origCtx) 9498 a.ctx = origCtx 9499 }() 9500 9501 defer span.Finish() 9502 resultVar0, resultVar1 := a.app.UpdateBranchMemberRoles(branchId, userId, newRoles) 9503 9504 if resultVar1 != nil { 9505 span.LogFields(spanlog.Error(resultVar1)) 9506 ext.Error.Set(span, true) 9507 } 9508 9509 return resultVar0, resultVar1 9510 } 9511 9512 func (a *OpenTracingAppLayer) UpdateBranchMemberSchemeRoles(branchId string, userId string, isSchemeUser bool, isSchemeAdmin bool) (*model.BranchMember, *model.AppError) { 9513 origCtx := a.ctx 9514 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBranchMemberSchemeRoles") 9515 9516 a.ctx = newCtx 9517 a.app.Srv().Store.SetContext(newCtx) 9518 defer func() { 9519 a.app.Srv().Store.SetContext(origCtx) 9520 a.ctx = origCtx 9521 }() 9522 9523 defer span.Finish() 9524 resultVar0, resultVar1 := a.app.UpdateBranchMemberSchemeRoles(branchId, userId, isSchemeUser, isSchemeAdmin) 9525 9526 if resultVar1 != nil { 9527 span.LogFields(spanlog.Error(resultVar1)) 9528 ext.Error.Set(span, true) 9529 } 9530 9531 return resultVar0, resultVar1 9532 } 9533 9534 func (a *OpenTracingAppLayer) UpdateBranchScheme(branch *model.Branch) (*model.Branch, *model.AppError) { 9535 origCtx := a.ctx 9536 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateBranchScheme") 9537 9538 a.ctx = newCtx 9539 a.app.Srv().Store.SetContext(newCtx) 9540 defer func() { 9541 a.app.Srv().Store.SetContext(origCtx) 9542 a.ctx = origCtx 9543 }() 9544 9545 defer span.Finish() 9546 resultVar0, resultVar1 := a.app.UpdateBranchScheme(branch) 9547 9548 if resultVar1 != nil { 9549 span.LogFields(spanlog.Error(resultVar1)) 9550 ext.Error.Set(span, true) 9551 } 9552 9553 return resultVar0, resultVar1 9554 } 9555 9556 func (a *OpenTracingAppLayer) UpdateClass(class *model.Class) (*model.Class, *model.AppError) { 9557 origCtx := a.ctx 9558 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClass") 9559 9560 a.ctx = newCtx 9561 a.app.Srv().Store.SetContext(newCtx) 9562 defer func() { 9563 a.app.Srv().Store.SetContext(origCtx) 9564 a.ctx = origCtx 9565 }() 9566 9567 defer span.Finish() 9568 resultVar0, resultVar1 := a.app.UpdateClass(class) 9569 9570 if resultVar1 != nil { 9571 span.LogFields(spanlog.Error(resultVar1)) 9572 ext.Error.Set(span, true) 9573 } 9574 9575 return resultVar0, resultVar1 9576 } 9577 9578 func (a *OpenTracingAppLayer) UpdateClassMemberNotifyProps(data map[string]string, classId string, userId string) (*model.ClassMember, *model.AppError) { 9579 origCtx := a.ctx 9580 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClassMemberNotifyProps") 9581 9582 a.ctx = newCtx 9583 a.app.Srv().Store.SetContext(newCtx) 9584 defer func() { 9585 a.app.Srv().Store.SetContext(origCtx) 9586 a.ctx = origCtx 9587 }() 9588 9589 defer span.Finish() 9590 resultVar0, resultVar1 := a.app.UpdateClassMemberNotifyProps(data, classId, userId) 9591 9592 if resultVar1 != nil { 9593 span.LogFields(spanlog.Error(resultVar1)) 9594 ext.Error.Set(span, true) 9595 } 9596 9597 return resultVar0, resultVar1 9598 } 9599 9600 func (a *OpenTracingAppLayer) UpdateClassMemberRoles(classId string, userId string, newRoles string) (*model.ClassMember, *model.AppError) { 9601 origCtx := a.ctx 9602 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClassMemberRoles") 9603 9604 a.ctx = newCtx 9605 a.app.Srv().Store.SetContext(newCtx) 9606 defer func() { 9607 a.app.Srv().Store.SetContext(origCtx) 9608 a.ctx = origCtx 9609 }() 9610 9611 defer span.Finish() 9612 resultVar0, resultVar1 := a.app.UpdateClassMemberRoles(classId, userId, newRoles) 9613 9614 if resultVar1 != nil { 9615 span.LogFields(spanlog.Error(resultVar1)) 9616 ext.Error.Set(span, true) 9617 } 9618 9619 return resultVar0, resultVar1 9620 } 9621 9622 func (a *OpenTracingAppLayer) UpdateClassMemberSchemeRoles(classId string, userId string, isSchemeUser bool, isSchemeAdmin bool) (*model.ClassMember, *model.AppError) { 9623 origCtx := a.ctx 9624 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClassMemberSchemeRoles") 9625 9626 a.ctx = newCtx 9627 a.app.Srv().Store.SetContext(newCtx) 9628 defer func() { 9629 a.app.Srv().Store.SetContext(origCtx) 9630 a.ctx = origCtx 9631 }() 9632 9633 defer span.Finish() 9634 resultVar0, resultVar1 := a.app.UpdateClassMemberSchemeRoles(classId, userId, isSchemeUser, isSchemeAdmin) 9635 9636 if resultVar1 != nil { 9637 span.LogFields(spanlog.Error(resultVar1)) 9638 ext.Error.Set(span, true) 9639 } 9640 9641 return resultVar0, resultVar1 9642 } 9643 9644 func (a *OpenTracingAppLayer) UpdateClassPrivacy(oldClass *model.Class, user *model.User) (*model.Class, *model.AppError) { 9645 origCtx := a.ctx 9646 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClassPrivacy") 9647 9648 a.ctx = newCtx 9649 a.app.Srv().Store.SetContext(newCtx) 9650 defer func() { 9651 a.app.Srv().Store.SetContext(origCtx) 9652 a.ctx = origCtx 9653 }() 9654 9655 defer span.Finish() 9656 resultVar0, resultVar1 := a.app.UpdateClassPrivacy(oldClass, user) 9657 9658 if resultVar1 != nil { 9659 span.LogFields(spanlog.Error(resultVar1)) 9660 ext.Error.Set(span, true) 9661 } 9662 9663 return resultVar0, resultVar1 9664 } 9665 9666 func (a *OpenTracingAppLayer) UpdateClassScheme(class *model.Class) (*model.Class, *model.AppError) { 9667 origCtx := a.ctx 9668 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateClassScheme") 9669 9670 a.ctx = newCtx 9671 a.app.Srv().Store.SetContext(newCtx) 9672 defer func() { 9673 a.app.Srv().Store.SetContext(origCtx) 9674 a.ctx = origCtx 9675 }() 9676 9677 defer span.Finish() 9678 resultVar0, resultVar1 := a.app.UpdateClassScheme(class) 9679 9680 if resultVar1 != nil { 9681 span.LogFields(spanlog.Error(resultVar1)) 9682 ext.Error.Set(span, true) 9683 } 9684 9685 return resultVar0, resultVar1 9686 } 9687 9688 func (a *OpenTracingAppLayer) UpdateCommand(oldCmd *model.Command, updatedCmd *model.Command) (*model.Command, *model.AppError) { 9689 origCtx := a.ctx 9690 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateCommand") 9691 9692 a.ctx = newCtx 9693 a.app.Srv().Store.SetContext(newCtx) 9694 defer func() { 9695 a.app.Srv().Store.SetContext(origCtx) 9696 a.ctx = origCtx 9697 }() 9698 9699 defer span.Finish() 9700 resultVar0, resultVar1 := a.app.UpdateCommand(oldCmd, updatedCmd) 9701 9702 if resultVar1 != nil { 9703 span.LogFields(spanlog.Error(resultVar1)) 9704 ext.Error.Set(span, true) 9705 } 9706 9707 return resultVar0, resultVar1 9708 } 9709 9710 func (a *OpenTracingAppLayer) UpdateConfig(f func(*model.Config)) { 9711 origCtx := a.ctx 9712 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateConfig") 9713 9714 a.ctx = newCtx 9715 a.app.Srv().Store.SetContext(newCtx) 9716 defer func() { 9717 a.app.Srv().Store.SetContext(origCtx) 9718 a.ctx = origCtx 9719 }() 9720 9721 defer span.Finish() 9722 a.app.UpdateConfig(f) 9723 } 9724 9725 func (a *OpenTracingAppLayer) UpdateEphemeralPost(userId string, post *model.Post) *model.Post { 9726 origCtx := a.ctx 9727 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateEphemeralPost") 9728 9729 a.ctx = newCtx 9730 a.app.Srv().Store.SetContext(newCtx) 9731 defer func() { 9732 a.app.Srv().Store.SetContext(origCtx) 9733 a.ctx = origCtx 9734 }() 9735 9736 defer span.Finish() 9737 resultVar0 := a.app.UpdateEphemeralPost(userId, post) 9738 9739 return resultVar0 9740 } 9741 9742 func (a *OpenTracingAppLayer) UpdateLastActivityAtIfNeeded(session model.Session) { 9743 origCtx := a.ctx 9744 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateLastActivityAtIfNeeded") 9745 9746 a.ctx = newCtx 9747 a.app.Srv().Store.SetContext(newCtx) 9748 defer func() { 9749 a.app.Srv().Store.SetContext(origCtx) 9750 a.ctx = origCtx 9751 }() 9752 9753 defer span.Finish() 9754 a.app.UpdateLastActivityAtIfNeeded(session) 9755 } 9756 9757 func (a *OpenTracingAppLayer) UpdateMfa(activate bool, userId string, token string) *model.AppError { 9758 origCtx := a.ctx 9759 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMfa") 9760 9761 a.ctx = newCtx 9762 a.app.Srv().Store.SetContext(newCtx) 9763 defer func() { 9764 a.app.Srv().Store.SetContext(origCtx) 9765 a.ctx = origCtx 9766 }() 9767 9768 defer span.Finish() 9769 resultVar0 := a.app.UpdateMfa(activate, userId, token) 9770 9771 if resultVar0 != nil { 9772 span.LogFields(spanlog.Error(resultVar0)) 9773 ext.Error.Set(span, true) 9774 } 9775 9776 return resultVar0 9777 } 9778 9779 func (a *OpenTracingAppLayer) UpdateMobileAppBadge(userId string) { 9780 origCtx := a.ctx 9781 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateMobileAppBadge") 9782 9783 a.ctx = newCtx 9784 a.app.Srv().Store.SetContext(newCtx) 9785 defer func() { 9786 a.app.Srv().Store.SetContext(origCtx) 9787 a.ctx = origCtx 9788 }() 9789 9790 defer span.Finish() 9791 a.app.UpdateMobileAppBadge(userId) 9792 } 9793 9794 func (a *OpenTracingAppLayer) UpdateOAuthUserAttrs(userData io.Reader, user *model.User, provider einterfaces.OauthProvider, service string) *model.AppError { 9795 origCtx := a.ctx 9796 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOAuthUserAttrs") 9797 9798 a.ctx = newCtx 9799 a.app.Srv().Store.SetContext(newCtx) 9800 defer func() { 9801 a.app.Srv().Store.SetContext(origCtx) 9802 a.ctx = origCtx 9803 }() 9804 9805 defer span.Finish() 9806 resultVar0 := a.app.UpdateOAuthUserAttrs(userData, user, provider, service) 9807 9808 if resultVar0 != nil { 9809 span.LogFields(spanlog.Error(resultVar0)) 9810 ext.Error.Set(span, true) 9811 } 9812 9813 return resultVar0 9814 } 9815 9816 func (a *OpenTracingAppLayer) UpdateOauthApp(oldApp *model.OAuthApp, updatedApp *model.OAuthApp) (*model.OAuthApp, *model.AppError) { 9817 origCtx := a.ctx 9818 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateOauthApp") 9819 9820 a.ctx = newCtx 9821 a.app.Srv().Store.SetContext(newCtx) 9822 defer func() { 9823 a.app.Srv().Store.SetContext(origCtx) 9824 a.ctx = origCtx 9825 }() 9826 9827 defer span.Finish() 9828 resultVar0, resultVar1 := a.app.UpdateOauthApp(oldApp, updatedApp) 9829 9830 if resultVar1 != nil { 9831 span.LogFields(spanlog.Error(resultVar1)) 9832 ext.Error.Set(span, true) 9833 } 9834 9835 return resultVar0, resultVar1 9836 } 9837 9838 func (a *OpenTracingAppLayer) UpdatePassword(user *model.User, newPassword string) *model.AppError { 9839 origCtx := a.ctx 9840 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePassword") 9841 9842 a.ctx = newCtx 9843 a.app.Srv().Store.SetContext(newCtx) 9844 defer func() { 9845 a.app.Srv().Store.SetContext(origCtx) 9846 a.ctx = origCtx 9847 }() 9848 9849 defer span.Finish() 9850 resultVar0 := a.app.UpdatePassword(user, newPassword) 9851 9852 if resultVar0 != nil { 9853 span.LogFields(spanlog.Error(resultVar0)) 9854 ext.Error.Set(span, true) 9855 } 9856 9857 return resultVar0 9858 } 9859 9860 func (a *OpenTracingAppLayer) UpdatePasswordAsUser(userId string, currentPassword string, newPassword string) *model.AppError { 9861 origCtx := a.ctx 9862 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordAsUser") 9863 9864 a.ctx = newCtx 9865 a.app.Srv().Store.SetContext(newCtx) 9866 defer func() { 9867 a.app.Srv().Store.SetContext(origCtx) 9868 a.ctx = origCtx 9869 }() 9870 9871 defer span.Finish() 9872 resultVar0 := a.app.UpdatePasswordAsUser(userId, currentPassword, newPassword) 9873 9874 if resultVar0 != nil { 9875 span.LogFields(spanlog.Error(resultVar0)) 9876 ext.Error.Set(span, true) 9877 } 9878 9879 return resultVar0 9880 } 9881 9882 func (a *OpenTracingAppLayer) UpdatePasswordByUserIdSendEmail(userId string, newPassword string, method string) *model.AppError { 9883 origCtx := a.ctx 9884 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordByUserIdSendEmail") 9885 9886 a.ctx = newCtx 9887 a.app.Srv().Store.SetContext(newCtx) 9888 defer func() { 9889 a.app.Srv().Store.SetContext(origCtx) 9890 a.ctx = origCtx 9891 }() 9892 9893 defer span.Finish() 9894 resultVar0 := a.app.UpdatePasswordByUserIdSendEmail(userId, newPassword, method) 9895 9896 if resultVar0 != nil { 9897 span.LogFields(spanlog.Error(resultVar0)) 9898 ext.Error.Set(span, true) 9899 } 9900 9901 return resultVar0 9902 } 9903 9904 func (a *OpenTracingAppLayer) UpdatePasswordSendEmail(user *model.User, newPassword string, method string) *model.AppError { 9905 origCtx := a.ctx 9906 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePasswordSendEmail") 9907 9908 a.ctx = newCtx 9909 a.app.Srv().Store.SetContext(newCtx) 9910 defer func() { 9911 a.app.Srv().Store.SetContext(origCtx) 9912 a.ctx = origCtx 9913 }() 9914 9915 defer span.Finish() 9916 resultVar0 := a.app.UpdatePasswordSendEmail(user, newPassword, method) 9917 9918 if resultVar0 != nil { 9919 span.LogFields(spanlog.Error(resultVar0)) 9920 ext.Error.Set(span, true) 9921 } 9922 9923 return resultVar0 9924 } 9925 9926 func (a *OpenTracingAppLayer) UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError) { 9927 origCtx := a.ctx 9928 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePost") 9929 9930 a.ctx = newCtx 9931 a.app.Srv().Store.SetContext(newCtx) 9932 defer func() { 9933 a.app.Srv().Store.SetContext(origCtx) 9934 a.ctx = origCtx 9935 }() 9936 9937 defer span.Finish() 9938 resultVar0, resultVar1 := a.app.UpdatePost(post, safeUpdate) 9939 9940 if resultVar1 != nil { 9941 span.LogFields(spanlog.Error(resultVar1)) 9942 ext.Error.Set(span, true) 9943 } 9944 9945 return resultVar0, resultVar1 9946 } 9947 9948 func (a *OpenTracingAppLayer) UpdatePreferences(userId string, preferences model.Preferences) *model.AppError { 9949 origCtx := a.ctx 9950 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdatePreferences") 9951 9952 a.ctx = newCtx 9953 a.app.Srv().Store.SetContext(newCtx) 9954 defer func() { 9955 a.app.Srv().Store.SetContext(origCtx) 9956 a.ctx = origCtx 9957 }() 9958 9959 defer span.Finish() 9960 resultVar0 := a.app.UpdatePreferences(userId, preferences) 9961 9962 if resultVar0 != nil { 9963 span.LogFields(spanlog.Error(resultVar0)) 9964 ext.Error.Set(span, true) 9965 } 9966 9967 return resultVar0 9968 } 9969 9970 func (a *OpenTracingAppLayer) UpdateRole(role *model.Role) (*model.Role, *model.AppError) { 9971 origCtx := a.ctx 9972 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateRole") 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 resultVar0, resultVar1 := a.app.UpdateRole(role) 9983 9984 if resultVar1 != nil { 9985 span.LogFields(spanlog.Error(resultVar1)) 9986 ext.Error.Set(span, true) 9987 } 9988 9989 return resultVar0, resultVar1 9990 } 9991 9992 func (a *OpenTracingAppLayer) UpdateScheme(scheme *model.Scheme) (*model.Scheme, *model.AppError) { 9993 origCtx := a.ctx 9994 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateScheme") 9995 9996 a.ctx = newCtx 9997 a.app.Srv().Store.SetContext(newCtx) 9998 defer func() { 9999 a.app.Srv().Store.SetContext(origCtx) 10000 a.ctx = origCtx 10001 }() 10002 10003 defer span.Finish() 10004 resultVar0, resultVar1 := a.app.UpdateScheme(scheme) 10005 10006 if resultVar1 != nil { 10007 span.LogFields(spanlog.Error(resultVar1)) 10008 ext.Error.Set(span, true) 10009 } 10010 10011 return resultVar0, resultVar1 10012 } 10013 10014 func (a *OpenTracingAppLayer) UpdateSessionsIsGuest(userId string, isGuest bool) { 10015 origCtx := a.ctx 10016 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateSessionsIsGuest") 10017 10018 a.ctx = newCtx 10019 a.app.Srv().Store.SetContext(newCtx) 10020 defer func() { 10021 a.app.Srv().Store.SetContext(origCtx) 10022 a.ctx = origCtx 10023 }() 10024 10025 defer span.Finish() 10026 a.app.UpdateSessionsIsGuest(userId, isGuest) 10027 } 10028 10029 func (a *OpenTracingAppLayer) UpdateUser(user *model.User, sendNotifications bool) (*model.User, *model.AppError) { 10030 origCtx := a.ctx 10031 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUser") 10032 10033 a.ctx = newCtx 10034 a.app.Srv().Store.SetContext(newCtx) 10035 defer func() { 10036 a.app.Srv().Store.SetContext(origCtx) 10037 a.ctx = origCtx 10038 }() 10039 10040 defer span.Finish() 10041 resultVar0, resultVar1 := a.app.UpdateUser(user, sendNotifications) 10042 10043 if resultVar1 != nil { 10044 span.LogFields(spanlog.Error(resultVar1)) 10045 ext.Error.Set(span, true) 10046 } 10047 10048 return resultVar0, resultVar1 10049 } 10050 10051 func (a *OpenTracingAppLayer) UpdateUserActive(userId string, active bool) *model.AppError { 10052 origCtx := a.ctx 10053 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserActive") 10054 10055 a.ctx = newCtx 10056 a.app.Srv().Store.SetContext(newCtx) 10057 defer func() { 10058 a.app.Srv().Store.SetContext(origCtx) 10059 a.ctx = origCtx 10060 }() 10061 10062 defer span.Finish() 10063 resultVar0 := a.app.UpdateUserActive(userId, active) 10064 10065 if resultVar0 != nil { 10066 span.LogFields(spanlog.Error(resultVar0)) 10067 ext.Error.Set(span, true) 10068 } 10069 10070 return resultVar0 10071 } 10072 10073 func (a *OpenTracingAppLayer) UpdateUserAsUser(user *model.User, asAdmin bool) (*model.User, *model.AppError) { 10074 origCtx := a.ctx 10075 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAsUser") 10076 10077 a.ctx = newCtx 10078 a.app.Srv().Store.SetContext(newCtx) 10079 defer func() { 10080 a.app.Srv().Store.SetContext(origCtx) 10081 a.ctx = origCtx 10082 }() 10083 10084 defer span.Finish() 10085 resultVar0, resultVar1 := a.app.UpdateUserAsUser(user, asAdmin) 10086 10087 if resultVar1 != nil { 10088 span.LogFields(spanlog.Error(resultVar1)) 10089 ext.Error.Set(span, true) 10090 } 10091 10092 return resultVar0, resultVar1 10093 } 10094 10095 func (a *OpenTracingAppLayer) UpdateUserAuth(userId string, userAuth *model.UserAuth) (*model.UserAuth, *model.AppError) { 10096 origCtx := a.ctx 10097 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserAuth") 10098 10099 a.ctx = newCtx 10100 a.app.Srv().Store.SetContext(newCtx) 10101 defer func() { 10102 a.app.Srv().Store.SetContext(origCtx) 10103 a.ctx = origCtx 10104 }() 10105 10106 defer span.Finish() 10107 resultVar0, resultVar1 := a.app.UpdateUserAuth(userId, userAuth) 10108 10109 if resultVar1 != nil { 10110 span.LogFields(spanlog.Error(resultVar1)) 10111 ext.Error.Set(span, true) 10112 } 10113 10114 return resultVar0, resultVar1 10115 } 10116 10117 func (a *OpenTracingAppLayer) UpdateUserNotifyProps(userId string, props map[string]string) (*model.User, *model.AppError) { 10118 origCtx := a.ctx 10119 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserNotifyProps") 10120 10121 a.ctx = newCtx 10122 a.app.Srv().Store.SetContext(newCtx) 10123 defer func() { 10124 a.app.Srv().Store.SetContext(origCtx) 10125 a.ctx = origCtx 10126 }() 10127 10128 defer span.Finish() 10129 resultVar0, resultVar1 := a.app.UpdateUserNotifyProps(userId, props) 10130 10131 if resultVar1 != nil { 10132 span.LogFields(spanlog.Error(resultVar1)) 10133 ext.Error.Set(span, true) 10134 } 10135 10136 return resultVar0, resultVar1 10137 } 10138 10139 func (a *OpenTracingAppLayer) UpdateUserRoles(userId string, newRoles string, sendWebSocketEvent bool) (*model.User, *model.AppError) { 10140 origCtx := a.ctx 10141 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateUserRoles") 10142 10143 a.ctx = newCtx 10144 a.app.Srv().Store.SetContext(newCtx) 10145 defer func() { 10146 a.app.Srv().Store.SetContext(origCtx) 10147 a.ctx = origCtx 10148 }() 10149 10150 defer span.Finish() 10151 resultVar0, resultVar1 := a.app.UpdateUserRoles(userId, newRoles, sendWebSocketEvent) 10152 10153 if resultVar1 != nil { 10154 span.LogFields(spanlog.Error(resultVar1)) 10155 ext.Error.Set(span, true) 10156 } 10157 10158 return resultVar0, resultVar1 10159 } 10160 10161 func (a *OpenTracingAppLayer) UpdateWebConnUserActivity(session model.Session, activityAt int64) { 10162 origCtx := a.ctx 10163 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UpdateWebConnUserActivity") 10164 10165 a.ctx = newCtx 10166 a.app.Srv().Store.SetContext(newCtx) 10167 defer func() { 10168 a.app.Srv().Store.SetContext(origCtx) 10169 a.ctx = origCtx 10170 }() 10171 10172 defer span.Finish() 10173 a.app.UpdateWebConnUserActivity(session, activityAt) 10174 } 10175 10176 func (a *OpenTracingAppLayer) UploadEmojiImage(id string, imageData *multipart.FileHeader) *model.AppError { 10177 origCtx := a.ctx 10178 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadEmojiImage") 10179 10180 a.ctx = newCtx 10181 a.app.Srv().Store.SetContext(newCtx) 10182 defer func() { 10183 a.app.Srv().Store.SetContext(origCtx) 10184 a.ctx = origCtx 10185 }() 10186 10187 defer span.Finish() 10188 resultVar0 := a.app.UploadEmojiImage(id, imageData) 10189 10190 if resultVar0 != nil { 10191 span.LogFields(spanlog.Error(resultVar0)) 10192 ext.Error.Set(span, true) 10193 } 10194 10195 return resultVar0 10196 } 10197 10198 func (a *OpenTracingAppLayer) UploadFile(data []byte, classId string, filename string) (*model.FileInfo, *model.AppError) { 10199 origCtx := a.ctx 10200 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFile") 10201 10202 a.ctx = newCtx 10203 a.app.Srv().Store.SetContext(newCtx) 10204 defer func() { 10205 a.app.Srv().Store.SetContext(origCtx) 10206 a.ctx = origCtx 10207 }() 10208 10209 defer span.Finish() 10210 resultVar0, resultVar1 := a.app.UploadFile(data, classId, filename) 10211 10212 if resultVar1 != nil { 10213 span.LogFields(spanlog.Error(resultVar1)) 10214 ext.Error.Set(span, true) 10215 } 10216 10217 return resultVar0, resultVar1 10218 } 10219 10220 func (a *OpenTracingAppLayer) UploadFileX(classId string, name string, input io.Reader, opts ...func(*UploadFileTask)) (*model.FileInfo, *model.AppError) { 10221 origCtx := a.ctx 10222 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFileX") 10223 10224 a.ctx = newCtx 10225 a.app.Srv().Store.SetContext(newCtx) 10226 defer func() { 10227 a.app.Srv().Store.SetContext(origCtx) 10228 a.ctx = origCtx 10229 }() 10230 10231 defer span.Finish() 10232 resultVar0, resultVar1 := a.app.UploadFileX(classId, name, input, opts...) 10233 10234 if resultVar1 != nil { 10235 span.LogFields(spanlog.Error(resultVar1)) 10236 ext.Error.Set(span, true) 10237 } 10238 10239 return resultVar0, resultVar1 10240 } 10241 10242 func (a *OpenTracingAppLayer) UploadFiles(branchId string, classId string, userId string, files []io.ReadCloser, filenames []string, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 10243 origCtx := a.ctx 10244 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadFiles") 10245 10246 a.ctx = newCtx 10247 a.app.Srv().Store.SetContext(newCtx) 10248 defer func() { 10249 a.app.Srv().Store.SetContext(origCtx) 10250 a.ctx = origCtx 10251 }() 10252 10253 defer span.Finish() 10254 resultVar0, resultVar1 := a.app.UploadFiles(branchId, classId, userId, files, filenames, clientIds, now) 10255 10256 if resultVar1 != nil { 10257 span.LogFields(spanlog.Error(resultVar1)) 10258 ext.Error.Set(span, true) 10259 } 10260 10261 return resultVar0, resultVar1 10262 } 10263 10264 func (a *OpenTracingAppLayer) UploadMultipartFiles(branchId string, classId string, userId string, fileHeaders []*multipart.FileHeader, clientIds []string, now time.Time) (*model.FileUploadResponse, *model.AppError) { 10265 origCtx := a.ctx 10266 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UploadMultipartFiles") 10267 10268 a.ctx = newCtx 10269 a.app.Srv().Store.SetContext(newCtx) 10270 defer func() { 10271 a.app.Srv().Store.SetContext(origCtx) 10272 a.ctx = origCtx 10273 }() 10274 10275 defer span.Finish() 10276 resultVar0, resultVar1 := a.app.UploadMultipartFiles(branchId, classId, userId, fileHeaders, clientIds, now) 10277 10278 if resultVar1 != nil { 10279 span.LogFields(spanlog.Error(resultVar1)) 10280 ext.Error.Set(span, true) 10281 } 10282 10283 return resultVar0, resultVar1 10284 } 10285 10286 func (a *OpenTracingAppLayer) UserCanSeeOtherUser(userId string, otherUserId string) (bool, *model.AppError) { 10287 origCtx := a.ctx 10288 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.UserCanSeeOtherUser") 10289 10290 a.ctx = newCtx 10291 a.app.Srv().Store.SetContext(newCtx) 10292 defer func() { 10293 a.app.Srv().Store.SetContext(origCtx) 10294 a.ctx = origCtx 10295 }() 10296 10297 defer span.Finish() 10298 resultVar0, resultVar1 := a.app.UserCanSeeOtherUser(userId, otherUserId) 10299 10300 if resultVar1 != nil { 10301 span.LogFields(spanlog.Error(resultVar1)) 10302 ext.Error.Set(span, true) 10303 } 10304 10305 return resultVar0, resultVar1 10306 } 10307 10308 func (a *OpenTracingAppLayer) ValidateAndSetLicenseBytes(b []byte) { 10309 origCtx := a.ctx 10310 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.ValidateAndSetLicenseBytes") 10311 10312 a.ctx = newCtx 10313 a.app.Srv().Store.SetContext(newCtx) 10314 defer func() { 10315 a.app.Srv().Store.SetContext(origCtx) 10316 a.ctx = origCtx 10317 }() 10318 10319 defer span.Finish() 10320 a.app.ValidateAndSetLicenseBytes(b) 10321 } 10322 10323 func (a *OpenTracingAppLayer) VerifyEmailFromToken(userSuppliedTokenString string) *model.AppError { 10324 origCtx := a.ctx 10325 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyEmailFromToken") 10326 10327 a.ctx = newCtx 10328 a.app.Srv().Store.SetContext(newCtx) 10329 defer func() { 10330 a.app.Srv().Store.SetContext(origCtx) 10331 a.ctx = origCtx 10332 }() 10333 10334 defer span.Finish() 10335 resultVar0 := a.app.VerifyEmailFromToken(userSuppliedTokenString) 10336 10337 if resultVar0 != nil { 10338 span.LogFields(spanlog.Error(resultVar0)) 10339 ext.Error.Set(span, true) 10340 } 10341 10342 return resultVar0 10343 } 10344 10345 func (a *OpenTracingAppLayer) VerifyUserEmail(userId string, email string) *model.AppError { 10346 origCtx := a.ctx 10347 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.VerifyUserEmail") 10348 10349 a.ctx = newCtx 10350 a.app.Srv().Store.SetContext(newCtx) 10351 defer func() { 10352 a.app.Srv().Store.SetContext(origCtx) 10353 a.ctx = origCtx 10354 }() 10355 10356 defer span.Finish() 10357 resultVar0 := a.app.VerifyUserEmail(userId, email) 10358 10359 if resultVar0 != nil { 10360 span.LogFields(spanlog.Error(resultVar0)) 10361 ext.Error.Set(span, true) 10362 } 10363 10364 return resultVar0 10365 } 10366 10367 func (a *OpenTracingAppLayer) WaitForClassMembership(classId string, userId string) { 10368 origCtx := a.ctx 10369 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WaitForClassMembership") 10370 10371 a.ctx = newCtx 10372 a.app.Srv().Store.SetContext(newCtx) 10373 defer func() { 10374 a.app.Srv().Store.SetContext(origCtx) 10375 a.ctx = origCtx 10376 }() 10377 10378 defer span.Finish() 10379 a.app.WaitForClassMembership(classId, userId) 10380 } 10381 10382 func (a *OpenTracingAppLayer) WriteFile(fr io.Reader, path string) (int64, *model.AppError) { 10383 origCtx := a.ctx 10384 span, newCtx := tracing.StartSpanWithParentByContext(a.ctx, "app.WriteFile") 10385 10386 a.ctx = newCtx 10387 a.app.Srv().Store.SetContext(newCtx) 10388 defer func() { 10389 a.app.Srv().Store.SetContext(origCtx) 10390 a.ctx = origCtx 10391 }() 10392 10393 defer span.Finish() 10394 resultVar0, resultVar1 := a.app.WriteFile(fr, path) 10395 10396 if resultVar1 != nil { 10397 span.LogFields(spanlog.Error(resultVar1)) 10398 ext.Error.Set(span, true) 10399 } 10400 10401 return resultVar0, resultVar1 10402 } 10403 10404 func NewOpenTracingAppLayer(childApp AppIface, ctx context.Context) *OpenTracingAppLayer { 10405 newApp := OpenTracingAppLayer{ 10406 app: childApp, 10407 ctx: ctx, 10408 } 10409 10410 newApp.srv = childApp.Srv() 10411 newApp.log = childApp.Log() 10412 newApp.notificationsLog = childApp.NotificationsLog() 10413 newApp.t = childApp.GetT() 10414 if childApp.Session() != nil { 10415 newApp.session = *childApp.Session() 10416 } 10417 newApp.requestId = childApp.RequestId() 10418 newApp.ipAddress = childApp.IpAddress() 10419 newApp.path = childApp.Path() 10420 newApp.userAgent = childApp.UserAgent() 10421 newApp.acceptLanguage = childApp.AcceptLanguage() 10422 newApp.accountMigration = childApp.AccountMigration() 10423 newApp.cluster = childApp.Cluster() 10424 newApp.compliance = childApp.Compliance() 10425 newApp.dataRetention = childApp.DataRetention() 10426 newApp.searchEngine = childApp.SearchEngine() 10427 newApp.ldap = childApp.Ldap() 10428 newApp.messageExport = childApp.MessageExport() 10429 newApp.metrics = childApp.Metrics() 10430 newApp.notification = childApp.Notification() 10431 newApp.saml = childApp.Saml() 10432 newApp.httpService = childApp.HTTPService() 10433 newApp.imageProxy = childApp.ImageProxy() 10434 newApp.timezones = childApp.Timezones() 10435 newApp.context = childApp.Context() 10436 10437 return &newApp 10438 } 10439 10440 func (a *OpenTracingAppLayer) Srv() *Server { 10441 return a.srv 10442 } 10443 func (a *OpenTracingAppLayer) Log() *mlog.Logger { 10444 return a.log 10445 } 10446 func (a *OpenTracingAppLayer) NotificationsLog() *mlog.Logger { 10447 return a.notificationsLog 10448 } 10449 func (a *OpenTracingAppLayer) T(translationID string, args ...interface{}) string { 10450 return a.t(translationID, args...) 10451 } 10452 func (a *OpenTracingAppLayer) Session() *model.Session { 10453 return &a.session 10454 } 10455 func (a *OpenTracingAppLayer) RequestId() string { 10456 return a.requestId 10457 } 10458 func (a *OpenTracingAppLayer) IpAddress() string { 10459 return a.ipAddress 10460 } 10461 func (a *OpenTracingAppLayer) Path() string { 10462 return a.path 10463 } 10464 func (a *OpenTracingAppLayer) UserAgent() string { 10465 return a.userAgent 10466 } 10467 func (a *OpenTracingAppLayer) AcceptLanguage() string { 10468 return a.acceptLanguage 10469 } 10470 func (a *OpenTracingAppLayer) AccountMigration() einterfaces.AccountMigrationInterface { 10471 return a.accountMigration 10472 } 10473 func (a *OpenTracingAppLayer) Cluster() einterfaces.ClusterInterface { 10474 return a.cluster 10475 } 10476 func (a *OpenTracingAppLayer) Compliance() einterfaces.ComplianceInterface { 10477 return a.compliance 10478 } 10479 func (a *OpenTracingAppLayer) DataRetention() einterfaces.DataRetentionInterface { 10480 return a.dataRetention 10481 } 10482 func (a *OpenTracingAppLayer) Ldap() einterfaces.LdapInterface { 10483 return a.ldap 10484 } 10485 func (a *OpenTracingAppLayer) MessageExport() einterfaces.MessageExportInterface { 10486 return a.messageExport 10487 } 10488 func (a *OpenTracingAppLayer) Metrics() einterfaces.MetricsInterface { 10489 return a.metrics 10490 } 10491 func (a *OpenTracingAppLayer) Notification() einterfaces.NotificationInterface { 10492 return a.notification 10493 } 10494 func (a *OpenTracingAppLayer) Saml() einterfaces.SamlInterface { 10495 return a.saml 10496 } 10497 func (a *OpenTracingAppLayer) HTTPService() httpservice.HTTPService { 10498 return a.httpService 10499 } 10500 func (a *OpenTracingAppLayer) ImageProxy() *imageproxy.ImageProxy { 10501 return a.imageProxy 10502 } 10503 func (a *OpenTracingAppLayer) Timezones() *timezones.Timezones { 10504 return a.timezones 10505 } 10506 func (a *OpenTracingAppLayer) Context() context.Context { 10507 return a.context 10508 } 10509 func (a *OpenTracingAppLayer) SetSession(sess *model.Session) { 10510 a.session = *sess 10511 } 10512 func (a *OpenTracingAppLayer) SetT(t goi18n.TranslateFunc) { 10513 a.t = t 10514 } 10515 func (a *OpenTracingAppLayer) SetRequestId(str string) { 10516 a.requestId = str 10517 } 10518 func (a *OpenTracingAppLayer) SetIpAddress(str string) { 10519 a.ipAddress = str 10520 } 10521 func (a *OpenTracingAppLayer) SetUserAgent(str string) { 10522 a.userAgent = str 10523 } 10524 func (a *OpenTracingAppLayer) SetAcceptLanguage(str string) { 10525 a.acceptLanguage = str 10526 } 10527 func (a *OpenTracingAppLayer) SetPath(str string) { 10528 a.path = str 10529 } 10530 func (a *OpenTracingAppLayer) SetContext(c context.Context) { 10531 a.context = c 10532 } 10533 func (a *OpenTracingAppLayer) SetServer(srv *Server) { 10534 a.srv = srv 10535 } 10536 func (a *OpenTracingAppLayer) GetT() goi18n.TranslateFunc { 10537 return a.t 10538 }