libcompose: github.com/docker/libcompose/utils Index | Files

package utils

import "github.com/docker/libcompose/utils"

Index

Package Files

util.go

func Contains Uses

func Contains(collection []string, key string) bool

Contains checks if the specified string (key) is present in the specified collection.

func Convert Uses

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 Uses

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 ConvertKeysToStrings Uses

func ConvertKeysToStrings(item interface{}) interface{}

ConvertKeysToStrings converts map[interface{}] to map[string] recursively

func CopyMap Uses

func CopyMap(m map[string]string) map[string]string

CopyMap creates an exact copy of the provided string-to-string map

func CopySlice Uses

func CopySlice(s []string) []string

CopySlice creates an exact copy of the provided string slice

func DurationStrToSecondsInt Uses

func DurationStrToSecondsInt(s string) *int

DurationStrToSecondsInt converts duration string to *int in seconds

func FilterString Uses

func FilterString(data map[string][]string) string

FilterString returns a json representation of the specified map that is used as filter for docker.

func FilterStringSet Uses

func FilterStringSet(s map[string]bool, f func(x string) bool) map[string]bool

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 Merge Uses

func Merge(coll1, coll2 []string) []string

Merge performs a union of two string slices: the result is an unordered slice that includes every item from either argument exactly once

type InParallel Uses

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 Uses

func (i *InParallel) Add(task func() error)

Add runs the specified task in parallel and adds it to the waitGroup.

func (*InParallel) Wait Uses

func (i *InParallel) Wait() error

Wait waits for all tasks to complete and returns the latest error encountered if any.

Package utils imports 5 packages (graph) and is imported by 84 packages. Updated 2017-10-28. Refresh now. Tools for package owners.