archiver

package
v1.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchiveRequest

type ArchiveRequest struct {
	// 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 ArchiveRepository

func ArchiveRepository(request *ArchiveRequest) *ArchiveRequest

ArchiveRepository satisfies the ArchiveRequest being passed in. Processing will occur in a separate goroutine, as this phase may take a while to complete. If the archive already exists, ArchiveRepository will not do anything. In all cases, the caller should be examining the *ArchiveRequest being returned for completion, as it may be different than the one they passed in.

func DeriveRequestFrom

func DeriveRequestFrom(ctx *context.Context, uri string) *ArchiveRequest

DeriveRequestFrom creates an archival request, based on the URI. The resulting ArchiveRequest is suitable for being passed to ArchiveRepository() if it's determined that the request still needs to be satisfied.

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.

func (*ArchiveRequest) GetArchivePath

func (aReq *ArchiveRequest) GetArchivePath() string

GetArchivePath returns the path from which we can serve this archive.

func (*ArchiveRequest) IsComplete

func (aReq *ArchiveRequest) IsComplete() bool

IsComplete returns the completion status of this request.

func (*ArchiveRequest) TimedWaitForCompletion

func (aReq *ArchiveRequest) TimedWaitForCompletion(ctx *context.Context, dur time.Duration) (bool, bool)

TimedWaitForCompletion will wait for this request to complete, with timeout happening after the specified Duration. It returns whether the archive is now complete and whether we hit the timeout or not. The latter may not be useful if the request is complete or we started to shutdown.

func (*ArchiveRequest) WaitForCompletion

func (aReq *ArchiveRequest) WaitForCompletion(ctx *context.Context) bool

WaitForCompletion will wait for this request to complete, with no timeout. It returns whether the archive was actually completed, as the channel could have also been closed due to an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL