Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // RequiredFiles list of required files in a directory to treat it as a working directory RequiredFiles = []string{".env", "docker-compose.yml"} // OptionalFiles list of optional files that could be deleted when pruning OptionalFiles = []string{"docker-compose.override.yml"} // ErrMalformed is the returned error when the workdir is wrong ErrMalformed = goerrors.NewKind("workdir %s is not valid") // ErrInitFailed is an error returned on workdir initialization for custom cases ErrInitFailed = goerrors.NewKind("initialization failed") )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler provides a way to interact with all the workdirs by exposing the following operations:
- read/set/unset active workdir,
- remove/validate a workdir,
- list workdirs.
func NewHandler ¶
NewHandler creates a handler that manages workdirs in the path returned by the `workdirsPath` function
func (*Handler) Remove ¶
Remove removes working directory by removing required and optional files, and recursively removes directories up to the workdirs root as long as they are empty
func (*Handler) SetActive ¶
SetActive creates a symlink from the fixed active workdir path to the prodived workdir
func (*Handler) UnsetActive ¶
UnsetActive removes symlink for active workdir
type Workdir ¶
type Workdir struct {
// Type is the type of working directory
Type Type
// Name is a human-friendly string to identify the workdir
Name string
// Path is the absolute path corresponding to the workdir
Path string
}
Workdir represents a workdir associated with a local or an orgs initialization
Click to show internal directories.
Click to hide internal directories.