Documentation ¶
Index ¶
- Constants
- Variables
- func EscapeID(id string) string
- func GetMetadataFilePath(layersDir string) string
- func ProcessPath(pType string) string
- type BashShell
- type Buildpack
- type CmdShell
- type Env
- type ExecD
- type ExecDRunner
- type ExecFunc
- type Launcher
- type Metadata
- type Process
- type Shell
- type ShellProcess
Constants ¶
const (
CNBDir = `/cnb`
)
Variables ¶
var ( LifecycleDir = filepath.Join(CNBDir, "lifecycle") ProcessDir = filepath.Join(CNBDir, "process") LauncherPath = filepath.Join(LifecycleDir, "launcher"+exe) )
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 process type
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 ExecDRunner ¶ added in v0.10.0
type ExecDRunner struct {
Out, Err io.Writer // Out and Err can be used to configure Stdout and Stderr processes run by ExecDRunner.
}
ExecDRunner is responsible for running ExecD binaries.
func NewExecDRunner ¶ added in v0.10.0
func NewExecDRunner() *ExecDRunner
NewExecDRunner creates an ExecDRunner with Out and Err set to stdout and stderr
func (*ExecDRunner) ExecD ¶ added in v0.10.0
func (e *ExecDRunner) ExecD(path string, env Env) error
ExecD executes the executable file at path and sets the returned variables in env. The executable at path should implement the ExecD interface in the buildpack specification https://github.com/buildpacks/spec/blob/main/buildpack.md#execd
type Launcher ¶
type Launcher struct { AppDir string Buildpacks []Buildpack DefaultProcessType string Env Env Exec ExecFunc ExecD ExecD 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 Process ¶
type Process struct { Type string `toml:"type" json:"type"` Command string `toml:"command" json:"command"` Args []string `toml:"args" json:"args"` Direct bool `toml:"direct" json:"direct"` Default bool `toml:"default,omitempty" json:"default,omitempty"` BuildpackID string `toml:"buildpack-id" json:"buildpackID"` WorkingDirectory string `toml:"working-dir,omitempty" json:"working-dir,omitempty"` }
type Shell ¶ added in v0.9.0
type Shell interface {
Launch(ShellProcess) error
}
type ShellProcess ¶ added in v0.9.0
type ShellProcess struct { Script bool // Script indicates whether Command is a script or should be a token in a generated script Args []string Command string Caller string // Caller used to set argv0 for Bash profile scripts and is ignored in Cmd Profiles []string Env []string WorkingDirectory string }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package testmock is a generated GoMock package.
|
Package testmock is a generated GoMock package. |