Documentation ¶
Index ¶
- Constants
- type Env
- func (e *Env) DataDir(job string) Path
- func (e *Env) DataPackageDir() Path
- func (e *Env) JobDir(job string) Path
- func (e *Env) JobNames() []string
- func (e *Env) LogDir(job string) Path
- func (e *Env) PackageDir() Path
- func (e *Env) Root() Path
- func (e *Env) RunDir(job string) Path
- func (e *Env) StoreDir(job string) Path
- type Path
Constants ¶
const DefaultRoot = "/var/vcap"
DefaultRoot is the standard root directory for all bosh jobs. All ephemeral data, persistent data, logs, and configuration etc. are expected to be in a directory somewhere inside this one.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env represents a BOSH BPM environment. This is not a concept outside BPM but allows us to isolate BPM invocations from one another so that integration tests can be made concurrent.
func NewEnv ¶
NewEnv creates a new environment with a particular directory as its root. If root is empty then the DefaultRoot will be used.
func (*Env) DataDir ¶
DataDir returns a Path representation of the directory where a job should store its ephemeral data.
func (*Env) DataPackageDir ¶
DataPackageDir returns a Path representation of the global directory where all BOSH packages are actually stored (PackageDir is typically a symlink to this).
func (*Env) JobDir ¶
JobDir returns a Path representation of the directory where a job should can find its templated BOSH configuration.
func (*Env) LogDir ¶
LogDir returns a Path representation of the directory where a job should write any additional log files.
func (*Env) PackageDir ¶
PackageDir returns a Path representation of the global directory where all BOSH packages are stored.
func (*Env) Root ¶
Root returns a Path representation of the environment's root. It is typically not useful by itself but can be appended to with Path.Join().
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path represents a filesystem path to some kind of directory inside a BOSH root. A Path has an internal and external representation. The external representation is the path outside the running BPM job. The internal representation is the path when inside the BPM job mount namespace. In production these will always be the DefaultRoot.
This abstraction only exists because we want to have multiple roots on a single machine so we can run integration tests concurrently. Forcing the consumer to chose between the Internal() or External() representation removes a category of bugs around external test harness paths being present in the test jobs.
func (Path) Join ¶
Join allows one or more elements to be joined onto a Path (similar to filepath.Join). It returns a new Path with the new elements appended.
func (Path) String ¶
String implements the Stringer interface but should never be used. This was added to avoid the common mistake of doing:
fmt.{S,F,}Printf("... %s ...", bosh.Path{...})
Which will does not make it clear if the internal or external representation is wanted and is likely a bug. Omitting this function returns the standard Go representation of the struct which is almost certainly wrong.