github.com/HashDataInc/packer@v1.3.2/communicator/none/communicator.go (about) 1 package none 2 3 import ( 4 "errors" 5 "io" 6 "os" 7 8 "github.com/hashicorp/packer/packer" 9 ) 10 11 type comm struct { 12 config string 13 } 14 15 // Creates a null packer.Communicator implementation. This takes 16 // an already existing configuration. 17 func New(config string) (result *comm, err error) { 18 // Establish an initial connection and connect 19 result = &comm{ 20 config: config, 21 } 22 23 return 24 } 25 26 func (c *comm) Start(cmd *packer.RemoteCmd) (err error) { 27 cmd.SetExited(0) 28 return 29 } 30 31 func (c *comm) Upload(path string, input io.Reader, fi *os.FileInfo) error { 32 return errors.New("Upload is not implemented when communicator = 'none'") 33 } 34 35 func (c *comm) UploadDir(dst string, src string, excl []string) error { 36 return errors.New("UploadDir is not implemented when communicator = 'none'") 37 } 38 39 func (c *comm) Download(path string, output io.Writer) error { 40 return errors.New("Download is not implemented when communicator = 'none'") 41 } 42 43 func (c *comm) DownloadDir(dst string, src string, excl []string) error { 44 return errors.New("DownloadDir is not implemented when communicator = 'none'") 45 }