docs/operator-manual/notifications/functions.md
Time related functions.
<hr> **`time.Now() Time`**Executes function built-in Golang time.Now function. Returns an instance of Golang Time.
<hr> **`time.Parse(val string) Time`**Parses specified string using RFC3339 layout. Returns an instance of Golang Time.
<hr> Time related constants.Durations
time.Nanosecond = 1
time.Microsecond = 1000 * Nanosecond
time.Millisecond = 1000 * Microsecond
time.Second = 1000 * Millisecond
time.Minute = 60 * Second
time.Hour = 60 * Minute
Timestamps
Used when formatting time instances as strings (e.g. time.Now().Format(time.RFC3339)).
time.Layout = "01/02 03:04:05PM '06 -0700" // The reference time, in numerical order.
time.ANSIC = "Mon Jan _2 15:04:05 2006"
time.UnixDate = "Mon Jan _2 15:04:05 MST 2006"
time.RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
time.RFC822 = "02 Jan 06 15:04 MST"
time.RFC822Z = "02 Jan 06 15:04 -0700" // RFC822 with numeric zone
time.RFC850 = "Monday, 02-Jan-06 15:04:05 MST"
time.RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
time.RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
time.RFC3339 = "2006-01-02T15:04:05Z07:00"
time.RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
time.Kitchen = "3:04PM"
// Handy time stamps.
time.Stamp = "Jan _2 15:04:05"
time.StampMilli = "Jan _2 15:04:05.000"
time.StampMicro = "Jan _2 15:04:05.000000"
time.StampNano = "Jan _2 15:04:05.000000000"
String related functions.
<hr> **`strings.ReplaceAll() string`**Executes function built-in Golang strings.ReplaceAll function.
<hr> **`strings.ToUpper() string`**Executes function built-in Golang strings.ToUpper function.
<hr> **`strings.ToLower() string`**Executes function built-in Golang strings.ToLower function.
Functions that provide additional information about Application source repository.
<hr> **`repo.RepoURLToHTTPS(url string) string`**Transforms given GIT URL into HTTPs format.
<hr> **`repo.FullNameByRepoURL(url string) string`**Returns repository URL full name (<owner>/<repoName>). Currently supports only Github, GitLab and Bitbucket.
QueryEscape escapes the string, so it can be safely placed inside a URL
Example:
/projects/{{ call .repo.QueryEscape (call .repo.FullNameByRepoURL .app.status.RepoURL) }}/merge_requests
Returns commit metadata. The commit must belong to the application source repository. CommitMetadata fields:
Message string commit messageAuthor string - commit authorDate time.Time - commit creation dateTags []string - Associated tagsReturns application details. AppDetail fields:
Type string - AppDetail typeHelm HelmAppSpec - Helm details
Name stringValueFiles []stringParameters []*v1alpha1.HelmParameterValues stringFileParameters []*v1alpha1.HelmFileParameterGetParameterValueByName(Name string) Retrieve value by name in Parameters fieldGetFileParameterPathByName(Name string) Retrieve path by name in FileParameters fieldKustomize *apiclient.KustomizeAppSpec - Kustomize detailsDirectory *apiclient.DirectoryAppSpec - Directory details