Port client lib from samalba/dockerclient to docker/docker/client

This commit is contained in:
Ross Cadogan 2016-10-13 21:34:24 +01:00
parent 25f1fee8e2
commit 99ed959155
4 changed files with 74 additions and 61 deletions

View file

@ -1,5 +1,9 @@
package container
import (
"github.com/docker/go-connections/nat"
)
func sliceEqual(s1, s2 []string) bool {
if len(s1) != len(s2) {
return false
@ -62,3 +66,15 @@ func structMapSubtract(m1, m2 map[string]struct{}) map[string]struct{} {
return m
}
func structMapPortSubtract(m1, m2 map[nat.Port]struct{}) map[nat.Port]struct{} {
m := map[nat.Port]struct{}{}
for k1, v1 := range m1 {
if _, ok := m2[k1]; !ok {
m[k1] = v1
}
}
return m
}