1
0
Fork 0

Sync vendor and glide.

This commit is contained in:
Ludovic Fernandez 2017-11-29 13:26:03 +01:00 committed by Traefiker
parent 9fe6a0a894
commit 7081f3df58
12 changed files with 374 additions and 190 deletions

View file

@ -0,0 +1,23 @@
package servicefabric
import "strings"
func hasServiceLabel(service ServiceItemExtended, key string) bool {
_, exists := service.Labels[key]
return exists
}
func getFuncBoolLabel(labelName string) func(service ServiceItemExtended) bool {
return func(service ServiceItemExtended) bool {
return getBoolLabel(service, labelName)
}
}
func getBoolLabel(service ServiceItemExtended, labelName string) bool {
value, exists := service.Labels[labelName]
return exists && strings.EqualFold(strings.TrimSpace(value), "true")
}
func getServiceLabelValue(service ServiceItemExtended, key string) string {
return service.Labels[key]
}