add Hostname helper in expr and templating (#2193)

This commit is contained in:
blotus 2023-05-11 14:25:04 +02:00 committed by GitHub
parent 71b7a594bd
commit 4ae41a363d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 0 deletions

View file

@ -595,3 +595,11 @@ func B64Decode(params ...any) (any, error) {
}
return string(decoded), nil
}
func Hostname(params ...any) (any, error) {
hostname, err := os.Hostname()
if err != nil {
return "", err
}
return hostname, nil
}