Documentation
¶
Index ¶
Constants ¶
View Source
const (
CNBDir = `/cnb`
)
Variables ¶
View Source
var ( LifecycleDir = filepath.Join(CNBDir, "lifecycle") ProcessDir = filepath.Join(CNBDir, "process") LauncherPath = filepath.Join(LifecycleDir, "launcher"+exe) )
View Source
var ( OSExecFunc = syscall.Exec DefaultShell = &BashShell{Exec: OSExecFunc} )
Functions ¶
func GetMetadataFilePath ¶
func ProcessPath ¶ added in v0.9.0
ProcessPath returns the absolute path to the symlink for a given processType
Types ¶
type BashShell ¶ added in v0.9.0
type BashShell struct {
Exec ExecFunc
}
func (*BashShell) Launch ¶ added in v0.9.0
func (b *BashShell) Launch(proc ShellProcess) error
Launch launches the given ShellProcess with Bash
It shall execute a Bash command that sources profile scripts and then executes the process in a nested Bash command When ShellProcess.Script is true nested Bash script shall be proc.Command with proc.Args provided as argument to Bash When ShellProcess.Script is false a Bash command shall be contructed from proc.Command and proc.Args
type CmdShell ¶ added in v0.9.0
type CmdShell struct {
Exec ExecFunc
}
func (*CmdShell) Launch ¶ added in v0.9.0
func (c *CmdShell) Launch(proc ShellProcess) error
Launch launches the given ShellProcess with cmd
type Launcher ¶
type Launcher struct { AppDir string Buildpacks []Buildpack DefaultProcessType string Env Env Exec ExecFunc Shell Shell LayersDir string PlatformAPI *api.Version Processes []Process Setenv func(string, string) error }
func (*Launcher) Launch ¶
Launch uses cmd to select a process and launches that process
For direct=false processes, self is used to set argv0 during profile script execution
func (*Launcher) LaunchProcess ¶ added in v0.9.0
LaunchProcess launches the provided process
For direct=false processes, self is used to set argv0 during profile script execution
func (*Launcher) ProcessFor ¶ added in v0.9.0
ProcessFor creates a process from container cmd
If the Platform API if 0.4 or greater and DefaultProcess is set: * The default process is returned with `cmd` appended to the process args If the Platform API is less than 0.4 * If there is exactly one argument and it matches a process type, it returns that process. * If cmd is empty, it returns the default process Else * it constructs a new process from cmd * If the first element in cmd is `cmd` the process shall be direct
type Metadata ¶
type Shell ¶ added in v0.9.0
type Shell interface {
Launch(ShellProcess) error
}
type ShellProcess ¶ added in v0.9.0
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package testmock is a generated GoMock package.
|
Package testmock is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.