2013-03-23 02:00:23 -04:00
|
|
|
// This is the main package for the `packer` application.
|
|
|
|
package main
|
|
|
|
|
2013-03-23 18:59:17 -04:00
|
|
|
// A command is a runnable sub-command of the `packer` application.
|
|
|
|
// When `packer` is called with the proper subcommand, this will be
|
|
|
|
// called.
|
|
|
|
//
|
|
|
|
// The mapping of command names to command interfaces is in the
|
|
|
|
// Environment struct.
|
|
|
|
type Command interface {
|
|
|
|
Run(args []string)
|
|
|
|
}
|
|
|
|
|
|
|
|
// The environment struct contains all the state necessary for a single
|
|
|
|
// instance of Packer.
|
|
|
|
//
|
|
|
|
// It is *not* a singleton, but generally a single environment is created
|
|
|
|
// when Packer starts running to represent that Packer run. Technically,
|
|
|
|
// if you're building a custom Packer binary, you could instantiate multiple
|
|
|
|
// environments and run them in parallel.
|
|
|
|
type Environment struct {
|
|
|
|
commands map[string]Command
|
|
|
|
}
|
2013-03-23 02:00:23 -04:00
|
|
|
|
|
|
|
func main() {
|
2013-03-23 18:59:17 -04:00
|
|
|
env := Environment {
|
|
|
|
commands: map[string]Command {
|
|
|
|
""
|
|
|
|
},
|
|
|
|
}
|
2013-03-23 02:00:23 -04:00
|
|
|
}
|