Documentation ¶
Index ¶
- func StartCleaning(locator storage.Locator, storages []config.Storage, d time.Duration)
- type Dir
- func New(ctx context.Context, storageName string, locator storage.Locator) (Dir, error)
- func NewRepository(ctx context.Context, storageName string, locator storage.Locator) (*gitalypb.Repository, Dir, error)
- func NewWithPrefix(ctx context.Context, storageName, prefix string, locator storage.Locator) (Dir, error)
- func NewWithoutContext(storageName string, locator storage.Locator) (Dir, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dir ¶ added in v14.2.0
type Dir struct {
// contains filtered or unexported fields
}
Dir is a storage-scoped temporary directory.
func New ¶
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 ¶ added in v14.2.0
func NewRepository(ctx context.Context, storageName string, 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 ¶ added in v14.2.0
func NewWithPrefix(ctx context.Context, storageName, prefix string, 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 ¶ added in v14.2.0
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 ¶ added in v14.2.0
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.