-
Notifications
You must be signed in to change notification settings - Fork 263
Code Navigation
Code is the truth and uncompiled documentation is a guy chasing the truth.
Anyway the following will help you understand how the awless
code is organized and to locate things more easily.
Importantly: do not see the current implementation of awless
(or what is described below) as definite and permanent. Things can be moved, reduced, simplified, re-design and there is plenty of room for improvement (as long as it is test driven ;) )
Let's say you issue the cloud command create instance name=redis-prod
either from the CLI (i.e. awless create instance name=redis-prod
) or from running a template file containing the actual line. Both end up being processing the same way.
-
Lexing, parsing and AST representation of this line starts in template/parser.go the bulk of it being in template/internal/ast
-
Compilation and passes made on the AST in template/compile.go
-
template/params define all the abstract logic and interfaces to bridge between AWS cloud specs (i.e. drivers) and the compiler.
-
template/env will define the interfaces for the a template's compile environment (i.e.
cenv
) and a template's running environment (i.e.renv
) -
template/runner.go allows you to wrap context and hooks around a template run.
-
template/template.go is where the core of it happens i.e. where the template runner delegate at some point to retrieve, load and execute the actual corresponding cloud specs (i.e. AWS drivers).