go fmt
This commit is contained in:
parent
2efab467a8
commit
15f215d04f
@ -16,11 +16,18 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
|
// Access information
|
||||||
AccessKey string `mapstructure:"access_key"`
|
AccessKey string `mapstructure:"access_key"`
|
||||||
AMIName string `mapstructure:"ami_name"`
|
|
||||||
Region string
|
|
||||||
SecretKey string `mapstructure:"secret_key"`
|
SecretKey string `mapstructure:"secret_key"`
|
||||||
SourceAmi string `mapstructure:"source_ami"`
|
|
||||||
|
// Information for the source AMI
|
||||||
|
Region string
|
||||||
|
SourceAmi string `mapstructure:"source_ami"`
|
||||||
|
SSHUsername string `mapstructure:"ssh_username"`
|
||||||
|
SSHKeyPath string `mapstructure:"ssh_private_key_path"`
|
||||||
|
|
||||||
|
// Configuration of the resulting AMI
|
||||||
|
AMIName string `mapstructure:"ami_name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Builder struct {
|
type Builder struct {
|
||||||
|
@ -34,7 +34,7 @@ func (Command) Run(env packer.Environment, args []string) int {
|
|||||||
// The component finder for our builds
|
// The component finder for our builds
|
||||||
components := &packer.ComponentFinder{
|
components := &packer.ComponentFinder{
|
||||||
Builder: env.Builder,
|
Builder: env.Builder,
|
||||||
Hook: env.Hook,
|
Hook: env.Hook,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Go through each builder and compile the builds that we care about
|
// Go through each builder and compile the builds that we care about
|
||||||
|
@ -3,8 +3,8 @@ package ssh
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"code.google.com/p/go.crypto/ssh"
|
"code.google.com/p/go.crypto/ssh"
|
||||||
"github.com/mitchellh/packer/packer"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/mitchellh/packer/packer"
|
||||||
"net"
|
"net"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -29,10 +29,10 @@ type Communicator interface {
|
|||||||
// ExitStatus is the exit code of the remote process. It is only available
|
// ExitStatus is the exit code of the remote process. It is only available
|
||||||
// once Wait is called.
|
// once Wait is called.
|
||||||
type RemoteCommand struct {
|
type RemoteCommand struct {
|
||||||
Stdin io.Writer
|
Stdin io.Writer
|
||||||
Stdout io.Reader
|
Stdout io.Reader
|
||||||
Stderr io.Reader
|
Stderr io.Reader
|
||||||
Exited bool
|
Exited bool
|
||||||
ExitStatus int
|
ExitStatus int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,16 +43,16 @@ type Environment interface {
|
|||||||
// An implementation of an Environment that represents the Packer core
|
// An implementation of an Environment that represents the Packer core
|
||||||
// environment.
|
// environment.
|
||||||
type coreEnvironment struct {
|
type coreEnvironment struct {
|
||||||
commands []string
|
commands []string
|
||||||
components ComponentFinder
|
components ComponentFinder
|
||||||
ui Ui
|
ui Ui
|
||||||
}
|
}
|
||||||
|
|
||||||
// This struct configures new environments.
|
// This struct configures new environments.
|
||||||
type EnvironmentConfig struct {
|
type EnvironmentConfig struct {
|
||||||
Commands []string
|
Commands []string
|
||||||
Components ComponentFinder
|
Components ComponentFinder
|
||||||
Ui Ui
|
Ui Ui
|
||||||
}
|
}
|
||||||
|
|
||||||
// DefaultEnvironmentConfig returns a default EnvironmentConfig that can
|
// DefaultEnvironmentConfig returns a default EnvironmentConfig that can
|
||||||
|
@ -7,10 +7,10 @@ import (
|
|||||||
|
|
||||||
type TestHook struct {
|
type TestHook struct {
|
||||||
runCalled bool
|
runCalled bool
|
||||||
runComm Communicator
|
runComm Communicator
|
||||||
runData interface{}
|
runData interface{}
|
||||||
runName string
|
runName string
|
||||||
runUi Ui
|
runUi Ui
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *TestHook) Run(name string, ui Ui, comm Communicator, data interface{}) {
|
func (t *TestHook) Run(name string, ui Ui, comm Communicator, data interface{}) {
|
||||||
|
@ -9,8 +9,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type cmdHook struct {
|
type cmdHook struct {
|
||||||
hook packer.Hook
|
hook packer.Hook
|
||||||
client *client
|
client *client
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *cmdHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) {
|
func (c *cmdHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) {
|
||||||
|
@ -28,19 +28,19 @@ type RemoteCommandServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CommunicatorStartResponse struct {
|
type CommunicatorStartResponse struct {
|
||||||
StdinAddress string
|
StdinAddress string
|
||||||
StdoutAddress string
|
StdoutAddress string
|
||||||
StderrAddress string
|
StderrAddress string
|
||||||
RemoteCommandAddress string
|
RemoteCommandAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommunicatorDownloadArgs struct {
|
type CommunicatorDownloadArgs struct {
|
||||||
Path string
|
Path string
|
||||||
WriterAddress string
|
WriterAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CommunicatorUploadArgs struct {
|
type CommunicatorUploadArgs struct {
|
||||||
Path string
|
Path string
|
||||||
ReaderAddress string
|
ReaderAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,20 +11,20 @@ import (
|
|||||||
|
|
||||||
type testCommunicator struct {
|
type testCommunicator struct {
|
||||||
startCalled bool
|
startCalled bool
|
||||||
startCmd string
|
startCmd string
|
||||||
|
|
||||||
startIn *io.PipeReader
|
startIn *io.PipeReader
|
||||||
startOut *io.PipeWriter
|
startOut *io.PipeWriter
|
||||||
startErr *io.PipeWriter
|
startErr *io.PipeWriter
|
||||||
startExited *bool
|
startExited *bool
|
||||||
startExitStatus *int
|
startExitStatus *int
|
||||||
|
|
||||||
uploadCalled bool
|
uploadCalled bool
|
||||||
uploadPath string
|
uploadPath string
|
||||||
uploadData string
|
uploadData string
|
||||||
|
|
||||||
downloadCalled bool
|
downloadCalled bool
|
||||||
downloadPath string
|
downloadPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) {
|
func (t *testCommunicator) Start(cmd string) (*packer.RemoteCommand, error) {
|
||||||
|
@ -18,8 +18,8 @@ type HookServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type HookRunArgs struct {
|
type HookRunArgs struct {
|
||||||
Name string
|
Name string
|
||||||
Data interface{}
|
Data interface{}
|
||||||
RPCAddress string
|
RPCAddress string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type testHook struct {
|
type testHook struct {
|
||||||
runCalled bool
|
runCalled bool
|
||||||
runUi packer.Ui
|
runUi packer.Ui
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *testHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) {
|
func (h *testHook) Run(name string, ui packer.Ui, comm packer.Communicator, data interface{}) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user