mirror of
https://github.com/harness/drone.git
synced 2025-05-06 02:10:05 +08:00
28 lines
693 B
Go
28 lines
693 B
Go
package repo
|
|
|
|
import (
|
|
"context"
|
|
|
|
apiauth "github.com/harness/gitness/internal/api/auth"
|
|
"github.com/harness/gitness/internal/auth"
|
|
"github.com/harness/gitness/types"
|
|
"github.com/harness/gitness/types/enum"
|
|
)
|
|
|
|
// ExportProgress returns progress of the export job.
|
|
func (c *Controller) ExportProgress(ctx context.Context,
|
|
session *auth.Session,
|
|
repoRef string,
|
|
) (types.JobProgress, error) {
|
|
repo, err := c.repoStore.FindByRef(ctx, repoRef)
|
|
if err != nil {
|
|
return types.JobProgress{}, err
|
|
}
|
|
|
|
if err = apiauth.CheckRepo(ctx, c.authorizer, session, repo, enum.PermissionRepoView, false); err != nil {
|
|
return types.JobProgress{}, err
|
|
}
|
|
|
|
return c.exporter.GetProgress(ctx, repo)
|
|
}
|