homogenization of templates: Marathon
This commit is contained in:
parent
b60edd9ee9
commit
870c0b5cf4
6 changed files with 1646 additions and 825 deletions
|
@ -93,6 +93,14 @@ func GetBoolValue(labels map[string]string, labelName string, defaultValue bool)
|
|||
return defaultValue
|
||||
}
|
||||
|
||||
// GetBoolValueP get bool value associated to a label
|
||||
func GetBoolValueP(labels *map[string]string, labelName string, defaultValue bool) bool {
|
||||
if labels == nil {
|
||||
return defaultValue
|
||||
}
|
||||
return GetBoolValue(*labels, labelName, defaultValue)
|
||||
}
|
||||
|
||||
// GetIntValue get int value associated to a label
|
||||
func GetIntValue(labels map[string]string, labelName string, defaultValue int) int {
|
||||
if rawValue, ok := labels[labelName]; ok {
|
||||
|
@ -229,6 +237,14 @@ func HasPrefix(labels map[string]string, prefix string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// HasPrefixP Check if a value is associated to a less one label with a prefix
|
||||
func HasPrefixP(labels *map[string]string, prefix string) bool {
|
||||
if labels == nil {
|
||||
return false
|
||||
}
|
||||
return HasPrefix(*labels, prefix)
|
||||
}
|
||||
|
||||
// FindServiceSubmatch split service label
|
||||
func FindServiceSubmatch(name string) []string {
|
||||
matches := ServicesPropertiesRegexp.FindStringSubmatch(name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue