Documentation ¶
Index ¶
- Constants
- type CensoredWriter
- type CommandBuilder
- type Context
- func (c *Context) CopyDirectory(srcDir, destDir string, includeBaseDir bool) error
- func (c *Context) CopyFile(src, dest string) error
- func (c *Context) IsVerbose() bool
- func (c *Context) SetSensitiveValues(vals []string)
- func (c *Context) SetVerbose(value bool)
- func (c *Context) WriteMixinOutputToFile(filename string, bytes []byte) error
- type PluginDebugContext
- type TestContext
- func (c *TestContext) AddCleanupDir(dir string)
- func (c *TestContext) AddTestDirectory(srcDir, destDir string)
- func (c *TestContext) AddTestDriver(src, name string) string
- func (c *TestContext) AddTestFile(src, dest string) []byte
- func (c *TestContext) AddTestFileContents(file []byte, dest string) error
- func (c *TestContext) Cleanup()
- func (c *TestContext) ClearOutputs()
- func (c *TestContext) FindBinDir() string
- func (c *TestContext) GetError() string
- func (c *TestContext) GetOutput() string
- func (c *TestContext) UseFilesystem() string
Constants ¶
const (
// MixinOutputsDir represents the directory where mixin output files are written/read
MixinOutputsDir = "/cnab/app/porter/outputs"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CensoredWriter ¶
type CensoredWriter struct {
// contains filtered or unexported fields
}
CensoredWriter is a writer wrapping the provided io.Writer with logic to censor certain values
func NewCensoredWriter ¶
func NewCensoredWriter(writer io.Writer) *CensoredWriter
NewCensoredWriter returns a new CensoredWriter
func (*CensoredWriter) SetSensitiveValues ¶
func (cw *CensoredWriter) SetSensitiveValues(vals []string)
SetSensitiveValues sets values needing masking for an CensoredWriter
type CommandBuilder ¶
func NewTestCommand ¶
func NewTestCommand() CommandBuilder
type Context ¶
type Context struct { Debug bool DebugPlugins bool FileSystem *afero.Afero In io.Reader Out io.Writer Err io.Writer NewCommand CommandBuilder PlugInDebugContext *PluginDebugContext // contains filtered or unexported fields }
func (*Context) CopyDirectory ¶
func (*Context) SetSensitiveValues ¶
SetSensitiveValues sets the sensitive values needing masking on output/err streams
func (*Context) SetVerbose ¶
type PluginDebugContext ¶ added in v0.29.1
type PluginDebugContext struct { RunPlugInInDebugger string PlugInWorkingDirectory string DebuggerPort string }
func NewPluginDebugContext ¶ added in v0.29.1
func NewPluginDebugContext() *PluginDebugContext
type TestContext ¶
func NewTestContext ¶
func NewTestContext(t *testing.T) *TestContext
NewTestContext initializes a configuration suitable for testing, with the output buffered, and an in-memory file system.
func (*TestContext) AddCleanupDir ¶ added in v0.28.0
func (c *TestContext) AddCleanupDir(dir string)
func (*TestContext) AddTestDirectory ¶
func (c *TestContext) AddTestDirectory(srcDir, destDir string)
func (*TestContext) AddTestDriver ¶ added in v0.28.0
func (c *TestContext) AddTestDriver(src, name string) string
func (*TestContext) AddTestFile ¶
func (c *TestContext) AddTestFile(src, dest string) []byte
func (*TestContext) AddTestFileContents ¶
func (c *TestContext) AddTestFileContents(file []byte, dest string) error
func (*TestContext) Cleanup ¶ added in v0.28.0
func (c *TestContext) Cleanup()
func (*TestContext) ClearOutputs ¶ added in v0.28.0
func (c *TestContext) ClearOutputs()
func (*TestContext) FindBinDir ¶
func (c *TestContext) FindBinDir() string
func (*TestContext) GetError ¶
func (c *TestContext) GetError() string
GetError returns all text printed to stderr.
func (*TestContext) GetOutput ¶
func (c *TestContext) GetOutput() string
GetOutput returns all text printed to stdout.
func (*TestContext) UseFilesystem ¶ added in v0.28.0
func (c *TestContext) UseFilesystem() string
UseFilesystem has porter's context use the OS filesystem instead of an in-memory filesystem Returns the temp porter home directory created for the test