This repository has been archived by the owner on Jun 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
10,953 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
--- | ||
category: "general" | ||
title: "Bootstrap" | ||
--- | ||
|
||
## Classes | ||
|
||
<dl> | ||
<dt><a href="#Bootstrap">Bootstrap</a></dt> | ||
<dd><p>Application bootstrap used to initialize the environment and the application | ||
itself.</p> | ||
</dd> | ||
</dl> | ||
|
||
## Constants | ||
|
||
<dl> | ||
<dt><a href="#PRODUCTION_ENVIRONMENT">PRODUCTION_ENVIRONMENT</a> : <code>string</code></dt> | ||
<dd><p>Environment name value in the production environment.</p> | ||
</dd> | ||
</dl> | ||
|
||
## Bootstrap <a name="Bootstrap" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L20" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Application bootstrap used to initialize the environment and the application | ||
itself. | ||
|
||
**Kind**: global class | ||
|
||
* [Bootstrap](#Bootstrap) | ||
* [new Bootstrap(oc)](#new_Bootstrap_new) | ||
* [._oc](#Bootstrap+_oc) : <code>ObjectContainer</code> | ||
* [._config](#Bootstrap+_config) : <code>Object.<string, \*></code> | ||
* [.run(config)](#Bootstrap+run) | ||
* [._initSettings()](#Bootstrap+_initSettings) | ||
* [._getEnvironmentSetting()](#Bootstrap+_getEnvironmentSetting) ⇒ <code>Object.<string, \*></code> | ||
* [._bindDependencies()](#Bootstrap+_bindDependencies) | ||
* [._initRoutes()](#Bootstrap+_initRoutes) | ||
* [._initServices()](#Bootstrap+_initServices) | ||
|
||
|
||
* * * | ||
|
||
### new Bootstrap(oc) <a name="new_Bootstrap_new"></a> | ||
Initializes the bootstrap. | ||
|
||
|
||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| oc | <code>ObjectContainer</code> | The application's object container to use for managing dependencies. | | ||
|
||
|
||
* * * | ||
|
||
### bootstrap._oc : <code>ObjectContainer</code> <a name="Bootstrap+_oc" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L33" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
The object container used to manage dependencies. | ||
|
||
**Kind**: instance property of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap._config : <code>Object.<string, \*></code> <a name="Bootstrap+_config" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L40" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Application configuration. | ||
|
||
**Kind**: instance property of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap.run(config) <a name="Bootstrap+run" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L56" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Initializes the application by running the bootstrap sequence. The | ||
sequence initializes the components of the application in the following | ||
order: | ||
- application settings | ||
- constants, service providers and class dependencies configuration | ||
- services | ||
- UI components | ||
- routing | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| config | <code>Object.<string, \*></code> | The application environment configuration for the current environment. | | ||
|
||
|
||
* * * | ||
|
||
### bootstrap._initSettings() <a name="Bootstrap+_initSettings" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L72" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Initializes the application settings. The method loads the settings for | ||
all environments and then pics the settings for the current environment. | ||
|
||
The method also handles using the values in the production environment | ||
as default values for configuration items in other environments. | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap._getEnvironmentSetting() ⇒ <code>Object.<string, \*></code> <a name="Bootstrap+_getEnvironmentSetting" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L108" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Returns setting for current environment where base values are from production | ||
environment and other environments override base values. | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap._bindDependencies() <a name="Bootstrap+_bindDependencies" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L125" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Binds the constants, service providers and class dependencies to the | ||
object container. | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap._initRoutes() <a name="Bootstrap+_initRoutes" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L143" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Initializes the routes. | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
### bootstrap._initServices() <a name="Bootstrap+_initServices" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L151" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Initializes the basic application services. | ||
|
||
**Kind**: instance method of [<code>Bootstrap</code>](#Bootstrap) | ||
|
||
* * * | ||
|
||
## PRODUCTION_ENVIRONMENT : <code>string</code> <a name="PRODUCTION_ENVIRONMENT" href="https://github.com/seznam/IMA.js-core/tree/stable/Bootstrap.js#L14" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Environment name value in the production environment. | ||
|
||
**Kind**: global constant | ||
|
||
* * * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
category: "cache" | ||
title: "CacheEntry" | ||
--- | ||
|
||
## CacheEntry <a name="CacheEntry" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L5" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
The cache entry is a typed container of cache data used to track the | ||
creation and expiration of cache entries. | ||
|
||
**Kind**: global class | ||
|
||
* [CacheEntry](#CacheEntry) | ||
* [new CacheEntry(value, ttl)](#new_CacheEntry_new) | ||
* [._value](#CacheEntry+_value) : <code>\*</code> | ||
* [._ttl](#CacheEntry+_ttl) : <code>number</code> | ||
* [._created](#CacheEntry+_created) : <code>number</code> | ||
* [.isExpired()](#CacheEntry+isExpired) ⇒ <code>boolean</code> | ||
* [.serialize()](#CacheEntry+serialize) ⇒ <code>Object</code> | ||
* [.getValue()](#CacheEntry+getValue) ⇒ <code>\*</code> | ||
|
||
|
||
* * * | ||
|
||
### new CacheEntry(value, ttl) <a name="new_CacheEntry_new"></a> | ||
Initializes the cache entry. | ||
|
||
|
||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| value | <code>\*</code> | The cache entry value. | | ||
| ttl | <code>number</code> | The time to live in milliseconds. | | ||
|
||
|
||
* * * | ||
|
||
### cacheEntry._value : <code>\*</code> <a name="CacheEntry+_value" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L18" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Cache entry value. | ||
|
||
**Kind**: instance property of [<code>CacheEntry</code>](#CacheEntry) | ||
|
||
* * * | ||
|
||
### cacheEntry._ttl : <code>number</code> <a name="CacheEntry+_ttl" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L26" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
The time to live in milliseconds. The cache entry is considered | ||
expired after this time. | ||
|
||
**Kind**: instance property of [<code>CacheEntry</code>](#CacheEntry) | ||
|
||
* * * | ||
|
||
### cacheEntry._created : <code>number</code> <a name="CacheEntry+_created" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L33" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
The timestamp of creation of this cache entry. | ||
|
||
**Kind**: instance property of [<code>CacheEntry</code>](#CacheEntry) | ||
|
||
* * * | ||
|
||
### cacheEntry.isExpired() ⇒ <code>boolean</code> <a name="CacheEntry+isExpired" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L41" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Returns `true` if this entry has expired. | ||
|
||
**Kind**: instance method of [<code>CacheEntry</code>](#CacheEntry) | ||
**Returns**: <code>boolean</code> - `true` if this entry has expired. | ||
|
||
* * * | ||
|
||
### cacheEntry.serialize() ⇒ <code>Object</code> <a name="CacheEntry+serialize" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L52" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Exports this cache entry into a JSON-serializable object. | ||
|
||
**Kind**: instance method of [<code>CacheEntry</code>](#CacheEntry) | ||
**Returns**: <code>Object</code> - This entry exported to a | ||
JSON-serializable object. | ||
|
||
* * * | ||
|
||
### cacheEntry.getValue() ⇒ <code>\*</code> <a name="CacheEntry+getValue" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheEntry.js#L61" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Returns the entry value. | ||
|
||
**Kind**: instance method of [<code>CacheEntry</code>](#CacheEntry) | ||
**Returns**: <code>\*</code> - The entry value. | ||
|
||
* * * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
category: "cache" | ||
title: "CacheFactory" | ||
--- | ||
|
||
## CacheFactory <a name="CacheFactory" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheFactory.js#L6" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Factory for creating instances of [CacheEntry](CacheEntry). | ||
|
||
**Kind**: global class | ||
|
||
* * * | ||
|
||
### cacheFactory.createCacheEntry(value, [ttl]) ⇒ <code>CacheEntry</code> <a name="CacheFactory+createCacheEntry" href="https://github.com/seznam/IMA.js-core/tree/stable/cache/CacheFactory.js#L19" target="_blank"><span class="icon"><i class="fas fa-external-link-alt fa-xs"></i></span></a> | ||
Create a new instance of [CacheEntry](CacheEntry) with value and ttl. | ||
|
||
**Kind**: instance method of [<code>CacheFactory</code>](#CacheFactory) | ||
**Returns**: <code>CacheEntry</code> - The created cache entry. | ||
|
||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| value | <code>\*</code> | The cache entry value. | | ||
| [ttl] | <code>number</code> | Cache entry time to live in milliseconds. The entry will expire after the specified amount of milliseconds. | | ||
|
||
|
||
* * * | ||
|
Oops, something went wrong.