Module: validation

Methods

(static) addToDockerfile(filename, dockerfile)

Function that authenticates input username and password against Dockerhub API
Parameters:
Name Type Description
filename string Filename of YML file that will be loaded and parsed
dockerfile array Array of sub-arrays that will render as a Dockerfile
Source:

(static) authenticateUser(obj)

Function that authenticates input username and password against Dockerhub API
Parameters:
Name Type Description
obj object Object of parameters passed in with username and password
Source:

(static) hasValue()

Checks to make sure they entered a non-empty response
Source:

(static) inOptions(obj)

Function that checks whether input data is within available options displayed in prompt
Parameters:
Name Type Description
obj object Object with input value and array of options
Source:

(static) inPortRange(obj)

Function that checks whether input ports are valid
Parameters:
Name Type Description
obj object Object with portPublic or portPrivate parameter
Source:

(static) isValidRepoName()

Function checks whether input is a valid Docker hub repo name Rule #1: 3 - 30 characters. Rule #2: Only lowercase letters, digits and _ - .
Source:

(static) noValidation()

Placeholder function that just returns true instead of running any sort of validation on input data
Source:

(static) prepDockerfile(dockerfile)

Function that formats each line of Dockerfile
Parameters:
Name Type Description
dockerfile array Array of sub-arrays that will render as a Dockerfile
Source:

(static) readDirectory(dir, dockerfile)

Function that searches root directory for files that require global dependencies
Parameters:
Name Type Description
dir string Filepath of directory to check
dockerfile array Array of sub-arrays that will render as a Dockerfile
Source:

(static) spaces(num)

Function returns number of spaces required after command in Dockerfile
Parameters:
Name Type Description
num number Length of command converted to num of spaces
Source: