amazonebsmock

package
v0.0.0-...-c80ec77 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2017 License: MPL-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	Config Config
	// The testMsg field used to get some feedback during tests from method
	// which don't return anything like Cancel()
	TestMsg string
}

Builder implements the Packer's Builder interface in order to mock its methods

func (*Builder) Cancel

func (b *Builder) Cancel()

Cancel mocks the official Packer's method documented in packer/builder.go This mock does absolutely nothing

func (*Builder) LoadDefaultConfig

func (b *Builder) LoadDefaultConfig()

LoadDefaultConfig initializes a Config structure with default values It is expected to be called at the beginning of the Prepare() step and must be called before the config.DecodeOpts calls on the config, else this will just override it

func (*Builder) Prepare

func (b *Builder) Prepare(raws ...interface{}) ([]string, error)

Prepare mocks the official Packer's method documented in packer/builder.go This mock only parses config and do a some checks on it TODO : ideally, the Config and initialization should be the same than the official Amazon EBS Builder

func (*Builder) Run

func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error)

Run mocks the official Packer's method documented in packer/builder.go This mock generates AMI IDs based on what is asked in the configuration It doesn't perform any real, impactful thing; it just generate strings and returns them

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	Amount int    `mapstructure:"amount"`
	Region string `mapstructure:"region"`
	// contains filtered or unexported fields
}

Config will be initialize by Packer's helper DecodeOpts and uses the mapstructure lib to associate JSON fields to the parameters it adds

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL