(ctx context.Context, rep repo.Repository, authz auth.AuthorizationInfo, req *grpcapi.PrefetchContentsRequest)
| 440 | } |
| 441 | |
| 442 | func handlePrefetchContentsRequest(ctx context.Context, rep repo.Repository, authz auth.AuthorizationInfo, req *grpcapi.PrefetchContentsRequest) *grpcapi.SessionResponse { |
| 443 | ctx, span := tracer.Start(ctx, "GRPCSession.PrefetchContents") |
| 444 | defer span.End() |
| 445 | |
| 446 | if authz.ContentAccessLevel() < auth.AccessLevelRead { |
| 447 | return accessDeniedResponse() |
| 448 | } |
| 449 | |
| 450 | contentIDs, err := content.IDsFromStrings(req.GetContentIds()) |
| 451 | if err != nil { |
| 452 | return errorResponse(err) |
| 453 | } |
| 454 | |
| 455 | cids := rep.PrefetchContents(ctx, contentIDs, req.GetHint()) |
| 456 | |
| 457 | return &grpcapi.SessionResponse{ |
| 458 | Response: &grpcapi.SessionResponse_PrefetchContents{ |
| 459 | PrefetchContents: &grpcapi.PrefetchContentsResponse{ |
| 460 | ContentIds: content.IDsToStrings(cids), |
| 461 | }, |
| 462 | }, |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | func handleApplyRetentionPolicyRequest(ctx context.Context, rep repo.RepositoryWriter, authz auth.AuthorizationInfo, usernameAtHostname string, req *grpcapi.ApplyRetentionPolicyRequest) *grpcapi.SessionResponse { |
| 467 | ctx, span := tracer.Start(ctx, "GRPCSession.ApplyRetentionPolicy") |
no test coverage detected