Constructor
new FlapUnit(migrations_diropt)
Initializes the class. Resolves the path to the migration tracking file.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
migrations_dir |
string |
<optional> |
'./flaps.json' | Path to the directory used to track applied migrations. This directory may not exist yet. |
- Source:
Extends
Members
(static) name
Get the name of service provided by this unit: 'flap'
- Source:
(private) _di_allow_defer :boolean
If true, the injector will defer the class if the class requests any services that the container is missing. These services are filled in later and added to the prototype and any instances. True by default.
- boolean
- Overrides:
- Source:
(private) _di_deferred_instances :Array.<module:flitter-di/src/Injectable~Injectable>
Collection of instances of this class that need to have the deferred service instances injected into them when the deferred services are finally provided.
- Source:
(private) _di_deferred_services :Array.<string>
List of services that were deferred and not provided at the time of injection.
- Array.<string>
- Source:
Methods
(async) cleanup(app) → {Promise.<void>}
Cleans up the unit's resources before Flitter closes.
Name | Type | Description |
---|---|---|
app |
module:libflitter/app/FlitterApp~FlitterApp | the Flitter app |
- Overrides:
- Source:
- Type
- Promise.<void>
directives() → {Array.<module:flitter-cli/Directive~Directive>}
Get an array with the directive classes provided by this unit.
- Source:
- Type
- Array.<module:flitter-cli/Directive~Directive>
directories() → {Object}
Get the directories managed by this unit.
- Overrides:
- Source:
- Type
- Object
(async) go(app) → {Promise.<void>}
Loads the unit. Checks each unit. If the unit has a migrations() function, call it to get the path to the unit's migration folder. Binds the array of folders, path to the migration tracking file, and helper functions to the context.
Name | Type | Description |
---|---|---|
app |
module:libflitter/app/FlitterApp~FlitterApp |
- Overrides:
- Source:
- Type
- Promise.<void>
migrations() → {string}
Get the fully-qualified path to this unit's migration files.
- Source:
- Type
- string
name() → {String}
Get the name of the unit. Should be a lowercase, alphanum/dash/underscore string.
- Overrides:
- Source:
- Type
- String
status(setopt) → {string}
Get or set the unit's current status.
Name | Type | Attributes | Description |
---|---|---|---|
set |
string |
<optional> |
if provided, set the status of the unit |
- Overrides:
- Source:
- current status of the unit
- Type
- string