Documentation ¶
Index ¶
- func Contains(collection []string, key string) bool
- func Convert(src, target interface{}) error
- func ConvertByJSON(src, target interface{}) error
- func CopyMap(m map[string]string) map[string]string
- func CopySlice(s []string) []string
- func FilterString(data map[string][]string) string
- func FilterStringSet(s map[string]bool, f func(x string) bool) map[string]bool
- func LabelFilter(key, value string) map[string][]string
- func LabelFilterString(key, value string) string
- func Merge(coll1, coll2 []string) []string
- type InParallel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contains ¶
Contains checks if the specified string (key) is present in the specified collection.
func Convert ¶
func Convert(src, target interface{}) error
Convert 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.
func ConvertByJSON ¶
func ConvertByJSON(src, target interface{}) error
ConvertByJSON 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.
func FilterString ¶
FilterString returns a json representation of the specified map that is used as filter for docker.
func FilterStringSet ¶
FilterStringSet 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`
func LabelFilter ¶
LabelFilter returns a label map representation of the specifed couple (key,value) that is used as filter for docker.
func LabelFilterString ¶
LabelFilterString returns a label json string representation of the specifed couple (key,value) that is used as filter for docker.
Types ¶
type InParallel ¶
type InParallel struct {
// contains filtered or unexported fields
}
InParallel holds a pool and a waitgroup to execute tasks in parallel and to be able to wait for completion of all tasks.
func (*InParallel) Add ¶
func (i *InParallel) Add(task func() error)
Add runs the specified task in parallel and adds it to the waitGroup.
func (*InParallel) Wait ¶
func (i *InParallel) Wait() error
Wait waits for all tasks to complete and returns the latest error encountered if any.