tempdir

package
v1.87.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
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 = "+gitaly"

	// 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 added in v1.86.0

func AppendCacheDir(storagePath string) string

AppendCacheDir will append the cache directory convention to the storage path provided

func AppendStateDir added in v1.86.0

func AppendStateDir(storagePath string) string

AppendStateDir will append the state directory convention to the storage path provided

func AppendTempDir added in v1.86.0

func AppendTempDir(storagePath string) string

AppendTempDir will append the temp directory convention to the storage path provided

func CacheDir added in v1.60.0

func CacheDir(storage config.Storage) string

CacheDir returns the path to the cache dir for a storage location

func ForDeleteAllRepositories added in v0.103.0

func ForDeleteAllRepositories(storageName string) (string, error)

ForDeleteAllRepositories returns a temporary directory for the given storage. It is not context-scoped but it will get removed eventuall (after MaxAge).

func New

func New(ctx context.Context, repo *gitalypb.Repository) (string, error)

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 added in v0.96.0

func NewAsRepository(ctx context.Context, repo *gitalypb.Repository) (*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 added in v0.74.0

func StartCleaning()

StartCleaning starts tempdir cleanup goroutines.

func StateDir added in v1.66.0

func StateDir(storage config.Storage) string

StateDir returns the path to the state dir for a storage location

func TempDir added in v1.60.0

func TempDir(storage config.Storage) string

TempDir returns the path to the temp dir for a storage location

Types

This section is empty.

Jump to

Keyboard shortcuts

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