utils

Contains utility functions.

Since: 3.0.0
Example

// Take an object and write a docker compose file
var filename = lando.utils.compose(filename, data);

// Scan URLs and print results
return lando.utils.scanUrls(urls)
.then(function(results) {
  console.log(results);
});

utils.dockerComposify()

Translate a name for use by docker-compose eg strip - and . and

Kind: static method of utils
Todo:: possibly more than that
Since: 3.0.0

utils.merger()

Used with _.mergeWith to concat arrays

Kind: static method of utils
Since: 3.0.0
Example

// Take an object and write a docker compose file
var newObject = _.mergeWith(a, b, lando.utils.merger);

utils.compose(file, data) ⇒ String

Writes a docker compose object to a file.

Kind: static method of utils
Returns: String - The absolute path to the destination file.
Since: 3.0.0

Param Type Description
file String The absolute path to the destination file.
data Object The data to write to the file.

Example

// Take an object and write a docker compose file
var filename = lando.utils.compose(filename, data);

utils.scanUrls(urls, [opts]) ⇒ Array

Scans URLs to determine if they are up or down.

Kind: static method of utils
Returns: Array - An array of objects of the form {url: url, status: true|false}
Since: 3.0.0

Param Type Default Description
urls Array An array of urls like https://mysite.lndo.site or https://localhost:34223
[opts] Object Options to configure the scan.
[opts.max] Integer 7 The amount of times to retry accessing each URL.
[opts.waitCode] Array [400, 502 The HTTP codes to prompt a retry.

Example

// Scan URLs and print results
return lando.utils.scanUrls(['http://localhost', 'https://localhost'])
.then(function(results) {
  console.log(results);
});

results matching ""

    No results matching ""