Documentation ¶
Index ¶
- Constants
- func AppendCacheDir(storagePath string) string
- func AppendStateDir(storagePath string) string
- func AppendTempDir(storagePath string) string
- func CacheDir(storage config.Storage) string
- func ForDeleteAllRepositories(locator storage.Locator, storageName string) (string, error)
- func New(ctx context.Context, repo *gitalypb.Repository, locator storage.Locator) (string, error)
- func NewAsRepository(ctx context.Context, repo *gitalypb.Repository, loc storage.Locator) (*gitalypb.Repository, string, error)
- func StartCleaning(storages []config.Storage, d time.Duration)
- func StateDir(storage config.Storage) string
- func TempDir(storage config.Storage) string
Constants ¶
const ( // GitalyDataPrefix is the top-level directory we use to store system // (non-user) data. We need to be careful that this path does not clash // with any directory name that could be provided by a user. The '+' // character is not allowed in GitLab namespaces or repositories. GitalyDataPrefix = config.GitalyDataPrefix // MaxAge is used by ForDeleteAllRepositories. It is also a fallback // for the context-scoped temporary directories, to ensure they get // cleaned up if the cleanup at the end of the context failed to run. MaxAge = 7 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func AppendCacheDir ¶
AppendCacheDir will append the cache directory convention to the storage path provided
func AppendStateDir ¶
AppendStateDir will append the state directory convention to the storage path provided
func AppendTempDir ¶
AppendTempDir will append the temp directory convention to the storage path provided
func ForDeleteAllRepositories ¶
ForDeleteAllRepositories returns a temporary directory for the given storage. It is not context-scoped but it will get removed eventuall (after MaxAge).
func New ¶
New returns the path of a new temporary directory for use with the repository. The directory is removed with os.RemoveAll when ctx expires.
func NewAsRepository ¶
func NewAsRepository(ctx context.Context, repo *gitalypb.Repository, loc storage.Locator) (*gitalypb.Repository, string, error)
NewAsRepository 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 StartCleaning ¶
StartCleaning starts tempdir cleanup in a goroutine.
Types ¶
This section is empty.