func LabelFilter(key, value string) map[string][]string {
	return map[string][]string{
		"label": {fmt.Sprintf("%s=%s", key, value)},
	}
}
LabelFilter returns a label map representation of the specifed couple (key,value)
that is used as filter for docker.
package labels
import (
	"encoding/json"
	"fmt"
	"github.com/docker/libcompose/utils"
)
type Label string
const (
	NUMBER  = Label("com.docker.compose.container-number")
	ONEOFF  = Label("com.docker.compose.oneoff")
	PROJECT = Label("com.docker.compose.project")
	SERVICE = Label("com.docker.compose.service")
	HASH    = Label("com.docker.compose.config-hash")
	VERSION = Label("com.docker.compose.version")
	PROJECT_LEGACY = Label("io.docker.compose.project")
	SERVICE_LEGACY = Label("io.docker.compose.service")
	HASH_LEGACY    = Label("io.docker.compose.config-hash")
)
func (f Label) EqString(value string) string {
	return LabelFilterString(string(f), value)
}
func (f Label) Eq(value string) map[string][]string {
	return LabelFilter(string(f), value)
}
func AndString(left, right string) string {
	leftMap := map[string][]string{}
	rightMap := map[string][]string{}
	json.Unmarshal([]byte(left), &leftMap)
	json.Unmarshal([]byte(right), &rightMap)
	for k, v := range rightMap {
		existing, ok := leftMap[k]
		if ok {
			leftMap[k] = append(existing, v...)
		} else {
			leftMap[k] = v
		}
	}
	result, _ := json.Marshal(leftMap)
	return string(result)
}
func And(left, right map[string][]string) map[string][]string {
	result := map[string][]string{}
	for k, v := range left {
		result[k] = v
	}
	for k, v := range right {
		existing, ok := result[k]
		if ok {
			result[k] = append(existing, v...)
		} else {
			result[k] = v
		}
	}
	return result
}
func (f Label) Str() string {
	return string(f)
}
func LabelFilterString(key, value string) string {
	return utils.FilterString(map[string][]string{
		"label": {fmt.Sprintf("%s=%s", key, value)},
	})
}