Skip to content
simcap edited this page May 17, 2018 · 1 revision

awless relies in part on Golang code generation.

Since awless (among other things) basically wraps AWS services intelligently, a lot of the pumbling and wrapping code can be automatically generated safely from AWS API and struct definition. This allow to write manually some code only when necessary or when value is added.

Note that:

  1. All generated Golang files have the gen_ prefix (list them with find . -name "gen_*" -type f).
  2. All the code generation logic takes place from the gen/ directory.

One idempotent command is use to generate all the code. This command can be run multiple times safely:

$ cd awless
$ make generate

Code generation will help generating:

  • AWS mocks for acceptance testing
  • CLI documentation for commands, params, etc.
  • awless's fetchers and services wrappers
  • etc.

The gen/ folder is organized as followed:

  • gen/aws contains definitions files that will capture usually in Golang code the RDF definitions, AWS definitions, etc.
  • gen/aws/generators contains a main.go file that will run all the independent generators at once.
Clone this wiki locally