github.com/gdavison/packer@v0.10.1/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  		"parallels-headless":     new(FixerParallelsHeadless),
    30  		"parallels-deprecations": new(FixerParallelsDeprecations),
    31  		"sshkeypath":             new(FixerSSHKeyPath),
    32  	}
    33  
    34  	FixerOrder = []string{
    35  		"iso-md5",
    36  		"createtime",
    37  		"virtualbox-gaattach",
    38  		"pp-vagrant-override",
    39  		"virtualbox-rename",
    40  		"vmware-rename",
    41  		"parallels-headless",
    42  		"parallels-deprecations",
    43  		"sshkeypath",
    44  	}
    45  }