{"modulePath":"github.com/hyperhq/libcompose","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package utils\n\n## Functions\n\n```go\nfunc Contains(collection []string, key string) bool\n```\nContains checks if the specified string (key) is present in the specified collection.\n\n```go\nfunc Convert(src, target interface{}) error\n```\nConvert converts a struct (src) to another one (target) using yaml marshalling/unmarshalling. If the structure are not compatible, this will throw an error as the unmarshalling will fail.\n\n```go\nfunc ConvertByJSON(src, target interface{}) error\n```\nConvertByJSON converts a struct (src) to another one (target) using json marshalling/unmarshalling. If the structure are not compatible, this will throw an error as the unmarshalling will fail.\n\n```go\nfunc CopyMap(m map[string]string) map[string]string\n```\nCopyMap creates an exact copy of the provided string-to-string map\n\n```go\nfunc CopySlice(s []string) []string\n```\nCopySlice creates an exact copy of the provided string slice\n\n```go\nfunc FilterString(data map[string][]string) string\n```\nFilterString returns a json representation of the specified map that is used as filter for docker.\n\n```go\nfunc FilterStringSet(s map[string]bool, f func(x string) bool) map[string]bool\n```\nFilterStringSet accepts a string set \\`s\\` (in the form of \\`map\\[string]bool\\`) and a filtering function \\`f\\` and returns a string set containing only the strings \\`x\\` for which \\`f(x) == true\\`\n\n```go\nfunc LabelFilter(key, value string) map[string][]string\n```\nLabelFilter returns a label map representation of the specifed couple (key,value) that is used as filter for docker.\n\n```go\nfunc LabelFilterString(key, value string) string\n```\nLabelFilterString returns a label json string representation of the specifed couple (key,value) that is used as filter for docker.\n\n```go\nfunc Merge(coll1, coll2 []string) []string\n```\nMerge performs a union of two string slices: the result is an unordered slice that includes every item from either argument exactly once\n\n## Types\n\n```go\ntype InParallel struct {\n\t// contains filtered or unexported fields\n}\n```\nInParallel holds a pool and a waitgroup to execute tasks in parallel and to be able to wait for completion of all tasks.\n\n```go\nfunc (i *InParallel) Add(task func() error)\n```\nAdd runs the specified task in parallel and adds it to the waitGroup.\n\n```go\nfunc (i *InParallel) Wait() error\n```\nWait waits for all tasks to complete and returns the latest error encountered if any.\n\n","path":"github.com/hyperhq/libcompose/utils","name":"utils","synopsis":"","isRedistributable":true}
