github.com/kaixiang/packer@v0.5.2-0.20140114230416-1f5786b0d7f1/command/fix/fixer.go (about)

     1  package fix
     2  
     3  // A Fixer is something that can perform a fix operation on a template.
     4  type Fixer interface {
     5  	// Fix takes a raw map structure input, potentially transforms it
     6  	// in some way, and returns the new, transformed structure. The
     7  	// Fix method is allowed to mutate the input.
     8  	Fix(input map[string]interface{}) (map[string]interface{}, error)
     9  
    10  	// Synopsis returns a string description of what the fixer actually
    11  	// does.
    12  	Synopsis() string
    13  }
    14  
    15  // Fixers is the map of all available fixers, by name.
    16  var Fixers map[string]Fixer
    17  
    18  // FixerOrder is the default order the fixers should be run.
    19  var FixerOrder []string
    20  
    21  func init() {
    22  	Fixers = map[string]Fixer{
    23  		"iso-md5":             new(FixerISOMD5),
    24  		"createtime":          new(FixerCreateTime),
    25  		"pp-vagrant-override": new(FixerVagrantPPOverride),
    26  		"virtualbox-gaattach": new(FixerVirtualBoxGAAttach),
    27  		"virtualbox-rename":   new(FixerVirtualBoxRename),
    28  		"vmware-rename":       new(FixerVMwareRename),
    29  	}
    30  
    31  	FixerOrder = []string{
    32  		"iso-md5",
    33  		"createtime",
    34  		"virtualbox-gaattach",
    35  		"pp-vagrant-override",
    36  		"virtualbox-rename",
    37  		"vmware-rename",
    38  	}
    39  }