Documentation
¶
Index ¶
- func DeleteOldRepositoryArchives(ctx context.Context, olderThan time.Duration) error
- func DeleteRepositoryArchives(ctx context.Context) error
- func Init(ctx context.Context) error
- func ServeRepoArchive(ctx *gitea_context.Base, archiveReq *ArchiveRequest) error
- func StartArchive(request *ArchiveRequest) error
- type ArchiveRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteOldRepositoryArchives ¶
DeleteOldRepositoryArchives deletes old repository archives.
func DeleteRepositoryArchives ¶
DeleteRepositoryArchives deletes all repositories' archives.
func ServeRepoArchive ¶ added in v1.25.0
func ServeRepoArchive(ctx *gitea_context.Base, archiveReq *ArchiveRequest) error
func StartArchive ¶
func StartArchive(request *ArchiveRequest) error
StartArchive push the archive request to the queue
Types ¶
type ArchiveRequest ¶
type ArchiveRequest struct {
Repo *repo_model.Repository
Type repo_model.ArchiveType
CommitID string
Paths []string
// contains filtered or unexported fields
}
ArchiveRequest defines the parameters of an archive request, which notably includes the specific repository being archived as well as the commit, the name by which it was requested, and the kind of archive being requested. This is entirely opaque to external entities, though, and mostly used as a handle elsewhere.
func NewRequest ¶
func NewRequest(repo *repo_model.Repository, gitRepo *git.Repository, archiveRefExt string, paths []string) (*ArchiveRequest, error)
NewRequest creates an archival request, based on the URI. The resulting ArchiveRequest is suitable for being passed to Await() if it's determined that the request still needs to be satisfied.
func (*ArchiveRequest) Await ¶ added in v1.17.2
func (aReq *ArchiveRequest) Await(ctx context.Context) (*repo_model.RepoArchiver, error)
Await awaits the completion of an ArchiveRequest. If the archive has already been prepared the method returns immediately. Otherwise, an archiver process will be started and its completion awaited. On success the returned RepoArchiver may be used to download the archive. Note that even if the context is cancelled/times out a started archiver will still continue to run in the background.
func (*ArchiveRequest) GetArchiveName ¶
func (aReq *ArchiveRequest) GetArchiveName() string
GetArchiveName returns the name of the caller, based on the ref used by the caller to create this request.