github.com/cloudbase/juju-core@v0.0.0-20140504232958-a7271ac7912f/utils/exec/exec.go (about)

     1  // Copyright 2014 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package exec
     5  
     6  import (
     7  	"github.com/juju/loggo"
     8  )
     9  
    10  var logger = loggo.GetLogger("juju.util.exec")
    11  
    12  // Parameters for RunCommands.  Commands contains one or more commands to be
    13  // executed using '/bin/bash -s'.  If WorkingDir is set, this is passed
    14  // through to bash.  Similarly if the Environment is specified, this is used
    15  // for executing the command.
    16  type RunParams struct {
    17  	Commands    string
    18  	WorkingDir  string
    19  	Environment []string
    20  }
    21  
    22  // ExecResponse contains the return code and output generated by executing a
    23  // command.
    24  type ExecResponse struct {
    25  	Code   int
    26  	Stdout []byte
    27  	Stderr []byte
    28  }