Documentation ¶
Index ¶
- func StartCleaning(logger log.Logger, locator storage.Locator, storages []config.Storage, ...)
- type Dir
- func New(ctx context.Context, storageName string, logger log.Logger, ...) (Dir, error)
- func NewRepository(ctx context.Context, storageName string, logger log.Logger, ...) (*gitalypb.Repository, Dir, error)
- func NewWithPrefix(ctx context.Context, storageName, prefix string, logger log.Logger, ...) (Dir, error)
- func NewWithoutContext(storageName string, logger log.Logger, locator storage.Locator) (Dir, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dir ¶
type Dir struct {
// contains filtered or unexported fields
}
Dir is a storage-scoped temporary directory.
func New ¶
func New(ctx context.Context, storageName string, logger log.Logger, locator storage.Locator) (Dir, error)
New returns the path of a new temporary directory for the given storage. The directory is removed asynchronously with os.RemoveAll when the context expires.
func NewRepository ¶
func NewRepository(ctx context.Context, storageName string, logger log.Logger, locator storage.Locator) (*gitalypb.Repository, Dir, error)
NewRepository is the same as New, but it returns a *gitalypb.Repository for the created directory as well as the bare path as a string.
func NewWithPrefix ¶
func NewWithPrefix(ctx context.Context, storageName, prefix string, logger log.Logger, locator storage.Locator) (Dir, error)
NewWithPrefix returns the path of a new temporary directory for the given storage with a specific prefix used to create the temporary directory's name. The directory is removed asynchronously with os.RemoveAll when the context expires.
func NewWithoutContext ¶
NewWithoutContext returns a temporary directory for the given storage suitable which is not storage scoped. The temporary directory will thus not get cleaned up when the context expires, but instead when the temporary directory is older than MaxAge.
func (Dir) WaitForCleanup ¶
func (d Dir) WaitForCleanup()
WaitForCleanup waits until the temporary directory got removed via the asynchronous cleanupOnDone call. This is mainly intended for use in tests.