Versions in this module Expand all Collapse all v0 v0.0.12 Feb 8, 2021 Changes in this version + const CmdDisconnect + const HookCleanupProvision + const HookProvision + var DefaultCacheDir = "packer_cache" + var ErrInterrupted = errors.New("interrupted") + var LogSecretFilter secretFilter + var ScriptUploadErrorMockCommunicatorError = errors.New("ScriptUploadErrorMockCommunicator Upload error") + func CachePath(paths ...string) (path string, err error) + type Artifact interface + BuilderId func() string + Destroy func() error + Files func() []string + Id func() string + State func(name string) interface{} + String func() string + type BasicUi struct + ErrorWriter io.Writer + PB getter.ProgressTracker + Reader io.Reader + TTY TTY + Writer io.Writer + func (rw *BasicUi) Ask(query string) (string, error) + func (rw *BasicUi) Error(message string) + func (rw *BasicUi) Machine(t string, args ...string) + func (rw *BasicUi) Message(message string) + func (rw *BasicUi) Say(message string) + func (rw *BasicUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) + type Build interface + Name func() string + Prepare func() ([]string, error) + Run func(context.Context, Ui) ([]Artifact, error) + SetDebug func(bool) + SetForce func(bool) + SetOnError func(string) + type Builder interface + Prepare func(...interface{}) ([]string, []string, error) + Run func(context.Context, Ui, Hook) (Artifact, error) + type Communicator interface + Download func(string, io.Writer) error + DownloadDir func(src string, dst string, exclude []string) error + Start func(context.Context, *RemoteCmd) error + Upload func(string, io.Reader, *os.FileInfo) error + UploadDir func(dst string, src string, exclude []string) error + type ConfigurableCommunicator interface + Configure func(...interface{}) ([]string, error) + type Datasource interface + Configure func(...interface{}) error + Execute func() (cty.Value, error) + OutputSpec func() hcldec.ObjectSpec + type DispatchHook struct + Mapping map[string][]Hook + func (h *DispatchHook) Run(ctx context.Context, name string, ui Ui, comm Communicator, data interface{}) error + type FlatMockBuilder struct + ArtifactId *string + CancelCalled *bool + GeneratedVars []string + PrepareCalled *bool + PrepareConfig []interface{} + PrepareWarnings []string + RunCalled *bool + RunErrResult *bool + RunHook Hook + RunNilResult *bool + RunUi Ui + func (*FlatMockBuilder) HCL2Spec() map[string]hcldec.Spec + type FlatMockDatasource struct + Foo *string + func (*FlatMockDatasource) HCL2Spec() map[string]hcldec.Spec + type FlatMockDatasourceResponse struct + Foo *string + func (*FlatMockDatasourceResponse) HCL2Spec() map[string]hcldec.Spec + type FlatMockProvisioner struct + PrepCalled *bool + PrepConfigs []interface{} + ProvCalled *bool + ProvCommunicator Communicator + ProvRetried *bool + ProvUi Ui + func (*FlatMockProvisioner) HCL2Spec() map[string]hcldec.Spec + type HCL2Speccer interface + ConfigSpec func() hcldec.ObjectSpec + type Hook interface + Run func(context.Context, string, Ui, Communicator, interface{}) error + type MapOfBuilder map[string]func() (Builder, error) + func (mob MapOfBuilder) Has(builder string) bool + func (mob MapOfBuilder) List() []string + func (mob MapOfBuilder) Set(builder string, starter func() (Builder, error)) + func (mob MapOfBuilder) Start(builder string) (Builder, error) + type MapOfDatasource map[string]func() (Datasource, error) + func (mod MapOfDatasource) Has(dataSource string) bool + func (mod MapOfDatasource) List() []string + func (mod MapOfDatasource) Set(dataSource string, starter func() (Datasource, error)) + func (mod MapOfDatasource) Start(dataSource string) (Datasource, error) + type MapOfPostProcessor map[string]func() (PostProcessor, error) + func (mopp MapOfPostProcessor) Has(postProcessor string) bool + func (mopp MapOfPostProcessor) List() []string + func (mopp MapOfPostProcessor) Set(postProcessor string, starter func() (PostProcessor, error)) + func (mopp MapOfPostProcessor) Start(postProcessor string) (PostProcessor, error) + type MapOfProvisioner map[string]func() (Provisioner, error) + func (mop MapOfProvisioner) Has(provisioner string) bool + func (mop MapOfProvisioner) List() []string + func (mop MapOfProvisioner) Set(provisioner string, starter func() (Provisioner, error)) + func (mop MapOfProvisioner) Start(provisioner string) (Provisioner, error) + type MockArtifact struct + BuilderIdValue string + DestroyCalled bool + FilesValue []string + IdValue string + StateValues map[string]interface{} + StringValue string + func (a *MockArtifact) BuilderId() string + func (a *MockArtifact) Destroy() error + func (a *MockArtifact) Files() []string + func (a *MockArtifact) Id() string + func (a *MockArtifact) State(name string) interface{} + func (a *MockArtifact) String() string + type MockBuilder struct + ArtifactId string + CancelCalled bool + GeneratedVars []string + PrepareCalled bool + PrepareConfig []interface{} + PrepareWarnings []string + RunCalled bool + RunErrResult bool + RunFn func(ctx context.Context) + RunHook Hook + RunNilResult bool + RunUi Ui + func (*MockBuilder) FlatMapstructure() interface{ ... } + func (tb *MockBuilder) ConfigSpec() hcldec.ObjectSpec + func (tb *MockBuilder) FlatConfig() interface{} + func (tb *MockBuilder) Prepare(config ...interface{}) ([]string, []string, error) + func (tb *MockBuilder) Run(ctx context.Context, ui Ui, h Hook) (Artifact, error) + type MockCommunicator struct + DownloadCalled bool + DownloadData string + DownloadDirDst string + DownloadDirExclude []string + DownloadDirSrc string + DownloadPath string + StartCalled bool + StartCmd *RemoteCmd + StartExitStatus int + StartStderr string + StartStdin string + StartStdout string + UploadCalled bool + UploadData string + UploadDirDst string + UploadDirExclude []string + UploadDirSrc string + UploadPath string + func (c *MockCommunicator) Download(path string, w io.Writer) error + func (c *MockCommunicator) DownloadDir(src string, dst string, excl []string) error + func (c *MockCommunicator) Start(ctx context.Context, rc *RemoteCmd) error + func (c *MockCommunicator) Upload(path string, r io.Reader, fi *os.FileInfo) error + func (c *MockCommunicator) UploadDir(dst string, src string, excl []string) error + type MockDatasource struct + ConfigureCalled bool + ConfigureConfigs []interface{} + ExecuteCalled bool + Foo string + OutputSpecCalled bool + func (*MockDatasource) FlatMapstructure() interface{ ... } + func (d *MockDatasource) ConfigSpec() hcldec.ObjectSpec + func (d *MockDatasource) Configure(configs ...interface{}) error + func (d *MockDatasource) Execute() (cty.Value, error) + func (d *MockDatasource) OutputSpec() hcldec.ObjectSpec + type MockDatasourceResponse struct + Foo string + func (*MockDatasourceResponse) FlatMapstructure() interface{ ... } + type MockHook struct + RunCalled bool + RunComm Communicator + RunData interface{} + RunFunc func(context.Context) error + RunName string + RunUi Ui + func (t *MockHook) Run(ctx context.Context, name string, ui Ui, comm Communicator, data interface{}) error + type MockProvisioner struct + PrepCalled bool + PrepConfigs []interface{} + ProvCalled bool + ProvCommunicator Communicator + ProvFunc func(context.Context) error + ProvRetried bool + ProvUi Ui + func (*MockProvisioner) FlatMapstructure() interface{ ... } + func (t *MockProvisioner) Communicator() Communicator + func (t *MockProvisioner) ElevatedPassword() string + func (t *MockProvisioner) ElevatedUser() string + func (t *MockProvisioner) Prepare(configs ...interface{}) error + func (t *MockProvisioner) Provision(ctx context.Context, ui Ui, comm Communicator, ...) error + func (tp *MockProvisioner) ConfigSpec() hcldec.ObjectSpec + func (tp *MockProvisioner) FlatConfig() interface{} + type MockUi struct + AskCalled bool + AskQuery string + ErrorCalled bool + ErrorMessage string + MachineArgs []string + MachineCalled bool + MachineType string + MessageCalled bool + MessageMessage string + ProgressBarAddCalled bool + ProgressBarCloseCalled bool + SayCalled bool + SayMessages []SayMessage + TrackProgressCalled bool + func (u *MockUi) Ask(query string) (string, error) + func (u *MockUi) Error(message string) + func (u *MockUi) Machine(t string, args ...string) + func (u *MockUi) Message(message string) + func (u *MockUi) Say(message string) + func (u *MockUi) TrackProgress(_ string, _, _ int64, stream io.ReadCloser) (body io.ReadCloser) + type MultiError struct + Errors []error + func MultiErrorAppend(err error, errs ...error) *MultiError + func (e *MultiError) Error() string + type NoopProgressTracker struct + func (*NoopProgressTracker) TrackProgress(_ string, _, _ int64, stream io.ReadCloser) io.ReadCloser + type PostProcessor interface + Configure func(...interface{}) error + PostProcess func(context.Context, Ui, Artifact) (a Artifact, keep bool, forceOverride bool, err error) + type Provisioner interface + Prepare func(...interface{}) error + Provision func(context.Context, Ui, Communicator, map[string]interface{}) error + type RemoteCmd struct + Command string + Stderr io.Writer + Stdin io.Reader + Stdout io.Writer + func (r *RemoteCmd) ExitStatus() int + func (r *RemoteCmd) RunWithUi(ctx context.Context, c Communicator, ui Ui) error + func (r *RemoteCmd) SetExited(status int) + func (r *RemoteCmd) Wait() int + type SafeUi struct + PB getter.ProgressTracker + Sem chan int + Ui Ui + func (u *SafeUi) Ask(s string) (string, error) + func (u *SafeUi) Error(s string) + func (u *SafeUi) Machine(t string, args ...string) + func (u *SafeUi) Message(s string) + func (u *SafeUi) Say(s string) + func (u *SafeUi) TrackProgress(src string, currentSize, totalSize int64, stream io.ReadCloser) (body io.ReadCloser) + type SayMessage struct + Message string + SayTime time.Time + type ScriptUploadErrorMockCommunicator struct + func (c *ScriptUploadErrorMockCommunicator) Upload(path string, r io.Reader, fi *os.FileInfo) error + type TTY interface + Close func() error + ReadString func() (string, error) + type Ui interface + Ask func(string) (string, error) + Error func(string) + Machine func(string, ...string) + Message func(string) + Say func(string) + func TestUi(t *testing.T) Ui