# Functions
ExecuteTemplate creates a template from the file and execute it with the specified data.
ExecuteTemplateData creates a template from string and execute it with the specified data.
ExecuteTemplateFile - creates a template from the file and execute it with the specified data.
GetAllTemplates - get all template files
The structur of the folder is, base path, the kind (CRD in lower case), - path - base path of the templates folder - kind - sub folder for the CRDs templates - templateType - TType of the templates.
GetEnvVar - Get the value associated with key from environment variables, but use baseDefault as a value in case the ENV variable is not defined.
GetOr returns the value of m[key] if it exists, fallback otherwise.
GetStringListFromMap - It returns a list of strings based on a comma separated list assigned to the map key.
GetTemplateData - Renders templates specified via Template struct
Check the TType const and Template type for more details on defining the template.
GetTemplatesPath get path to templates, either running local or deployed as container.
HashOfInputHashes - calculates the overall hash of hashes.
InitMap - Inititialise a map to an empty map if it is nil.
IsJSON check if string is json format.
IsSet returns the value of m[key] if key exists, otherwise false Different from getOr because it will return zero values.
LogErrorForObject - Error logging.
LogForObject - generic info level logging.
MergeMaps - merge two or more maps NOTE: In case a key exists, the value in the first map is preserved.
MergeStringMaps - merge two or more string->map maps NOTE: In case a key exists, the value in the first map is preserved.
ObjectHash creates a deep object hash and return it as a safe encoded string.
RemoveIndex - remove int from slice.
SetHash - set hashStr of type hashType on hashMap if it does not exist or hashStr is different from current stored value.
SortStringMapByValue - Creates a sorted List contain key/value of a map[string]string sorted by key.
StringInSlice - is string in slice.
WrapErrorForObject -.
# Constants
TemplateTypeConfig - config type.
TemplateTypeCustom - custom config type, the secret/cm will not get upated as it is exected that the content is owned by a user if the configmap/secret does not exist on first check, it gets created.
TemplateTypeNone - none type, don't add configs from a directory, only files from AdditionalData.
TemplateTypeScripts - scripts type.
# Variables
ErrCannotUpdateObject indicates that the object cannot be updated.
ErrFieldNotFound indicates that the field was not found in the Secret.
ErrInvalidEndpoint indicates that the endpoint type is invalid.
ErrInvalidPort indicates that the port is invalid.
ErrInvalidStatus indicates that the status is invalid.
ErrMoreThanOne indicates that only one should exist.
ErrNoPodSubdomain indicates that there is no Subdomain or Hostname.
ErrNotFound indicates that the object was not found.
ErrPodsInterfaces indicates that pod interfaces aren't configured.
ErrResourceIsNotReady indicates that the resource is not ready.